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

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

Main Reference: Sections in CLRS.

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

Network Flow. Data Structures and Algorithms Andrei Bulatov

Graphs III - Network 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

1 Motivation and Basic Definitions

Today: Max Flow Proofs

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

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

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

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. 11 Augmenting Path Algorithms. Augmenting Path Algorithm. Augmenting Path Algorithm

Warm Up. Correct order: s,u,v,y,x,w,t

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

CS4445/9544 Analysis of Algorithms II Solution for Assignment 1

Matching. Slides designed by Kevin Wayne.

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

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

Soviet Rail Network, 1955

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

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

CSE 521: Design & Analysis of Algorithms I

Network Flows UPCOPENCOURSEWARE number 34414

Maximum Flow and Minimum Cut

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

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

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

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

Soviet Rail Network, 1955

Network Flows: Introduction & Maximum Flow

CSE 421 Introduction to Algorithms Winter The Network Flow Problem

Reminder: Flow Networks

Algorithm Design and Analysis

Algorithmic Discrete Mathematics 6. Exercise Sheet

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

16 Max-Flow Algorithms and Applications

Introduction to Congestion Games

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.

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

Algorithm Design and Analysis

Maximum Flow in Planar Graphs

Randomized Perfect Bipartite Matching

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

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

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

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

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

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

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

Algorithms. Algorithms 6.4 MAXIMUM FLOW

23 Maximum Flows and Minimum Cuts

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

Star coloring of sparse graphs

Sequences Arising From Prudent Self-Avoiding Walks Shanzhen Gao, Heinrich Niederhausen Florida Atlantic University, Boca Raton, Florida 33431

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

18 Extensions of Maximum Flow

arxiv: v1 [cs.cg] 21 Mar 2013

Congruent Numbers and Elliptic Curves

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

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

Longest Common Prefixes

Flow Network. The following figure shows an example of a flow network:

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

Network Flow Applications

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

Average Case Lower Bounds for Monotone Switching Networks

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

1 Solutions to selected problems

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

Monochromatic Infinite Sumsets

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

DESIGN OF TENSION MEMBERS

16 Max-Flow Algorithms

Notes for Lecture 17-18

Challenge Problems. DIS 203 and 210. March 6, (e 2) k. k(k + 2). k=1. f(x) = k(k + 2) = 1 x k

COMPETITIVE LOCAL ROUTING WITH CONSTRAINTS

Math 334 Fall 2011 Homework 11 Solutions

u(t) Figure 1. Open loop control system

Bernoulli numbers. Francesco Chiatti, Matteo Pintonello. December 5, 2016

The Arcsine Distribution

Elastic and Inelastic Collisions

CHAPTER 2 Signals And Spectra

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

Inventory Analysis and Management. Multi-Period Stochastic Models: Optimality of (s, S) Policy for K-Convex Objective Functions

Languages That Are and Are Not Context-Free

t is a basis for the solution space to this system, then the matrix having these solutions as columns, t x 1 t, x 2 t,... x n t x 2 t...

Some Ramsey results for the n-cube

Geometric Path Problems with Violations

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

Chapter 6. Laplace Transforms

Srednicki Chapter 20

556: MATHEMATICAL STATISTICS I

Lecture Notes 2. The Hilbert Space Approach to Time Series

The multisubset sum problem for finite abelian groups

Entropy compression method applied to graph colorings

arxiv: v2 [cs.cg] 30 Apr 2015

ENGI 9420 Engineering Analysis Assignment 2 Solutions

u(x) = e x 2 y + 2 ) Integrate and solve for x (1 + x)y + y = cos x Answer: Divide both sides by 1 + x and solve for y. y = x y + cos x

Transcription:

