Question: Consider the following algorithm for computing the shortest path tree in a graph with negative edges. If there are no negative edges, just run Dijkstra's

 Consider the following algorithm for computing the shortest path tree in

Consider the following algorithm for computing the shortest path tree in a graph with negative edges. If there are no negative edges, just run Dijkstra's algorithm. If there are negative edges, find the smallest edge weight W and add - W to every edge weight in the graph. Now all the edges weights are positive, so use Dijkstra's algorithm. This algorithm does not work! Find an example input where it does not compute the correct

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!