Chapter 7. Network Flow. CS 350: Winter 2018

Similar documents
Algorithm Design and Analysis

Chapter 7. Network Flow. Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved.

Today. Flow review. Augmenting paths. Ford-Fulkerson Algorithm. Intro to cuts (reason: prove correctness)

Soviet Rail Network, 1955

Soviet Rail Network, 1955

6/3/2009. CS 244 Algorithm Design Instructor: t Artur Czumaj. Lecture 8 Network flows. Maximum Flow and Minimum Cut. Minimum Cut Problem.

CS4800: Algorithms & Data Jonathan Ullman

Algorithms and Theory of Computation. Lecture 11: Network Flow

Agenda. Soviet Rail Network, We ve done Greedy Method Divide and Conquer Dynamic Programming

Maximum Flow and Minimum Cut

Algorithm Design and Analysis

! Abstraction for material flowing through the edges. ! G = (V, E) = directed graph, no parallel edges.

Problem Set 8 Solutions

Algorithm Design and Analysis

CS 170: Midterm Exam II University of California at Berkeley Department of Electrical Engineering and Computer Sciences Computer Science Division

Running Time. Assumption. All capacities are integers between 1 and C.

Soviet Rail Network, 1955

directed weighted graphs as flow networks the Ford-Fulkerson algorithm termination and running time

Greedy. I Divide and Conquer. I Dynamic Programming. I Network Flows. Network Flow. I Previous topics: design techniques

Undirected Graphs. V = { 1, 2, 3, 4, 5, 6, 7, 8 } E = { 1-2, 1-3, 2-3, 2-4, 2-5, 3-5, 3-7, 3-8, 4-5, 5-6 } n = 8 m = 11

Max Flow: Algorithms and Applications

Lecture 21. The Lovasz splitting-off lemma Topics in Combinatorial Optimization April 29th, 2004

Algorithms: Lecture 12. Chalmers University of Technology

Algorithm Design and Analysis

Max Flow, Min Cut COS 521. Kevin Wayne Fall Soviet Rail Network, Cuts. Minimum Cut Problem. Flow network.

Chapter Landscape of an Optimization Problem. Local Search. Coping With NP-Hardness. Gradient Descent: Vertex Cover

List coloring hypergraphs

Today: Max Flow Proofs

Balanced Network Flows

4. Connectivity Connectivity Connectivity. Whitney's s connectivity theorem: (G) (G) (G) for special

CS4445/9544 Analysis of Algorithms II Solution for Assignment 1

Suggested Answers To Exercises. estimates variability in a sampling distribution of random means. About 68% of means fall

Minimum Cost Noncrossing Flow Problem on Layered Networks

Maximum flow problem CE 377K. February 26, 2015

Physics 741 Graduate Quantum Mechanics 1 Solutions to Final Exam, Fall 2014

Bogoliubov Transformation in Classical Mechanics

Algorithm Design and Analysis

ρ water = 1000 kg/m 3 = 1.94 slugs/ft 3 γ water = 9810 N/m 3 = 62.4 lbs/ft 3

Problem Set If all directed edges in a network have distinct capacities, then there is a unique maximum flow.

SOME RESULTS ON INFINITE POWER TOWERS

Physics 2212 G Quiz #2 Solutions Spring 2018

Chapter 7. Network Flow. Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved.

Layering as Optimization Decomposition

Fair Game Review. Chapter 7 A B C D E Name Date. Complete the number sentence with <, >, or =

CSC 373: Algorithm Design and Analysis Lecture 12

Hybrid Control and Switched Systems. Lecture #6 Reachability

7.5 Bipartite Matching

SIMPLE LINEAR REGRESSION

Network Flow. Data Structures and Algorithms Andrei Bulatov

11.2 Stability. A gain element is an active device. One potential problem with every active circuit is its stability

Codes Correcting Two Deletions

Two Applications of Maximum Flow

Social Studies 201 Notes for March 18, 2005

Flows and Cuts. 1 Concepts. CS 787: Advanced Algorithms. Instructor: Dieter van Melkebeek

