Related Articles

# GATE | GATE CS 2012 | Question 38

• Difficulty Level : Hard
• Last Updated : 14 Feb, 2018

Consider the directed graph shown in the figure below. There are multiple shortest paths between vertices S and T. Which one will be reported by Dijstra?s shortest path algorithm? Assume that, in any iteration, the shortest path to a vertex v is updated only when a strictly shorter path to v is discovered.

(A) SDT
(B) SBDT
(C) SACDT
(D) SACET

Explanation:

Background Required –  Dijkstra’s Single Source Shortest Path Algorithm
Explanation – Applying  Dijkstra’s algorithm to compute the shortest distances from S and finally generating the Tree as given below in the diagram.

This solution is contributed by Pranjul Ahuja.

Attention reader! Don’t stop learning now.  Practice GATE exam well before the actual exam with the subject-wise and overall quizzes available in GATE Test Series Course.

Learn all GATE CS concepts with Free Live Classes on our youtube channel.

My Personal Notes arrow_drop_up