felipernb/algorithms.js — pull request #84 by eush77 (2014-08-02 22:50:28+00:00)
Title: Stop early in Bellman-Ford

If the current iteration finds no shorter paths, then it is safe to stop. This optimization also makes it possible to include the extra iteration in the main loop.