ALG 5.3 Flow Algorithms:

Similar documents
Maximum Flow. Flow Graph

Graduate Algorithms CS F-18 Flow Networks

Solutions to assignment 3

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

CSC 373: Algorithm Design and Analysis Lecture 9

1 The Network Flow Problem

Bipartite Matching. Matching. Bipartite Matching. Maxflow Formulation

Max-flow and min-cut

Max-flow and min-cut

Network Flows: Introduction & Maximum Flow

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

Graphs III - Network Flow

Matching. Slides designed by Kevin Wayne.

Soviet Rail Network, 1955

Lecture 2: Network Flow. c 14

Maximum Flow and Minimum Cut

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

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

Main Reference: Sections in CLRS.

Algorithm Design and Analysis

CS3510 Design & Analysis of Algorithms Fall 2017 Section A. Test 3 Solutions. Instructor: Richard Peng In class, Wednesday, Nov 15, 2017

Algorithmic Discrete Mathematics 6. Exercise Sheet

Today: Max Flow Proofs

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)

CS4445/9544 Analysis of Algorithms II Solution for Assignment 1

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

5. Network flow. Network flow. Maximum flow problem. Ford-Fulkerson algorithm. Min-cost flow. Network flow 5-1

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

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

CSE 521: Design & Analysis of Algorithms I

Algorithm Design and Analysis

Bisimulation, Games & Hennessy Milner logic p.1/32

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

Randomized Perfect Bipartite Matching

Jonathan Turner Exam 2-10/28/03

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

1 Motivation and Basic Definitions

Network Flow. Data Structures and Algorithms Andrei Bulatov

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

Reminder: Flow Networks

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

Robust Network Coding for Bidirected Networks

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

IX.1.1 The Laplace Transform Definition 700. IX.1.2 Properties 701. IX.1.3 Examples 702. IX.1.4 Solution of IVP for ODEs 704

Soviet Rail Network, 1955

IX.1.1 The Laplace Transform Definition 700. IX.1.2 Properties 701. IX.1.3 Examples 702. IX.1.4 Solution of IVP for ODEs 704

Fall 2014 David Wagner 10/31 Notes. The min-cut problem. Examples

LAPLACE TRANSFORMS. 1. Basic transforms

CSE 421 Introduction to Algorithms Winter The Network Flow Problem

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

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

Three Dimensional Coordinate Geometry

0 for t < 0 1 for t > 0

A LOG IS AN EXPONENT.

Maximum Flow in Planar Graphs

Minimum Squared Error

Minimum Squared Error

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

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

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

Released Assessment Questions, 2017 QUESTIONS

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

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

Introduction to Congestion Games

graph of unit step function t

18 Extensions of Maximum Flow

4. UNBALANCED 3 FAULTS

Chapter 2: Evaluative Feedback

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

Chapter Introduction. 2. Linear Combinations [4.1]

T-Match: Matching Techniques For Driving Yagi-Uda Antennas: T-Match. 2a s. Z in. (Sections 9.5 & 9.7 of Balanis)

Global alignment in linear space

ME 391 Mechanical Engineering Analysis

Positive and negative solutions of a boundary value problem for a

5.1-The Initial-Value Problems For Ordinary Differential Equations

UT Austin, ECE Department VLSI Design 5. CMOS Gate Characteristics

( ) ( ) ( ) ( ) ( ) ( y )

EECE 301 Signals & Systems Prof. Mark Fowler

Some basic notation and terminology. Deterministic Finite Automata. COMP218: Decision, Computation and Language Note 1

X-Ray Notes, Part III

can be viewed as a generalized product, and one for which the product of f and g. That is, does

ECE Microwave Engineering. Fall Prof. David R. Jackson Dept. of ECE. Notes 10. Waveguides Part 7: Transverse Equivalent Network (TEN)

Transformations. Ordered set of numbers: (1,2,3,4) Example: (x,y,z) coordinates of pt in space. Vectors

P a g e 5 1 of R e p o r t P B 4 / 0 9

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

ANSWERS TO EVEN NUMBERED EXERCISES IN CHAPTER 2

T h e C S E T I P r o j e c t

Average Case Lower Bounds for Monotone Switching Networks

