I am interested in running Newman's modularity clustering algorithm on a large graph. If you can point me to a library (or R package, etc) that implements it I would be most grateful.
我对在一个大的图上运行纽曼的模块化聚类算法很感兴趣。如果您能给我指出一个实现它的库(或R包,等等),我将非常感激。
best ~lara
最好的~【
3 个解决方案
#1
8
Use the igraph package for R: http://igraph.sourceforge.net/doc/R/fastgreedy.community.html this implements a fast algorithm for community finding using the newman-girvan modularity maximization method.
使用igraph软件包进行R: http://igraph.sourceforge.net/doc/R/fastgreedy.community.html这实现了使用newman-girvan模块化最大化方法进行社区查找的快速算法。
your code will look like this:
您的代码将如下所示:
library(igraph)
# read graph from csv file
G<-read.graph("edgelist.txt", format="ncol")
fgreedy<-fastgreedy.community(G,merges=TRUE, modularity=TRUE)
memberships <-community.to.membership(G, fgreedy$merges, steps=which.max(fgreedy$modularity)-1)
print(paste('Number of detected communities=',length(memberships$csize)))
# Community sizes:
print(memberships$csize)
# modularity:
max(fgreedy$modularity)
#2
1
I'm not quite sure whether the open-source data visualization tool, Gephi, is running with this algorithm. As I know, it runs with the algo in paper: Fast unfolding of communities in large networks
我不太确定开源数据可视化工具Gephi是否使用了这种算法。正如我所知道的,它在论文中与算法一起运行:在大型网络中快速展开社区
It's also a modularity based methods.
它也是基于模块化的方法。
#3
0
There's a method in the excellent networkx package that returns a Newman-Watts-Strogatz small world graph.
在优秀的networkx包中有一个方法,它返回一个Newman-Watts-Strogatz小世界图。
#1
8
Use the igraph package for R: http://igraph.sourceforge.net/doc/R/fastgreedy.community.html this implements a fast algorithm for community finding using the newman-girvan modularity maximization method.
使用igraph软件包进行R: http://igraph.sourceforge.net/doc/R/fastgreedy.community.html这实现了使用newman-girvan模块化最大化方法进行社区查找的快速算法。
your code will look like this:
您的代码将如下所示:
library(igraph)
# read graph from csv file
G<-read.graph("edgelist.txt", format="ncol")
fgreedy<-fastgreedy.community(G,merges=TRUE, modularity=TRUE)
memberships <-community.to.membership(G, fgreedy$merges, steps=which.max(fgreedy$modularity)-1)
print(paste('Number of detected communities=',length(memberships$csize)))
# Community sizes:
print(memberships$csize)
# modularity:
max(fgreedy$modularity)
#2
1
I'm not quite sure whether the open-source data visualization tool, Gephi, is running with this algorithm. As I know, it runs with the algo in paper: Fast unfolding of communities in large networks
我不太确定开源数据可视化工具Gephi是否使用了这种算法。正如我所知道的,它在论文中与算法一起运行:在大型网络中快速展开社区
It's also a modularity based methods.
它也是基于模块化的方法。
#3
0
There's a method in the excellent networkx package that returns a Newman-Watts-Strogatz small world graph.
在优秀的networkx包中有一个方法,它返回一个Newman-Watts-Strogatz小世界图。