Nested loop over graph objects.
Hi, given a set graph_db of graphs, I want to compare the vertices of each graph with the vertices of each other graph from graph_db. Naturally, this results in a fourfold nested loop. Unfortunately , this is really slow in python. Is there a way to way to speed up this process. I tried iterating over indices of graph objects instead of graph objects itself, but this doesn't improve performance. Best regards Christopher
On 14.10.2015 12:33, Christopher Morris wrote:
Hi,
given a set graph_db of graphs, I want to compare the vertices of each graph with the vertices of each other graph from graph_db. Naturally, this results in a fourfold nested loop. Unfortunately , this is really slow in python.
Is there a way to way to speed up this process. I tried iterating over indices of graph objects instead of graph objects itself, but this doesn't improve performance.
I don't know exactly what kind of comparison you are doing, but if it is a simple adjacency one, the similarity() function could be used to push the innermost loop into C++: https://graph-tool.skewed.de/static/doc/topology.html#graph_tool.topology.si... Best, Tiago -- Tiago de Paula Peixoto <tiago@skewed.de>
participants (2)
-
Christopher Morris -
Tiago de Paula Peixoto