Hard

Bellman-Ford Algorithm

Bellman-Ford relaxes every edge, once per vertex. A further successful relaxation means a negative cycle is reachable.

Costs

CategoryAlgorithm
DifficultyHard
TimeO(V × E)
Negative edgesallowed
Detects a reachable negative cycleyes

Questions

What is Bellman-Ford Algorithm?

Bellman-Ford relaxes every edge, once per vertex. A further successful relaxation means a negative cycle is reachable.

Where do I practice it?

DSA Master keeps challenges and progress on the phone. This page is the idea and the costs.