Graph - Shortest Path From Algorithm Algorithm: P Vasuki
Graph - Shortest Path From Algorithm Algorithm: P Vasuki
Algorithm
P VASUKI
Bellman Ford Algorithm
• nput: Graph and a source vertex src
Output: Shortest distance to all vertices from src. If there is a
negative weight cycle, then shortest distances are not calculated,
negative weight cycle is reported.
Bellman Ford Algorithm
• 1) This step initializes distances from source
to all vertices as infinite and distance to source
itself as 0. Create an array dist[] of size |V|
with all values as infinite except dist[src]
where src is source vertex.
• On Board ..
Additional Reference - Visualization
• https://visualgo.net/en/sssp