LINEAR ALGEBRA METHOD IN COMBINATORICS. Theorem 1.1 (Oddtown theorem). In a town of n citizens, no more than n clubs can be formed under the rules

Myriad of applications

Social Studies 201 Notes for November 14, 2003

CHAPTER 6. Estimation

An Interesting Property of Hyperbolic Paraboloids

UNIT 15 RELIABILITY EVALUATION OF k-out-of-n AND STANDBY SYSTEMS

Electronic Theses and Dissertations

March 18, 2014 Academic Year 2013/14

Network Flows: Introduction & Maximum Flow

Question 1 Equivalent Circuits

Math 273 Solutions to Review Problems for Exam 1

ECE Linear Circuit Analysis II

7. NETWORK FLOW II. bipartite matching disjoint paths extensions to max flow 3D Memory Reliability survey design airline scheduling image segmentation

Chapter 7. Network Flow. Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved.

Assignment for Mathematics for Economists Fall 2016

ON A CERTAIN FAMILY OF QUARTIC THUE EQUATIONS WITH THREE PARAMETERS. Volker Ziegler Technische Universität Graz, Austria

Learning Multiplicative Interactions

ALLOCATING BANDWIDTH FOR BURSTY CONNECTIONS

ON A CERTAIN FAMILY OF QUARTIC THUE EQUATIONS WITH THREE PARAMETERS

arxiv: v1 [math.mg] 25 Aug 2011

Multicolor Sunflowers

Time-Optimal Trajectory Planning Along Predefined Path for Mobile Robots with Velocity and Acceleration Constraints

Chapter 7. Root Locus Analysis

Clustering Methods without Given Number of Clusters

MATEMATIK Datum: Tid: eftermiddag. A.Heintz Telefonvakt: Anders Martinsson Tel.:

Algorithm Design and Analysis

Comparing Means: t-tests for Two Independent Samples

DTM: A Distributed Traffic Management Algorithm for Sensor Networks

Z a>2 s 1n = X L - m. X L = m + Z a>2 s 1n X L = The decision rule for this one-tail test is

Fermi Distribution Function. n(e) T = 0 T > 0 E F

TRIPLE SOLUTIONS FOR THE ONE-DIMENSIONAL

Example: Amplifier Distortion

TAYLOR POLYNOMIALS FOR NABLA DYNAMIC EQUATIONS ON TIME SCALES

Problem set 1. (c) Is the Ford-Fulkerson algorithm guaranteed to produce an acyclic maximum flow?

7.2 INVERSE TRANSFORMS AND TRANSFORMS OF DERIVATIVES 281

CONTROL SYSTEMS. Chapter 5 : Root Locus Diagram. GATE Objective & Numerical Type Solutions. The transfer function of a closed loop system is

Flow Network. The following figure shows an example of a flow network:

SERIES COMPENSATION: VOLTAGE COMPENSATION USING DVR (Lectures 41-48)

Preemptive scheduling on a small number of hierarchical machines

Primitive Digraphs with the Largest Scrambling Index

Optimal Coordination of Samples in Business Surveys

Fair Game Review. Chapter 6. Evaluate the expression. 3. ( ) 7. Find ± Find Find Find the side length s of the square.

USPAS Course on Recirculated and Energy Recovered Linear Accelerators

The Residual Graph. 12 Augmenting Path Algorithms. Augmenting Path Algorithm. Augmenting Path Algorithm

UNIQUE CONTINUATION FOR A QUASILINEAR ELLIPTIC EQUATION IN THE PLANE

NOTE: The items d) and e) of Question 4 gave you bonus marks.

Transcription:

Chapter 7 Network Flow CS 3: Winter 1 1

Soviet Rail Network, Reference: On the hitory of the tranportation and maximum flow problem. Alexander Schrijver in Math Programming, 1: 3,.

Maximum Flow and Minimum Cut Max flow and min cut. Two very rich algorithmic problem. Cornertone problem in combinatorial optimization. Beautiful mathematical duality. Nontrivial application / reduction. Data mining. Open-pit mining. Project election. Airline cheduling. Bipartite matching. Baeball elimination. Image egmentation. Network connectivity. Network reliability. Ditributed computing. Egalitarian table matching. Security of tatitical data. Network intruion detection. Multi-camera cene recontruction. Many many more 3

