如果您从 R 中使用 igraph,请使用此选项
cluster_label_prop {igraph} | R 文档 |
这是一种快速的、近线性时间算法,用于检测网络中的社区结构。其工作原理是使用唯一标签标记顶点,然后通过顶点邻域中的多数投票更新标签。
cluster_label_prop(graph, weights = NULL, initial = NULL, fixed = NULL)
图 |
输入图应为无向图才有意义。 |
weights |
边的权重。它必须是正数值向量, |
initial |
初始状态。如果为 |
fixed |
指示哪些标签固定的逻辑向量。当然,这只有在您提供了初始状态时才有意义,否则将忽略此元素。另请注意,没有标签的顶点无法固定。 |
此函数实现了社区检测方法,该方法描述于:Raghavan, U.N. and Albert, R. and Kumara, S.: Near linear time algorithm to detect community structures in large-scale networks. Phys Rev E 76, 036106. (2007)。此版本通过考虑边权重以及允许固定某些标签的能力扩展了原始方法。
从论文的摘要中:“在我们的算法中,每个节点都初始化一个唯一标签,并且在每个步骤中,每个节点都采用其大多数邻居当前拥有的标签。在这个迭代过程中,密集连接的节点组就一个唯一的标签形成共识,从而形成社区。”
cluster_label_prop
返回一个 communities
对象,有关详细信息,请参见 communities
手册页。
Tamas Nepusz ntamas@gmail.com 为 C 实现,Gabor Csardi csardi.gabor@gmail.com 为此手册页。
Raghavan, U.N. and Albert, R. and Kumara, S.: Near linear time algorithm to detect community structures in large-scale networks. Phys Rev E 76, 036106. (2007)
communities
用于提取实际结果。
cluster_fast_greedy
, cluster_walktrap
, cluster_spinglass
, cluster_louvain
和 cluster_leiden
用于其他社区检测方法。
g <- sample_gnp(10, 5/10) %du% sample_gnp(9, 5/9)
g <- add_edges(g, c(1, 12))
cluster_label_prop(g)