I don't have python where I am right now, so I can't write an example,
but I recommend using read_edgelist to create a graph, then calling
the pagerank function. Both functions are well documented. Looking
at the pagerank code in networkx 1.5, it appears to do the right thing
with weighted directed networks, so I think you should be OK there.
Regards,
Nick
In [1]: import networkx as nx
In [2]: cat graph.edgelist
1 2 14
1 3 15
2 5 16
In [3]: G=nx.read_weighted_edgelist('graph.edgelist',nodetype=int)
In [4]: nx.pagerank(G)
Out[4]:
{1: 0.31576945228063863,
2: 0.32367032787416605,
3: 0.17632967212583389,
5: 0.18423054771936137}
--
You received this message because you are subscribed to the Google Groups "networkx-discuss" group.
To post to this group, send email to networkx...@googlegroups.com.
To unsubscribe from this group, send email to networkx-discu...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/networkx-discuss?hl=en.
Well it doesn't work correctly I guess. Just consider this edgelist
1 2 142 3 113 1 213 2 31
>>> G=nx.read_weighted_edgelist('graph.edgelist',nodetype=int)>>> print G.edges(data=True)[(1, 2, {'weight': 14.0}), (1, 3, {'weight': 21.0}), (2, 3, {'weight': 31.0})]
Just see everything gets interchanged. Any suggestion how to overcome this?
--
You received this message because you are subscribed to the Google Groups "networkx-discuss" group.
To post to this group, send email to networkx...@googlegroups.com.
To unsubscribe from this group, send email to networkx-discu...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/networkx-discuss?hl=en.