Minimum Cut Problem Flow network. Abtraction for material flowing through the edge. G = (V, E) = directed graph, no parallel edge. Two ditinguihed node: = ource, t = ink. c(e) = capacity of edge e. ource 3 t ink capacity 3 7

Cut Def. An -t cut i a partition (A, B) of V with A and t B. Def. The capacity of a cut (A, B) i: cap(a, B) c(e) e out of A 3 t A 3 7 Capacity = + + = 3

Cut Def. An -t cut i a partition (A, B) of V with A and t B. Def. The capacity of a cut (A, B) i: cap(a, B) c(e) e out of A 3 t A 3 7 Capacity = + + + 3 =

Minimum Cut Problem Min -t cut problem. Find an -t cut of minimum capacity. 3 t A 3 7 Capacity = + + = 7

Flow Def. An -t flow i a function that atifie: For each e E: For each v V {, t}: f (e) c(e) f (e) f (e) e in to v e out of v [capacity] [conervation] Def. The value of a flow f i: v( f ) f (e). e out of 3 t capacity flow 3 7 Value =

Flow Def. An -t flow i a function that atifie: For each e E: For each v V {, t}: f (e) c(e) f (e) f (e) e in to v e out of v [capacity] [conervation] Def. The value of a flow f i: v( f ) f (e). e out of 3 3 t capacity 1 flow 11 11 3 7 Value =

Maximum Flow Problem Max flow problem. Find -t flow of maximum value. 1 3 t capacity flow 1 1 3 7 Value =

Flow and Cut Flow value lemma. Let f be any flow, and let (A, B) be any -t cut. Then, the net flow ent acro the cut i equal to the amount leaving. f (e) f (e) v( f ) e out of A e in to A 3 3 t A 1 11 11 3 7 Value = 11

Flow and Cut Flow value lemma. Let f be any flow, and let (A, B) be any -t cut. Then, the net flow ent acro the cut i equal to the amount leaving. f (e) f (e) v( f ) e out of A e in to A 3 3 t A 1 11 11 3 7 Value = + + - 1 + 11 = 1

Flow and Cut Flow value lemma. Let f be any flow, and let (A, B) be any -t cut. Then, the net flow ent acro the cut i equal to the amount leaving. f (e) f (e) v( f ) e out of A e in to A 3 3 t A 1 11 11 3 7 Value = - + - + = 13

Flow and Cut Flow value lemma. Let f be any flow, and let (A, B) be any -t cut. Then f (e) f (e) v( f ). e out of A e in to A Pf. by flow conervation, all term except v = are v( f ) f (e) e out of v A (by definition) f (e) f (e) e out of v e in to v f (e) f (e). e out of A e in to A 1

Flow and Cut Weak duality. Let f be any flow, and let (A, B) be any -t cut. Then the value of the flow i at mot the capacity of the cut. Cut capacity = 3 Flow value 3 3 t A 3 7 Capacity = 3

Flow and Cut Weak duality. Let f be any flow. Then, for any -t cut (A, B) we have v(f) cap(a, B). Pf. v( f ) f (e) f (e) e out of A e in to A f (e) e out of A c(e) e out of A cap(a, B) A 7 B t 1

Certificate of Optimality Corollary. Let f be any flow, and let (A, B) be any cut. If v(f) = cap(a, B), then f i a max flow and (A, B) i a min cut. Value of flow = Cut capacity = Flow value 1 3 t A 1 1 3 7 17

Toward a Max Flow Algorithm Greedy algorithm. Start with f(e) = for all edge e E. Find an -t path P where each edge ha f(e) < c(e). Augment flow along path P. Repeat until you get tuck. 1 3 t Flow value = 1

Toward a Max Flow Algorithm Greedy algorithm. Start with f(e) = for all edge e E. Find an -t path P where each edge ha f(e) < c(e). Augment flow along path P. Repeat until you get tuck. 1 X 3 X t X Flow value = 1

