Skip to content

Files

Latest commit

f966ef5 · May 21, 2018

History

History
This branch is 23 commits behind trekhleb/javascript-algorithms:master.

bellman-ford

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
May 3, 2018
May 21, 2018
May 3, 2018

Bellman–Ford Algorithm

The Bellman–Ford algorithm is an algorithm that computes shortest paths from a single source vertex to all of the other vertices in a weighted digraph. It is slower than Dijkstra's algorithm for the same problem, but more versatile, as it is capable of handling graphs in which some of the edge weights are negative numbers.

Bellman-Ford

Complexity

Worst-case performance O(|V||E|) Best-case performance O(|E|) Worst-case space complexity O(|V|)

References