• edited by
1,048 views
1 1 vote

Which of the following statements is NOT true?

  1. Adding a constant to every edge weight in a directed graph can change the set of edges that belongs to shortest path tree. Assume unique weights
  2. Adding a constant to every edge weight in an undirected graph can change the set of edges that belongs to the minimum spanning tree
  3. Rerunning Dijkstra's algorithm on a graph $V$ times will result in the correct shortest paths tree, even if there are negative edges (but no negative cycles)
  4. None of these

2 Answers

0 0 votes

B is correct. Draw some graph and visualize.
C is wrong. Dijkstra will work fine for -ve edge weight when we eliminate a vertex after using the vertex 2 times.

0 0 votes
the answer should be none . as both 1 and 2 are true. it doesn't matter the graph is directed or undirected., the minimum cost spanning tree will not change by adding constants till the weights are kept unique. while dijisktra gives the right answer if made to run on a graph with no negative cycle. so c is true. 1 and 2 are wrong
Position:
Show:

Related questions

1 1 vote
1 1 answer
1.6k
1.6k views
Souvik33 asked Dec 19, 2022
1,572 views
If a -ve weight cycle is reachable from source, the Dijkstra's algorithm gets into an infinite loop TRUEFALSE
0 0 votes
0 0 answers
2.0k
2.0k views
anisha007 asked Jan 24, 2019
2,045 views
Somebody please clarify me, will dijkstra’s algorithm terminate if there is a negative cycle present? (as far as I know, it doesn't give correct result as it keep updatin...