Question: 8. [Shortest Paths] (i) Given an example of a graph to show why Dijkstra's algorithm does not compute single source shortest paths correctly if the

 8. [Shortest Paths] (i) Given an example of a graph to

8. [Shortest Paths] (i) Given an example of a graph to show why Dijkstra's algorithm does not compute single source shortest paths correctly if the graph has edges with negative weights. Clearly indicate the source vertex and the vertex for which the algorithm makes an error. [5 Marks] (ii) Here is a claim by Bob to make Dijkstra's algorithm work for computing single source shortest path even in graphs with negative edge weights: Add a large enough constant to every edge weight, so that all of them are positive and then run Dijkstra's algorithm. This will not change the solution to single source shortest path. Is Bo correct? If not, give a counterexample. 5 Marks]

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!