Question
Let be any connected undirected edge-weighted graph. The weights of the edges in are positive and distinct. Consider the following statements:
(I) Minimum Spanning Tree of is always unique.
(II) Shortest path between any two vertices of is always unique.
Which of the above statements is/are necessarily true?
Official answer and solution
- Official answer
- A
- From
- Official GATE 2017 answer key
Solution
Analyze the uniqueness of Minimum Spanning Trees and Shortest Paths in graphs with distinct positive edge weights.
Statement (I): In any connected undirected graph where all edge weights are distinct, the Minimum Spanning Tree (MST) is unique.
Proof: Suppose there are two distinct MSTs, and . Let be the minimum weight edge that belongs to one tree but not the other, say . Adding to creates a cycle . There must be an edge that is not in . Since all edge weights are distinct and is the minimum such edge, . Replacing with in produces a spanning tree of strictly smaller weight than , contradicting the assumption that was an MST. Hence, the MST is always unique. Statement (I) is necessarily true.
Statement (II): Distinct positive edge weights do not guarantee that the shortest path between every pair of vertices is unique.
Counterexample: Consider a graph with vertices and distinct edge weights:
- ,
- ,
All four edge weights are positive and distinct (1, 2, 3, 4). The path has length , and the path has length . Both paths between and have the exact same shortest distance 5, so the shortest path is not unique. Hence, Statement (II) is not necessarily true.
Therefore, only Statement (I) is necessarily true.
A
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2017 Computer Science and Information Technology (CS) Session 1
- Question
- 26 of 65, printed as CS Q.26
- 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.