2080 8

CSC211 ยท 2080 ยท 5 marks

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]

Data Structures and AlgorithmsChapter 8: Trees and GraphsShortest Path Algorithms

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. ---...