Toward a Max Flow Algorithm Greedy algorithm. Start with f(e) = for all edge e E. Find an -t path P where each edge ha f(e) < c(e). Augment flow along path P. Repeat until you get tuck. locally optimality global optimality 1 1 3 t 3 t greedy = opt = 3

Reidual Graph Original edge: e = (u, v) E. Flow f(e), capacity c(e). u 17 capacity v flow Reidual edge. "Undo" flow ent. e = (u, v) and e R = (v, u). Reidual capacity: u 11 reidual capacity v c(e) f (e) c f (e) if f (e) e E if e R E reidual capacity Reidual graph: G f = (V, E f ). Reidual edge with poitive reidual capacity. E f = {e : f(e) < c(e)} {e R : f(e) > }. 1

7. Ford-Fulkeron Demo

Ford-Fulkeron Algorithm G: capacity 3 t 3

Ford-Fulkeron Algorithm G: flow capacity 3 t Flow value =

Ford-Fulkeron Algorithm G: X X flow capacity X 3 t Flow value = G f : reidual capacity 3 t

Ford-Fulkeron Algorithm G: X X X X 3 t Flow value = G f : 3 t

Ford-Fulkeron Algorithm G: X X X X 3 t Flow value = G f : 3 7 t 7

Ford-Fulkeron Algorithm G: X X X X 3 t Flow value = 1 G f : 3 1 t

Ford-Fulkeron Algorithm X 3 G: X 7 X X X 3 t Flow value = 1 G f : 3 1 t

Ford-Fulkeron Algorithm 3 G: 7 3 t Flow value = 1 3 1 G f : 7 1 1 1 3 t 3

Ford-Fulkeron Algorithm 3 G: 7 3 t Cut capacity = 1 Flow value = 1 3 1 G f : 7 1 1 1 3 t 31

Augmenting Path Algorithm Augment(f, c, P) { b bottleneck(p) foreach e P { } if (e E) f(e) f(e) + b ele f(e R ) f(e R ) - b } return f forward edge revere edge Ford-Fulkeron(G,, t, c) { foreach e E f(e) G f reidual graph } while (there exit augmenting path P) { f Augment(f, c, P) update G f } return f 3

Max-Flow Min-Cut Theorem Augmenting path theorem. Flow f i a max flow iff there are no augmenting path. Max-flow min-cut theorem. [Elia-Feintein-Shannon, Ford-Fulkeron ] The value of the max flow i equal to the value of the min cut. Pf. We prove both imultaneouly by howing TFAE (the following are equivalent): (i) There exit a cut (A, B) uch that v(f) = cap(a, B). (ii) Flow f i a max flow. (iii) There i no augmenting path relative to f. (i) (ii) Thi wa the corollary to weak duality lemma. (ii) (iii) We how contrapoitive. Let f be a flow. If there exit an augmenting path, then we can improve f by ending flow along path. 33

Proof of Max-Flow Min-Cut Theorem (iii) (i) Let f be a flow with no augmenting path. Let A be et of vertice reachable from in reidual graph. By definition of A, A. By definition of f, t A. v( f ) f (e) f (e) e out of A e in to A c(e) e out of A cap(a, B) A B t original network 3

Running Time Aumption. All capacitie are integer between 1 and C. Invariant. Every flow value f(e) and every reidual capacity c f (e) remain an integer throughout the algorithm. Theorem. The algorithm terminate in at mot v(f*) nc iteration. Pf. Each augmentation increae value by at leat 1. Corollary. If C = 1, Ford-Fulkeron run in O(mn) time. Integrality theorem. If all capacitie are integer, then there exit a max flow f for which every flow value f(e) i an integer. Pf. Since algorithm terminate, theorem follow from invariant. 3

Kleinberg HW 7.3 The figure how a flow network on which an -t flow ha been computed. The capacity of each edge appear a a label next to the edge, and the number in the boxe give the amount of flow ent on each edge (Edge without boxed number have no flow being ent on them). What i the value of thi flow? I thi a maximum (,t) flow in thi graph? 3

