Introduction to Maximum Flows

Slides:



Advertisements
Similar presentations
Min Cost Flow: Polynomial Algorithms. Overview Recap: Min Cost Flow, Residual Network Potential and Reduced Cost Polynomial Algorithms Approach Capacity.
Advertisements

Max Flows 2: The Excess Scaling Algorithm and Variants. James Orlin.
Chapter 6 Maximum Flow Problems Flows and Cuts Augmenting Path Algorithm.
Network Optimization Models: Maximum Flow Problems
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.
Network Optimization Models: Maximum Flow Problems In this handout: The problem statement Solving by linear programming Augmenting path algorithm.
Maximum Flows Lecture 4: Jan 19. Network transmission Given a directed graph G A source node s A sink node t Goal: To send as much information from s.
and 6.855J The Capacity Scaling Algorithm.
1 Minimum Cost Flows Goal: Minimize costs to meet all demands in a network subject to capacities (combines elements of both shortest path and max flow.
15.082J and 6.855J and ESD.78J October 19, 2010 Max Flows 3 Preflow-Push Algorithms.
Maximum Flow Problem (Thanks to Jim Orlin & MIT OCW)
& 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.
15.082J and 6.855J March 4, 2003 Introduction to Maximum Flows.
15.082J and 6.855J and ESD.78J The Successive Shortest Path Algorithm and the Capacity Scaling Algorithm for the Minimum Cost Flow Problem.
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.
15.082J and 6.855J and ESD.78J October 21, 2010 Max Flows 4.
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
Network Simplex Animations
Dijkstra’s Algorithm with two levels of buckets
Edmonds-Karp Algorithm
The Shortest Augmenting Path Algorithm for the Maximum Flow Problem
Introduction to Maximum Flows
15.082J & 6.855J & ESD.78J Visualizations
15.082J & 6.855J & ESD.78J Visualizations
Lecture 6 Shortest Path Problem.
Breadth first search animation
Lecture 4 Graph Search.
Introduction to Minimum Cost Flows
Not Always Feasible 2 (3,5) 1 s (0,2) 3 (, u) t.
Spanning Tree Algorithms
and 6.855J Flow Decomposition
Primal-Dual Algorithm
Complexity of Ford-Fulkerson
Successive Shortest Path Algorithm
Successive Shortest Path Algorithm
EE5900 Advanced Embedded System For Smart Infrastructure
and 6.855J March 6, 2003 Maximum Flows 2
15.082J & 6.855J & ESD.78J Radix Heap Animation
Network Optimization Depth First Search
Introduction to Algorithms
Min Global Cut Animation
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
MAXIMUM flow by Eric Wengert.
The Ford-Fulkerson Algorithm
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
The Minimum Cost Spanning Tree Problem
and 6.855J Depth First Search
Breadth first search animation
Introduction to Maximum Flows
The Successive Shortest Path Algorithm
Not Always Feasible 2 (3,5) 1 s (0,2) 3 (, u) t.
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
Excess Scaling Approach Algorithm
Presentation transcript:

Introduction to Maximum Flows Lecture 8 Introduction to Maximum Flows

The Ford Fulkerson Maximum Flow Algorithm Begin x := 0; create the residual network G(x); while there is some directed path from s to t in G(x) do begin let P be a path from s to t in G(x); ∆:= δ(P); send ∆ units of flow along P; update the r's; End end {the flow x is now maximum}.

The Ford-Fulkerson Augmenting Path Algorithm for the Maximum Flow Problem Obtain a network, and use the same network to illustrate the shortest path problem for communication networks, 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.)

Ford-Fulkerson Max Flow 4 2 5 1 3 1 1 2 2 s 4 t 3 2 1 3 This is the original network, and the original residual network.

Ford-Fulkerson Max Flow 4 2 5 1 3 1 1 2 2 s 4 t 3 2 1 3 Find any s-t path in G(x)

