Question
Let 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 before and after the edge weight update?
Official answer and solution
- Official answer
- C
- From
- Official GATE 2025 answer key
Solution
Compare how adding to each edge changes the cost of spanning trees (fixed number of edges ) versus paths (variable number of edges).
- Minimum Spanning Trees: Every spanning tree of a connected graph has exactly edges. Adding to every edge increases the total weight of every spanning tree by the same constant (and preserves the relative order of all edge weights). Therefore, every MST remains an MST.
- Shortest Paths: Two paths between and may contain different numbers of edges. For example, if a 2-edge path has weights and a 1-edge path has weight , adding changes their weights to and , changing the shortest path. Thus SPs need not remain SPs.
Option (C)
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2025 Computer Science and Information Technology - Session 2 (CS2)
- Question
- 37 of 65
- 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.