GateAI
Minimum Spanning Trees and Shortest Paths

GATE CSE 2025 Set 2 · Q37

MCQ2 marksEasy

Time

Let GG be an edge-weighted undirected graph with positive edge weights. Suppose a positive constant α\alpha is added to the weight of every edge. Which ONE of the following statements is TRUE about the minimum spanning trees (MSTs) and shortest paths (SPs) in GG before and after the edge weight update?

Select one answerSingle correct

Pick an option to check

Solution

Step-by-step verified solution

Official answer: C) Every MST remains an MST, and SPs need not remain SPs.

Minimum Spanning Trees and Shortest Paths

### 1. Minimum Spanning Trees (MSTs) Every spanning tree of a connected undirected graph with ∣V∣|V| vertices contains exactly ∣V∣−1|V| - 1 edges.

When a constant α>0\alpha > 0 is added to each edge weight, the total weight of any spanning tree TT becomes:

w′(T)=∑e∈T(w(e)+α)=w(T)+(∣V∣−1)αw^{\prime}(T) = \sum_{e \in T} (w(e) + \alpha) = w(T) + (|V| - 1)\alpha

Because (∣V∣−1)α(|V| - 1)\alpha is an identical constant added to the weight of every spanning tree, the relative ordering of tree weights is completely preserved. Therefore, any spanning tree that was an MST before the addition remains an MST after the addition.

---

### 2. Shortest Paths (SPs) Unlike spanning trees, different paths between a pair of vertices can have different numbers of edges (hops).

If path P1P_1 has k1k_1 edges and path P2P_2 has k2k_2 edges, their new path weights after adding α\alpha to each edge are:

w′(P1)=w(P1)+k1αw^{\prime}(P_1) = w(P_1) + k_1\alpha
w′(P2)=w(P2)+k2αw^{\prime}(P_2) = w(P_2) + k_2\alpha

Counterexample: Consider two paths between vertices uu and vv:

  • Path P1P_1: consists of 22 edges, each of weight 11 (total weight =2= 2).

  • Path P2P_2: consists of 11 edge of weight 33 (total weight =3= 3).

Initially, P1P_1 is the shortest path since 2<32 < 3. If we add α=2\alpha = 2 to each edge:

  • w′(P1)=(1+2)+(1+2)=6w^{\prime}(P_1) = (1+2) + (1+2) = 6

  • w′(P2)=3+2=5w^{\prime}(P_2) = 3 + 2 = 5

Now P2P_2 is shorter than P1P_1, so the shortest path changes. Thus, SPs need not remain SPs.

Hence, (C) is the correct statement.

Try the question first, then check your work.

Think the official key or this write-up is wrong?

Report error or challenge

Examiner trap

The misconception this question tests

This Minimum Spanning Trees and Shortest Paths previous year question is Q37 of the GATE CSE 2025 Set 2 paper. Find more GATE CSE PYQs on Minimum Spanning Trees and Shortest Paths in Algorithms, or browse all GATE CSE PYQs.

Free diagnostic

Where do you stand for GATE?

Take the 20-minute diagnostic: the 3 topics that cost you the most marks, and a rank range. Or sit 1 related Minimum Spanning Trees and Shortest Paths PYQs now with no account.

One GATE CSE PYQ every morning

An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.

Minimum Spanning Trees and Shortest Paths in GATE CSE

GATE CSE 2025 Set 2 Q37 is the only Minimum Spanning Trees and Shortest Paths question in the GATE CSE papers so far.

How GATE tests Minimum Spanning Trees and Shortest Paths

More from GATE CSE 2025 Set 2

Share this solution

A plain-text card for WhatsApp or Telegram study groups.

GateAI solution cardGATE CSE 2025 Set 2 · Q37 · MCQ

Let G be an edge-weighted undirected graph with positive edge weights. Suppose a positive constant is added to the weight of every edge. Which ONE of the following statements is TRUE about the minimum spanning trees (MSTs) and shortest paths (SPs) in G before and after the edge weight update?

Topic-wise GATE CS PYQs with verified steps

Independent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.