我尝试在python中使用igraph中的community_optimal_modularity函数。文档
http://igraph.org/python/doc/igraph.Graph-class.html#community_optimal_modularity
http://igraph.org/python/doc/igraph.GraphBase-class.html#community_optimal_modularity
声称feedind关键字“weight”会考虑边权重。
不幸的是,它并不像看起来那样:
import numpy as np
import igraph
gra = igraph.Graph.Full(10)
gra.es["weight"] = np.random.rand(gra.ecount())
gra.community_optimal_modularity(weights="weight")导致"community_optimal_modularity()无需参数(给定1个)“,而相同的代码在没有指定最后一个命令的关键字的情况下工作。我使用igraph版本0.7.0,这是最新的版本。
是否有可能通过最优模块化来考虑社区检测中的权重?
发布于 2015-03-05 12:03:23
尝试:
gra.community_optimal_modularity(weights= gra.es["weight"])对我很管用。
https://stackoverflow.com/questions/24514297
复制相似问题