Bellman-Ford, like Dijkstra’s Algorithm, is also a algorithm to find a shortest path in a graph.

If has no negative cycles, then there is a shortest path from to that is simple (i.e., does not repeat nodes), and hence has at most edges.

Let to denote the minimum cost of a path using at most edges. Our problem is to compute .