networkx 计算出它的良好分区和模块化

networkx calculate a a good partition and modularity of it

我正在 networkx 中寻找一种与此方法功能相同的方法,只是它确实考虑了边权重https://networkx.github.io/documentation/latest/reference/algorithms/generated/networkx.algorithms.community.modularity_max.greedy_modularity_communities.html

greedy_modularity_communities:

Find communities in graph using Clauset-Newman-Moore greedy modularity maximization. This method currently supports the Graph class and does not consider edge weights.

它存在吗?我找不到它。 感谢阅读。

一定要是Networkx吗? iGraph 包为社区检测提供了更多的功能,包括加权快速贪婪的实现。您可以将 Networkx 中的图形文件保存为 .gml,这样可以轻松将其传输到 iGraph。

如果您转到 this 页面,您将看到此软件包提供的检测算法的完整列表,每个算法都以标记 'community_' 开头。该页面还将提供有关如何实现这些算法的教程。

我认为 Networkx 不会直接提供此功能,但是有一个名为 python-louvain 的附加程序包可能会提供您正在寻找的内容。