The Bellman-Ford algorithm is a graph search algorithm that computes shortest paths from a single source vertex to all of the other vertices in a weighted digraph en.wikipedia.org cp-algorithms.com. It is more versatile than Dijkstra's algorithm as it is capable of handling graphs in which some of the edge weights are negative numbers.