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

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

Soviet Rail Network, 1955

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

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

Today: Max Flow Proofs

Network Flow. Data Structures and Algorithms Andrei Bulatov

CS4445/9544 Analysis of Algorithms II Solution for Assignment 1

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

Maximum Flow and Minimum Cut

Graphs III - Network Flow

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

1 Motivation and Basic Definitions

Soviet Rail Network, 1955

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

Network Flows: Introduction & Maximum Flow

Main Reference: Sections in CLRS.

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

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

Matching. Slides designed by Kevin Wayne.

Algorithmic Discrete Mathematics 6. Exercise Sheet

CSE 521: Design & Analysis of Algorithms I

Algorithm Design and Analysis

Introduction to Congestion Games

Algorithm Design and Analysis

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

18 Extensions of Maximum Flow

Randomized Perfect Bipartite Matching

Network Flows UPCOPENCOURSEWARE number 34414

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

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

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

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

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. How do we transport the maximum amount data from source to sink? Some of these slides are adapted from Lecture Notes of Kevin Wayne.

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

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

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

16 Max-Flow Algorithms and Applications

Maximum Flow in Planar Graphs

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

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

CSE 421 Introduction to Algorithms Winter The Network Flow Problem

Reminder: Flow Networks

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

23 Maximum Flows and Minimum Cuts

Introduction to SLE Lecture Notes

Ford Fulkerson algorithm max-flow min-cut theorem. max-flow min-cut theorem capacity-scaling 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

u(t) Figure 1. Open loop control system

, 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

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

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

Bipartite Matching. Matching. Bipartite Matching. Maxflow Formulation

16 Max-Flow Algorithms

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

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

Algorithms. Algorithms 6.4 MAXIMUM FLOW

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

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

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

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

Efficient Algorithms for Computing Disjoint QoS Paths

arxiv: v1 [cs.cg] 21 Mar 2013

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

EECE 301 Signals & Systems Prof. Mark Fowler

Longest Common Prefixes

A Shooting Method for A Node Generation Algorithm

Online Learning Applications

Stationary Distribution. Design and Analysis of Algorithms Andrei Bulatov

Average Case Lower Bounds for Monotone Switching Networks

6.302 Feedback Systems Recitation : Phase-locked Loops Prof. Joel L. Dawson

Discussion Session 2 Constant Acceleration/Relative Motion Week 03

Price of Stability and Introduction to Mechanism Design

Topics in Combinatorial Optimization May 11, Lecture 22

Random Walk with Anti-Correlated Steps

Selfish Routing and the Price of Anarchy. Tim Roughgarden Cornell University

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

Exponential Sawtooth

Additional Methods for Solving DSGE Models

Chapter 7: Inverse-Response Systems