Nework flow The problem Seing flow nework G = (V, E, c), a orce and a ink no in E implie c(, ) = 0 Flow from o capaciy conrain kew-ymmery flow-coneraion ale of he flow jfj = P 2V Find a maximm flow from o c : V V! R + 0 [ f+g f : V V! R [ f+g 8 ;2V f(; ) c(; ) 8 ;2V f(; ) = f(; ) 8 2V f;g P2V f(; ): f(; ) = 0

Poiie flow Poiie flow f + (; ) = maxff(; ); 0g Flow coneraion X 8 2V f;g f + (; ) 2N + G () Vale of flow f jfj = X f + (; ) 2N + G () X X 2N G () f + (; ) = 0 2N G () f + (; ) Example capaciy poiie flow / / / / 30/ 30/ / / / / Flow from o wih ale aximm flow from o ha ale 30 2

Properie of flow Definiion of flow exended f(x; Y ) = X o e f(; ) 2X;2Y = X f + (; ) 2X;2Y 2X;2Y Properie of flow X f + (; ) 8 X½V f(x; X) = 0 8 X;Y ½V f(x; Y ) = f(y; X) 8 X;Y;Z½V X \ Y = ; ) f(x [ Y; Z) = f(x; Z) + f(y; Z) ^ f(z; X [ Y ) = f(z; X) + f(z; Y ) Flow coneraion 8 2V f;g f(; V ) = 0 Working wih he properie of flow jfj = f(; V ) = f(v; V ) f(v ; V ) = f(v ; V ) = f(v; V ) = f(v; ) + f(v; V ) = f(v; ) f(v ; V ) = f(v; ) he ale of he flow defined a he flow leaing he orce can eqialenly be regarded a he flow enering he ink 3

Flow decompoiion Gien wo flow f and g heir m f + g i defined a (f + g)(,) = f(,) + g(,) Propoiion: An - flow can be decompoed ino a mo m flow along pah from o, where m i he nmber of link in he nework Proof (kech): delee link wiho flow ake any link wih poiie flow recriely follow an ogoing link wih poiie flow oward ; recriely follow an incoming link wih poiie flow oward if a cycle i fond, find he poiie flow along he cycle and brac ha flow; a lea one link ha no flow and can be deleed ogeher wih i oppoie repea he proce nil a pah from o wih poiie flow i fond; find he poiie flow along ha pah and brac ha flow; one pah i fond and, afer bracion, a lea one link ha no flow and can be deleed ogeher wih i oppoie Flow decompoiion: example / / 30/ / / + +

Flow along pah / 30/ / 30-= Can injec a flow of ale along pah J diconing he flow along he pah preclde finding he maximm flow Phing flow back i imporan Reidal nework Gien nework G = (V,E,c) and a flow f from o, define he reidal capaciy from o c f (; ) = c(; ) f(; ) Gien nework G=(V,E,c) and a flow f from o, define he reidal nework indced by f on G, G f = (V, E f, c f ) E f = f(; ) 2 V V j c f (; ) > 0g If neiher nor belong o G, hen neiher nor belong o G f

Example / /0 30/ /0 / A nework and a flow Reidal nework indced by he flow Flow in reidal nework f i a flow in G=(V,E,c) G f i he reidal nework indced by f f i a flow in G f (f+f ) i a flow in G wih ale f+f = f + f Capaciy conrain (f + f 0 )(; ) = f(; ) + f 0 (; ) f(; ) + (c(; ) f(; )) = c(; ) Flow ale jf + f 0 j = X (f + f 0 )(; ) 2V = X 2V (f(; ) + f 0 (; )) = X f(; ) + X f 0 (; ) 2V 2V = jfj + jf 0 j 6

Agmening pah A pah P from o in reidal nework G f i an agmening pah Flow along agmening pah f P 8 < minfc f (; ) j 2 E(P )g if 2 E(P ) f P (; ) = minfc f (; ) j 2 E(P )g if 2 E(P ) : 0 oherwie Agmening pah P arae link if f p = c f (,) > 0 C and heir capaciie c (S, S) in a flow nework i a pariion of V ch ha S and S capaciy of (S, S) i c(s, S) jfj = f(; V ) = f(; V ) + f(s ; V ) = f(s; V ) = f(s; V ) f(s; S) = f(s; S) ¹ jfj = f(s; ¹ S) = X 2S;2 ¹S X 2S;2 ¹S = c(s; ¹ S); f(; ) c(; ) propoiion: eery flow ale i pper bonded by he capaciy of eery c

Example 30 aximm flow from o i a mo 0 aximm flow from o i a mo 30 ax-flow min-c heorem f i a maximm flow no agmening pah (,)-pah S = f j here i a pah in G f from o g: (S, S) i an (,)-c for eery S and S he reidal capaciy c f (,) = c(,) f(,) i zero h, c(s; S) ¹ = f(s; S) ¹ = jfj (S, S) i a minimm c; f i a maximm flow propoiion: he maximm ale of an (,)-flow eqal he minimm capaciy of an (,)-c 8

Ford-Flkeron mehod FordFlkeron(G) for each E do f[, ] = 0 f[, ] = 0 while here i a pah P from o in he reidal nework G f do r = min{ c(, ) f[, ] E(P)} for each E(P) do f[, ] = f[, ] + r f[, ] = - f[,] le C = c({}, V {}); if all capaciie are ineger, C i finie propoiion: if all capaciie are ineger, hen he Ford-Flkeron erminae in a mo C ieraion of he while loop; wor cae complexiy i O(mC) propoiion: if all capaciie are ineger, hen here i a maximm flow of inegral ale Ford-Flkeron: example I 6 2 9 3 6 2 9 6/ 2/ 9/ 3 3 / / 9

Ford-Flkeron: example II 2 8 6/ / 2/ 9/ / / 3 3 / / 8 3 3 2/2 6/ 9/ / / / 3 3 8 3/8 / / Ford-Flkeron: example III 3 8 2 3 2/2 6/ 9 / 3/2 / /9 / / 3 2 2 9 3 9 min c = 23 max flow = 23

Slow erminaion wih a bad choice of agmening pah i ake 2 of hem o find he maximm flow Non erminaion e 2 e 3 r Wih irraional capaciie, Ford- Flkeron may no erminae, and i may conerge o flow which i no he maximm flow e p r = 2 In he figre a he lef, an nfornae eqence of agmening pah may lead Ford- Flkeron mehod o neer erminae and conerge o a flow of ale + 2 / ( r), wherea he maximm flow i 2 +

Edmond-Karp algorihm chooe agmening pah which are of hore lengh in erm of nmber of link (BFS) Propoiion: le G f be a reidal nework and P an agmening pah from o. Then he diance from o a node in G f+fp i no maller han he diance from o he ame node in G f Proof: hypohei Conradicion. Chooe ch ha d Gf+fP (; ) < d Gf (; ) (diance from o i horer in G f+fp han in G f ) () d Gf+fP (; x) < d Gf+fP (; ) ) d Gf (; x) d Gf+fP (; x) (2) ( i he farhe node from in G f+fp ch ha diance from o i horer in G f+fp han in G f ) d Gf+fP (; ) + = d Gf+fP (; ) (3) ( i he paren of in hore pah from o in G f+fp ) 2

Proof: conradicion I Conradicion. Chooe ch ha d Gf+fP (; ) < d Gf (; ) d Gf+fP (; x) < d Gf+fP (; ) ) d Gf (; x) d Gf+fP (; x) d Gf+fP (; ) + = d Gf+fP (; ) () (2) (3) if i in E f G f G f+fp d Gf (; ) d Gf (; ) + d Gf+fP (; ) + = d Gf+fP (; ) ( i in E f ) (from (2)) (from (3)) Proof: conradicion II Conradicion. Chooe ch ha d Gf+fP (; ) < d Gf (; ) d Gf+fP (; x) < d Gf+fP (; ) ) d Gf (; x) d Gf+fP (; x) d Gf+fP (; ) + = d Gf+fP (; ) () (2) (3) if i no in E f, o ha i in an agmening pah in G f G f G f+fp d Gf (; ) = d Gf (; ) d Gf+fP (; ) = d Gf+fP (; ) 2 < d Gf+fP (; ) ( m be in he agmening pah) (from (2)) (from (3)) 3

Complexiy of Edmond-Karp Propoiion: he nmber of ime ha eiher link or link i araed i pper bonded by n Proof: agmening pah P arae in G f d Gf 0 (; ) = d Gf 0 (; ) + : agmening pah P arae in G f d Gf 00 (; ) = d Gf 00 (; ) + : araion of followed by araion of correpond o d Gf 0 (; ) + 2 d Gf 00 (; ) Nmber of agmening pah araing link i O(n) Nmber of agmening pah i O(n m) Oerall complexiy i O(n m 2 )