Loading Bellman–Ford algorithm