Chapter 4: Q15E (page 133)
Shortest paths are not always unique: sometimes there are two or more different paths with the minimum possible length. Show how to solve the following problem in time.
Input:An undirected graph ;edge lengths ; starting vertex .
Output:A Boolean array for each node u , the entry should be if and only if there is a unique shortest path s to u (Note:)
Short Answer
The given problem can be solved by modifying the Dijkstra’s algorithm as follows:
for all edges
if
else if