Raphaël Clifford firstname.lastname@example.org
Bristol University, Department of Computer Science Bristol BS8 1UB, UK
December 3, 2009
Raphaël Clifford email@example.com COMS21102: Bellman-Ford
Single-Source Shortest Paths
We have previously looked at this problem in two cases
When there are no negative weight edges, Dijkstra’s shortest path algorithm uses |V | E XTRACT-M IN and I NSERT operations plus |E | D ECREASE -K EY operations. This gives a total worst case of O (|E | log |V |) or O (|V | log(|V |) + |E |) time depending on how we implement the priority queue. Where the graph has no cycles at all (it is a DAG) then we can solve the problem in O (|V | + |E |) time In this lecture we consider the case where there are negatively weighted edges. The algorithm is known as Bellman-Ford If the graph has a negatively weighted cycle, the algorithm will tell us. Otherwise, it will give us the shortest path from the source to ..