Maximum Flow and Minimum Cut

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

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

Soviet Rail Network, 1955

Soviet Rail Network, 1955

Algorithm Design and Analysis

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

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

Today: Max Flow Proofs

CS Lunch This Week. Special Talk This Week. Soviet Rail Network, Flow Networks. Slides20 - Network Flow Intro.key - December 5, 2016

Maximum Flow. Contents. Max Flow Network. Maximum Flow and Minimum Cut

Network Flows: Introduction & Maximum Flow

Flow networks. Flow Networks. A flow on a network. Flow networks. The maximum-flow problem. Introduction to Algorithms, Lecture 22 December 5, 2001

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

Maximum Flow. How do we transport the maximum amount data from source to sink? Some of these slides are adapted from Lecture Notes of Kevin Wayne.

Graphs III - Network Flow

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

Matching. Slides designed by Kevin Wayne.

Main Reference: Sections in CLRS.

1 Motivation and Basic Definitions

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

CSE 521: Design & Analysis of Algorithms I

4/12/12. Applications of the Maxflow Problem 7.5 Bipartite Matching. Bipartite Matching. Bipartite Matching. Bipartite matching: the flow network

3/3/2015. Chapter 7. Network Flow. Maximum Flow and Minimum Cut. Minimum Cut Problem

Network Flow. Data Structures and Algorithms Andrei Bulatov

Algorithm Design and Analysis

MAXIMUM FLOW. introduction Ford-Fulkerson algorithm maxflow-mincut theorem

CS4445/9544 Analysis of Algorithms II Solution for Assignment 1

CSE 421 Introduction to Algorithms Winter The Network Flow Problem

7. NETWORK FLOW I. Lecture slides by Kevin Wayne Copyright 2005 Pearson-Addison Wesley. Last updated on 11/22/17 6:11 AM

Admin MAX FLOW APPLICATIONS. Flow graph/networks. Flow constraints 4/30/13. CS lunch today Grading. in-flow = out-flow for every vertex (except s, t)

7. NETWORK FLOW I. Lecture slides by Kevin Wayne Copyright 2005 Pearson-Addison Wesley. Last updated on 11/22/17 6:11 AM

CSC 364S Notes University of Toronto, Spring, The networks we will consider are directed graphs, where each edge has associated with it

Network Flows UPCOPENCOURSEWARE number 34414

Algorithms and Data Structures 2011/12 Week 9 Solutions (Tues 15th - Fri 18th Nov)

Flow networks, flow, maximum flow. Some definitions. Edmonton. Saskatoon Winnipeg. Vancouver Regina. Calgary. 12/12 a.

Flow Networks. Ma/CS 6a. Class 14: Flow Exercises

Reminder: Flow Networks

Algorithms. Algorithms 6.4 MAXIMUM FLOW

Algorithmic Discrete Mathematics 6. Exercise Sheet

Algorithm Design and Analysis

Chapter 7. Network Flow. CS 350: Winter 2018

Randomized Perfect Bipartite Matching

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

CS 473G Lecture 15: Max-Flow Algorithms and Applications Fall 2005

Please Complete Course Survey. CMPSCI 311: Introduction to Algorithms. Approximation Algorithms. Coping With NP-Completeness. Greedy Vertex Cover

They were originally developed for network problem [Dantzig, Ford, Fulkerson 1956]

Ford Fulkerson algorithm max-flow min-cut theorem. max-flow min-cut theorem capacity-scaling algorithm

introduction Ford-Fulkerson algorithm

introduction Ford-Fulkerson algorithm

CMPS 6610/4610 Fall Flow Networks. Carola Wenk Slides adapted from slides by Charles Leiserson

18 Extensions of Maximum Flow

16 Max-Flow Algorithms and Applications

7.5 Bipartite Matching. Chapter 7. Network Flow. Matching. Bipartite Matching

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

April 3, The maximum flow problem. See class notes on website.

26.1 Flow networks. f (u,v) = 0.

Ford-Fulkerson Algorithm for Maximum Flow

Basic Tools CMSC 641. Running Time. Problem. Problem. Algorithmic Design Paradigms. lg (n!) (lg n)! (lg n) lgn n.2

7. NETWORK FLOW II. Soviet rail network (1950s) Max-flow and min-cut applications. "Free world" goal. Cut supplies (if cold war turns into real war).

Today s topics. CSE 421 Algorithms. Problem Reduction Examples. Problem Reduction. Undirected Network Flow. Bipartite Matching. Problem Reductions

Maximum Flow in Planar Graphs

Introduction to Congestion Games

Average Case Lower Bounds for Monotone Switching Networks

7.5 Bipartite Matching. Chapter 7. Network Flow. Matching. Bipartite Matching

