[graph-tool] ranking vertices by value of vertex property
ioana.hulpus at gmail.com
Tue Jul 7 17:22:08 CEST 2020
Great, thanks a lot!
On Tue, Jul 7, 2020 at 4:29 PM Tiago de Paula Peixoto <tiago at skewed.de>
> Am 07.07.20 um 15:39 schrieb Ioana K-Hulpus:
> > Hi,
> > I ran PageRank on my graph, and now I need to get the top-k highest
> > Is there any faster / more straightforward way of achieving this than by
> > creating and then sorting a new dictionary, as in the following method?
> Yes, you can access property map values as numpy arrays via the ".a"
> attribute, e.g. if pr is a vertex property map with the pagerank scores,
> will give you a numpy array. This means you can use the argsort() method
> to obtain the indexes (i.e. vertices) in increasing order:
> Tiago de Paula Peixoto <tiago at skewed.de>
> graph-tool mailing list
> graph-tool at skewed.de
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the graph-tool