Use this if you are using igraph from R
Multidimensional scaling of some distance matrix defined on the vertices of a graph.
layout_with_mds(graph, dist = NULL, dim = 2, options = arpack_defaults) with_mds(...)
The input graph.
The distance matrix for the multidimensional scaling. If
This is currently ignored, as ARPACK is not used any more for solving the eigenproblem
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
This function generates the layout separately for each graph component and
then merges them via
A numeric matrix with
Cox, T. F. and Cox, M. A. A. (2001) Multidimensional Scaling. Second edition. Chapman and Hall.
Other graph layouts:
g <- sample_gnp(100, 2/100) l <- layout_with_mds(g) plot(g, layout=l, vertex.label=NA, vertex.size=3)