网络度中心度

2024-10-01 00:32:31 发布

您现在位置:Python中文网/ 问答频道 /正文

我发现所有节点的度中心度都小于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?我看不出这是怎么回事。我真的不知道这是不是合适的地方,但请你帮忙,如果可以的话。我真的很感激。 谢谢你


Tags: keyget节点中心gcdictreverse分量
1条回答
网友
1楼 · 发布于 2024-10-01 00:32:31

根据NetworkX函数^{}的文档,您可以阅读:

The degree centrality values are normalized by dividing by the maximum possible degree in a simple graph n-1 where n is the number of nodes in G.

但是,如果您需要计算连接的组件,则有一个函数正好对应于这个函数connected_components。也可以检查类似的方法here。在

相关问题 更多 >