GATE DA 2025 Q58: Shortest paths: which edges cannot be in G?
- Programming, Data Structures and Algorithms
- 2 marks
- MSQ
- No negative marking
Question
Let be a simple, unweighted, and undirected graph. A subset of the vertices and edges of are shown below.

It is given that is a shortest path between and ; is a shortest path between and ; is a shortest path between and . Which of the following is/are NOT the edges of ?
Try it: multiple select: one or more correct options
Show answer and explanation
Answer: A, C, D (official GATE 2025 final answer key)
Concept used: A given shortest path rules out any edge that would create a shorter route.
First step: Each given shortest path has length 3. Test each candidate edge: does adding it give a path of length 2 between the same endpoints? For example, would give .
Full step-by-step solution
Detailed working, common mistakes and linked mock tests will be available with a free GATEiit account. Log-in is coming soon.
Share this question
Source: official GATE 2025 DA question paper and final answer key, organised by IIT Roorkee. Question paper · Answer key
More Programming, Data Structures and Algorithms PYQs
- 2025 · Q18Hashing with linear probing: h(x) = 3x mod 10
- 2025 · Q23Python lists: which call gives A = [1, 2, 3, 4, 5, 6]?
- 2025 · Q27When does binary search run in O(log n)?
- 2025 · Q29Insertion sort with exactly two swaps: possible values of x
- 2025 · Q47Python sets in a while loop: which set ends up with "this"?
- 2025 · Q63Python recursion: value of f(15, 10)