这是一种快速的、接近线性时间的算法,用于检测网络中的社区结构。 它通过用唯一的标签标记顶点,然后通过顶点邻域中的多数投票来更新标签来工作。
用法
cluster_label_prop(
graph,
weights = NULL,
...,
mode = c("out", "in", "all"),
initial = NULL,
fixed = NULL
)
参数
- graph
输入图。 请注意,该算法最初是为无向图定义的。 如果您在此处传递有向图,建议将“mode”设置为
all
,以将其视为无向图。- weights
边的权重。 它必须是正数值向量、
NULL
或NA
。 如果它是NULL
并且输入图具有“weight”边属性,那么将使用该属性。 如果为NULL
并且不存在这样的属性,那么边将具有相等的权重。 如果该图具有“weight”边属性,但您不想将其用于社区检测,请将其设置为NA
。 较大的边权重意味着此函数的连接更强。- ...
这些点用于未来的扩展,并且必须为空。
- mode
逻辑值,是否考虑标签传播的边的方向,如果是,则标签应在哪个方向传播。 无向图忽略此参数。“all”表示忽略边的方向(即使在有向图中)。“out”表示沿着边的自然方向传播标签。“in”表示向后传播标签(即从头到尾)。
- initial
初始状态。 如果为
NULL
,则每个顶点在一开始都将具有不同的标签。 否则,它必须是每个顶点都有一个条目的向量。 非负值表示不同的标签,负值表示没有标签的顶点。- fixed
逻辑向量,表示哪些标签是固定的。 当然,这只有在您提供了初始状态时才有意义,否则将忽略此元素。 另请注意,没有标签的顶点不能被固定。
值
cluster_label_prop()
返回一个 communities()
对象,有关详细信息,请参见 communities()
手册页。
详细信息
此函数实现了社区检测方法,该方法在以下文章中描述: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)。 此版本通过考虑边权重以及允许固定某些标签的能力扩展了原始方法。
从论文的摘要中:“在我们的算法中,每个节点都用一个唯一的标签初始化,并且在每个步骤中,每个节点都采用其大多数邻居当前拥有的标签。 在这个迭代过程中,节点的高度连接组就唯一的标签形成共识,从而形成社区。”
参考文献
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()
用于其他社区检测方法。
社区检测 as_membership()
, cluster_edge_betweenness()
, cluster_fast_greedy()
, cluster_fluid_communities()
, cluster_infomap()
, cluster_leading_eigen()
, cluster_leiden()
, cluster_louvain()
, cluster_optimal()
, cluster_spinglass()
, cluster_walktrap()
, compare()
, groups()
, make_clusters()
, membership()
, modularity.igraph()
, plot_dendrogram()
, split_join_distance()
, voronoi_cells()
作者
Tamas Nepusz ntamas@gmail.com 用于 C 实现,Gabor Csardi csardi.gabor@gmail.com 用于此手册页。
示例
g <- sample_gnp(10, 5 / 10) %du% sample_gnp(9, 5 / 9)
g <- add_edges(g, c(1, 12))
cluster_label_prop(g)
#> IGRAPH clustering label propagation, groups: 2, mod: 0.45
#> + groups:
#> $`1`
#> [1] 1 2 3 4 5 6 7 8 9 10
#>
#> $`2`
#> [1] 11 12 13 14 15 16 17 18 19
#>