Skip to content
Related Articles

Related Articles

GATE | GATE CS 1996 | Question 65

Improve Article
Save Article
  • Last Updated : 03 Oct, 2018
Improve Article
Save Article

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

My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!