Graph III - Nework Flow
Flow nework eup graph G=(V,E) edge capaciy w(u,v) 0 - if edge doe no exi, hen w(u,v)=0 pecial verice: ource verex ; ink verex - no edge ino and no edge ou of Aume every verex v i on a pah from ource o ink ( v ) - verice v ha are no on uch pah can be ignored (deleed) along wih all connecing edge
Flow nework flow i a funcion f:vxv->r uch ha - flow from u o v: f(u,v) w(u,v) - ymmery f(u,v) = -f(v,u) - flow i conerved on all node excep ource and ink X vv f(u, v) =0 oal flow (from he orce)
Maximum Flow Problem deermine he flow f ha realize he maximum oal flow
More on Flow f(u,u)=0 oal ne flow ino/ou-o a verex i 0 X vv f(v, u) =0 - excep for ource and ink if edge (u,v) i miing in G, here can be no ne flow from u o v
More on Flow poiive ne flow enering v X uv ;f(u,v)>0 f(u, v) poiive ne flow leaving v hee wo are equal X f(v, u) uv ;f(v,u)>0
Cancellaion poiive flow on (u,v) cancel poiive flow on (v,u) unil only one i poiive (he oher become 0) - boh flow decreae, o hey ill aify capaciy conrain - flow conervaion aified ince boh flow reduced by he ame amoun
Ford-Fulkeron wan he max flow for ource o ink - a cla of algorihm, no a ingle one iniialize flow wih O; repea find an augmening pah from o (ha admi more flow) end more flow on ha pah unil no augmening pah exi have o prove ha hi erminaion condiion implie he flow i max. - if an augmening pah exi, ending more flow o i increae he value of he exiing flow
Reidual nework afer ending ome flow on a pah from o, he graph eenially change - exiing flow edge will have a differen capaciy in he reidual nework (becaue he flow ue ome) - new edge can appear (in red) : he poibiliie of revering he exiing flow
Reidual nework reidual capaciy of edge (u,v) : r(u,v) = w(u,v)-f(u,v) reidual nework R induced by f i given by he e of edge alo called R wih poiive reidual capaciy - edge e R = { (u,v) : r(u,v)>0 } noe ha ome new edge appear! u 3 v - example (u,v) E; w(u,v)=3, f(u,v)= - hen r(u,v) = 3- = - edge (v,u) no in he original graph u v - bu r(v,u) = 0 - f(v,u) = 0- (-)=; herefore edge (v,u) i now par of he reidual nework. edge (v,u) can be par of he reidual newwork only if eiher (u,v) or (v,u) are edge in he original graph - hu R E
Augmening pah any pah p= -> in he reidual nework R he reidual capaciy of he pah p i he minimum ( boleneck ) edge reidual capaciy - r(p) = min { r(u,v) : (u,v) p } add he pah p a addiional flow f p of ize r(p) - o he exiing flow f ha creaed R - new flow f = f + f p - increae he flow oal by r(p). Proof in he book.
Cu in flow nework Cu C = (S,T) i a pariion of verice - S T=V ; S T= ; S=V T - S conain he ource and T conain he ink S; T Ne flow acro cu i f(s,t), he um of all flow on edge from S o T f(s,t)=3 ; w(s,t)=5 capaciy of a cu i he um of edge capaciy from S o T
Max Flow - Min Cu heorem (S,T) i a cu, f a flow wih oal value f. Then - f(s,t) = f (he oal flow value) - conequenly f w(s,t) : flow value i maller han he capaciy of any cu MAX-FLOW MIN-CUT heorem. The following are equivalen: - (a) f i a max flow - (b) reidual nework R=R f ha no augmening pah - (c) here i a cu (S,T) uch ha f = w(s,t)
Max Flow - Min Cu proof inuiion (a)=>(b) already dicued (b)=>(c): conider S = { v pah v in reidual R} - S - T =V S; T. If S, hen here would be a augmening pah in R - R can have an edge (v S, u T) becaue ha would mean u S - hu exiing flow aurae he cu (S,T) v v v impoible v u u u (c)=>(a): no flow can be bigger han capaciy of a cu, o f mu be a maximum flow (ince i aurae he cu decribed above)
Ford-Fulkeron for each edge (u,v) ini: f(u,v)=0; f(v,u)=0 R = G while exi pah p( )in reidual R c(p) = min { r(u,v); (u,v) p }//pah capaciy, ued a new flow for each (u,v) p f(u,v) = f(u,v) + c(p) ; f(v,u)= - f(u,v) recompue reidual nework R=Rf
Ford-Fulkeron Running ime wih ineger capaciie - fing a pah in R i O(E) (ay wih DFS) - f =oal flow value - a mo f ieraion; every ieraion increae he flow by or more - oal O(E* f ) problem: f can be very large, hu he algorihm very low - for real-value edge cacpaciie, Ford-Fulkeron can be arbirary low
Ford-Fulkeron Running ime wih ineger capaciie - fing a pah in R i O(E) (ay wih DFS) - f =oal flow value - a mo f ieraion; every ieraion increae he flow by or more - oal O(E* f ) problem: f can be very large, hu he algorihm very low - for real-value edge cacpaciie, Ford-Fulkeron can be arbirary low
Ford-Fulkeron Running ime wih ineger capaciie - fing a pah in R i O(E) (ay wih DFS) - f =oal flow value - a mo f ieraion; every ieraion increae he flow by or more - oal O(E* f ) problem: f can be very large, hu he algorihm very low - for real-value edge cacpaciie, Ford-Fulkeron can be arbirary low
Ford-Fulkeron Running ime wih ineger capaciie - fing a pah in R i O(E) (ay wih DFS) - f =oal flow value - a mo f ieraion; every ieraion increae he flow by or more - oal O(E* f ) problem: f can be very large, hu he algorihm very low - for real-value edge cacpaciie, Ford-Fulkeron can be arbirary low
Ford-Fulkeron Running ime wih ineger capaciie - fing a pah in R i O(E) (ay wih DFS) - f =oal flow value - a mo f ieraion; every ieraion increae he flow by or more - oal O(E* f ) problem: f can be very large, hu he algorihm very low - for real-value edge cacpaciie, Ford-Fulkeron can be arbirary low
Ford-Fulkeron Running ime wih ineger capaciie - fing a pah in R i O(E) (ay wih DFS) - f =oal flow value - a mo f ieraion; every ieraion increae he flow by or more - oal O(E* f ) problem: f can be very large, hu he algorihm very low - for real-value edge cacpaciie, Ford-Fulkeron can be arbirary low
Ford-Fulkeron Running ime wih ineger capaciie - fing a pah in R i O(E) (ay wih DFS) - f =oal flow value - a mo f ieraion; every ieraion increae he flow by or more - oal O(E* f ) problem: f can be very large, hu he algorihm very low - for real-value edge cacpaciie, Ford-Fulkeron can be arbirary low
Ford-Fulkeron Running ime wih ineger capaciie - fing a pah in R i O(E) (ay wih DFS) - f =oal flow value - a mo f ieraion; every ieraion increae he flow by or more - oal O(E* f ) problem: f can be very large, hu he algorihm very low - for real-value edge cacpaciie, Ford-Fulkeron can be arbirary low
Ford-Fulkeron Running ime wih ineger capaciie - fing a pah in R i O(E) (ay wih DFS) - f =oal flow value - a mo f ieraion; every ieraion increae he flow by or more - oal O(E* f ) problem: f can be very large, hu he algorihm very low - for real-value edge cacpaciie, Ford-Fulkeron can be arbirary low
Ford-Fulkeron Running ime wih ineger capaciie - fing a pah in R i O(E) (ay wih DFS) - f =oal flow value - a mo f ieraion; every ieraion increae he flow by or more - oal O(E* f ) problem: f can be very large, hu he algorihm very low - for real-value edge cacpaciie, Ford-Fulkeron can be arbirary low
Ford-Fulkeron Running ime wih ineger capaciie - fing a pah in R i O(E) (ay wih DFS) - f =oal flow value - a mo f ieraion; every ieraion increae he flow by or more - oal O(E* f ) problem: f can be very large, hu he algorihm very low - for real-value edge cacpaciie, Ford-Fulkeron can be arbirary low 997 3 3 997
Ford-Fulkeron Running ime wih ineger capaciie - fing a pah in R i O(E) (ay wih DFS) - f =oal flow value - a mo f ieraion; every ieraion increae he flow by or more - oal O(E* f ) problem: f can be very large, hu he algorihm very low - for real-value edge cacpaciie, Ford-Fulkeron can be arbirary low 997 3 3 997
Edmond-Karp ame a FF, bu find he augmening pah wih BFS for each edge (u,v) ini: f(u,v)=0; f(v,u)=0 R = G while BFS find pah p( )in reidual R c(p) = min { r(u,v); (u,v) p }//pah capaciy, ued a new flow for each (u,v) p f(u,v) = f(u,v) + c(p) ; f(v,u)= - f(u,v) recompue reidual nework R=Rf
Analyi of Edmond-Karp BFS will find he augmening pah wih fewe number of edge noe ha previu oy bad example would find max flow afer wo ieraion
Analyi of Edmond-Karp BFS will find he augmening pah wih fewe number of edge noe ha previu oy bad example would find max flow afer wo ieraion
Analyi of Edmond-Karp BFS will find he augmening pah wih fewe number of edge noe ha previu oy bad example would find max flow afer wo ieraion
Analyi of Edmond-Karp BFS will find he augmening pah wih fewe number of edge noe ha previu oy bad example would find max flow afer wo ieraion
Analyi of Edmond-Karp BFS will find he augmening pah wih fewe number of edge noe ha previu oy bad example would find max flow afer wo ieraion
Analyi of Edmond-Karp How many augmening pah can EK find? - augmening pah p ha criical edge (u,v), if (u,v) i he minimum reidual capaciy edge on he pah - any edge can be criical a mo V ime during EK. Proof in he book - here are E edge, o a mo V * E criical edge for he enire execuion - hu a mo O(VE) augmening pah (each pah ha a lea one criical edge) BFS ake O(E) o find each augmening pah oal O(VE )
Puh-Relabel (Opional reading) Advanced maerial no covered - opional reading from book inuiion : flood he nework, uing verex heigh - node can accumulae flow - he more flow hey accumulae, he higher hey go - flow goe downhill pracical / fa implemenaion: O(V 3 ) running ime.