Objectives: Find a Single Source Shortest Path (SSSP) using Dijkstra's Algorithm
Before working on this assignment, you would need to read the lecture SSSP-Dijkstra's Algorithm, Module 11 where the graph, pseudocode and outcomes of running Dijkstra's algorithm can be found. Write a program to implement the process of finding a SSSP of the example in the lecture.
The following instructions would help in your coding.
Represent vertex as numbers
Vertex in letters = {A, B, C, D, E) ==> Vertex in numbers = {0, 1, 2, 3, 4}
Represent edges of the given graph from vertex ‘u’ to vertex ‘v’ having weight ‘w’ as follows:
{0, 1, 3}, {0, 2, 1}, {1, 3, 3}, {1, 4, 1}, {2, 1, 1}, {2, 4, 4}, {4, 3, 2}
Example {0, 1, 3} => from vertex A to vertex B, weight 3
Sample output:
Shortest path from 0 (A) to 1, 2, 3 and 4 (B, C, D and E).
Path (0 -> 1): Minimum cost = 2, Route = [0, 2, 1]
Path (0 -> 2): Minimum cost = 1, Route = [0, 2]
Path (0 -> 3): Minimum cost = 5, Route = [0, 2, 1, 3]
Path (0 -> 4): Minimum cost = 3, Route = [0, 2, 1, 4]
Need to create header file and class file sparetely