[C++-sig] [Graph] Getting PageRank to work in BGL-Python
j.reid at mail.cryst.bbk.ac.uk
Fri Dec 7 10:49:32 CET 2007
John Reid wrote:
> It does seem to work on directed graphs:
> dg = bgl.Digraph()
> bgl.page_rank(dg, dg.add_vertex_property('float'))
The page rank docs say it only works on directed graphs:
Computes the PageRank of each vertex in a directed graph. For optimal
results, the graph should be strongly connected.
That's your problem, as
a=bgl.Graph.small_world_graph(5,5,.9, allow_self_loops=True )
creates an undirected graph.
More information about the Cplusplus-sig