I am working with a citation network and I would like to calculate the sum of probabilities of visiting a given node in the network from any other node in the network on a random walk. My understanding is that currentflow_betweeness_centrality is a metric that is similar to this idea, but it does not seem to work with directed grpahs:
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)
As outout, I get:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Frameworks/EPD64.framework/Versions/7.3/lib/python2.7/site-packages/networkx/algorithms/centrality/current_flow_betweenness.py", line 223, in current_flow_betweenness_centrality
'not defined for digraphs.')
networkx.exception.NetworkXError: ('current_flow_betweenness_centrality() ', 'not defined for digraphs.')
Any ideas on how why this limitation exists?