Let be any undirected graph with positive edge weights, and be a minimum spanning tree of . For any two vertices, and , let and be the shortest distances between and in and , respectively. Which ONE of the options is CORRECT for all possible and ?
GATE CSE 2025Algorithms › Graph AlgorithmsVerified
GATE CSE 2025 PYQ: Let G G G be any undirected graph with positive edge weights, and T T T be a minimum spanning tree of G G G…
- A
- BCorrect answer
- C
- D
Answer
(B) d 1 ( u , v ) ≤ d 2 ( u , v ) d_{1}(u, v) \leq d_{2}(u, v) d 1 ( u , v ) ≤ d 2 ( u , v )
Approach
Since the minimum spanning tree T is a subgraph of G, every path in T is also a path in G. Therefore the shortest path distance in G cannot exceed the shortest path distance in T, giving d1(u,v) ≤ d2(u,v) for all u,v. The other options are eliminated by counterexamples.
Because the MST T uses only edges of G, any path in T is also a path in G, making the shortest path in G no longer than that in T. Thus d1(u,v) ≤ d2(u,v) is the only universally valid relation, matching option B.
Reviewed by GateIQ Editorial Team: IIT & IISc Alumni.