Bellman–Ford by Bounded Edge Counts

Interpret relaxation rounds as dynamic programming over path length and use one further round to detect a reachable negative cycle.

Source
Anbloq
Language
English
Created
Updated
Chapters
2
Reading time
1 min
In this article2 chapters
  1. One more edge defines the next state
  2. A further strict improvement has a structural cause

One more edge defines the next state

Let \(D_k(v)\) be the minimum cost of a walk from \(s\) to \(v\) with at most \(k\) edges. Set \(D_0(s)=0\) and other values to infinity. Then

\[ D_{k+1}(v)=\min\bigl(D_k(v),\min_{(u,v)}[D_k(u)+w(u,v)]\bigr). \]

This version reads the previous layer, so it has the exact bounded-edge interpretation. An in-place relaxation order can propagate improvements across more edges in one round.

A further strict improvement has a structural cause

When no reachable negative cycle exists, delete any repeated-vertex cycles from an optimal walk without increasing its cost. A simple path uses at most \(|V|-1\) edges. A further improvement after that many full rounds implies a reachable negative cycle. Vertices reachable from such a cycle have no finite shortest-walk cost. DAG shortest paths eliminate repeated scanning by exploiting acyclicity. Johnson reweighting can use Bellman–Ford once to find feasible potentials.[1][2]

References

  1. Jeff Erickson, Algorithms ↩
  2. MIT OpenCourseWare, Design and Analysis of Algorithms: Lecture Notes ↩