T L. t=1. Proof of Lemma 1. Using the marginal cost accounting in Equation(4) and standard arguments. t )+Π RB. t )+K 1(Q RB

Macroeconomics 1. Ali Shourideh. Final Exam

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

CHAPTER 7: SECOND-ORDER CIRCUITS

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

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

Lecture 26. Lucas and Stokey: Optimal Monetary and Fiscal Policy in an Economy without Capital (JME 1983) t t

2. VECTORS. R Vectors are denoted by bold-face characters such as R, V, etc. The magnitude of a vector, such as R, is denoted as R, R, V

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

Generalized Orlicz Spaces and Wasserstein Distances for Convex-Concave Scale Functions

5.2 GRAPHICAL VELOCITY ANALYSIS Polygon Method

To become more mathematically correct, Circuit equations are Algebraic Differential equations. from KVL, KCL from the constitutive relationship

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

Christos Papadimitriou & Luca Trevisan November 22, 2016

Notes for Lecture 17-18

4 Sequences of measurable functions

EXERCISES FOR SECTION 1.5

Graph Theory: Network Flow

introduction Ford-Fulkerson algorithm

Transcription:

Augmening Pah Algorihm Greedy-algorihm: ar wih f (e) = everywhere find an - pah wih f (e) < c(e) on every edge augmen flow along he pah repea a long a poible The Reidual Graph From he graph G = (V, E, c) and he curren flow f we conruc an auxiliary graph G f = (V, E f, c f ) (he reidual graph): Suppoe he original graph ha edge e = (u, v), and e = (v, u) beween u and v. G f ha edge e wih capaciy max{, c(e ) f (e ) + f (e )} and e wih wih capaciy max{, c(e ) f (e ) + f (e )}. 3 G u v G f u v c Ern Mayr, Harald Räcke 9. Generic Augmening Pah c Ern Mayr, Harald Räcke Augmening Pah Algorihm Definiion 5 An augmening pah wih repec o flow f, i a pah in he auxiliary graph G f ha conain only edge wih non-zero capaciy. Algorihm 5 FordFulkeron(G = (V, E, c)) : Iniialize f (e) for all edge. : while augmening pah p in G f do 3: augmen a much flow along p a poible. Augmening Pah Algorihm Theorem 5 A flow f i a maximum flow iff here are no augmening pah. Theorem 5 The value of a maximum flow i equal o he value of a minimum cu. Proof. Le f be a flow. The following are equivalen:. There exi a cu A, B uch ha val(f ) = cap(a, B).. Flow f i a maximum flow. 3. There i no augmening pah w.r.. f.. Generic Augmening Pah c Ern Mayr, Harald Räcke. Generic Augmening Pah c Ern Mayr, Harald Räcke

Augmening Pah Algorihm.. Thi we already howed.. 3. If here were an augmening pah, we could improve he flow. Conradicion. 3.. Le f be a flow wih no augmening pah. Le A be he e of verice reachable from in he reidual graph along non-zero capaciy edge. Since here i no augmening pah we have A and A. Augmening Pah Algorihm val(f ) = Thi finihe he proof. e ou(a) = e ou(a) f (e) c(e) = cap(a, V \ A) e ino(a) f (e) Here he fir equaliy ue he flow value lemma, and he econd exploi he fac ha he flow along incoming edge mu be a he reidual graph doe no have edge leaving A.. Generic Augmening Pah c Ern Mayr, Harald Räcke 3. Generic Augmening Pah c Ern Mayr, Harald Räcke Analyi Aumpion: All capaciie are ineger beween and C. Invarian: Every flow value f (e) and every reidual capaciy c f (e) remain inegral roughou he algorihm. Lemma 53 The algorihm erminae in a mo val(f ) nc ieraion, where f denoe he maximum flow. Each ieraion can be implemened in ime O(m). Thi give a oal running ime of O(nmC). Theorem 5 If all capaciie are ineger, hen here exi a maximum flow for which every flow value f (e) i inegral.. Generic Augmening Pah c Ern Mayr, Harald Räcke 5. Generic Augmening Pah c Ern Mayr, Harald Räcke

A bad inpu Problem: The running ime may no be polynomial. A bad inpu Problem: The running ime may no be polynomial. 999 998 999 998 999 998 999 998 Queion: Can we weak he algorihm o ha he running ime i polynomial in he inpu lengh? Queion: Can we weak he algorihm o ha he running ime i polynomial in he inpu lengh?. Generic Augmening Pah c Ern Mayr, Harald Räcke 7. Generic Augmening Pah c Ern Mayr, Harald Räcke 8 A Pahological Inpu Le r = ( 5 ). Then r n+ = r n r n+. r 5 How o chooe augmening pah? We need o find pah efficienly. We wan o guaranee a mall number of ieraion. 3 r 3 Several poibiliie: Chooe pah wih maximum boleneck capaciy. Chooe pah wih ufficienly large boleneck capaciy. Chooe he hore augmening pah. r + r 3 r 7 Running ime may be infinie!!!. Generic Augmening Pah c Ern Mayr, Harald Räcke 9. Generic Augmening Pah c Ern Mayr, Harald Räcke

=[fill=darkgreen,draw=darkgreen] Overview: Shore Augmening Pah Lemma 55 The lengh of he hore augmening pah never decreae. Lemma 5 Afer a mo O(m) augmenaion, he lengh of he hore augmening pah ricly increae.. Shore Augmening Pah c Ern Mayr, Harald Räcke. Shore Augmening Pah c Ern Mayr, Harald Räcke Overview: Shore Augmening Pah Thee wo lemma give he following heorem: Theorem 57 The hore augmening pah algorihm perform a mo O(mn) augmenaion. Thi give a running ime of O(m n). Proof. We can find he hore augmening pah in ime O(m) via BFS. O(m) augmenaion for pah of exacly k < n edge. Shore Augmening Pah Define he level l(v) of a node a he lengh of he hore -v pah in G f. Le L G denoe he ubgraph of he reidual graph G f ha conain only hoe edge (u, v) wih l(v) = l(u) +. A pah P i a hore -u pah in G f if i i a an -u pah in L G. G f L G 3 9 5. Shore Augmening Pah c Ern Mayr, Harald Räcke. Shore Augmening Pah c Ern Mayr, Harald Räcke 3

Shore Augmening Pah Fir Lemma: The lengh of he hore augmening pah never decreae. Afer an augmenaion he following change are done in G f. Some edge of he choen pah may be deleed (boleneck edge). Back edge are added o all edge ha don have back edge o far. Thee change canno decreae he diance beween and. G f L G Shore Augmening Pah Second Lemma: Afer a mo m augmenaion he lengh of he hore augmening pah ricly increae. Le E L denoe he e of edge in graph L G a he beginning of a round when he diance beween and i k. An - pah in G f ha doe ue edge no in E L ha lengh larger han k, even when conidering edge added o G f during he round. In each augmenaion one edge i deleed from E L. G f E L 9 3 9 9 5 9 9 3 9 9 5 9. Shore Augmening Pah c Ern Mayr, Harald Räcke. Shore Augmening Pah c Ern Mayr, Harald Räcke 5 Shore Augmening Pah Theorem 58 The hore augmening pah algorihm perform a mo O(mn) augmenaion. Each augmenaion can be performed in ime O(m). Theorem 59 (wihou proof) There exi nework wih m = Θ(n ) ha require O(mn) augmenaion, when we reric ourelve o only augmen along hore augmening pah. Shore Augmening Pah When icking o hore augmening pah we canno improve (aympoically) on he number of augmenaion. However, we can improve he running ime o O(mn ) by improving he running ime for finding an augmening pah (currenly we aume O(m) per augmenaion for hi). Noe: There alway exi a e of m augmenaion ha give a maximum flow.. Shore Augmening Pah c Ern Mayr, Harald Räcke. Shore Augmening Pah c Ern Mayr, Harald Räcke 7

Shore Augmening Pah We mainain a ube E L of he edge of G f wih he guaranee ha a hore - pah uing only edge from E L i a hore augmening pah. Wih each augmenaion ome edge are deleed from E L. When E L doe no conain an - pah anymore he diance beween and ricly increae. Noe ha E L i no he e of edge of he level graph bu a ube of level-graph edge. Suppoe ha he iniial diance beween and in G f i k. E L i iniialized a he level graph L G. Perform a DFS earch o find a pah from o uing edge from E L. Eiher you find afer a mo n ep, or you end a a node v ha doe no have any ougoing edge. You can delee incoming edge of v from E L.. Shore Augmening Pah c Ern Mayr, Harald Räcke 8. Shore Augmening Pah c Ern Mayr, Harald Räcke 9 Le a phae of he algorihm be defined by he ime beween wo augmenaion during which he diance beween and ricly increae. Iniializing E L for he phae ake ime O(m). The oal co for earching for augmening pah during a phae i a mo O(mn), ince every earch (ucceful (i.e., reaching ) or unucceful) decreae he number of edge in E L and ake ime O(n). The oal co for performing an augmenaion during a phae i only O(n). For every edge in he augmening pah one ha o updae he reidual graph G f and ha o check wheher he edge i ill in E L for he nex earch. How o chooe augmening pah? We need o find pah efficienly. We wan o guaranee a mall number of ieraion. Several poibiliie: Chooe pah wih maximum boleneck capaciy. Chooe pah wih ufficienly large boleneck capaciy. Chooe he hore augmening pah. There are a mo n phae. Hence, oal co i O(mn ).. Shore Augmening Pah c Ern Mayr, Harald Räcke 3.3 Capaciy Scaling c Ern Mayr, Harald Räcke 3

Capaciy Scaling Inuiion: Chooing a pah wih he highe boleneck increae he flow a much a poible in a ingle ep. Don worry abou finding he exac boleneck. Mainain caling parameer. G f ( ) i a ub-graph of he reidual graph G f ha conain only edge wih capaciy a lea. G f G f (99) 5 33 87 5 33 Capaciy Scaling Algorihm maxflow(g,,, c) : foreach e E do f e ; : log C 3: while do : G f ( ) -reidual graph 5: while here i augmening pah P in G f ( ) do : f augmen(f, c, P) 7: updae(g f ( )) 8: / 9: reurn f.3 Capaciy Scaling c Ern Mayr, Harald Räcke 3.3 Capaciy Scaling c Ern Mayr, Harald Räcke 33 Capaciy Scaling Aumpion: All capaciie are ineger beween and C. Invarian: All flow and capaciie are/remain inegral hroughou he algorihm. Correcne: The algorihm compue a maxflow: becaue of inegraliy we have G f () = G f herefore afer he la phae here are no augmening pah anymore hi mean we have a maximum flow. Capaciy Scaling Lemma There are log C ieraion over. Proof: obviou. Lemma Le f be he flow a he end of a -phae. Then he maximum flow i maller han val(f ) + m. Proof: le obviou, bu imple: An - cu in G f ( ) give me an upper bound on he amoun of flow ha my algorihm can ill add o f. The edge ha currenly have capaciy a mo in G f form an - cu wih capaciy a mo m..3 Capaciy Scaling c Ern Mayr, Harald Räcke 3.3 Capaciy Scaling c Ern Mayr, Harald Räcke 35

Capaciy Scaling Lemma There are a mo m augmenaion per caling-phae. Proof: Le f be he flow a he end of he previou phae. val(f ) val(f ) + m each augmenaion increae flow by. Theorem 3 We need O(m log C) augmenaion. The algorihm can be implemened in ime O(m log C)..3 Capaciy Scaling c Ern Mayr, Harald Räcke 3