我发现所有节点的度中心度都小于1。我在看无向图的连通分量。在
bcGC_dict = dict(nx.betweenness_centrality(GC))
ordered_bcGC = sorted(bcGC_dict, key = bcGC_dict.get,reverse = True)
print("\n top 11 betweenness centrality connected component:")
for i in range(11):
print(ordered_bcGC[i])
中心度最高的节点的输出为:
0.6933097652302072
有人知道为什么会这样吗?中间性中心度是否可能低于1?我看不出这是怎么回事。我真的不知道这是不是合适的地方,但请你帮忙,如果可以的话。我真的很感激。 谢谢你
根据NetworkX函数^{} 的文档,您可以阅读:
但是,如果您需要计算连接的组件,则有一个函数正好对应于这个函数
connected_components
。也可以检查类似的方法here。在相关问题 更多 >
编程相关推荐