Skip to main content

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…

Let GG be any undirected graph with positive edge weights, and TT be a minimum spanning tree of GG. For any two vertices, uu and vv, let d1(u,v)d_{1}(u, v) and d2(u,v)d_{2}(u, v) be the shortest distances between uu and vv in GG and TT, respectively. Which ONE of the options is CORRECT for all possible G,T,uG, T, u and vv ?

  1. A
    d1(u,v)=d2(u,v)d_{1}(u, v)=d_{2}(u, v)
  2. B
    d1(u,v)≤d2(u,v)d_{1}(u, v) \leq d_{2}(u, v)
    Correct answer
  3. C
    d1(u,v)≥d2(u,v)d_{1}(u, v) \geq d_{2}(u, v)
  4. D
    d1(u,v)≠d2(u,v)d_{1}(u, v) \neq d_{2}(u, v)

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.