EMIS 8374 Shortest Path Problems: Introduction Updated 9 February 2008

Slides:



Advertisements
Similar presentations
IKI 10100: Data Structures & Algorithms Ruli Manurung (acknowledgments to Denny & Ade Azurat) 1 Fasilkom UI Ruli Manurung (Fasilkom UI)IKI10100: Lecture10.
Advertisements

Chapter 5 Shortest Paths: Label-Correcting Algorithms
Chapter 6 Maximum Flow Problems Flows and Cuts Augmenting Path Algorithm.
15.082J, 6.855J, and ESD.78J Sept 16, 2010 Lecture 3. Graph Search Breadth First Search Depth First Search Intro to program verification Topological Sort.
Management Science 461 Lecture 2b – Shortest Paths September 16, 2008.
1 Maximum Flow Networks Suppose G = (V, E) is a directed network. Each edge (i,j) in E has an associated ‘capacity’ u ij. Goal: Determine the maximum amount.
Chapter 7 Maximum Flows: Polynomial Algorithms
MIT and James Orlin © Introduction to Networks Eulerian Tours Hamiltonian Tours The Shortest Path Problem Dijkstra’s Algorithm for Solving the Shortest.
Graph COMP171 Fall Graph / Slide 2 Graphs * Extremely useful tool in modeling problems * Consist of: n Vertices n Edges D E A C F B Vertex Edge.
Outline Max Flow Algorithm Model of Computation Proposed Algorithm Self Stabilization Contribution 1 A self-stabilizing algorithm for the maximum flow.
1 Routing Algorithms. 2 Outline zBellaman-Ford Algorithm zDijkstra Algorithm.
Shortest Paths1 C B A E D F
Computational Methods for Management and Economics Carla Gomes
& 6.855J & ESD.78J Algorithm visualizations Modified Label Correcting Algorithm.
Chapter 4: Finding the Shortest Path Lesson 1: Dijkstra’s Algorithm
Chapter 4 Shortest Path Label-Setting Algorithms Introduction & Assumptions Applications Dijkstra’s Algorithm.
Using Dijkstra’s Algorithm to Find a Shortest Path from a to z 1.
Graph Algorithms Mathematical Structures for Computer Science Chapter 6 Copyright © 2006 W.H. Freeman & Co.MSCS SlidesGraph Algorithms.
Lecture 10 The Label Correcting Algorithm.
15.082J & 6.855J & ESD.78J September 23, 2010 Dijkstra’s Algorithm for the Shortest Path Problem.
Chapter 3 Algorithms Complexity Analysis Search and Flow Decomposition Algorithms.
Assignments and matchings Chapter 12 Presented by Yorai Geffen.
Network Flows Chun-Ta, Yu Graduate Institute Information Management Dept. National Taiwan University.
and 6.855J March 6, 2003 Maximum Flows 2. 2 Network Reliability u Communication Network u What is the maximum number of arc disjoint paths from.
CSE 421 Algorithms Richard Anderson Winter 2009 Lecture 5.
15.082J & 6.855J & ESD.78J September 30, 2010 The Label Correcting Algorithm.
Suppose G = (V, E) is a directed network. Each edge (i,j) in E has an associated ‘length’ c ij (cost, time, distance, …). Determine a path of shortest.
Decision Maths 1 Shortest path algorithm Dijkstra’s Algorithm A V Ali :
EMIS 8374 Shortest Path Trees Updated 11 February 2008 Slide 1.
EMIS 8374 The Ford-Fulkerson Algorithm (aka the labeling algorithm) Updated 4 March 2008.
1 Maximum Flows CONTENTS Introduction to Maximum Flows (Section 6.1) Introduction to Minimum Cuts (Section 6.1) Applications of Maximum Flows (Section.
Cycle Canceling Algorithm
All-pairs Shortest paths Transitive Closure
Shortest Paths CONTENTS Introduction to Shortest Paths (Section 4.1)
Network Simplex Animations
Discrete Optimization Lecture 1
EMIS 8374 Dijkstra’s Algorithm Updated 18 February 2008
EMIS 8374 Node Splitting updated 27 January 2004
The Shortest Augmenting Path Algorithm for the Maximum Flow Problem
Introduction to Maximum Flows
Shortest Paths C B A E D F Shortest Paths
Dijkstra’s Algorithm for the Shortest Path Problem
Dijkstra’s Algorithm for the Shortest Path Problem
Lecture 4 Graph Search.
Shortest-Path Property 4.1
Chapter 4: Finding the Shortest Path Lesson 1: Dijkstra’s Algorithm
Complexity of Ford-Fulkerson
Shortest Path Problems
and 6.855J March 6, 2003 Maximum Flows 2
Introduction to Algorithms
The Shortest Augmenting Path Algorithm for the Maximum Flow Problem
Reading before Lecture 13
The Shortest Augmenting Path Algorithm for the Maximum Flow Problem
EMIS 8374 Search Algorithms Updated 9 February 2004
The Ford-Fulkerson Algorithm
Network Optimization Topological Ordering
Lecture 6 Shortest Path Problem.
Network Simplex Animations
and 6.855J Topological Ordering
CSE 417: Algorithms and Computational Complexity
15.082J & 6.855J & ESD.78J Visualizations
Shortest Path Solutions
and 6.855J Depth First Search
Breadth first search animation
Richard Anderson Lecture 5 Graph Theory
Lecture 11 Graph Algorithms
EMIS 8374 Search Algorithms Updated 12 February 2008
Dijkstra’s Algorithm Ryan Keedy CSE 599 April 4th, 2012.
Max Flows 3 Preflow-Push Algorithms
Class 11 Max Flows Obtain a network, and use the same network to illustrate the shortest path problem for communication networks, the max flow.
Presentation transcript:

EMIS 8374 Shortest Path Problems: Introduction Updated 9 February 2008

Assumptions All arc costs (cij) are integers. The network contains a directed path from the source node to every other node in the network. No negative (directed) cycles

A Network with Negative Cycles 3 2 4 1 1 2 1 6 3 -3 -3 3 3 5 1 7

Shortest Path Problems Acyclic Networks

Topological Ordering Renumber the nodes so that for every arc (i,j), i < j Let k := 1 Find a node i with in-degree = 0 If no such node then quit (no T.O.) Else let order(i) := k, k := k+1 Remove i and all incident arcs (i,j) Goto Step 2

A Network with no Topological Ordering 1 2 3

Theorem A network is acyclic if and only if it has a topological ordering of its nodes. Complexity of T.O. Algorithm: O(m)

T.O. Algorithm 2 4 1 6 1 3 5

T.O. Algorithm 2 4 3 5 6 2

T.O. Algorithm 2 4 6 5 3

T.O. Algorithm 4 5 2 4 6 6

Topological Ordering 4 5 2 4 1 6 1 6 3 5 2 3

The Reaching Algorithm: Initialization Number the nodes by a topological ordering. Let d(s) := 0; d(i) :=  for all other nodes. d(i) indicates the length of the shortest path found so far from s to i. When d(i) = , it means we have not yet found a path from s to i. Pred(s) := 0;

The Reaching Algorithm: Main Loop for i = 1 to n do for (i,j) in A(i) do if d(j) > d(i) + cij then begin let d(j) := d(i) + cij pred(j) := i end

Reaching Algorithm Example   2 4 5 7 1 1 2 6  1 6 5 2 3 -2  

Examine A(1) 7   2 4 5 7 1 1 2 6  1 6 5 2 3 -2   5

Examine A(2) 7 6  2 4 5 7 1 1 2 6  1 6 5 2 3 -2  5 3

Examine A(3) 6 5  2 4 5 7 1 1 2 6  9 1 6 5 2 3 -2 5 3

Examine A(4) 5 7  2 4 5 7 1 1 2 6 9 1 6 5 2 3 -2 5 3

Examine A(5) 5 7 2 4 5 7 1 1 2 6 8 9 1 6 5 2 3 -2 5 3

Examine A(5) 5 7 2 4 5 7 1 1 2 6 8 1 6 5 2 3 -2 5 3

Complexity of the Reaching Algorithm for i = 1 to n do for (i,j) in A(i) do if d(j) > d(i) + cij then begin let d(j) := d(i) + cij pred(j) := i; end Outer loop (for i := i+1) executes n times. Examining an arc is O(1). Comparison, updates of d(j) and pred(j) are O(1). Each arc is examined once. O(n+m) = O(m)

Shortest Path Tree We can store a set of shortest paths from s to all other nodes in a tree Use the pred(j) label to keep track of the last arc (i,j) that sets d(j) = d(i) + cij

Shortest Path Tree 7 6 7 5  2 4 5 1 1 2 6 8  5 2 3 -2  5 3 