图的顶点上定义的某个距离矩阵的多维标度。
用法
layout_with_mds(graph, dist = NULL, dim = 2, options = arpack_defaults())
with_mds(...)
参数
- graph
输入图。
- dist
用于多维标度的距离矩阵。如果为
NULL
(默认值),则使用未加权的最短路径矩阵。- dim
layout_with_mds()
支持的最大维度为节点数减一,但前提是图是连通的;对于非连通图,唯一可能的值是 2。这是因为merge_coords()
仅在 2D 中有效。- options
目前已被忽略,因为 ARPACK 不再用于解决特征值问题
- ...
传递给
layout_with_mds()
。
详细信息
layout_with_mds()
使用经典多维标度(Torgerson 标度)来生成坐标。多维标度旨在将来自更高维度空间中的点放置在(通常)二维平面中,以便尽可能地保持点之间的距离。
默认情况下,igraph 使用最短路径矩阵作为节点之间的距离,但用户可以通过 dist
参数覆盖此设置。
警告:如果图对于两个顶点的交换是对称的(例如连接到同一父节点的树的叶子),则经典多维标度可能会为这些顶点分配相同的坐标。
此函数分别为每个图组件生成布局,然后通过 merge_coords()
合并它们。
参考文献
Cox, T. F. and Cox, M. A. A. (2001) Multidimensional Scaling. Second edition. Chapman and Hall.
参见
其他图布局:add_layout_()
, component_wise()
, layout_()
, layout_as_bipartite()
, layout_as_star()
, layout_as_tree()
, layout_in_circle()
, layout_nicely()
, layout_on_grid()
, layout_on_sphere()
, layout_randomly()
, layout_with_dh()
, layout_with_fr()
, layout_with_gem()
, layout_with_graphopt()
, layout_with_kk()
, layout_with_lgl()
, layout_with_sugiyama()
, merge_coords()
, norm_coords()
, normalize()
作者
Tamas Nepusz ntamas@gmail.com 和 Gabor Csardi csardi.gabor@gmail.com
示例
g <- sample_gnp(100, 2 / 100)
l <- layout_with_mds(g)
plot(g, layout = l, vertex.label = NA, vertex.size = 3)