Bellman–Ford–Moore algorithm