Dark Mode

284 views

0 votes

Consider the following strategy to convert a graph with negative edge weights to one that does not have negative edge weights. Let the maximum magnitude negative edge weight in the graph be -k. Then, for each edge in the graph with weight w, update the weight to w+k+1. Consider the following claim:

- To solve the shortest path problem in the original graph, we can run Dijkstra's algorithm on the modified graph and subtract the added weights to get the original distances.

Which of the following is not correct.

- The claim is not true in general.
- The claim is true for all graphs.
- The claim is true for connected acyclic graphs.
- The claim is not true in general for connected graphs with cycles