如何将权重纳入igraph社区检测[Python / C / R]

时间:2014-07-16 18:21:23

标签: python c r graph igraph

使用commuinity_leading_eigenvector igraph时,假设已经创建了图表g,如何将图g的权重列表传递给community_leading_eigenvector

  

community_leading_eigenvector(clusters = None,weights = None,   arpack_options =无)

1 个答案:

答案 0 :(得分:3)

您可以将包含权重的属性名称传递给weights参数,也可以使用g.es["weight"]将所有权重检索到列表中,然后将其传递给weights参数。因此,假设您的权重在weight边缘属性中

,则其中任何一个都足够了
  1. g.community_leading_eigenvector(weights="weight")
  2. g.community_leading_eigenvector(weights=g.es["weight"])