Network Optimization Depth First Search

Slides:



Advertisements
Similar presentations
Outline LP formulation of minimal cost flow problem
Advertisements

15.082J & 6.855J & ESD.78J Shortest Paths 2: Bucket implementations of Dijkstra’s Algorithm R-Heaps.
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.
CISC220 Fall 2009 James Atlas Nov 13: Graphs, Line Intersections.
15.082J/6.855J/ESD.78J September 14, 2010 Data Structures.
& 6.855J & ESD.78J Algorithm visualizations Modified Label Correcting Algorithm.
15.082J, 6.855J, and ESD.78J September 21, 2010 Eulerian Walks Flow Decomposition and Transformations.
and 6.855J The Capacity Scaling Algorithm.
15.082J & 6.855J & ESD.78J September 23, 2010 Dijkstra’s Algorithm for the Shortest Path Problem.
Search exploring the consequences of possible actions.
& 6.855J & ESD.78J Algorithm Visualization The Ford-Fulkerson Augmenting Path Algorithm for the Maximum Flow Problem.
The Ford-Fulkerson Augmenting Path Algorithm for the Maximum Flow Problem Thanks to Jim Orlin & MIT OCW.
and 6.855J The Goldberg-Tarjan Preflow Push Algorithm for the Maximum Flow Problem.
Network Simplex Animations Network Simplex Animations.
15.082J & 6.855J & ESD.78J September 30, 2010 The Label Correcting Algorithm.
15.082J and 6.855J and ESD.78J Network Simplex Animations.
Cycle Canceling Algorithm
Network Optimization J.B. Orlin
Binary search tree. Removing a node
Network Simplex Animations
C.Eng 213 Data Structures Graphs Fall Section 3.
Dijkstra’s Algorithm with two levels of buckets
The Shortest Augmenting Path Algorithm for the Maximum Flow Problem
Introduction to Maximum Flows
15.082J & 6.855J & ESD.78J Visualizations
Dijkstra’s Algorithm for the Shortest Path Problem
15.082J & 6.855J & ESD.78J Visualizations
Lecture 6 Shortest Path Problem.
Dijkstra’s Algorithm for the Shortest Path Problem
Breadth first search animation
Lecture 4 Graph Search.
Lecture 19-Problem Solving 4 Incremental Method
Introduction to Minimum Cost Flows
Spanning Tree Algorithms
and 6.855J Flow Decomposition
Primal-Dual Algorithm
Successive Shortest Path Algorithm
Successive Shortest Path Algorithm
and 6.855J March 6, 2003 Maximum Flows 2
15.082J & 6.855J & ESD.78J Radix Heap Animation
Introduction to Algorithms
Min Global Cut Animation
Network Optimization Flow Decomposition.
Dijkstra’s Algorithm for Shortest Paths
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
Network Optimization Topological Ordering
and 6.855J The Goldberg-Tarjan Preflow Push Algorithm for the Maximum Flow Problem Obtain a network, and use the same network to illustrate the.
and 6.855J Dijkstra’s Algorithm
Visualizations Dijkstra’s Algorithm
Introduction to Maximum Flows
Network Simplex Animations
and 6.855J The Goldberg-Tarjan Preflow Push Algorithm for the Maximum Flow Problem Obtain a network, and use the same network to illustrate the.
Eulerian Cycles in directed graphs
and 6.855J Topological Ordering
15.082J & 6.855J & ESD.78J Visualizations
Shortest Path Solutions
The Minimum Cost Spanning Tree Problem
and 6.855J Depth First Search
Breadth first search animation
OPIM 915 Fall 2010 Data Structures 23-38,
Introduction to Maximum Flows
EMIS 8374 Search Algorithms Updated 12 February 2008
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.
15.082J & 6.855J & ESD.78J Visualizations
EMIS 8374 Search Algorithms: DFS Updated 12 February 2004
Presentation transcript:

Network Optimization Depth First Search Get ahold of a network, and use the same network to illustrate the shortest path problem for communication newtorks, the max flow problem, the minimum cost flow problem, and the multicommodity flow problem. This will be a very efficient way of introducing the four problems. (Perhaps under 10 minutes of class time.) James Orlin 2010

Initialize 1 2 4 5 3 6 9 7 8 1 2 4 5 3 6 9 7 8 1 1 Unmark all nodes in N; Mark node 1 and add it to LIST LIST 1

Select a node i in LIST 1 2 4 5 3 6 9 7 8 1 1 1 Select last node in LIST LIST 1

