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