Gabriella Lapesa
Gabriella Lapesa

Reputation: 73

single_source_shortest_path : criterion in case of multiple shortest paths?

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?

Upvotes: 0

Views: 131

Answers (1)

user2268997
user2268997

Reputation: 1391

There is none. Since it traverses the graph with a BFSish approach, and the order it visits a node's neighbors, is determined by a for loop, and that has an arbitrary order.

Upvotes: 1

Related Questions