I understand that it returns an iterator, but I assume it still does some preparatory work internally that potentially allocates memory. I don't do any list conversion. I simply call the function without even assigning the output to any local variable. The error message I get is as follow: Traceback (most recent call last): File "/usr/local/lib/python3.5/dist-packages/IPython/core/interactiveshell.py", line 2862, in run_code exec(code_obj, self.user_global_ns, self.user_ns) File "<ipython-input-3-07c125e74096>", line 1, in <module> all_shortest_paths(g, v_start, v_dest, ep["sp_weight"], epsilon=10) File "/usr/lib/python3/dist-packages/graph_tool/topology/__init__.py", line 1978, in all_shortest_paths _prop("v", g, all_preds_map)) MemoryError On Tue, Jan 16, 2018 at 10:28 PM, Tiago de Paula Peixoto <tiago@skewed.de> wrote:
On 11.01.2018 01:05, Evangelos Petsalis wrote:
Hi,
I have a large graph (800K vertices and 6e6 edges) and I am running the all_shortest_paths function with edge weights. The problem is that due to the size of the graph, there are probably millions of paths that qualify and the function fails with a "MemoryError" code.
Is there a way to limit the number of shortest paths returned, or even better a version that returns an iterator and compute the paths as needed?
The function all_shortest_paths() *DOES* return an iterator to all the paths! It does *not* store them all in memory. You must be doing some list conversion...
-- Tiago de Paula Peixoto <tiago@skewed.de>
_______________________________________________ graph-tool mailing list graph-tool@skewed.de https://lists.skewed.de/mailman/listinfo/graph-tool