Kleinberg HW 7.3 The figure how a flow network on which an -t flow ha been computed. The capacity of each edge appear a a label next to the edge, and the number in the boxe give the amount of flow ent on each edge (Edge without boxed number have no flow being ent on them). What i the value of thi flow? I thi a maximum (,t) flow in thi graph? No. 37

Kleinberg HW 7.3 The figure how a flow network on which an -t flow ha been computed. The capacity of each edge appear a a label next to the edge, and the number in the boxe give the amount of flow ent on each edge (Edge without boxed number have no flow being ent on them). (b) Find a minimum -t cut in the flow network pictured, and alo ay what it capacity i. 3

Kleinberg HW 7.3 The figure how a flow network on which an -t flow ha been computed. The capacity of each edge appear a a label next to the edge, and the number in the boxe give the amount of flow ent on each edge (Edge without boxed number have no flow being ent on them). (b) Find a minimum -t cut in the flow network pictured, and alo ay what it capacity i. Min cut i: ({,a,b,c},{d,t}); the capacity i 11. 3

Kleinberg HW 7. Decide whether you think the following tate i true or fale. If it i true, give a hort explanation. If it i fale give a counter-example. Let G be an arbitrary flow network, with a ource, a ink t, and a poitive integer capacity c e on every edge; and let (A,B) be a minimum -t cut with repect to thee capacitie. Now uppoe we add 1 to every capacity; then (A,B) i till a minimum -t cut with repect to thee new capacitie.

Kleinberg HW 7. Decide whether you think the following tate i true or fale. If it i true, give a hort explanation. If it i fale give a counter-example. Let G be an arbitrary flow network, with a ource, a ink t, and a poitive integer capacity c e on every edge; and let (A,B) be a minimum -t cut with repect to thee capacitie. Now uppoe we add 1 to every capacity; then (A,B) i till a minimum -t cut with repect to thee new capacitie. Anwer: Fale. Conider a graph with node,v,w,t, and edge: (,v), (v,w), (w,t), capacitie of on (,v) and (w,t) and a capacity of 1 on (v,w). The maximum flow ha value 1, and doe not aturate the edge out of. 1

Kleinberg HW 7.7 Conider a et of mobile computing client in a certain town who each need to be connected to one of everal poible bae tation. We ll uppoe there are n client, with the poition of each client pecified by it (x,y) coordinate in the plane. There are alo k bae tation; the poition of each of thee i pecified by (x,y) coordinate a well. For each client, we wih to connect it to exactly one of the bae tation. Our choice of connection i contrained in the following way. There i a range parameter r: a client can only be connected to a bae tation that i within ditance r. There i alo a load parameter L: no more than L client can be connected to any ingle bae tation. Your goal i to deign a polynomial-time algorithm for the following problem. Give the poition of a et of bae tation, be connected imultaneouly to a bae tation, ubject to the range and load condition in the previou paragraph.

Kleinberg HW 7.7 There i a range parameter r: a client can only be connected to a bae tation that i within ditance r. There i alo a load parameter L: no more than L client can be connected to any ingle bae tation. Your goal i to deign a polynomial-time algorithm for the following problem. Give the poition of a et of bae tation, be connected imultaneouly to a bae tation, ubject to the range and load condition in the previou paragraph. 3

Kleinberg HW 7.7 There i a range parameter r: a client can only be connected to a bae tation that i within ditance r. There i alo a load parameter L: no more than L client can be connected to any ingle bae tation. Your goal i to deign a polynomial-time algorithm for the following problem. Give the poition of a et of bae tation, be connected imultaneouly to a bae tation, ubject to the range and load condition in the previou paragraph. Anwer: (getting tarted) Build the flow network a node v i for each client, a node w j for each bae and an edge (v i,w j ) of capacity 1 if client i i in range of bae tation j. Latly, expand thi graph by adding the ource node that connect to each of the client node with capacity 1, and we connect each of the bae tation to a ink node t by an edge of capacity L. Now how that there i a feaible way to connect all client to bae tation if and only if there i an -t flow of value n. Running time i time required to olve max-flow on graph with O(n+k) node and O(nk) edge