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

Similar documents
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.

Maximum Flow and Minimum Cut

Soviet Rail Network, 1955

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

Algorithm Design and Analysis

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

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

Today: Max Flow Proofs

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

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

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

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.

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

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

Matching. Slides designed by Kevin Wayne.

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

Network Flows: Introduction & Maximum Flow

Graphs III - Network Flow

Main Reference: Sections in CLRS.

1 Motivation and Basic Definitions

Algorithms. Algorithms 6.4 MAXIMUM FLOW

CSE 521: Design & Analysis of Algorithms I

Network Flow. Data Structures and Algorithms Andrei Bulatov

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

Algorithm Design and Analysis

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

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

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

CSE 421 Introduction to Algorithms Winter The Network Flow Problem

CS4445/9544 Analysis of Algorithms II Solution for Assignment 1

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

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

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

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

Network Flows UPCOPENCOURSEWARE number 34414

introduction Ford-Fulkerson algorithm

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

introduction Ford-Fulkerson algorithm

Algorithm Design and Analysis

Reminder: Flow Networks

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

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

Chapter 7. Network Flow. CS 350: Winter 2018

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

Algorithmic Discrete Mathematics 6. Exercise Sheet

16 Max-Flow Algorithms and Applications

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

Randomized Perfect Bipartite Matching

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)

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

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).

18 Extensions of Maximum Flow

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

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

16 Max-Flow Algorithms

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

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

Network Flow Applications

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

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

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

23 Maximum Flows and Minimum Cuts

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

Maximum Flow in Planar Graphs

Average Case Lower Bounds for Monotone Switching Networks

Introduction to Congestion Games

Algorithm Design and Analysis

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

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

Bipartite Matching. Matching. Bipartite Matching. Maxflow Formulation

18.03SC Unit 3 Practice Exam and Solutions

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

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

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

Topics in Combinatorial Optimization May 11, Lecture 22

Introduction to SLE Lecture Notes

Stationary Distribution. Design and Analysis of Algorithms Andrei Bulatov

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

Ford-Fulkerson Algorithm for Maximum Flow

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

Random Walk with Anti-Correlated Steps

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

Algorithm Design and Analysis

Math 333 Problem Set #2 Solution 14 February 2003

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

EECE 301 Signals & Systems Prof. Mark Fowler

Tom Heskes and Onno Zoeter. Presented by Mark Buller

u(t) Figure 1. Open loop control system

Solutions for Assignment 2

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

Notes for Lecture 17-18

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

Laplace transfom: t-translation rule , Haynes Miller and Jeremy Orloff

Math 2142 Exam 1 Review Problems. x 2 + f (0) 3! for the 3rd Taylor polynomial at x = 0. To calculate the various quantities:

An introduction to the theory of SDDP algorithm

Ma/CS 6a Class 15: Flows and Bipartite Graphs

Course Notes for EE227C (Spring 2018): Convex Optimization and Approximation

Supplement for Stochastic Convex Optimization: Faster Local Growth Implies Faster Global Convergence

, the. L and the L. x x. max. i n. It is easy to show that these two norms satisfy the following relation: x x n x = (17.3) max

Transcription:

Sovie Rail Nework, haper Nework Flow Slide by Kevin Wayne. opyrigh Pearon-ddion Weley. ll righ reerved. Reference: On he hiory of he ranporaion and maximum flow problem. lexander Schrijver in Mah Programming, :,. Maximum Flow and Minimum u Minimum u Problem Max flow and min cu.! Two very rich algorihmic problem.! ornerone problem in combinaorial opimizaion.! Beauiful mahemaical dualiy. Flow nework.! bracion for maerial flowing hrough he edge.! G = (V, E) = direced graph, no parallel edge.! Two diinguihed node: = ource, = ink.! c(e) = capaciy of edge e. Nonrivial applicaion / reducion.! Daa mining.! Nework reliabiliy.! Open-pi mining.! Diribued compuing.! Projec elecion.! irline cheduling.! Egaliarian able maching.! Securiy of aiical daa.! Biparie maching.! Baeball eliminaion.! Nework inruion deecion.! Muli-camera cene reconrucion. ource ink! Image egmenaion.! Nework conneciviy.! Many many more... capaciy

u u Def. n - cu i a pariion (, B) of V wih! and! B. Def. n - cu i a pariion (, B) of V wih! and! B. 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 apaciy = + + = apaciy = + + + = Minimum u Problem Flow Min - cu problem. Find an - cu of minimum capaciy. 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 apaciy = + + = capaciy flow Value =

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 Max flow problem. Find - flow of maximum value. capaciy flow Value = capaciy flow Value = Flow and u Flow and u 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. " f (e) # " f (e) = v( f ) e ou of e in o 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. " f (e) # " f (e) = v( f ) e ou of e in o Value = Value = + + - + =

Flow and u Flow and u 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. " f (e) # " f (e) = v( f ) e ou of e in o Flow value lemma. Le f be any flow, and le (, B) be any - cu. Then " f (e)# " f (e) = v( f ). e ou of e in o Pf. by flow conervaion, all erm excep v = are v( f ) = " f (e) e ou of = % ( " ' " f (e) $ " f (e)* & ) v # e ou of v e in o v = " f (e) $ " f (e). e ou of e in o Value = - + - + = Flow and u Flow and u 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. Weak dualiy. Le f be any flow. Then, for any - cu (, B) we have v(f) " cap(, B). Pf. u capaciy = # Flow value " 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 apaciy =

