Bellman Ford Algorithm, Lecture Slides - Computer Science, Slides for Introduction to Computers. University of Bristol

Introduction to Computers

Description: Single Source Shortest path Analysis Correctness Negative Weighted cycle Difference constraints
Showing pages  1  -  2  of  20
COMS21102: Bellman-Ford
Raphaël Clifford
Bristol University, Department of Computer Science
Bristol BS8 1UB, UK
December 3, 2009
Raphaël Clifford
COMS21102: Bellman-Ford Slide 1
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|EXTRACT-MIN and INSERT operations plus |E|
DECREASE-KEY 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 every node.
The good news is that Bellman-Ford is simpler than the previous
graph algorithms.
Raphaël Clifford
COMS21102: Bellman-Ford Slide 2
The preview of this document ends here! Please or to read the full document or to download it.
Document information
Embed this document:
Docsity is not optimized for the browser you're using. In order to have a better experience please switch to Google Chrome, Firefox, Internet Explorer 9+ or Safari! Download Google Chrome