If node i is incident to an admissible arc… 2 4 2 2 8 1 1 1 1 5 7 Scan an arc out of node 1. 9 3 6 If endpoint is unmarked, then mark it and add it to LIST. LIST 1 2

Select the last node on LIST 2 4 2 2 2 8 1 1 1 1 1 5 7 Select Node 2. 9 3 6 LIST 1 2

If node i is incident to an admissible arc… 2 4 4 2 2 2 3 8 1 1 1 1 1 5 7 Scan arc out of node 2. 9 3 6 Mark node 4 and add it to LIST. LIST 1 2 4

Select 2 4 4 4 2 2 2 2 3 8 1 1 1 1 1 5 7 Select node 4 9 3 6 LIST 1 2

If node i is incident to an admissible arc… 2 4 4 4 2 2 2 2 3 8 8 4 1 1 1 1 1 5 7 Scan arc out of node 4. 9 3 6 Mark 8 and add it to LIST. LIST 1 2 4 8

Select 2 4 4 4 2 2 2 2 3 8 8 8 4 1 1 1 1 1 5 7 Select node 8 9 3 6 LIST 1 2 4 8

If node i is not incident to an admissible arc… 2 4 4 4 2 2 2 2 3 8 8 8 4 1 1 1 1 1 5 7 If there are no unscanned arcs out of node 8, delete it from LIST. 9 3 6 LIST 1 2 4 8

Select 2 4 4 4 4 2 2 2 2 3 8 8 8 8 4 1 1 1 1 1 5 7 Select Node 4 9 3 6 LIST 1 2 4 8

If node i is incident to an admissible arc… 2 4 4 4 4 2 2 2 2 3 8 8 8 8 4 5 1 1 1 1 1 5 5 7 Scan arc out of node 4. 9 3 6 Mark 5 and add it to LIST. LIST 1 2 4 8 5

Select 2 4 4 4 4 4 2 2 2 2 3 8 8 8 8 4 5 1 1 1 1 1 5 5 5 7 Select node 5 9 3 6 LIST 1 2 4 8 5

If node i is incident to an admissible arc… 2 4 4 4 4 4 2 2 2 2 3 8 8 8 8 4 5 1 1 1 1 1 5 5 5 7 Scan arc out of node 5. 9 3 6 6 Mark 6 and add it to LIST. 6 LIST 1 2 4 5 8 6

Select the last node on LIST 2 4 4 4 4 4 2 2 2 2 3 8 8 8 8 4 5 1 1 1 1 1 5 5 5 5 7 Select node 6 9 3 6 6 6 6 LIST 1 2 4 5 8 6

If node i is incident to an admissible arc… 2 4 4 4 4 4 2 2 2 2 3 8 8 8 8 4 5 1 1 1 1 1 5 5 5 5 7 Scan arc out of node 6. 9 9 3 6 6 6 7 Mark 9 and add it to LIST. 6 LIST 1 2 4 5 8 6 9

Select the last node on LIST 2 4 4 4 4 4 2 2 2 2 3 8 8 8 8 4 5 1 1 1 1 1 5 5 5 5 7 Select node 9 9 9 9 3 6 6 6 6 7 6 LIST 1 2 4 8 5 6 9

If node i is incident to an admissible arc… 2 4 4 4 4 4 2 2 2 2 3 8 8 8 8 4 5 1 8 1 1 1 1 5 5 5 5 7 7 Scan arc out of node 9. 9 9 9 3 6 6 6 6 7 Mark 7 and add it to LIST. 6 LIST 1 2 4 8 5 6 9 7

Select the last node on LIST 2 4 4 4 4 4 2 2 2 2 3 8 8 8 8 4 5 1 8 1 1 1 1 5 5 5 5 7 7 7 Select node 7 9 9 9 9 3 6 6 6 6 7 6 LIST 1 2 4 8 5 6 9 7

Scan arc (7,4) 2 4 4 4 4 4 2 2 2 2 3 8 8 8 8 4 5 1 8 1 1 1 1 5 5 5 5 7 7 7 Scan arc out of node 7 9 9 9 9 3 6 6 6 6 7 6 If endpoint is marked, then label arc as “scanned”. LIST 1 2 4 8 5 6 9 7

Scan arc (7,5) 2 4 4 4 4 4 2 2 2 2 3 8 8 8 8 4 5 1 8 1 1 1 1 5 5 5 5 7 7 7 Scan arc out of node 7 9 9 9 9 3 6 6 6 6 7 6 If endpoint is marked, then label arc as “scanned”. LIST 1 2 4 8 5 6 9 7

