Open In App

GATE | GATE CS 1996 | Question 65

Last Updated : 03 Oct, 2018
Improve
Improve
Like Article
Like
Save
Share
Report

Let G be the directed, weighted graph shown in below figure

gra

We are interested in the shortest paths from A.

(a) Output the sequence of vertices identified by the Dijkstra’s algorithm for single source shortest path when the algorithm is started at node A.
(b) Write down sequence of vertices in the shortest path from A to E.
(c) What is the cost of the shortest path from A to E?


Answer:

Explanation: According to Dijkstra’s algorithm:
(a) Sequence of vertices when algorithm start traversing from A: A -> B -> D -> C -> F -> E
(b) The sequence remain same as answer (a).
(c) Cost of the shortest path from A to E is 84.

Quiz of this Question


Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads