GATE 2012 CS (CS1) – Question 50
For the shown directed weighted graph, several S-to-T shortest paths exist. Dijkstra updates a vertex’s predecessor only on finding a strictly shorter distance. Which path does it report?

Practise this question in The GATE Grind →
Show answer and explanation
Correct answer: (D) SACET
Explanation
Distances from S settle B=3, A=4, C=5, E=6 and D=7. C improves E to six, giving predecessor C. E is settled before D and sets T to ten via E→T. D later offers the same T distance ten, which the strict-update rule does not adopt. Thus S→A→C→E→T, D.
More Graph Algorithms: Traversals, Minimum Spanning Trees, Shortest Paths questions
- GATE 2013 CS (CS1) Q29
- GATE 2011 CS (CS1) Q64
- GATE 2011 CS (CS1) Q65
- GATE 2010 CS (CS1) Q60
- GATE 2010 CS (CS1) Q61
- GATE 2015 CS (CS2) Q47
All Graph Algorithms: Traversals, Minimum Spanning Trees, Shortest Paths questions →