Question: Professor Gaedel has written a program that he claims implements Dijkstras algorithm. The program produces .d and . for each vertex V. Give
Professor Gaedel has written a program that he claims implements Dijkstra’s algorithm. The program produces ν.d and ν.π for each vertex ν ∈ V. Give an O(V + E)-time algorithm to check the output of the professor’s program. It should determine whether the d and π attributes match those of some shortest-paths tree. You may assume that all edge weights are nonnegative.
Step by Step Solution
3.32 Rating (167 Votes )
There are 3 Steps involved in it
1 Verify that sd 0 and s NIL 2 Verify that d w for all s 3 Verify that d if ... View full answer
Get step-by-step solutions from verified subject matter experts
