Skip to content
Official PYQ · 2016

GATE CS 2016 Set 1 Q14 — Minimum Spanning Trees

Explain with AI

Let GG be a weighted connected undirected graph with distinct positive edge weights. If every edge weight is increased by the same value, then which of the following statements is/are TRUE?

  • PP: Minimum spanning tree of GG does not change.
  • QQ: Shortest path between any pair of vertices does not change.
Choose one option
View worked solution

Answer: A

To determine which statements are true, let us analyze PP and QQ individually.

Analysis of Statement PP: Minimum Spanning Tree (MST)

Let G=(V,E)G = (V, E) be a connected undirected graph with VV vertices. Any spanning tree TT of GG contains exactly V−1V - 1 edges.

Let the original weight of an edge ee be w(e)w(e). If every edge weight is increased by a constant c>0c > 0, the new weight of the edge becomes w′(e)=w(e)+cw'(e) = w(e) + c.

The total weight of any spanning tree TT under the new weight function is:

W′(T)=∑e∈Tw′(e)=∑e∈T(w(e)+c)=∑e∈Tw(e)+(V−1)c=W(T)+(V−1)cW'(T) = \sum_{e \in T} w'(e) = \sum_{e \in T} (w(e) + c) = \sum_{e \in T} w(e) + (V - 1)c = W(T) + (V - 1)c

Since (V−1)c(V - 1)c is a constant added to the weight of every spanning tree, the relative ordering of the weights of all spanning trees remains unchanged. Therefore, the spanning tree that minimizes W(T)W(T) will also minimize W′(T)W'(T).

Alternatively, greedy algorithms like Kruskal's or Prim's rely solely on the relative order of edge weights. Since w(e1)<w(e2)  ⟺  w(e1)+c<w(e2)+cw(e_1) < w(e_2) \iff w(e_1) + c < w(e_2) + c, the sorted order of edges remains identical. Thus, the MST does not change. Statement PP is TRUE.

Analysis of Statement QQ: Shortest Path

The shortest path between two vertices depends on the number of edges in the path. Adding a constant cc to each edge penalizes paths with more edges more heavily than paths with fewer edges.

Let us consider a counterexample:

  • Suppose we have two paths between vertices uu and vv:
    • Path P1P_1 consisting of 22 edges with weights 22 and 22 (Total weight = 44).
    • Path P2P_2 consisting of 11 edge with weight 55 (Total weight = 55).
  • Initially, the shortest path is P1P_1 with a cost of 44.
  • Now, increase every edge weight by c=2c = 2:
    • New weight of P1=(2+2)+(2+2)=8P_1 = (2 + 2) + (2 + 2) = 8.
    • New weight of P2=5+2=7P_2 = 5 + 2 = 7.

After the increase, the shortest path changes to P2P_2 (cost 77). Thus, the shortest path can change. Statement QQ is FALSE.

Hence, only statement PP is true.

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Minimum Spanning Trees questions