seung-lab / dijkstra3d

Dijkstra's Shortest Path for 6, 18, and 26-Connected 3D (Volumetric) Image Volumes
GNU General Public License v3.0
69 stars 13 forks source link

Dijkstra 3D All Paths #39

Open h-cohen opened 1 year ago

h-cohen commented 1 year ago

Hi,

Trying to figure out how to use the parents function. My goal is to obtain ALL possible shortest paths between a pair of nodes (or voxels).

Using the path_from_parents function is returning the same value as the regular dijkstra function.

Thank you for all your help, Cheers

william-silversmith commented 1 year ago

Hi! Path from parents is used to find a single shortest path from any point on the grid. Currently, there is no function in dijkstra3d that exhaustively searches for all equal paths.

networkx does have a function for this: https://networkx.org/documentation/stable/reference/algorithms/generated/networkx.algorithms.shortest_paths.generic.all_shortest_paths.html#networkx.algorithms.shortest_paths.generic.all_shortest_paths

I don't know what your performance requirements are though.