Topics in Combinatorial Optimization May 11, Lecture 22

Network flows. The problem. c : V V! R + 0 [ f+1g. flow network G = (V, E, c), a source s and a sink t uv not in E implies c(u, v) = 0

16 Max-Flow Algorithms

23 Maximum Flows and Minimum Cuts

Wrap up: Weighted, directed graph shortest path Minimum Spanning Tree. Feb 25, 2019 CSCI211 - Sprenkle

Maximum Flow 3/3 4/6 1/1 4/7 3/3. s 3/5 1/9 1/1 3/5 2/2. 1/18/2005 4:03 AM Maximum Flow 1

Solutions for Assignment 2

Graph Theory: Network Flow

CS261: A Second Course in Algorithms Lecture #1: Course Goals and Introduction to Maximum Flow

Maximum Flow 5/6/17 21:08. Presentation for use with the textbook, Algorithm Design and Applications, by M. T. Goodrich and R. Tamassia, Wiley, 2015

Introduction to SLE Lecture Notes

Dynamic Programming 11/8/2009. Weighted Interval Scheduling. Weighted Interval Scheduling. Unweighted Interval Scheduling: Review

Bipartite Matching. Matching. Bipartite Matching. Maxflow Formulation

7. NETWORK FLOW II. Minimum cut application (RAND 1950s) Maximum flow application (Tolstoǐ 1930s) Max-flow and min-cut applications

Stationary Distribution. Design and Analysis of Algorithms Andrei Bulatov

Network Flow Applications

I. Introduction to place/transition nets. Place/Transition Nets I. Example: a vending machine. Example: a vending machine

INDEPENDENT SETS IN GRAPHS WITH GIVEN MINIMUM DEGREE

Physics 240: Worksheet 16 Name

20/20 20/20 0/5 0/5 20/20 20/20 5/5 0/5 0/5 5/5 0/20 25/30 20/20 30/30 20/20 0/5 5/5 20/20 0/5 0/5 15/20 15/25 20/20 10/10

Random Walk with Anti-Correlated Steps

CMU-Q Lecture 3: Search algorithms: Informed. Teacher: Gianni A. Di Caro

6.003 Homework #9 Solutions

18.03SC Unit 3 Practice Exam and Solutions

EECE 301 Signals & Systems Prof. Mark Fowler

Mechtild Stoer * Frank Wagner** Abstract. fastest algorithm known. The runtime analysis is straightforward. In contrast to

5. Network flow. Network flow. Maximum flow problem. Ford-Fulkerson algorithm. Min-cost flow. Network flow 5-1

4.2 The Fourier Transform

On the Submodularity of Influence in Social Networks

Math 115 Final Exam December 14, 2017

Selfish Routing. Tim Roughgarden Cornell University. Includes joint work with Éva Tardos

EXERCISES FOR SECTION 1.5

Efficient Algorithms for Computing Disjoint QoS Paths

Q2.1 This is the x t graph of the motion of a particle. Of the four points P, Q, R, and S, the velocity v x is greatest (most positive) at

d = ½(v o + v f) t distance = ½ (initial velocity + final velocity) time

6.003 Homework #9 Solutions

Transcription:

// Sovie Rail Nework, Maximum Flow and Minimum Cu Max flow and min cu. Two very rich algorihmic problem. Cornerone problem in combinaorial opimizaion. Beauiful mahemaical dualiy. Nework Flow Flow nework. bracion for maerial flowing hrough he edge. G = (V, E): direced graph. Two diinguihed node: = ource, = ink. c(e): capaciy of edge e. Nonrivial applicaion. Daa mining. irline cheduling. Biparie maching. Image egmenaion. Nework conneciviy. Many more ource ink Reference: On he hiory of he ranporaion and maximum flow problem. lexander Schrijver in Mah Programming, :,. capaciy Flow Flow Maximum Flow Problem Def. n - flow i a funcion ha aifie: For each e E: f (e) c(e) [capaciy] For each v V {, : f (e) = f (e) [conervaion] e in o v e ou of v Def. The value of a flow f i: v( f ) = f (e). e ou of Def. The value of a flow f i: v( f ) = f (e). e ou of Max flow problem. Find - flow of maximum value. capaciy flow Value = Value = Value =

// Cu Def. n - cu i a pariion (, B) of V wih and B. Cu Def. n - cu i a pariion (, B) of V wih and B. Minimum Cu Problem Min - cu problem. Find an - cu of minimum capaciy. Def. The capaciy of a cu (, B) i: cap(, B) = c(e) e ou of Def. The capaciy of a cu (, B) i: cap(, B) = c(e) e ou of Capaciy = + + = Capaciy = + + + = Capaciy = + + = Flow and Cu Flow value lemma. Le f be any flow, and le (, B) be any - cu. Then, he ne flow en acro he cu i equal o he amoun leaving. e ou of e in o Flow and Cu Flow value lemma. Le f be any flow, and le (, B) be any - cu. Then, he ne flow en acro he cu i equal o he amoun leaving. e ou of e in o Flow and Cu Flow value lemma. Le f be any flow, and le (, B) be any - cu. Then, he ne flow en acro he cu i equal o he amoun leaving. e ou of e in o Value = Value = + + - + = Value = - + - + =

// Flow and Cu Flow value lemma. Le f be any flow, and le (, B) be any - cu. Then. e ou of e in o Proof. by flow conervaion, all erm excep v = are For all edge e for which boh end are in, f(e) appear wice in he um once wih a poiive ign, and once wih a negaive ign v( f ) = f (e) = e ou of v $ ' & f (e) f (e)) % e ou of v e in o v ( = f (e) f (e). e ou of e in o Flow and Cu Weak dualiy. Le f be any flow, and le (, B) be any - cu. Then he value of he flow i a mo he capaciy of he cu. Cu capaciy = Flow value Weak dualiy. Le f be any flow. Then, for any - cu (, B) we have v(f) cap(, B). Proof. Flow and Cu v( f ) = f (e) f (e) e ou of e in o f (e) e ou of c(e) e ou of = cap(, B) B Capaciy = Cerificae of Opimaliy Corollary. Le f be any flow, and le (, B) be any cu. If v(f) = cap(, B), hen f i a max flow and (, B) i a min cu. Value of flow = Cu capaciy = Flow value Toward a Max Flow lgorihm Greedy algorihm. Sar wih f(e) = for all edge e E. Find an - pah P where each edge ha f(e) < c(e). ugmen flow along pah P. Repea unil you ge uck. Toward a Max Flow lgorihm Greedy algorihm. Sar wih f(e) = for all edge e E. Find an - pah P where each edge ha f(e) < c(e). ugmen flow along pah P. Repea unil you ge uck. X X Flow value = X Flow value =

// Toward a Max Flow lgorihm Reidual Graph ugmening Pah lgorihm Greedy algorihm. Sar wih f(e) = for all edge e E. Find an - pah P where each edge ha f(e) < c(e). ugmen flow along pah P. Repea unil you ge uck. locally opimaliy global opimaliy greedy = op = Original edge: e = (u, v) E. Flow f(e), capaciy c(e). Reidual edge. "Undo" flow en. e = (u, v) and e R = (v, u). Reidual capaciy: $ c(e) f (e) c f (e) = % if e E & f (e) if e R E u u Reidual graph: G f = (V, E f ). Reidual edge wih poiive reidual capaciy. E f = {e : f(e) < c(e) {e R : f(e) >. capaciy v flow reidual capaciy v reidual capaciy Ford-Fulkeron(G,,, c) { foreach e E f(e) G f reidual graph while (here exi augmening pah P) { f ugmen(f, c, P) updae G f reurn f Queion: - How do we find an augmening pah? - How o implemen he ugmen mehod ugmening Pah lgorihm Ford-Fulkeron lgorihm lgorihm Correcne ugmen(f, c, P) { b boleneck(p) foreach e P { if (e E) f(e) f(e) + b ele f(e R ) f(e R ) - b reurn f forward edge revere edge G: capaciy The algorihm erminae when here i no augmening pah in he reidual graph. We will how ha in ha cae here exi a cu (, B) uch ha v(f) = cap(, B), from which we can conclude ha f i a max flow. Ford-Fulkeron(G,,, c) { foreach e E f(e) G f reidual graph while (here exi augmening pah P) { f ugmen(f, c, P) updae G f reurn f

// lgorihm Correcne Inegraliy Running Time Proof: Le f be a flow wih no augmening pah. Le be e of verice reachable from in reidual graph. By definiion of,. nd ince here i no augmening pah,. v( f ) = f (e) f (e) e ou of e in o = c(e) e ou of = cap(, B) B ume he capaciie are ineger We ar wih an iniial flow of. Wha can we ay abou he value of he flow produced by an augmening pah? Thi implie? umpion. ll capaciie are ineger beween and C. Invarian. Every flow value f(e) and every reidual capaciy c f (e) remain ineger hroughou he algorihm. Inegraliy heorem. If all capaciie are ineger, hen here exi a max flow f for which every flow value f(e) i an ineger. Proof. Since algorihm erminae, heorem follow from invarian. Theorem. The algorihm erminae in a mo v(f*) nc ieraion. Proof. Each augmenaion increae value by a lea. Corollary. If C =, Ford-Fulkeron run in O(mn) ime. original nework