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

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

Soviet Rail Network, 1955

Maximum Flow and Minimum Cut

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. Contents. Max Flow Network. Maximum Flow and Minimum Cut

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

Algorithm Design and Analysis

Today: Max Flow Proofs

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

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

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

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

Main Reference: Sections in CLRS.

Network Flows: Introduction & Maximum Flow

Matching. Slides designed by Kevin Wayne.

CSE 521: Design & Analysis of Algorithms I

CSE 421 Introduction to Algorithms Winter The Network Flow Problem

Network Flow. Data Structures and Algorithms Andrei Bulatov

Algorithm Design and Analysis

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

Algorithms. Algorithms 6.4 MAXIMUM FLOW

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

CS4445/9544 Analysis of Algorithms II Solution for Assignment 1

1 Motivation and Basic Definitions

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

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

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

Network Flows UPCOPENCOURSEWARE number 34414

Randomized Perfect Bipartite Matching

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

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

Algorithmic Discrete Mathematics 6. Exercise Sheet

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

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

Reminder: Flow Networks

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

16 Max-Flow Algorithms and Applications

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

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

introduction Ford-Fulkerson algorithm

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

23 Maximum Flows and Minimum Cuts

introduction Ford-Fulkerson algorithm

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

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)

Maximum Flow in Planar Graphs

Algorithm Design and Analysis

16 Max-Flow Algorithms

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

Introduction to Congestion Games

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

18 Extensions of Maximum Flow

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

Algorithms and Theory of Computation. Lecture 11: Network Flow

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

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

Chapter 7. Network Flow. CS 350: Winter 2018

Bipartite Matching. Matching. Bipartite Matching. Maxflow Formulation

Average Case Lower Bounds for Monotone Switching Networks

Introduction to SLE Lecture Notes

Stationary Distribution. Design and Analysis of Algorithms Andrei Bulatov

EECE 301 Signals & Systems Prof. Mark Fowler

Solutions for Assignment 2

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

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

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

Chapter 7: Inverse-Response Systems

Laplace Transform. Inverse Laplace Transform. e st f(t)dt. (2)

u(t) Figure 1. Open loop control system

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

Graduate Algorithms CS F-18 Flow Networks

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

Topics in Combinatorial Optimization May 11, Lecture 22

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

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

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

Longest Common Prefixes

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

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

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

Monochromatic Infinite Sumsets

PHYSICS 151 Notes for Online Lecture #4

Math 333 Problem Set #2 Solution 14 February 2003

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

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

