Suppose we run Dijkstra’s single source shortest path algorithm on the following edge-weighted directed graph with vertex $P$ as the source.
In what order do the nodes get included into the set of vertices for which the shortest path distances are finalized?
Answer is (B). In Dijkstra's algorithm at each point we choose the vertex with the shortest distance from the set of vertices in the shortest path found so far and add the edge connecting it to the shortest path.
The path visualized :-
Answer will be "B"
Option B :
64.3k questions
77.9k answers
244k comments
80.0k users