[graph-tool] Fast initialization of graph

arnfred jonas at ifany.org
Tue Mar 19 09:39:11 CET 2013


Hi there

I've just started using graph tool, and so far I'm very impressed with the
ease of use and the thorough documentation.

I'm currently trying to instantiate a fully connected graph with some 600
vertices, but I find that adding all the edges usually takes around 10
seconds on my system. The fastest way of doing it that I have come up with
so far is to write:

from itertools import combinations
edges = [g.add_edge(v1,v2) for (v1,v2) in combinations(g.vertices(),2)]

But I'm wondering if there is a faster method?

Thanks for a great tool

Jonas



--
View this message in context: http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com/Fast-initialization-of-graph-tp4025012.html
Sent from the Main discussion list for the graph-tool project mailing list archive at Nabble.com.



More information about the graph-tool mailing list