Maximum Flow Problem flow capacity Actual flow  capacity

Slides:



Advertisements
Similar presentations
1 EE5900 Advanced Embedded System For Smart Infrastructure Static Scheduling.
Advertisements

Network Optimization Models: Maximum Flow Problems
MAXIMUM FLOW Max-Flow Min-Cut Theorem (Ford Fukerson’s Algorithm)
1 Augmenting Path Algorithm s t G: Flow value = 0 0 flow capacity.
Lectures on Network Flows
Nick McKeown Spring 2012 Maximum Matching Algorithms EE384x Packet Switch Architectures.
CSE 421 Algorithms Richard Anderson Lecture 22 Network Flow.
1 Augmenting Path Algorithm s t G: Flow value = 0 0 flow capacity.
The max flow problem
The Dinitz Algorithm An example of a run. v1v1 Residual & Layered Networks construction s t v2v2 v3v3 v4v4 v5v5 v6v6 v7v
Minimal Spanning Trees. Spanning Tree Assume you have an undirected graph G = (V,E) Spanning tree of graph G is tree T = (V,E T E, R) –Tree has same set.
7. Preflow-Push Demo. 2 Preflow-Push Algorithm s 2 1 t 10 2 G: 5 3 s 2 1 t G f :
CSE 421 Algorithms Richard Anderson Lecture 22 Network Flow.
Minimum Spanning Trees. Subgraph A graph G is a subgraph of graph H if –The vertices of G are a subset of the vertices of H, and –The edges of G are a.
1 Scheduling Crossbar Switches Who do we chose to traverse the switch in the next time slot? N N 11.
9/23/2015ACM-ICPC1 Maximum Flow Problem Source t fg e 42 Target (sink) flow capacity b s c a de 2/3/ actual flow 1/2/ 1/ 2/ 1.Actual flow  capacity.
Lecture 16 Maximum Matching. Incremental Method Transform from a feasible solution to another feasible solution to increase (or decrease) the value of.
CS 4407, Algorithms University College Cork, Gregory M. Provan Network Optimization Models: Maximum Flow Problems In this handout: The problem statement.
1 WEEK 11 Graphs III Network Flow Problems A Simple Maximum-Flow Algorithm Izmir University of Economics.
& 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.
CS223 Advanced Data Structures and Algorithms 1 Maximum Flow Neil Tang 3/30/2010.
CSCI-256 Data Structures & Algorithm Analysis Lecture Note: Some slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved. 25.
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.
1 EE5900 Advanced Embedded System For Smart Infrastructure Static Scheduling.
CSE 421 Algorithms Richard Anderson Lecture 22 Network Flow.
EMIS 8374 The Ford-Fulkerson Algorithm (aka the labeling algorithm) Updated 4 March 2008.
Theory of Computing Lecture 12 MAS 714 Hartmut Klauck.
TIRGUL 10 Dijkstra’s algorithm Bellman-Ford Algorithm 1.
TU/e Algorithms (2IL15) – Lecture 8 1 MAXIMUM FLOW (part II)
Ford-Fulkerson Recap.
Data Structures and Algorithms (AT70. 02) Comp. Sc. and Inf. Mgmt
Lectures on Network Flows
December 1st – Graph Madness
Chapter 5. Optimal Matchings
Presented by Po-Chuan & Chen-Chen 2016/03/08
Topological Sort (topological order)
CSE 421: Introduction to Algorithms
Lecture 16 Maximum Matching
Network Flow 2016/04/12.
Instructor: Shengyu Zhang
Edmonds-Karp Algorithm
CSE Algorithms Max Flow Problems 11/21/02 CSE Max Flow.
The Shortest Augmenting Path Algorithm for the Maximum Flow Problem
Network Flow and Connectivity in Wireless Sensor Networks
Analysis of Algorithms
3.4 Push-Relabel(Preflow-Push) Maximum Flow Alg.
Richard Anderson Lecture 23 Network Flow
Richard Anderson Lecture 21 Network Flow
Not Always Feasible 2 (3,5) 1 s (0,2) 3 (, u) t.
Augmenting Path Algorithm
Flow Networks and Bipartite Matching
Fundamental Data Structures and Algorithms
Complexity of Ford-Fulkerson
Project Selection Bin Li 10/29/2008.
Algorithms (2IL15) – Lecture 7
EE5900 Advanced Embedded System For Smart Infrastructure
and 6.855J March 6, 2003 Maximum Flows 2
Flow Feasibility Problems
Min Global Cut Animation
The Shortest Augmenting Path Algorithm for the Maximum Flow Problem
The Shortest Augmenting Path Algorithm for the Maximum Flow Problem
The Ford-Fulkerson Algorithm
Augmenting Path Algorithm
Introduction to Maximum Flows
Richard Anderson Lecture 22 Network Flow
Introduction to Maximum Flows
Maximum Bipartite Matching
Not Always Feasible 2 (3,5) 1 s (0,2) 3 (, u) t.
Advanced Graph Homer Lee 2013/10/31.
Presentation transcript:

