Abstract
-
Used to find the shortest path from any starting node to all other nodes in a Graph - Single Source Shortest Path on a Weighted Graph that is either Directed Graph or Undirected Graph
-
Use Greedy Algorithm to improve the computation performance via Priority Queue
-
Use Combinatorial Optimisation to obtain the shortest distance from the given node to all other nodes
Negative Edge
May not work if there are negative Edge
Java Code Templates
Construct Adjacency List
From Adjacency Matrix
Main Algorithm
Debugging Codes
Examine the node relationships of the adjacency list
Leetcode Question
Terminologies
Source Vertex
- The starting node
Edge Relaxation
- Update path for already known nodes as soon as we find a shorter path to reach it