GATE CS 2025 Set 1 | Question 18
Algorithms › Graph Algorithms · MCQ · 1 mark · Answer: B
- Question 18Algorithmsmcq1 markLet be any undirected graph with positive edge weights, and be a minimum spanning tree of . For any two vertices, and , let and be the shortest distances between and in and , respectively. Which ONE of the options is CORRECT for all possible and ?
- A.
- B.✓
- C.
- D.
Answer: B
Solution
Answer: (B) is a subgraph of (it uses only edges of ). Any – path in is also a path in , so the shortest path in can only be shorter or equal:Equality can occur (e.g. a tree edge), and strict inequality is common (a direct non-tree edge in may be shorter), so (A), (C), (D) fail in general. - A.
More GATE PYQ on Graph Algorithms
All GATE CS Algorithms PYQ →Attempt GATE CS 2025 Set 1 in real GATE exam mode
Full paper with a timer, the GATE interface and a topic-wise analysis — free.
Create free account →