Skip to content
Related Articles

Related Articles

Improve Article

GATE | GATE MOCK 2017 | Question 48

  • Last Updated : 28 Jun, 2021

Consider a graph where all edge weights are positive. We have computed shortest path using Dijkstra’s shortest path algorithm and total weight of shortest path is W.

Consider below two statements about a shortest path from a source to a destination.

i) If the graph is modified and all edge weights are multiplied with x, then the shortest path remains same and weight of shortest path becomes W*x (W multiplied by x).

ii) If the graph is modified and x is added to all edge weights, then the shortest path remains same and weight of shortest path becomes W + n*x. Where n is number of edges on the shortest path.

(A) Only (i) is always True



(B) Only (ii) is always True

(C) Both are always True

(D) Neither (i) nor (ii) is always True


Answer: (A)

Explanation:

Quiz of this Question

Attention reader! Don’t stop learning now.  Practice GATE exam well before the actual exam with the subject-wise and overall quizzes available in GATE Test Series Course.

Learn all GATE CS concepts with Free Live Classes on our youtube channel.

My Personal Notes arrow_drop_up
Recommended Articles
Page :