Question

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
Official answer and solution
Official answer
A
From
Official GATE 2016 answer key

Solution

Analyze how an additive edge weight transformation affects spanning tree weights versus path weights with differing hop counts.

Let G=(V,E)G = (V, E) be a connected undirected graph with nn vertices. Suppose every edge weight w(e)w(e) is transformed to w′(e)=w(e)+cw'(e) = w(e) + c for a constant c>0c > 0.

Evaluate Statement PP (Minimum Spanning Tree):
Every spanning tree of GG contains exactly n−1n - 1 edges. If TT is any spanning tree, its new weight is:

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

Because the weight of EVERY spanning tree increases by the exact same constant (n−1)c(n - 1)c, the relative ordering of all spanning trees is completely preserved. The tree that minimized w(T)w(T) will also minimize w′(T)w'(T). Thus, the MST does not change. Statement PP is TRUE.

Evaluate Statement QQ (Shortest Paths):
Unlike spanning trees, different paths between a pair of vertices uu and vv can have different numbers of edges (hop counts). If path P1P_1 has 1 edge and path P2P_2 has 3 edges:

  • w′(P1)=w(P1)+cw'(P_1) = w(P_1) + c
  • w′(P2)=w(P2)+3cw'(P_2) = w(P_2) + 3c
    For example, if w(P1)=5w(P_1) = 5 and w(P2)=1+1+1=3w(P_2) = 1 + 1 + 1 = 3, P2P_2 is initially the shortest path (3<53 < 5).
    If c=3c = 3, then w′(P1)=5+3=8w'(P_1) = 5 + 3 = 8, while w′(P2)=3+3(3)=12w'(P_2) = 3 + 3(3) = 12. Now P1P_1 is shorter (8<128 < 12).
    Thus, the shortest path can change. Statement QQ is FALSE.

Therefore, only Statement PP is true.

Final answer

A

Common trap

Assuming that because edge weights are increased monotonically, the shortest path must also remain unchanged, overlooking path length dependence on edge counts.

The answer is the one in the official GATE answer key. The solution is this site's own explanation.

Source

Paper
GATE 2016 Computer Science and Information Technology (CS) Session 1
Question
24 of 65, printed as CS Q.14
Section
Computer Science and Information Technology

Report an error in this question

GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.