I have a directed graph-tool graph g
. I also have already calculated the pagerank for each vertex in the graph using graph_tool.centrality.pagerank
as shown below.
v_pr = g.new_vertex_property('float')
pr = pagerank(u, prop=v_pr)
u.vp['vertex_pagerank'] = v_pr
From here, I can access the pagerank value of a vertex given its index.
What I want to do, however, is to extract, say, the top 10 vertices of the graph in terms of their pagerank values.
Is there a quick way to do this on graph-tool
?