Ford-Fulkerson Max Flow 4 2 5 1 3 1 1 2 1 2 s 4 t 1 2 3 2 1 1 1 3 Determine the capacity D of the path. Send D units of flow in the path. Update residual capacities.

Ford-Fulkerson Max Flow 4 2 5 1 3 1 1 2 1 2 s 4 t 1 2 3 2 1 1 1 3 Find any s-t path

Ford-Fulkerson Max Flow 4 2 5 1 3 1 1 2 1 1 1 s 4 t 1 1 2 3 2 2 1 1 1 1 1 3 Determine the capacity D of the path. Send D units of flow in the path. Update residual capacities.

Ford-Fulkerson Max Flow 4 2 5 1 3 1 1 2 1 1 1 s 4 t 1 1 2 3 2 2 1 1 1 1 1 3 Find any s-t path

Ford-Fulkerson Max Flow 4 2 5 1 3 1 1 1 1 1 s 4 t 1 2 2 1 3 2 1 1 1 1 1 3 Determine the capacity D of the path. Send D units of flow in the path. Update residual capacities.

Ford-Fulkerson Max Flow 4 2 5 1 3 1 1 2 1 1 1 s 4 t 2 1 1 2 2 3 1 1 1 1 1 3 Find any s-t path

Ford-Fulkerson Max Flow 4 2 5 1 3 1 1 2 1 1 1 s 4 t 2 1 1 2 2 1 1 1 1 2 1 1 2 3 Determine the capacity D of the path. Send D units of flow in the path. Update residual capacities.

Ford-Fulkerson Max Flow 4 2 5 1 3 1 1 2 1 1 1 s 4 t 1 2 1 2 1 2 1 1 2 1 2 1 3 Find any s-t path

Ford-Fulkerson Max Flow 4 3 2 5 1 1 2 3 1 1 1 1 s 4 t 2 1 1 2 1 2 1 1 2 1 1 2 3 Determine the capacity D of the path. Send D units of flow in the path. Update residual capacities.

Ford-Fulkerson Max Flow 3 4 2 5 1 1 2 3 1 1 1 1 s 4 t 1 2 1 2 1 2 1 1 2 1 2 1 3 There is no s-t path in the residual network. This flow is optimal

Ford-Fulkerson Max Flow 4 3 2 2 5 5 1 1 2 3 1 1 1 1 s s 4 4 t 2 1 2 1 1 2 1 1 1 2 1 2 3 3 These are the nodes that are reachable from node s.

Ford-Fulkerson Max Flow 1 2 s 4 5 3 t Here is the optimal flow

Review for cutset theorem

The Capacity Scaling Algorithm 15.082 and 6.855J The Capacity Scaling Algorithm Obtain a network, and use the same network to illustrate the shortest path problem for communication networks, 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.)

The Capacity Scaling Algorithm Animation

The Original Costs and Node Potentials 4 2 4 7 5 2 1 1 6 2 Introduce myself and the Tas. It is critical that students sign up for the virtual campus web site. Hand out instructions on how to use it. Make sure that everyone signs up on the list. Also, create a class list that is separate from the web site. Ask for a show of where students come from. There should be four major contingencies: Grad EECS, ORC, Transportation, Rest 3 5

The Original Capacities and Supplies/Demands 5 -2 10 2 4 30 25 23 20 1 20 20 Introduce myself and the Tas. It is critical that students sign up for the virtual campus web site. Hand out instructions on how to use it. Make sure that everyone signs up on the list. Also, create a class list that is separate from the web site. Ask for a show of where students come from. There should be four major contingencies: Grad EECS, ORC, Transportation, Rest 3 25 5 -7 -19

Set  = 16. This begins the -scaling phase. 5 -2 10 We send flow from nodes with excess   to nodes with deficit  . 2 4 30 25 23 20 1 20 We ignore arcs with capacity  . 20 Introduce myself and the Tas. It is critical that students sign up for the virtual campus web site. Hand out instructions on how to use it. Make sure that everyone signs up on the list. Also, create a class list that is separate from the web site. Ask for a show of where students come from. There should be four major contingencies: Grad EECS, ORC, Transportation, Rest 3 25 5 -7 -19

