Maximm Flo χ 4/6 4/7 1/9 8/2005 4:03 AM Maximm Flo 1
Oline and Reading Flo neork Flo ( 8.1.1) C ( 8.1.2) Maximm flo Agmening pah ( 8.2.1) Maximm flo and minimm c ( 8.2.1) Ford-Flkeron algorihm ( 8.2.2-8.2.3) 8/2005 4:03 AM Maximm Flo 2
Flo Neork A flo neork (or j neork) N coni of A eighed digraph G ih nonnegaie ineger edge eigh, here he eigh of an edge e i called he capaciy c(e) of e To diingihed erice, and of G, called he orce and ink, repeciely, ch ha ha no incoming edge and ha no ogoing edge. Example: 5 6 3 1 1 2 3 7 9 5 8/2005 4:03 AM Maximm Flo 3
Flo A flo f for a neork N i i an aignmen of an ineger ale f(e) o each edge e ha aifie he folloing properie: Capaciy Rle: For each edge e, 0 f (e) c(e) Coneraion Rle: For each erex, here E () and E + () are he incoming and ogoing edge of, rep. The ale of a flo f, denoed f, i he oal flo from he orce, hich i he ame a he oal flo ino he ink Example: 2/6 f ( e) = + 8/2005 4:03 AM Maximm Flo 4 3/7 2/9 e E ( ) 4/5 e E ( ) f ( e)
Maximm Flo A flo for a neork N i aid o be maximm if i ale i he large of all flo for N The maximm flo problem coni of finding a maximm flo for a gien neork N 2/6 3/7 2/9 4/5 Flo of ale 8 = 2 + 3 + 3 = 1 + 3 + 4 Applicaion 4/6 Hydralic yem 3/7 Elecrical circi Traffic moemen 2/9 4/5 Freigh ranporaion Maximm flo of ale 10 = 4 + 3 + 3 = 3 + 3 + 4 8/2005 4:03 AM Maximm Flo 5
C A c of a neork N ih orce and ink i a pariion χ = (V,V ) of he erice of N ch ha V and V Forard edge of c χ: origin in V and deinaion in V Backard edge of c χ: origin in V and deinaion in V Flo f(χ) acro a c χ: oal flo of forard edge min oal flo of backard edge Capaciy c(χ) of a c χ: oal capaciy of forard edge Example: c(χ) = 24 f(χ) = 8 8/2005 4:03 AM Maximm Flo 6 5 6 2/6 χ χ 3 1 1 2 3 7 9 3/7 2/9 5 4/5
Flo and C Lemma: The flo f(χ) acro any c χ i eqal o he flo ale f Lemma: The flo f(χ) acro a c χ i le han or eqal o he capaciy c(χ) of he c Theorem: The ale of any flo i le han or eqal o he capaciy of any c, i.e., for any flo f and any c χ, e hae f c(χ) 2/6 χ 1 χ 2 3/7 2/9 4/5 c(χ 1 ) = 12 = 6 + 3 + 1 + 2 c(χ 2 ) = 21 = 3 + 7 + 9 + 2 f = 8 8/2005 4:03 AM Maximm Flo 7
Agmening Pah Conider a flo f for a neork N Le e be an edge from o : Reidal capaciy of e from o : f (, ) = c(e) f (e) Reidal capaciy of e from o : f (, ) = f (e) Le π be a pah from o The reidal capaciy f (π) of π i he malle of he reidal capaciie of he edge of π in he direcion from o A pah π from o i an agmening pah if f (π) > 0 8/2005 4:03 AM Maximm Flo 8 2/5 2/6 π 2/7 2/9 f (,) = 3 f (,) = 1 f (,) = 1 f (,) = 2 f (π) = 1 f = 7 4/5
Flo Agmenaion Lemma: Le π be an agmening pah for flo f in neork N. There exi a flo f for N of ale f = f + f (π) Proof: We compe flo f by modifying he flo on he edge of π Forard edge: f (e) = f(e) + f (π) Backard edge: f (e) = f(e) f (π) 8/2005 4:03 AM Maximm Flo 9 2/5 2/6 2/6 π π 2/7 2/9 f (π) = 1 2/3 2/7 2/9 4/5 4/5 f = 7 f = 8
Ford-Flkeron Algorihm Iniially, f(e) = 0 for each edge e Repeaedly Search for an agmening pah π Agmen by f (π) he flo along he edge of π A pecialiaion of DFS (or BFS) earche for an agmening pah An edge e i raered from o proided f (, ) > 0 Algorihm FordFlkeronMaxFlo(N) for all e G.edge() eflo(e, 0) hile G ha an agmening pah π { compe reidal capaciy of π } for all edge e π { compe reidal capaciy δ of e } if e i a forard edge of π δ gecapaciy(e) geflo(e) ele { e i a backard edge } δ geflo(e) if δ < δ { agmen flo along π } for all edge e π if e i a forard edge of π eflo(e, geflo(e) + ) ele { e i a backard edge } eflo(e, geflo(e) ) 8/2005 4:03 AM Maximm Flo 10
Max-Flo and Min-C Terminaion of Ford-Flkeron algorihm There i no agmening pah from o ih repec o he crren flo f Define V e of erice reachable from by agmening pah V e of remaining erice C χ = (V,V ) ha capaciy c(χ) = f Forard edge: f(e) = c(e) Backard edge: f(e) = 0 Th, flo f ha maximm ale and c χ ha minimm capaciy Theorem: The ale of a maximm flo i eqal o he capaciy of a minimm c 4/6 χ 4/7 1/9 c(χ) = f = 10 8/2005 4:03 AM Maximm Flo 11
8/2005 4:03 AM Maximm Flo 12 Example (1) 0/3 0/9 0/3 1/7 0/6 0/5 0/2 0/9 0/3 1/7 0/6 1/2 0/9 0/3 2/7 1/6 1/2 2/3 0/9 2/7 1/6 1/2
Example (2) 3/6 2/3 1/2 2/7 0/9 4/6 3/7 1/9 2/5 1/2 o ep 3/6 4/6 2/7 1/9 2/5 1/2 4/7 1/9 8/2005 4:03 AM Maximm Flo 13
Analyi In he or cae, Ford- Flkeron algorihm perform f* flo agmenaion, here f* i a maximm flo Example The agmening pah fond alernae beeen π 1 and π 2 The algorihm perform 100 agmenaion Finding an agmening pah and agmening he flo ake O(n + m) ime The rnning ime of Ford- Flkeron algorihm i O( f* (n + m)) 8/2005 4:03 AM Maximm Flo 14 0/50 0 0/50 0 π 1 π 2 0 0 0 0