SLOW INCREASING FUNCTIONS AND THEIR APPLICATIONS TO SOME PROBLEMS IN NUMBER THEORY

ENGR 1990 Engineering Mathematics The Integral of a Function as a Function

Chapter 6. Laplace Transforms

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

Contraction Mapping Principle Approach to Differential Equations

u(t) Figure 1. Open loop control system

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

Section P.1 Notes Page 1 Section P.1 Precalculus and Trigonometry Review

6.8 Laplace Transform: General Formulas

Mid-Term Examination - Spring 2014 Mathematical Programming with Applications to Economics Total Score: 45; Time: 3 hours

4.8 Improper Integrals

Optimally Cutting a Surface into a Disk

Transcription:

ALG 5. low Algorihm: () Mx-flow, min-u Theorem () Augmening Ph () 0 - flow (d) Verex Conneiviy (e) Plnr low Min Reding Seleion: CLR, Chper 7 Algorihm Profeor John Reif Auxillry Reding Seleion: Hndou: "Nework low" Cominoril Opimizion, y Eugene Lwler, Hol, Rinehr, Winon, 976. Nework Definiion: digrph G = ( V, E) diinguihed verie : oure Œ ink Œ edge piie : : EÆR + Ê Revere Edge : E R = revere of edge Á Ë in E u v u v ( u,v ) ( u,v ) R ( u,v ) R = ( v,u ) low f : E» E R ( ) ÆR + " e Œ E " v Œ V - {, } () () () ( V V f ( e) = -f ( e R ) fe ( ) ( e)  v, u ) Œ E fv,u ( )=0

low f Vlue ( f ) =  f (,v ) v Œ V = um of flow from oure u X, X i priion of V where ŒX, ŒX ( ) =  f v,u f X, X v ŒX uœx ( ) Lemm: The flow ro ny u X, X X X proof: Q. E. D. i equl o he vlue( f ). ( ) = f u,v f X, X  ( ) =  f ( v,w) v ŒX uœx =  f ( v,w) = vlue f v,w ŒX ( ) v ŒX w ŒX - 0 = vlue( f ).

reidul piy of edge e: re( e) = e ( ) - f ( e) reidul grph R: ue modified piie e ( ) = re( e) for re( e) > 0 ugmening ph p for flow f i ph in R from o ( ) = min( re( e) ) re p e Œ p Lemm: R h mx flow vlue vlue( f *) - vlue( f ), where f * i he mx flow of G. proof: If f i flow in R, hen f + f i flow of G. Alo, f = f * - f i flow in R. f(e ) f(e ) + e low f on ph p = e reidul re p e ( ) e,e, K,e k f(e ) f(e ) ( ) =D = min( e ( ) - f ( e) ) e eœp f(e ) + f(e ) e k e k k k + Q. E. D. 5 give Augmened flow f + re( p) 6

Sured Edge f= f= f= f= f=0 f= Sured Edge d f= f= Nework wih low Reidul Nework Augmening Ph (,,d,,,) d min u: u of minimum piy mx flow: mx( vlue( f )) f i flow ord - ulkeron : Theorem: The mx flow f i equl o he min u X, X. proof: () If f i mx flow, hen here n e no ugmening ph from o. Le X = verie in V, rehle from in reidul grph R. X = V - X Vlue f  ( ) =  u,v ( ) Q. E. D. ( ) = f u,v uœx v ŒX uœx v ŒX = X, ( X ) () Clerly, f h vlue mo X, X for ny u X, X. X X Cu ( ) 7 8

,,,,,,,,,,,,,,,,,,,,,,,, Mx low = Min Cu = 6 Lemm: A mo E flow ugmenion re required o onru mx. flow. proof: Suppoe f * i mx flow in G. Le G * e ugrph of G wih po. flow. i 0 while $ ph from o do Êi i + Áfind ph p i from o in G * Á Ále D i = min f * ( e) eœp Á i Áfor ll e Œ p do f * ( e) f * ( e) - D i Á Á if f * ( e) 0, hen delee e from G * Á od Á Áod Ë Edge Leled (Cpiy, low) Noe: Delee le on edge per ep! 9 0