Select a supply node and find the shortest paths shortest path distance 7 8 4 2 4 7 5 The shortest path tree is marked in bold and blue. 2 1 1 6 2 Introduce myself and the Tas. It is critical that students sign up for the virtual campus web site. Hand out instructions on how to use it. Make sure that everyone signs up on the list. Also, create a class list that is separate from the web site. Ask for a show of where students come from. There should be four major contingencies: Grad EECS, ORC, Transportation, Rest 3 5 8 6

Update the Node Potentials and the Reduced Costs -7 -8 4 3 2 4 7 To update a node potential, subtract the shortest path distance. 5 2 6 1 1 1 6 2 3 5 -6 -8

Send Flow Along a Shortest Path in G(x, 16) 5 -2 10 Send flow from node 1 to node 5. 2 4 30 25 23 20 1 1 20 How much flow should be sent? 20 3 25 5 -7 -19

Update the Residual Network 5 -2 10 19 units of flow were sent from node 1 to node 5. 2 4 30 23 25 4 20 1 1 20 19 1 19 3 5 6 -19 -7

This ends the 16-scaling phase. 5 -2 10 2 4 The -scaling phase continues when e(i)   for some i. e(j)  - for some j. There is a path from i to j. 30 25 4 20 1 1 20 19 1 19 3 5 6 -7

This begins and ends the 8-scaling phase. 5 -2 10 2 4 The -scaling phase continues when e(i)   for some i. e(j)  - for some j. There is a path from i to j. 30 25 4 20 1 1 20 19 1 19 3 5 6 -7

This begins 4-scaling phase. 5 -2 10 2 4 What would we do if there were arcs with capacity at least 4 and negative reduced cost? 30 25 4 20 1 1 20 19 1 19 3 5 6 -7

Select a “large excess” node and find shortest paths. -7 -8 3 2 4 The shortest path tree is marked in bold and blue. 6 1 1 1 3 5 -6 -8

Update the Node Potentials and the Reduced Costs -11 -7 -8 To update a node potential, subtract the shortest path distance. 2 4 1 2 1 1 Note: low capacity arcs may have a negative reduced cost 4 -4 3 5 -6 -8 -12 -10

Send Flow Along a Shortest Path in G(x, 4). 5 -2 10 2 4 Send flow from node 1 to node 7 30 25 4 20 1 1 20 How much flow should be sent? 19 1 19 3 5 6 -7

Update the Residual Network 5 -2 6 2 4 4 units of flow were sent from node 1 to node 3 4 26 25 4 4 20 1 1 16 19 4 1 15 3 5 10 -7 -3

This ends the 4-scaling phase. 5 -2 6 2 4 4 26 There is no node j with e(j)  -4. 25 4 20 1 1 16 19 4 1 15 3 5 10 -3

Begin the 2-scaling phase 5 -2 6 There is no node j with e(j)  -4. 2 4 4 26 25 4 20 What would we do if there were arcs with capacity at least 4 and negative reduced cost? 1 1 16 19 4 1 15 3 5 10 -3

Send flow along a shortest path 5 -2 6 2 4 Send flow from node 2 to node 4 4 26 25 4 20 1 1 16 19 4 How much flow should be sent? 1 15 3 5 10 -3

Update the Residual Network 3 5 -2 4 2 4 2 units of flow were sent from node 2 to node 4 6 26 25 4 20 1 1 16 19 4 1 15 3 5 10 -3

Send Flow Along a Shortest Path 3 4 2 4 Send flow from node 2 to node 3 6 26 25 4 20 1 1 16 19 4 How much flow should be sent? 1 15 3 5 10 -3

