Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

layout_with_mds

Graph layout by multidimensional scaling


Description

Multidimensional scaling of some distance matrix defined on the vertices of a graph.

Usage

layout_with_mds(graph, dist = NULL, dim = 2, options = arpack_defaults)

with_mds(...)

Arguments

graph

The input graph.

dist

The distance matrix for the multidimensional scaling. If NULL (the default), then the unweighted shortest path matrix is used.

dim

layout_with_mds supports dimensions up to the number of nodes minus one, but only if the graph is connected; for unconnected graphs, the only possible values is 2. This is because merge_coords only works in 2D.

options

This is currently ignored, as ARPACK is not used any more for solving the eigenproblem

...

Passed to layout_with_mds.

Details

layout_with_mds uses metric multidimensional scaling for generating the coordinates. Multidimensional scaling aims to place points from a higher dimensional space in a (typically) 2 dimensional plane, so that the distance between the points are kept as much as this is possible.

By default igraph uses the shortest path matrix as the distances between the nodes, but the user can override this via the dist argument.

This function generates the layout separately for each graph component and then merges them via merge_coords.

Value

A numeric matrix with dim columns.

Author(s)

Tamas Nepusz ntamas@gmail.com and Gabor Csardi csardi.gabor@gmail.com

References

Cox, T. F. and Cox, M. A. A. (2001) Multidimensional Scaling. Second edition. Chapman and Hall.

See Also

Examples

g <- sample_gnp(100, 2/100)
l <- layout_with_mds(g)
plot(g, layout=l, vertex.label=NA, vertex.size=3)

igraph

Network Analysis and Visualization

v1.2.10
GPL (>= 2)
Authors
See AUTHORS file.
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.