erificae of Opimaliy Toward a Max Flow lgorihm orollary. 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 = u capaciy = # Flow value " 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. Flow value = Toward a Max Flow lgorihm 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. 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 X X X Flow value = greedy = op =

Reidual Graph Ford-Fulkeron lgorihm Original edge: e = (u, v)! E.! Flow f(e), capaciy c(e). u capaciy flow v G: capaciy Reidual edge.! "Undo" flow en.! e = (u, v) and e R = (v, u).! Reidual capaciy: u reidual capaciy v $ c(e)" f (e) c f (e) = % if & f (e) e # E if e R # E reidual capaciy Reidual graph: G f = (V, E f ).! Reidual edge wih poiive reidual capaciy.! E f = {e : f(e) < c(e) % {e R : c(e) >. ugmening Pah lgorihm Max-Flow Min-u Theorem ugmen(f, c, P) { b $ boleneck(p) foreach e! P { if (e! E) f(e) $ f(e) + b ele f(e R ) $ f(e) - b reurn f 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 forward edge revere edge ugmening pah heorem. Flow f i a max flow iff here are no augmening pah. Max-flow min-cu heorem. [Ford-Fulkeron ] The value of he max flow i equal o he value of he min cu. Proof raegy. We prove boh imulaneouly by howing he TFE: (i) There exi a cu (, B) uch ha v(f) = cap(, B). (ii) Flow f i a max flow. (iii) There i no augmening pah relaive o f. (i) # (ii) Thi wa he corollary o weak dualiy lemma. (ii) # (iii) We how conrapoiive.! Le f be a flow. If here exi an augmening pah, hen we can improve f by ending flow along pah.

Proof of Max-Flow Min-u Theorem Running Time (iii) # (i)! Le f be a flow wih no augmening pah.! Le be e of verice reachable from in reidual graph.! By definiion of,!.! By definiion of f, &. v( f ) = " f (e)# " f (e) e ou of e in o = " c(e) e ou of = cap(, B) B umpion. ll capaciie are ineger beween and. Invarian. Every flow value f(e) and every reidual capaciie c f (e) remain an ineger hroughou he algorihm. Theorem. The algorihm erminae in a mo v(f*) " n ieraion. Pf. Each augmenaion increae value by a lea.! orollary. If =, Ford-Fulkeron run in O(mn) ime. Inegraliy heorem. If all capaciie are ineger, hen here exi a max flow f for which every flow value f(e) i an ineger. Pf. Since algorihm erminae, heorem follow from invarian.! original nework Ford-Fulkeron: Exponenial Number of ugmenaion. hooing Good ugmening Pah Q. I generic Ford-Fulkeron algorihm polynomial in inpu ize? m, n, and log. No. If max capaciy i, hen algorihm can ake ieraion. X X X X X X X X X

hooing Good ugmening Pah apaciy Scaling Ue care when elecing augmening pah.! Some choice lead o exponenial algorihm.! lever choice lead o polynomial algorihm.! If capaciie are irraional, algorihm no guaraneed o erminae! Goal: chooe augmening pah o ha:! an find augmening pah efficienly.! Few ieraion. Inuiion. hooing pah wih highe boleneck capaciy increae flow by max poible amoun.! Don' worry abou finding exac highe boleneck pah.! Mainain caling parameer '.! Le G f (') be he ubgraph of he reidual graph coniing of only arc wih capaciy a lea '. hooe augmening pah wih: [Edmond-Karp, Diniz ]! Max boleneck capaciy.! Sufficienly large boleneck capaciy.! Fewe number of edge. G f G f () apaciy Scaling apaciy Scaling: orrecne umpion. ll edge capaciie are ineger beween and. Scaling-Max-Flow(G,,, c) { foreach e! E f(e) $ ' $ malle power of greaer han or equal o G f $ reidual graph while (' ( ) { G f (') $ '-reidual graph while (here exi augmening pah P in G f (')) { f $ augmen(f, c, P) updae G f (') ' $ ' / reurn f Inegraliy invarian. ll flow and reidual capaciy value are inegral. orrecne. If he algorihm erminae, hen f i a max flow. Pf.! By inegraliy invarian, when ' = # G f (') = G f.! Upon erminaion of ' = phae, here are no augmening pah.!

apaciy Scaling: Running Time apaciy Scaling: Running Time Lemma. The ouer while loop repea + )log * ime. Pf. Iniially " ' <. ' decreae by a facor of each ieraion.! Lemma. Le f be he flow a he end of a '-caling phae. Then he value of he maximum flow i a mo v(f) + m '. proof on nex lide Lemma. There are a mo m augmenaion per caling phae.! Le f be he flow a he end of he previou caling phae.! L # v(f*) " v(f) + m (').! Each augmenaion in a '-phae increae v(f) by a lea '.! Theorem. The caling max-flow algorihm find a max flow in O(m log ) augmenaion. I can be implemened o run in O(m log ) ime.! Lemma. Le f be he flow a he end of a '-caling phae. Then value of he maximum flow i a mo v(f) + m '. Pf. (almo idenical o proof of max-flow min-cu heorem)! We how ha a he end of a '-phae, here exi a cu (, B) uch ha cap(, B) " v(f) + m '.! hooe o be he e of node reachable from in G f (').! By definiion of,!.! By definiion of f, &. v( f ) = " f (e) # " f (e) e ou of e in o $ " (c(e)# %) # " % e ou of e in o = " c(e) # " % # " % e ou of e ou of e in o $ cap(, B) - m% original nework B