Bellman Ford Algorithm
Author:
@wkw
Overview
Bellman Ford Algorithm computes shortest paths from a single source vertex to all of the other vertices in a weighted digraph. Similar to Dijkstra's algorithm, it proceeds by relaxation. However, Dijkstra's algorithm uses a priority queue to greedily select the closest vertex that has not been processed, which all of its outgoing edges will be processed. On the other hand, Bellman Ford Algorithm relaxes all the edges and does the relaxation only times where is the number of vertices in the graph. This is because given a graph with no negative weight cycles with vertices, the shortest path between any two vertices has at most