Scan arc (7,8) 2 4 4 4 4 4 2 2 2 2 3 8 8 8 8 4 5 1 8 1 1 1 1 5 5 5 5 7 7 7 Scan arc out of node 7 9 9 9 9 3 6 6 6 6 7 6 If endpoint is marked, then label arc as “scanned”. LIST 1 2 4 8 5 6 9 7

If node i is not incident to an admissible arc… 2 4 4 4 4 4 2 2 2 2 3 8 8 8 8 4 5 1 8 1 1 1 1 5 5 5 5 7 7 7 There are no arcs out of 7. Delete 7 from LIST 9 9 9 9 3 6 6 6 6 7 6 LIST 1 2 4 8 5 6 9 7

Select node 9 2 4 4 4 4 4 2 2 2 2 3 8 8 8 8 4 5 1 8 1 1 1 1 5 5 5 5 7 7 7 7 Select node 9. 9 9 9 9 9 3 6 6 6 6 7 6 LIST 1 2 4 5 8 6 9 7

Scan (9,4) 2 4 4 4 4 4 2 2 2 2 3 8 8 8 8 4 5 1 8 1 1 1 1 5 5 5 5 7 7 7 7 Scan arc out of node 9. 9 9 9 9 9 3 6 6 6 6 7 6 If endpoint is marked, then label arc as “scanned”. LIST 1 2 4 8 5 6 9 7

Delete 9 from LIST 2 4 4 4 4 4 2 2 2 2 3 8 8 8 8 4 5 1 8 1 1 1 1 5 5 5 5 7 7 7 7 Node 9 has no incident arcs. Delete it from list. 9 9 9 9 9 3 6 6 6 6 7 6 LIST 1 2 4 5 8 6 9 7

Select node 6 2 4 4 4 4 4 2 2 2 2 3 8 8 8 8 4 5 1 8 1 1 1 1 5 5 5 5 7 7 7 7 Select node 6. 9 9 9 9 9 9 3 6 6 6 6 6 7 6 LIST 1 2 4 5 8 6 9 7

Scan arc (6.7) 2 4 4 4 4 4 2 2 2 2 3 8 8 8 8 4 5 1 8 1 1 1 1 5 5 5 5 7 7 7 7 Select arc out of node 6. 9 9 9 9 9 9 3 6 6 6 6 6 7 6 LIST 1 2 4 5 8 6 9 7

Select node 6 2 4 4 4 4 4 2 2 2 2 3 8 8 8 8 4 5 1 8 1 1 1 1 5 5 5 5 7 7 7 7 Delete node 6 from LIST 9 9 9 9 9 9 3 6 6 6 6 6 7 6 LIST 1 2 4 5 8 6 9 7

Select node 5 2 4 4 4 4 4 2 2 2 2 3 8 8 8 8 4 5 1 8 1 1 1 1 5 5 5 5 5 7 7 7 7 9 9 9 9 9 9 Select Node 5 3 6 6 6 6 6 6 7 6 LIST 1 2 4 5 8 6 9 7

Select node 5 2 4 4 4 4 4 2 2 2 2 3 8 8 8 8 4 5 1 8 1 1 1 1 5 5 5 5 5 7 7 7 7 9 9 9 9 9 9 3 6 6 6 6 6 6 Delete node 5 from LIST 7 6 LIST 1 2 4 5 8 6 9 7

Select node 4 2 4 4 4 4 4 4 4 2 2 2 2 3 8 8 8 8 4 5 1 8 1 1 1 1 5 5 5 5 5 5 7 7 7 7 Select node 4 9 9 9 9 9 9 3 6 6 6 6 6 6 7 6 LIST 1 2 4 8 5 6 9 7

Delete node 4 2 4 4 4 4 4 4 2 2 2 2 3 8 8 8 8 4 5 1 8 1 1 1 1 5 5 5 5 5 5 7 7 7 7 Delete node 4 from LIST 9 9 9 9 9 9 3 6 6 6 6 6 6 7 6 LIST 1 2 4 8 5 6 9 7

Select node 2 2 4 4 4 4 4 4 4 2 2 2 2 2 3 8 8 8 8 4 5 1 8 1 1 1 1 5 5 5 5 5 5 7 7 7 7 Select Node 2 9 9 9 9 9 9 3 6 6 6 6 6 6 7 6 LIST 1 2 4 5 8 6 9 7

