Hi, igraph is optimized for static graphs, so it is (much) better to add all the edges at the same time, if you can do that.
Gabor On Fri, May 9, 2014 at 8:28 PM, Tim Althoff <[email protected]> wrote: > Hi, > > what is the proper way to efficiently select a node in python igraph? > > I want to do something like: > - find node object based on keyword attribute > - add new node to graph (add_vertex) [since this returns none I need to > "find" the new node obj] > - add edge between both nodes > > Currently this is very slow. Any tips? > > %timeit g.vs.find(paper_id_eq=paper_id) > %timeit g.add_edge(paper_id_node, new_node) > # G has 20k nodes and 100k edges > 10 loops, best of 3: 450 ms per loop > 10 loops, best of 3: 84.1 ms per loop > > > Thanks, > Tim > > _______________________________________________ > igraph-help mailing list > [email protected] > https://lists.nongnu.org/mailman/listinfo/igraph-help > >
_______________________________________________ igraph-help mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/igraph-help
