【问题标题】:Newman's modularity clustering for graphs纽曼图的模块化聚类
【发布时间】:2011-04-01 05:16:17
【问题描述】:

我有兴趣在大图上运行 Newman 的 modularity 聚类算法。如果您能指出一个实现它的库(或 R 包等),我将不胜感激。

最好的 ~拉拉

【问题讨论】:

标签: r statistics graph cluster-analysis modularity


【解决方案1】:

我不太确定开源数据可视化工具Gephi 是否使用此算法运行。据我所知,它与论文中的算法一起运行:大型网络中社区的快速展开

这也是一种基于模块化的方法。

【讨论】:

    【解决方案2】:

    使用 R 的 igraph 包: http://igraph.sourceforge.net/doc/R/fastgreedy.community.html 这实现了一种使用 newman-girvan 模块化最大化方法的快速社区发现算法。

    您的代码将如下所示:

    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)
    

    【讨论】:

      【解决方案3】:

      a method in the excellent networkx package 返回一个 Newman-Watts-Strogatz 小世界图。

      【讨论】:

      • 问题是对图进行聚类,而不是生成它 - 这就是该函数的作用
      猜你喜欢
      • 2020-03-18
      • 2019-04-13
      • 2016-10-06
      • 2020-12-14
      • 2020-08-17
      • 2022-01-23
      • 1970-01-01
      • 2018-03-11
      • 1970-01-01
      相关资源
      最近更新 更多