AI engineering glossary · Data structures algorithms
What is Bellman-Ford algorithm?
Bellman-Ford algorithm: A shortest-path algorithm that repeatedly relaxes every edge up to V-1 times, where V is the number of vertices. It handles negative edge weights and can detect a negative cycle, at the cost of O(V*E) time.
Bellman-Ford algorithm: an example
In a currency exchange graph with log-transformed rates, Bellman-Ford can reveal an arbitrage loop as a negative cycle.
Related terms
More Data structures algorithms terms
- Big-O notation
- Big-Omega notation
- Big-Theta notation
- Binary search
- Binary search tree
- Binary tree
- Bipartite graph
- Bloom filter
Where you learn it
Bellman-Ford algorithm is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.