Definiion given flow f ured edge e h f ()= e e () loking flow f every ph from o h ured edge ( o n no ugmen flow! ) Ide: Re - roue flow Level Grph L ugrph of R Noe level ()= v lengh of hore ph from o v in R L onin only edge level ( v,u ) Œ R.. ( u)= level ()+ v L give hore ugmening ph Conru L in O( V + E) ime y Bredh ir Serh of R Dini low Algorihm Inpu: nework G = ( V, E),, ( ) Æ R + piie i : E» E R Iniilizion: "e, f ( e) 0 Loop: [] Conru level grph L for f y Bredh ir Serh. [] By ugmenion, find loking flow f in L from f. [] "e, f ( e) f ( e) + f e ( ) [] If i no in level grph, hen reurn f ele go o []

Theorem Dini ' Algorihm hl fer V loking ep. Nework Proof Suppoe f i urren flow wih R = reidul grph (urrenly) level ( v)= min lengh ph from o v in R R' = new reidul grph level' ( v) = min lengh of ph o v in R' d Clim level '( ) > level ( ) Proof (y onrdiion ) If level( ) = level' ( ), hen level ( w)= level( v) + for every edge ( v,w ) ŒL. Thi onrdi he f h one edge i ured (on he loking flow ) on ny ph p in L. Q. E. D., Hene n ep uffie for he lgorihm Level Grph wih Bloking low f= f= f= f= f= f= f=0 f= d level 0 level level level

nd Level Grph wih Bloking low f= f= f= f= d f=0 level 0 level level level rd Level Grph wih Bloking low f= f= f= f= d f= level 0 level level 5 5 6

inl low f= f= f= f= f= f= d f= f= inding Bloking low Preflow j : (Krznov) () Sifie piie' onrin () My hve unlned veriie where Df (u) = f(u,v) >0 u v Wve mehod: - egin wih loking preflow f (ure on edge on every ph o D - lne verie o f (v) = 0 o ge loking flow S ' To lne loked verex v: D Repe (unil f (v) =0) do hooe edge (u,v) wih f(u,v) > 0 deree f(u,v) y min (f(uv), f(v)) D 7 or 8

To emp o lne unloked verex Df ( v) = 0 v: Repe (unil, or here i no n unured edge ( v,w) where wi unloked). do hooe ome uh edge nd deree ( v,w) ( ( ),Df( v) ). fv,w ( ) y min Cv,w ( ) - fv,w Wve Algorihm for Bloking low Iniilize: wih preflow h ure every edge ou of nd oherwie 0. (e ) 0 M (e ) k 0 0 0 9 0

6,6 6,6 6,6 6,5,,, 5,,,, 5,0 Bloked Bloked,,, 5,0,,, 5,0 d Bloked d d d,0,0,0,,0,,0,,,0,,0,,,, e f e f e f e f,,0,,,,,, Inreed low Dereed low Blned d Edge Leled (Cpiy, low) Dereed low Dereed low Blned All Blned Edge Leled (Cpiy, low)

e loked, nd e V - { } ll unloked. Repe unil here re no unlned verie do Inree flow: Sn ll verie eween, in opologil order, lning every verex v h i unlned nd unloked. (If lning fil, mke v loked.) Deree flow: Sn verie in revere opologil order, lning eh verex h i unlned nd loked. Theorem: Wve Algorihm ompue loking flow in O n ( ) ime (nd hene mx flow in ( ) ime). On Proof (ue invrin): () If v loked fi every ph from v o h ured edge. () The preflow onrued y lgorihm re loking. Modify: loked, nd depring edge ured. Induive Sep: () Snning in opologil order in inree flow gurnee no unloked, unlned verie. () Snning in revere opologil order gurenee every loked verex ge lned. Noe: Eh ep lok le verex fi mo n ep flow on edge e inree nd deree mo one fi ol ime ( ) = ( ) OV + E OV

Improved low Algorihm Sleer - Trjn ue d ruure o deree loking flow lgorihm o O( Elog V ) ime, giving... Theorem Mx flow n e ompued in OVE ( logv ) ime. Speil Ce: 0 - low, if "e ŒE,e ( ) = Uni Nework: All piie ŒZ nd every verex v oher hn or h Ïingle enering edge or Ì Óingle depring edge. Clim: If Uni Nework G h mx flow f, hen mx level i Ê V ˆ + Ë vlue f ( ) Proof: G n e deompoed ino vlue( f ) verex - dijoin ph from o. Theorem (Evn nd Trjn ) 0- low require min V, E ( ) loking ep of level o vlue(f) (level-) V Dini' Algorihm, o ol ime O min V, E ( ( )E log( V) ). 5 6