Scan arc (2,5) 2 4 4 4 4 4 4 4 2 2 2 2 2 3 8 8 8 8 4 5 1 8 1 1 1 1 5 5 5 5 5 5 7 7 7 7 Scan arc out of node 2 9 9 9 9 9 9 3 6 6 6 6 6 6 7 6 LIST 1 2 4 5 8 6 9 7

Delete node 2 2 4 4 4 4 4 4 4 2 2 2 2 2 2 3 8 8 8 8 4 5 1 8 1 1 1 1 5 5 5 5 5 5 7 7 7 7 9 9 9 9 9 9 3 6 6 6 6 6 6 Delete node 2 from LIST 7 6 LIST 1 2 4 8 5 6 9 7

Select node 1 2 4 4 4 4 4 4 4 2 2 2 2 2 2 3 8 8 8 8 4 5 1 8 1 1 1 1 1 5 5 5 5 5 5 7 7 7 7 Select node 1 9 9 9 9 9 9 3 6 6 6 6 6 6 7 6 LIST 1 2 4 5 8 6 9 7

Scan arc (1,3) 2 4 4 4 4 4 4 4 2 2 2 2 2 2 3 8 8 8 8 4 5 1 8 1 1 1 1 1 5 5 5 5 5 5 7 7 7 7 Scan arc out of node 1 9 9 9 9 9 9 3 3 6 6 6 6 6 6 7 9 6 LIST 1 3 2 4 8 5 6 9 7

Select node 3 2 4 4 4 4 4 4 4 2 2 2 2 2 2 3 8 8 8 8 4 5 1 8 1 1 1 1 1 1 5 5 5 5 5 5 7 7 7 7 Select node 3 9 9 9 9 9 9 3 3 3 6 6 6 6 6 6 7 9 6 LIST 1 3 2 4 5 8 6 9 7

Scan arcs (3,5) and (3,6) 2 4 4 4 4 4 4 4 2 2 2 2 2 2 3 8 8 8 8 4 5 1 8 1 1 1 1 1 1 5 5 5 5 5 5 7 7 7 7 Scan arcs out of node 3 9 9 9 9 9 9 3 3 3 6 6 6 6 6 6 7 9 6 LIST 1 3 2 4 5 8 6 9 7

Delete node 3 2 4 4 4 4 4 4 4 2 2 2 2 2 2 3 8 8 8 8 4 5 1 8 1 1 1 1 1 1 5 5 5 5 5 5 7 7 7 7 Delete node 3 from LIST 9 9 9 9 9 9 3 3 3 6 6 6 6 6 6 7 9 6 LIST 1 3 2 4 8 5 6 9 7

Select node 1 2 4 4 4 4 4 4 4 2 2 2 2 2 2 3 8 8 8 8 4 5 1 8 1 1 1 1 1 1 1 5 5 5 5 5 5 7 7 7 7 Select node 1 9 9 9 9 9 9 3 3 3 3 6 6 6 6 6 6 7 9 6 LIST 1 2 3 4 5 8 6 9 7

Scan arc (1, 5) 2 4 4 4 4 4 4 4 2 2 2 2 2 2 3 8 8 8 8 4 5 1 8 1 1 1 1 1 1 1 5 5 5 5 5 5 7 7 7 7 Scan arc out of (1,5) 9 9 9 9 9 9 3 3 3 3 6 6 6 6 6 6 7 9 6 LIST 1 2 3 4 5 8 6 9 7

Delete node 1 2 4 4 4 4 4 4 4 2 2 2 2 2 2 3 8 8 8 8 4 5 1 8 1 1 1 1 1 1 1 5 5 5 5 5 5 7 7 7 7 Delete node 1 from LIST 9 9 9 9 9 9 3 3 3 3 6 6 6 6 6 6 7 9 6 LIST 1 2 3 4 5 8 6 9 7

LIST is empty 2 4 4 4 4 4 4 4 2 2 2 2 2 2 3 8 8 8 8 4 5 1 8 1 1 1 1 1 1 1 1 5 5 5 5 5 5 7 7 7 7 The algorithm ends! 9 9 9 9 9 9 3 3 3 3 6 6 6 6 6 6 7 9 6 LIST 1 2 3 4 5 8 6 9 7

The depth first search tree 1 3 2 9 8 7 5 4 6 Note that each induced subtree has consecutively labeled nodes

15.082J / 6.855J / ESD.78J Network Optimization MITOpenCourseWare http://ocw.mit.edu 15.082J / 6.855J / ESD.78J Network Optimization Fall 2010 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.