• edited by
8,054 views
24 24 votes

​​​​Let $\text{G}$ 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 $\text{G}$ before and after the edge weight update?

  1. Every MST remains an MST, and every SP remains an SP.
  2. MSTs need not remain MSTs, and every SP remains an SP.
  3. Every MST remains an MST, and SPs need not remain SPs.
  4. MSTs need not remain MSTs, and SPs need not remain SPs.

3 Answers

14 14 votes
Option C:

Every MST will remain an MST because if we use Kruskal's Algorithm, adding alpha to each edge weight will not change the ordering of the edges, and the tree will be formed as it is.

for shortest paths, consider an undirected graph of 4  vertices v1, v2, v3, v4. The edge set of this graph is defined as {[v1,v2], [v2,v3], [v3,v4] and [v1,v4]}. Let edge weight of [v1,v2], [v2,v3], [v3,v4] and [v1,v4] be x1, x2, x3 and x4 respectively with the condition: x1+x2+x3 = x4 - 1. Thus originally the shortest path between v1 and v4 is x1+x2+x3. However after adding positive constant to each edge, the shortest path between v1 and v4 is x4 + alpha.
9 9 votes

Let $ G = (V, E) $ be an undirected graph with positive edge weights, and let a positive constant $ \alpha $ be added to the weight of every edge in $ G $. We analyze the effect of this transformation on Minimum Spanning Trees (MSTs) and Shortest Paths (SPs).

Effect on Minimum Spanning Trees

MSTs depend only on the relative ordering of edge weights, not their absolute values. Since adding the same constant $ \alpha > 0 $ to all edges preserves the order of weights, the set of edges selected by Kruskal’s or Prim’s algorithm remains unchanged.

Therefore, every MST of the original graph is also an MST of the modified graph.

Effect on Shortest Paths

Shortest paths, however, depend on the sum of absolute weights along a path. Adding $ \alpha $ to each edge increases the total weight of a path by $ \alpha \cdot (\text{number of edges in the path}) $. Consequently, paths with fewer edges are favored after the transformation even if they were more expensive originally.

Counterexample:
Consider a graph with edges $ AB = 1 $, $ BC = 1 $, and $ AC = 3 $.

  • Original shortest path from $ A $ to $ C $: $ A \to B \to C $ (cost = 2).
  • After adding $ \alpha = 2 $:
  • $ AB = 3 $, $ BC = 3 $, $ AC = 5 $
  • Path $ A \to B \to C $ costs 6, while direct edge $ AC $ costs 5.

Shortest path changes.Thus, shortest paths need not remain shortest after the transformation.

  • MSTs are invariant under uniform addition of a positive constant to all edge weights.
  • Shortest paths are not necessarily preserved.

Hence, the correct statement is:

$$
\color{lime} \boxed{\text{C. Every MST remains an MST, and SPs need not remain SPs.}}
$$

Answer:
Position:
Show:

Related questions

19 19 votes
6 6 answers
9.7k
9.7k views
Arjun asked Feb 27, 2025
9,666 views
Let $G$ be any undirected graph with positive edge weights, and $T$ be a minimum spanning tree of $G$. For any two vertices, $u$ and $v$, let $d_{1}(u, v)$ and $d_{2}(u, ...
1 1 vote
0 0 answers
390
390 views
Shubham Sharma 2 asked Jun 16, 2025
390 views
Let $G=(V, E)$ be a weighted, undirected and connected graph, with weight $1 \leq$ $\mathrm{wt}_{G}(e) \leq 99$ for edge $e \in E$. Suppose $G^{\prime}$ is the graph with...
12 12 votes
1 answers 1 answer
1.5k
1.5k views
GO Classes asked Jun 26, 2022
1,548 views
Consider two statements $\text{S1}$ and $\text{S2}.$The graph is stored in the Adjacency list.$\text{S1}:$ Assume that you are given a magical priority queue data structu...
11 11 votes
1 1 answer
1.7k
1.7k views
GO Classes asked Jun 26, 2022
1,696 views
Which of the following is/are FALSE?Let $\text{G = (V, E)}$ be a weighted graph and let $\text{M}$ be a minimum spanning tree of $\text{G}$. The path in $\text{M}$ betwee...