Too Long Execution Time When Using all_simple_paths()

63 views
Skip to first unread message

Dehan Zhang

unread,
Mar 3, 2024, 11:03:09 PMMar 3
to networkx-discuss
Hi,
I want to use all_simple_paths() on a graph (A) with nodes 2371 and edges 3305 but the program stuck.
When I use the function on a much larger graph (B) with nodes 14344 and edges 16947, the program finishes in a reasonable time.
Although the two graphs are both multigraphs, the largest component of graph B is still much larger than that of graph A.
And when I output the source node and the target node together with counting the paths, I noticed the function stuck between some nodes.
First, it stuck between node 5 and 6. It outputs the path[5,6] and then stopped.
Then I ignored node 5, and the function stuck between nodes 6 and 7. This time the function didn't find the path [6,5,7] and it just stuck. But before this, it found the path [6,5,4]. 
It's been confusing me for a long time.
group.PNG
Reply all
Reply to author
Forward
0 new messages