The intermediate states of the Bellman-Ford algorithm depend on edge order. Specify in-place edge relaxation in lexicographic directed-edge order:Starting with , the first pass changes the vector as follows; omitted relaxations make no change:The next pass makes no change, allowing early termination. If all passes are performed, passes two through four retain .
For the synchronous convention, where every relaxation reads only the previous row, the Synchronous Bellman-Ford recurrence instead givesBoth conventions reach the same shortest distances. The algorithm's eponyms are Richard Bellman and L. R. Ford Jr..