使用有向网络间流图?

2024-10-03 00:29:24 发布

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

我与一个引文网络一起工作,我想计算随机游动网络中任何其他节点访问网络中给定节点的概率总和。我的理解是currentflow_betweeness_centrality是一个与这个想法类似的度量,但它似乎不适用于有向grpah:

import networkx as nx
import pandas as pd
df = pd.read_csv(open("PATH TO CSV","rb"))

DG = nx.DiGraph()

DG.add_edges_from(zip(df.citing.values, df.cited.values))
largest_component = nx.weakly_connected_component_subgraphs(DG)[0]
random_walk = nx.current_flow_betweenness_centrality(largest_component)

最后,我得到:

^{pr2}$

你知道为什么会有这种限制吗?在


Tags: import网络df节点as概率componentpd