In case more than one shortest path between two nodes is available, which is the criterion used by single_source_shortest_path to pick one path?
Asked
Active
Viewed 124 times
1 Answers
1
There is none. Since it traverses the graph with a BFS
ish approach, and the order it visits a node's neighbors, is determined by a for loop, and that has an arbitrary order.

Community
- 1
- 1

user2268997
- 1,263
- 2
- 14
- 35
-
I have been making some tests: is it possible that the order is determined by the alphabetic sort of the node indexes? It seems to be a rather consistent behaviour, even if the indexes are explicitly declared as numbers, they are treated as strings. – Gabriella Lapesa Aug 23 '15 at 08:51
-
read the third answer and the comments of the second answer of linked question. – user2268997 Aug 23 '15 at 10:53