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

Similar documents
The Residual Graph. 12 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

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

Network Flow. Data Structures and Algorithms Andrei Bulatov

CS4445/9544 Analysis of Algorithms II Solution for Assignment 1

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 and Minimum Cut

Graphs III - Network Flow

Soviet Rail Network, 1955

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

1 Motivation and Basic Definitions

Network Flows: Introduction & Maximum Flow

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

Main Reference: Sections in CLRS.

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

Algorithmic Discrete Mathematics 6. Exercise Sheet

Randomized Perfect Bipartite Matching

Algorithm Design and Analysis

CSE 521: Design & Analysis of Algorithms I

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.

Introduction to Congestion Games

Matching. Slides designed by Kevin Wayne.

18 Extensions of Maximum Flow

Network Flows UPCOPENCOURSEWARE number 34414

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

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.

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

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

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)

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

16 Max-Flow Algorithms and Applications

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

Maximum Flow in Planar Graphs

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

CSE 421 Introduction to Algorithms Winter The Network Flow Problem

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

Introduction to SLE Lecture Notes

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

Reminder: Flow Networks

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

u(t) Figure 1. Open loop control system

23 Maximum Flows and Minimum Cuts

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

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

, 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

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

Bipartite Matching. Matching. Bipartite Matching. Maxflow Formulation

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

Algorithms. Algorithms 6.4 MAXIMUM FLOW

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

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

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

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

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

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

arxiv: v1 [cs.cg] 21 Mar 2013

Efficient Algorithms for Computing Disjoint QoS Paths

Exponential Sawtooth

Online Learning Applications

Average Case Lower Bounds for Monotone Switching Networks

Macroeconomics 1. Ali Shourideh. Final Exam

EECE 301 Signals & Systems Prof. Mark Fowler

Price of Stability and Introduction to Mechanism Design

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

Topics in Combinatorial Optimization May 11, Lecture 22

Longest Common Prefixes

Notes for Lecture 17-18

Stationary Distribution. Design and Analysis of Algorithms Andrei Bulatov

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

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

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

Discussion Session 2 Constant Acceleration/Relative Motion Week 03

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

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

Chapter 7: Inverse-Response Systems

Additional Methods for Solving DSGE Models

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

A Shooting Method for A Node Generation Algorithm

CHAPTER 7: SECOND-ORDER CIRCUITS

Lecture 4 Notes (Little s Theorem)

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

PHYSICS 151 Notes for Online Lecture #4

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

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

5.2 GRAPHICAL VELOCITY ANALYSIS Polygon Method

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

Random Walk with Anti-Correlated Steps

Christos Papadimitriou & Luca Trevisan November 22, 2016

introduction Ford-Fulkerson algorithm

Math 10B: Mock Mid II. April 13, 2016

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

Notes on cointegration of real interest rates and real exchange rates. ρ (2)

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 )}. G u v 3 G f u v Ern Mayr, Harald Räcke 3 Ern Mayr, Harald Räcke Augmening Pah Algorihm Augmening Pah Algorihm Definiion An augmening pah wih repec o flow f, i a pah from o in he auxiliary graph G f ha conain only edge wih non-zero capaciy. Algorihm 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. Animaion for augmening pah algorihm i only available in he lecure verion of he lide. Ern Mayr, Harald Räcke 5 Ern Mayr, Harald Räcke

Augmening Pah Algorihm Augmening Pah Algorihm Theorem A flow f i a maximum flow iff here are no augmening pah. Theorem 3 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... 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. Ern Mayr, Harald Räcke 7 Ern Mayr, Harald Räcke 8 Augmening Pah Algorihm Analyi val(f ) = f (e) f (e) e ou(a) = e ou(a) c(e) = cap(a, V \ A) Thi finihe he proof. e ino(a) 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. 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. Ern Mayr, Harald Räcke 9 Ern Mayr, Harald Räcke

A Bad Inpu Lemma 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. Problem: The running ime may no be polynomial. Queion: Can we weak he algorihm o ha he running ime i polynomial in he inpu lengh? Ern Mayr, Harald Räcke Ern Mayr, Harald Räcke A Bad Inpu Problem: The running ime may no be polynomial. A Pahological Inpu Le r = ( 5 ). Then r n+ = r n r n+. r 5 3 r 3 Queion: Can we weak he algorihm o ha he running ime i polynomial in he inpu lengh? See he lecure-verion of he lide for he animaion. Running ime may be infinie!!! r + r 3 r 7 See he lecure-verion of he lide for he animaion. Ern Mayr, Harald Räcke 3 Ern Mayr, Harald Räcke

Overview: Shore Augmening Pah 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. Lemma The lengh of he hore augmening pah never decreae. Lemma 7 Afer a mo O(m) augmenaion, he lengh of he hore augmening pah ricly increae. Ern Mayr, Harald Räcke 5. Shore Augmening Pah Ern Mayr, Harald Räcke Overview: Shore Augmening Pah Thee wo lemma give he following heorem: Theorem 8 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 Ern Mayr, Harald Räcke 7. Shore Augmening Pah Ern Mayr, Harald Räcke 8

Shore Augmening Pah Fir Lemma: The lengh of he hore augmening pah never decreae. In he following we aume ha he reidual graph G f doe no conain zero capaciy edge. Thi mean, we conruc i in he uual ene and hen delee edge of zero capaciy. Afer an augmenaion G f change a follow: Boleneck edge on he choen pah are deleed. 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 9 3 9 9 5 9. Shore Augmening Pah Ern Mayr, Harald Räcke 9 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 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 Shore Augmening Pah Theorem 9 The hore augmening pah algorihm perform a mo O(mn) augmenaion. Each augmenaion can be performed in ime O(m). Theorem (wihou proof) There exi nework wih m = Θ(n ) ha require O(mn) augmenaion, when we reric ourelve o only augmen along hore augmening pah. Noe: There alway exi a e of m augmenaion ha give a maximum flow (why?).. Shore Augmening Pah Ern Mayr, Harald Räcke

Shore 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). 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.. Shore Augmening Pah Ern Mayr, Harald Räcke 3. Shore Augmening Pah Ern Mayr, Harald Räcke 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. 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. There are a mo n phae. Hence, oal co i O(mn ).. Shore Augmening Pah Ern Mayr, Harald Räcke 5. Shore Augmening Pah Ern Mayr, Harald Räcke

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. 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 Ern Mayr, Harald Räcke 7 Ern Mayr, Harald Räcke 8 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 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. Ern Mayr, Harald Räcke 9 Ern Mayr, Harald Räcke 3

Capaciy Scaling 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: There mu exi an - cu in G f ( ) of zero capaciy. In G f hi cu can have capaciy a mo m. Thi give me an upper bound on he flow ha I can ill add. Lemma 3 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 We need O(m log C) augmenaion. The algorihm can be implemened in ime O(m log C). Ern Mayr, Harald Räcke 3 Ern Mayr, Harald Räcke 3