Theorem: Ê Dini Algorihm h O V Ë uni nework. Proof: () If vlue( f ) V fi# ep V ˆ ep on () If vlue( f ) > V fi level V +, V Ê ˆ o # ep O V Ë. Q. E. D. Ê ˆ Tol Time Uni low i O V E log E Ë. ( - ) Verex Sepror S V: if ll ph from o onin v ŒS. Menger Theroem: The ize of he mlle, Verex Sepror S i exly he me he numer of verex dijoin ph from o. : S 7 8

N(u,v) = min verex u ize for (G,u,v) Trnform Verex Conneiviy o Uni Nework low Prolem G undireed Verex Conneiviy: G ( ) G ( ) = { n - if G i omplee grph Min Nu,v ( ) ele u,v Œ V ( u, v) œ E V V' V" o Lemm G ( ) E V Proof Tol Time OV ( Elog( E) ) o ompue - Verex Conneiviy N(,) (from o ). Conneiviy min vœv u  degree( v) = E vœv degree( v), Hene, G ( ) E V N (, ) = numer of dijoin ph from o. 9 Q. E. D. (lo rue for edge onneiviy) 0

Lemm: If S i ( u,v) Verex Sepror wih S = G ( ), hen G ( ) = min N, ( ) for ll ŒV - S (,)œe Ide: Chooe rndom Œ V. Ê Ê O logá ˆ ˆ Á V E log E Ë Ë e Proof: G - S h le - omponen Rndomized Algorihm for Verex Conneiviy (Mehlhorn & Suden) S Le e ny node in omponen of G - S whih doe no hve. Thu, N(,) S = G ( ). Q. E. D. Ide: Chooe rndom ŒV. Inpu: G = ( V, E), error ound, e, 0< e< [0] m V - Ê logá ˆ [] for i =,,... unil i Ë e Ê log V ˆ Á Ë m do ele i ŒV rndom m min ( m,min N( i,)) od [] oupu m ŒV

Theorem: Pro( m π G ( )) e G = ( V, E) i plnr grph if G n e emedded on plne o no wo edge ro. Proof: Le S e Verex Sepror wih S = G ( ). If m> G ( ), hen,,..., k ll elong o S, where ( ) k log e log( V G ( )) Hene, pro ( m > G ( )) = pro (,..., k ŒS) = S k Ê ˆ Á Ë V Ê = G ( ) ˆ Á Ë V k = -log ( e) = log e =e. 0 Dul: DG ( ) =, DE ( ) ( ) = fe of emedding DE ( ) = { i, j } e ŒE i eween i, j { } 0

Lemm: If G i plnr emedded nework, hen mx flow in G i me min o yle in D( G) epring,. Proof: We ume ( i, j ) = e ( ), if e i eween i, j. Then, y min - o u heorem, flow vlue = min u X, X eween, = min o yle in D( G) epring, G i ouerplnr emedded if he plnr emedding h fe 0 iniden o ll verie. 0 Ide: To redue o Min Co Ph Add new edge (, ) wih weigh. Cyle p in D(G) 0 0 ' 5 6

ind min o ph from 0 o 0 in D( G) = min u in G = mx flow vlue in G Theorem: If G i ouerplnr, we n find mx flow in O( VlogV ) ime. Lemm: [Reif] If m(, ) i minimum o ph in D( G) from fe ounding on o fe ounding on, hen ny min o yle in DG ( ) epring, mu onin n edge of m(, ). m(, ) ph (, ) u yle 7 8

Proof Suppoe no. Then we n horu ny yle of D( G) epring, o ge horer one, uing edge of he m (, ) ph. Theorem: [Reif] The min o flow in plnr grph n e ompued in ( ) ime. OVlog V Proof: Ide: ue m(, ) u in D( G) o guide reurive divide nd onquer lgorihm. On eh ep, divide he m(, ) ph in hlf nd olve he prolem on eh hlf, eprely, uing, u epror. O( logv ) Require ep Eh ep OV ( logv ) m(,) ph ime 9 0