Update the Residual Network 3 1 2 4 3 units of flow were sent from node 2 to node 3 9 26 25 4 20 1 1 13 19 7 1 12 3 5 13 -3

This ends the 2-scaling phase. 1 2 4 Are we optimal? 9 26 25 4 20 1 1 13 19 7 1 12 3 5 13

Begin the 1-scaling phase. 1 2 4 Saturate any arc whose capacity is at least 1 and with negative reduced cost. 9 26 25 4 20 1 1 13 19 7 1 12 3 5 13 reduced cost is negative

Update the Residual Network 1 2 4 Send flow from node 3 to node 1. 9 26 -1 25 4 20 1 1 13 20 Note: Node 1 is now a node with deficit 7 12 3 5 13 1

Update the Residual Network 2 2 4 1 unit of flow was sent from node 3 to node 1. 8 27 25 3 20 1 1 14 20 6 Is this flow optimal? 13 3 5 12

The Final Optimal Flow 5 -2 10,8 2 4 30,3 25 23 20 1 20,6 20,20 3 Introduce myself and the Tas. It is critical that students sign up for the virtual campus web site. Hand out instructions on how to use it. Make sure that everyone signs up on the list. Also, create a class list that is separate from the web site. Ask for a show of where students come from. There should be four major contingencies: Grad EECS, ORC, Transportation, Rest 20,20 3 25,13 5 -7 -19

The Final Optimal Node Potentials and the Reduced Costs -7 -11 2 4 Flow is at lower bound. 1 2 1 -4 Introduce myself and the Tas. It is critical that students sign up for the virtual campus web site. Hand out instructions on how to use it. Make sure that everyone signs up on the list. Also, create a class list that is separate from the web site. Ask for a show of where students come from. There should be four major contingencies: Grad EECS, ORC, Transportation, Rest 3 5 Flow is at upper bound -10 -12

Max-flow Preflow Push

e(3)=1

Exact distance: d(i) equals the length of the shortest path from node i to node t in G(x)

The Goldberg-Tarjan Preflow Push Algorithm for the Maximum Flow Problem Obtain a network, and use the same network to illustrate the shortest path problem for communication networks, 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.)

Preflow Push 4 2 5 1 3 1 1 2 4 s 4 t 3 2 1 3 This is the original network, and the original residual network.

2 2 1 5 2 s 1 4 t 1 3 Initialize Distances 4 5 4 3 2 1 1 3 1 1 2 4 3 2 5 4 3 2 1 1 3 1 1 2 4 2 s 1 4 t 3 2 2 s 1 3 4 5 1 3 t The node label henceforth will be the distance label. d(j) is at most the distance of j to t in G(x)

Saturate Arcs out of node s 3 s 4 2 2 2 5 1 5 4 3 2 1 1 3 1 1 2 4 6 2 s 1 4 1 t 3 2 2 2 s s 2 1 3 3 4 4 5 1 3 1 t 3 Saturate arcs out of node s. Move excess to the adjacent arcs Relabel node s after all incident arcs have been saturated.

Select, then relabel/push 3 s 4 2 2 2 1 5 5 4 3 2 1 1 3 1 1 2 4 6 2 s 1 4 1 t 3 2 2 s s 2 1 3 4 5 3 1 1 1 t 1 3 Select an active node, that is, one with excess Push/Relabel Update excess after a push

Select, then relabel/push 3 s 4 2 2 2 1 5 5 4 3 2 1 1 3 1 1 2 4 2 6 s 4 1 1 t 3 2 s s 3 2 1 3 3 4 5 2 1 1 3 1 2 t 1 Select an active node, that is, one with excess No arc incident to the selected node is admissible. So relabel.

Select, then relabel/push 3 s 4 2 2 2 1 5 5 4 3 2 1 1 3 1 1 2 4 2 s 6 1 1 4 t 3 2 s 3 3 s 3 2 1 4 5 2 2 2 2 t 1 1 Select an active node, that is, one with excess Push/Relabel

