Discuss about a shortest paths problem


Discuss the below:

Here is a proposed algorithm to solve the single source shortest paths problem in a weighted directed graph G with possibly negative edges weights, but no negative weight cycles:

Form the graph G' from G by adding the same positive number, p, to all of the edge weights in the graph. This positive number should be chosen so that all the edge weights in G' are positive. (p = 1 + | min edge weight in G|). Run Dijkstra's algorithm on G'.

Is it true that the parent array produced by Dijkstra's algorithm on G' will also give the shortest paths in the original graph, G? Justify your answer with a counterexample or a sketch of a correctness proof.

Solution Preview :

Prepared by a verified Expert
Data Structure & Algorithms: Discuss about a shortest paths problem
Reference No:- TGS01931951

Now Priced at $20 (50% Discount)

Recommended (99%)

Rated (4.3/5)