Maximum Flow Problem flow capacity Actual flow  capacity The source node can produce flow as much as possible For every node other than s and t, flow out  flow in Source s actual flow 3/ 4 2/ 2 1/ 1 a b 2/ 3 2/ 2 1/ 2 our textbook says = d c e e The target node’s flow-in is called the flow of the graph f g A node may have different ways to dispatch its flow-out . 1/ 2 2/ 3 t What is the maximum flow of the graph? Target (sink) 11/21/2018 IT 279

What makes the maximum flow problem more difficult than the shortest path problem? Source s The shortest path of t is based on the shortest path of g. 3/ 4 2/ 2 once a node’s shortest path from s is determined, we will never have to revise the decision 1/ 1 a b 2/ 3 2/ 2 1/ 2 d c e e The maximum flow to t is not based on the maximum flows to f and g. f g 1/ 2 2/ 3 t Target 11/21/2018 IT 279

local optimum does not imply global optimum Source Source Source s s s 5/5 2/2 4/5 2/2 5/5 2/2 1/1 0/1 a 1/1 a b a b b 4/4 3/3 1/4 2/3 0/3 3/4 3/3 3/3 1/3 0/3 d 3/3 d c 1/3 d c c Target Target 2/2 5/5 sc max flow = 6 sd max flow = 7 t Target st max flow = 7 11/21/2018 IT 279

A naïve approach: adding all possible paths together Source Source Source s s s 1 2/ 2 1/ 1 2/ 3 2 1 1 1 a a a b b b 1/ 4 4 4 1 2/ 2 1 2/ 3 2 d d d c c c 2/ 3 1/ 1 2/ 2 3 t t t Target Target Target Residual Graph Residual Graph 11/21/2018 IT 279

Not always work. 3/3 2/2 1 1 3 1/4 1 3 2/2 2/ 2 3/3 We are just lucky Source Source s s 3/3 2/2 1 a 1 b a b 3 1/4 1 3 2/2 d c d c 2/ 2 3/3 t t Target Not always work. Target We are just lucky Residual Graph 11/21/2018 IT 279

A wrong choice: 3/ 3 2 2 1 1 3/ 4 1 3 2 3 2 2 3/ 3 2 s s a b a b d c d Source Source s s 3/ 3 2 2 1 a 1 b a b 3/ 4 1 3 2 3 2 d c d c 2 3/ 3 2 t t Target Target 11/21/2018 IT 279

Keep a path for changing decision: Source Source s s 3/ 3 2 2 3 1 a 1 b a b 3/ 4 1 3 2 3 2 3 d c d c 2 3/ 3 2 3 t t Target Target Augmented Graph 11/21/2018 IT 279

Find another path in the augmented graph No more path from s to t Source s s s 2/ 2 3 2 2 3 3 1 a 1 1 b a a b b 2 1 2/ 3 2/ 2 3 1 2 1 2 1 2/ 3 2 2 d 1 1 c d d c c 2/ 2 3 2 2 3 3 t t t Target Augmented Graph new Augmented Graph 11/21/2018 IT 279

+ = Add flows together 3 3 2 2 3 2 2 2 2 2 1 3 3 2 2 Maximum Flow s s Source + = s s 3 s 3 2 2 a b a b a b 3 2 2 2 2 2 1 d c d c d c 3 3 2 2 t t Target t Target Target Maximum Flow 11/21/2018 IT 279

An algorithm for finding the maximum flow of graphs Input: G = (V, E), and s,t  V Let Gmax = (, ), Gaug = G Find a path p from s to t in Gaug If no such p exists, output Gmax and stop the program Add p into Gmax and update Gaug Repeat 1, 2, and, if possible, 3 Complexity: O(f |E|) 11/21/2018 IT 279

Claim: This algorithm always terminates with a maximum flow of the input graph Our textbook says: The proof is somewhat difficult and beyond the scope of this text. Input: G = (V, E), and s,t  V Let Gmax = (, ), Gaug = G Find a path p from s to t in Gaug If no such p exists, output Gmax and stop the program Add p into Gmax and update Gaug Repeat 1, 2, and 3 if possible I say: No, it is not difficult and every one here should know. Since any given graph has a finite maximum flow, and every path from s to t, if any, provides a positive flow, the program therefore cannot run forever. By contradiction, suppose the algorithm terminates with a flow in Gmax. that is not maximum. Then, there must be a flow not included in Gmax. But, if this is the case, there must be a path from s to t to carries this flow, and hence the program should not terminate at this moment. A contradiction. 11/21/2018 IT 279

An inefficient situation Source s 1/ 1/ 1000 1/ 1000 1/ 1 a b 1/ 1 1/ 1000 1/ 1000 t Target 11/21/2018 IT 279

An inefficient situation Source s 2/ 1/ 1000 2/ 1/ 1000 1/ 1 a b 2/ 1/ 1000 2/ 1/ 1000 t Target 11/21/2018 IT 279

Always chose the maximum next edge Solution Always chose the maximum next edge Source s 1000/ 1000 1000 a b 1000/ 1000 1/ 1000 t Target 11/21/2018 IT 279