Let there b a graph where is the edge from vertex to vertex and is the least-cost path from node to .
Finally let be the neighbour of , i.e. the node connected by a single edge to .
Then the least costs are related by which is the Bellman-Ford equation.