According to this post, weights of a weighted digraph have an effect on the Page Rank of the graph. I have tried the code in that post:
from networkx.algorithms.link_analysis.pagerank_alg import pagerank_numpy
ddd=nx.DiGraph()
ddd.add_weighted_edges_from([('A','B',0.5),('A','C',0.5)])
print(pagerank_numpy(ddd))
ddd['A']['C']['weight']=1
print(pagerank_numpy(ddd))
>>> {'A': 0.2597402597402597, 'B': 0.37012987012987014, 'C': 0.37012987012987014}
>>> {'A': 0.2597402597402599, 'B': 0.3333333333333334, 'C': 0.40692640692640686}
However, at the same time, pagerank_numpy
has a parameter called weight
. According to the documentation:
weight (key, optional) – Edge data key to use as weight. If None weights are set to 1.
In the above example, weight
is not set, but it does not seem that weights are all set to 1. So, what does this parameter weight
really do?
Version of NetworkX: 2.1