GATE / CS ARCHIVE

GATE CSE 2016 SET 1 / QUESTION 14

GATE CSE 2016 Set 1 Q14

Algorithms · Graph Algorithms · Full GATE CSE 2016 Set 1 paper

GATE 2016 Set 1, Q14 1 mark · MCQ
Report issue

Graph Algorithms

Question 14, GATE 2016: In a connected weighted undirected graph with distinct positive edge weights, add the same positive amount to every edge weight. Evaluate P: the minimum spanning tree is unchanged; Q: the shortest path between every pair is unchanged. A: P only. B: Q only. C: neither. D: both.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

Every spanning tree has |V|−1 edges, so adding a constant c to each edge adds the same c(|V|−1) to every tree’s weight, preserving the unique MST. Paths may have different edge counts: triangle weights 1, 2, 4 initially favor 1+2 over 4, but adding 2 makes the direct 6 shorter than 3+4. Thus only P, A.

The invariant for trees is equal edge count, not merely preserved ordering of individual edge weights. Compare two trees T1,T2: the added terms cancel in their weight difference. By contrast a k-edge path gains kc, and another path with fewer edges gains less. The triangle counterexample demonstrates an actual reversal while retaining positive, distinct edge weights, so Q fails as a universal statement even though some particular graphs keep their shortest paths.

Original paper, page 7 · Answer key