Select, then relabel/push 3 3 s 1 4 2 2 2 2 2 1 1 5 5 4 3 2 1 3 1 3 1 1 2 4 6 2 s 4 1 1 t 3 2 2 3 s s 3 2 1 4 5 5 2 2 2 t 1 1 Select an active node. Push/Relabel

Select, then relabel/push 3 2 s 1 4 2 2 2 2 5 1 1 5 4 3 2 1 3 1 3 1 1 2 4 s 2 6 1 4 1 t 3 2 s 3 s 3 2 1 4 5 2 2 2 t 1 1 Select an active node. Push/Relabel

Select, then relabel/push 2 3 s 4 1 2 2 2 2 5 2 1 1 5 4 3 2 1 3 1 3 1 1 2 4 6 2 s 4 1 1 t 3 2 3 s s 5 2 3 1 4 5 5 2 2 2 t 1 1 Select an active node. There is no incident admissible arc. So Relabel.

Select, then relabel/push 3 1 2 s 4 1 2 2 2 2 5 2 2 1 5 4 3 2 1 3 1 3 1 1 2 4 6 2 s 4 1 1 t 3 2 3 s s 5 3 4 2 1 4 2 2 2 t 1 1 Select an active node. Push/Relabel

Select, then relabel/push 3 1 2 s 4 1 2 2 2 2 2 2 1 5 3 5 4 3 2 1 3 1 3 1 1 2 4 5 s 2 6 1 1 4 t 3 2 3 s s 5 5 4 2 3 1 4 2 2 2 t 1 1 Select an active node. There is no incident admissible arc. So relabel.

Select, then relabel/push 1 2 3 s 4 1 2 2 2 2 2 2 1 5 3 3 5 4 3 2 1 3 1 3 1 1 2 4 5 6 2 s 1 1 4 t 3 2 s s 3 3 4 2 1 4 5 5 2 2 2 t 1 1 Select an active node. Push/Relabel

Select, then relabel/push 1 s 2 4 2 2 2 2 2 3 3 2 5 1 5 4 3 2 1 2 1 3 1 1 2 4 5 s 2 6 1 4 1 1 1 t 3 2 s 3 s 4 3 4 2 1 4 4 5 5 2 2 2 t 1 1 Select an active node. Push/Relabel

Select, then relabel/push 1 s 4 2 2 2 2 2 4 2 3 2 2 1 3 5 5 4 3 2 1 2 1 3 1 2 1 2 4 5 6 s 2 1 4 1 t 3 2 2 s s 3 4 4 2 3 1 4 5 5 2 2 2 t 1 1 Select an active node. Push/Relabel

Select, then relabel/push 1 s 4 2 2 4 2 2 4 2 3 2 2 1 3 5 5 4 3 2 1 2 1 3 1 2 1 2 4 5 6 s 2 4 1 1 t 3 3 s s 4 4 2 3 1 4 5 5 2 2 2 t 1 1 Select an active node. Push/Relabel

Select, then relabel/push 1 s 1 4 4 2 4 2 2 2 5 3 3 5 2 1 2 3 5 4 3 2 1 5 3 1 3 1 2 1 2 4 5 5 6 2 s 1 4 1 t 3 3 s s 4 3 4 2 1 4 5 5 2 2 2 t 1 1 Select an active node. Push/Relabel

Select, then relabel/push 1 s 1 4 4 2 4 2 2 2 5 3 3 5 2 1 2 3 5 4 3 2 1 5 3 1 3 1 2 1 2 4 5 5 6 2 s 1 4 1 t 3 3 s s 4 3 4 2 1 4 5 5 2 2 2 t 1 1 One can keep pushing flow between nodes 2 and 5 until eventually all flow returns to node s. There are no paths from nodes 2 and 5 to t, and there are ways to speed up the last iterations.

Assignments Read 6.1- 6.4, 7.3 and 7.6 6.7 6.9 7.2 7.4