Data Structures and Algorithms20805 marksShortest Path Algorithms
Write Dijkstra's algorithm to find shortest path between any two vertices of a graph.
Write Dijkstra's algorithm to find shortest path between any two vertices of a graph. [5]
Dijkstra's algorithm finds the shortest path from a single source vertex to all other vertices in a weighted graph (digraph), assuming no negative weighted edges exist. The shortest distance from source V to any vertex V' is stored in that vertex, and the path is recorded using back pointers. ---...