igraph (version 0.6.6)

layout.mds: Graph layout by multidimensional scaling

Description

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

Usage

layout.mds(graph, dist=NULL, dim=2, options=igraph.arpack.default)

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.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 layout.merge only works in 2D.
options
This is currently ignored, as ARPACK is not used any more for solving the eigenproblem

Value

  • A numeric matrix with dim columns.

concept

Graph layout

Details

layout.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 layout.merge.

References

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

See Also

layout, plot.igraph

Examples

Run this code
g <- erdos.renyi.game(100, 2/100)
l <- layout.mds(g)
plot(g, layout=l, vertex.label=NA, vertex.size=3)

Run the code above in your browser using DataCamp Workspace