如果您从 R 中使用 igraph,请使用此选项
cluster_louvain {igraph} | R 文档 |
此函数实现多层模块化度优化算法,用于寻找社群结构,请参阅下面的参考资料。它基于模块化度度量和分层方法。
cluster_louvain(graph, weights = NULL, resolution = 1)
图 |
输入图。 |
weights |
边的权重。它必须是正数值向量, |
resolution |
可选的分辨率参数,允许用户调整算法内部使用的模块化度函数的分辨率参数。较低的值通常产生较少、较大的集群。 当分辨率参数设置为 1 时,将恢复模块化度的原始定义。 |
此函数实现多层模块化度优化算法,用于寻找社群结构,详情请参阅 VD Blondel, J-L Guillaume, R Lambiotte 和 E Lefebvre: 大型网络中社群层次结构的快速展开,https://arxiv.org/abs/0803.0476。
它基于模块化度度量和分层方法。 最初,每个顶点都被分配到自己的社群中。 在每个步骤中,顶点以局部贪婪的方式重新分配到社群:每个顶点都被移动到它对模块化度贡献最大的社群。 当没有顶点可以重新分配时,每个社群都被视为自己的顶点,并且该过程从合并的社群再次开始。 当只剩下一个顶点或在某个步骤中无法再增加模块化度时,该过程停止。 自 igraph 1.3 起,顶点以随机顺序处理。
此函数由 Tom Gregorovic 贡献。
cluster_louvain
返回一个 communities
对象,有关详细信息,请参阅 communities
手册页。
Tom Gregorovic, Tamas Nepusz ntamas@gmail.com
Vincent D. Blondel, Jean-Loup Guillaume, Renaud Lambiotte, Etienne Lefebvre: 大型网络中社群的快速展开。 J. Stat. Mech. (2008) P10008
有关从结果中提取成员关系、模块化分数等信息,请参见 communities
。
其他社群检测算法: cluster_walktrap
, cluster_spinglass
, cluster_leading_eigen
, cluster_edge_betweenness
, cluster_fast_greedy
, cluster_label_prop
cluster_leiden
# This is so simple that we will have only one level
g <- make_full_graph(5) %du% make_full_graph(5) %du% make_full_graph(5)
g <- add_edges(g, c(1,6, 1,11, 6, 11))
cluster_louvain(g)