Timed Circuits. Asynchronous Circuit Design. Timing Relationships. A Simple Example. Timed States. Timing Sequences. ({r 6 },t6 = 1.

15. Vector Valued Functions

Journal of Discrete Algorithms. Approximability of partitioning graphs with supply and demand

Flow Networks Alon Efrat Slides courtesy of Charles Leiserson with small changes by Carola Wenk. Flow networks. Flow networks CS 445

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

Maximum Flow. Flow Graph

Algorithm Design and Analysis

Computer-Aided Analysis of Electronic Circuits Course Notes 3

Traversal of a subtree is slow, which affects prefix and range queries.

Transcription:

Sovie Rail Nework, Max Flow, Min u OS Kevin Wayne Fall Reference: On he hiory of he ranporaion and maximum flow problem. lexander Schrijver in Mah Programming, :,. Minimum u Problem u Flow nework.! Digraph G = (V, E), nonnegaive edge capaciie c(e).! Two diinguihed node: = ource, = ink.! umpion: no parallel edge, no edge enering or leaving. 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 ource ink capaciy 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: val( f ) = " f (e). e ou of apaciy = + + = capaciy flow Value = Maximum Flow Problem Flow and u Max flow problem. Find - flow of maximum value. Flow value lemma. e 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) = val( f ) e ou of e in o capaciy flow Value = Value = - + - + =

Flow and u Flow and u Flow value lemma. e f be any flow, and le (, B) be any - cu. Then " f (e) # " f (e) = val( f ). e ou of e in o Weak dualiy. e f be any flow, and le (, B) be any - cu. Then he value of he flow i a mo he capaciy of he cu. Pf. by flow conervaion, all erm excep v = are val( f ) = " f (e) e ou of = % ( " ' " f (e) $ " f (e)* & ) v # e ou of v e in o v u capaciy = # Flow value " = " f (e) $ " f (e). e ou of e in o apaciy = Flow and u erificae of Opimaliy Weak dualiy. e f be any flow. Then, for any - cu (, B) we have val(f) " cap(, B). orollary. e f be any flow, and le (, B) be any cu. If val(f) = cap(, B), hen f i a max flow and (, B) i a min cu. Pf. val( f ) = " f (e) # " f (e) e ou of e in o $ " f (e) e ou of $ " c(e) e ou of = cap(, B) Value of flow = u capaciy = # 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. X X Flow value = X Flow value = Toward a Max Flow lgorihm Reidual Graph 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 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 capaciy v flow reidual capaciy v reidual capaciy greedy = op = Reidual graph: G f = (V, E f ).! Reidual edge wih poiive reidual capaciy.! E f = {e : f(e) < c(e)} $ {e R : c(e) > }.

Ford-Fulkeron lgorihm Max-Flow Min-u Theorem G: capaciy ugmening pah heorem. Flow f i a max flow iff here are no augmening pah. Max-flow min-cu heorem. [Elia-Feinein-Shannon, Ford-Fulkeron ] The value of he max flow i equal o he value of he min cu. Pf. e f be a flow. Then TFE: (i) There exi a cu (, B) uch ha val(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.! e 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 nalyi (iii) # (i)! e f be a flow wih no augmening pah.! e be e of verice reachable from in reidual graph.! By definiion of,!.! By definiion of f, %. val( 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 val(f*) " n ieraion. I can be implemened in O(mn) ime. Pf. Each augmenaion increae value by a lea.! 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: n Exponenial Inpu Ford-Fulkeron: Pahological Inpu Q. I generic Ford-Fulkeron algorihm polynomial in inpu ize? m, n, and log Q. I Ford-Fulkeron algorihm finie? " + e r = #... [ r n+ = r n - r n+ ] Max flow = + r + r. ugmenaion: fir augmen uni, hen repeaedly chooe pah wih lowe capaciy. X X X a a X X X b r b G X G X X c r c hooing Good ugmening Pah Shore ugmening Pah: Overview of nalyi Goal: chooe augmening pah o ha:! an find augmening pah efficienly.! Few ieraion. hooe augmening pah wih: [Edmond-Karp, Diniz ]! Max boleneck capaciy.! Sufficienly large boleneck capaciy.! Fewe number of edge.. The lengh of he hore augmening pah never decreae.. fer a mo m augmenaion, he lengh of he hore augmening pah ricly increae. Theorem. The hore augmening pah algorihm perform a mo O(mn) augmenaion. I can be implemened in O(m n) ime.! O(m) ime o find hore augmening pah via BFS.! O(m) augmenaion for pah of exacly k edge.! k < n

Shore ugmening Pah: nalyi Shore ugmening Pah: nalyi number of edge evel graph.! Define l (v) = lengh of hore -v pah in G.! G = (V, F) i ubgraph of G ha conain only hoe edge (u, v)! E wih l (v) = l (u) +.! ompue G in O(m+n) ime uing BFS, deleing back and ide edge.! P i a hore -u pah in G iff i i an -u pah G.. The lengh of he hore augmening pah never decreae.! e f and f' be flow before and afer a hore pah augmenaion.! e and ' be level graph of G f and G f '! Only back edge added o G f '! Pah wih back edge ha lengh greaer han previou lengh. G l = l = l = l = ' l = l = l = l = Shore ugmening Pah: nalyi Shore ugmening Pah: Review of nalyi. fer a mo m augmenaion, he lengh of he hore augmening pah ricly increae.! lea one edge (he boleneck edge) i deleed from afer each augmenaion.! No new edge added o unil lengh of hore pah ricly increae. l = l = l = l =. The lengh of he hore augmening pah never decreae.. fer a mo m augmenaion, he lengh of he hore augmening pah ricly increae. Theorem. The hore augmening pah algorihm perform a mo O(mn) augmenaion. I can be implemened in O(m n) ime. Noe: &(mn) augmenaion neceary on ome nework.! Try o decreae ime per augmenaion inead.! Dynamic ree # O(mn log n) [Sleaor-Tarjan, ]! Simple idea # O(mn ) '

Shore ugmening Pah: Improved Verion Shore ugmening Pah: Improved Verion Two ype of augmenaion.! Normal augmenaion: lengh of hore pah doen' change.! Special augmenaion: lengh of hore pah ricly increae. boleneck edge augmen. Group of normal augmenaion ake O(mn) ime.! Explicily mainain level graph - i change by a mo n edge afer each normal augmenaion.! Sar a, advance along an edge in unil reach or ge uck. if reach, augmen and delee a lea one edge if ge uck, delee node go uck, delee node delee augmen l = l = l = l = boleneck edge Shore ugmening Pah: Improved Verion Shore ugmening Pah: Improved Verion Two ype of augmenaion. augmen! Normal augmenaion: lengh of hore pah doen' change.! Special augmenaion: lengh of hore pah ricly increae. boleneck edge. Group of normal augmenaion ake O(mn) ime.! mo n advance ep before you eiher ge uck: delee a node from level graph reach : augmen and delee an edge from level graph Theorem. lgorihm run in O(mn ) ime.! O(mn) ime beween pecial augmenaion.! mo n pecial augmenaion. Sop: lengh of hore pah mu have ricly increaed.

Hiory of Wor-ae Running Time Year Dicoverer Mehod ympoic Time... Danzig Simplex m n Ford, Fulkeron ugmening pah m n Edmond-Karp Shore pah m n Edmond-Karp Fae pah m log (m log n) Diniz Improved hore pah m n Edmond-Karp, Diniz apaciy caling m log Diniz-Gabow Improved capaciy caling m n log Karzanov Preflow-puh n Sleaor-Tarjan Dynamic ree m n log n Goldberg-Tarjan FIFO preflow-puh m n log (n / m)......... Goldberg-Rao engh funcion m / log (n / m) log mn / log (n / m) log Edge capaciie are beween and. nex ime