CSC 373: Algorihm Deign n Anlyi Leure 9 Alln Boroin Jnury 28, 2013 1 / 16
Leure 9: Announemen n Ouline Announemen Prolem e 1 ue hi Friy. Term Te 1 will e hel nex Mony, Fe in he uoril. Two nnounemen o follow ou hooing CS Fou n pplying o Grue Shool. Toy ouline Sr flow nework For Fulkeron n ugmening ph For Fulkeron lol erh lgorihm 2 / 16
Chooing fou in CS CHOOSE YOUR OWN ADVENTURE: UNDERSTANDING THE CONCENTRATIONS FOCUSES THURSDAY, FEBRUARY 7, 2013 11:00 m 1:00pm ROOM: BA1180 HUMAN-COMPUTER INTERACTION, COMPUTER SYSTEMS, GAME DESIGN... So mny hoie! Fin ou wh eh Fou i ou n where i migh ke you. Ge your queion nwere y fuly exper in eh Fou re. For queion, on ugliion@.orono.eu. 3 / 16
Thinking ou Grue Shool? GRAD SCHOOL INFO SESSION TUESDAY, FEBRUARY 12, 2013 11:00 m 1:00pm ROOM: BA2135 THINKING ABOUT GRAD SCHOOL? Ge ome nwer! Wh i gr hool i like? How o I pply? How n I prepre n unergrue uen? How n I give myelf he e ege n ge ino he hool of my rem! For queion, on ugliion@.orono.eu. / 16
Flow nework I will e following our ol CSC36 leure noe for he i efiniion n reul onerning he ompuion of mx flow. We follow he onvenion of llowing negive flow. While inuiively hi my no eem o nurl, i oe implify he evelopmen. The DPV n KT ex ue he perhp more nr onvenion of ju hving non-negive flow. Definiion A flow nework (more uggeive o y piy nework) i uple F = (G,,, ) where G = (V, E) i iireionl grph he oure n he erminl re noe in V he piy : E R 0 5 / 16
Wh i flow? A flow i funion f : E R ifying he following properie: 1 Cpiy onrin: for ll (u, v) E, 2 Skew ymmery: for ll (u, v) E, f (u, v) (u, v) f (u, v) = f (v, u) 3 Flow onervion: for ll noe u (exep for n ), Noe v N(u) f (u, v) = 0 Coniion 3 i he flow in = flow ou onrin if we were uing he onvenion of only hving non-negive flow. 6 / 16
An exmple 1/1 13/20 17/22 1/10 1/ /8 7/7 8/13 / 11/15 The noion x/y on n ege (u, v) men x i he flow, i.e. x = f (u, v) y i he piy, i.e. x = (u, v) 7 / 16
An exmple of flow onervion 1/1 13/20 17/22 1/10 1/ /8 7/7 8/13 / 11/15 For noe : f (, ) + f (, ) + f (, ) = 13 + ( 1) + 1 = 0 8 / 16
An exmple of flow onervion 1/1 13/20 17/22 1/10 1/ /8 7/7 8/13 / 11/15 For noe : f (, ) + f (, ) + f (, ) = 13 + ( 1) + 1 = 0 For noe : f (, ) + f (, ) + f (, ) + f (, ) = 1 + + ( 7) + 17 = 0 8 / 16
The mx flow prolem The mx flow prolem Given nework flow, he gol i o fin vli flow h mximize he flow ou of he oure noe. A we will ee hi i lo equivlen o mximizing he flow in o he erminl noe. (Thi houl no e urpriing flow onervion ie h no flow i eing ore in he oher noe.) We le vl(f ) enoe he flow ou of he oure for given flow f. We will uy he For-Fulkeron ugmening ph heme for ompuing n opiml flow. I m lling i heme here re mny wy o innie hi heme lhough I on view i generl prigm in he wy I view (y) greey n DP lgorihm. 9 / 16
So why uy For-Fulkeron? Why o we uy he For-Fulkeron heme if i i no very generi lgorihmi pproh? A in DPV ex, mx flow prolem n lo e repreene liner progrm (LP) n ll LP n e olve in polynomil ime. I view For-Fulkeron n ugmening ph n imporn exmple of lol erh lgorihm lhough unlike mo lol erh lgorihm we oin n opiml oluion. The opi of mx flow (n vriou generlizion) i imporn eue of i immeie ppliion n mny ppliion of mx flow ype prolem o oher prolem (e.g. mx iprie mhing). Th i mny prolem n e polynomil ime rnforme/reue o mx flow (or one of i generlizion). One migh refer o ll hee ppliion flow e meho. 10 / 16
A flow f n i reiul grph Noe Given ny flow f for flow nework F = (G,,, ), we efine he reiul grph G f = (V, E f ), where V i he e of verie of he originl flow nework F E f i he e of ll ege e hving poiive reiul piy f (e) = (e) f (e) > 0. Noe h (e) f (e) 0 for ll ege y he piy onrin. Wih our onvenion of negive flow, even zero piy ege (in G) n hve reiul piy. The i onep unerlying he For-Fulkeron lgorihm i n ugmening ph whih i n - ph in G f. Suh ph n e ue o ugmen he urren flow f o erive eer flow f. 11 / 16
An exmple of reiul grph 1/1 13/20 17/22 1/10 1/ /8 7/7 8/13 / 11/15 The previou nework flow 7 11 3 1 7 5 5 11 The reiul grph 12 / 16
The reiul piy of n ugmening ph Given n ugmening ph π in G f, we efine i reiul piy f (π) o e he min{(e) f (e) e π} Noe: he reiul piy of n ugmening ph i ielf i greer hn 0 ine every ege in he ph h poiive reiul piy. Queion: How woul we ompue n ugmening ph of mximum reiul piy? 13 / 16
Uing n ugmening ph o improve he flow We n hink of n ugmening ph efining flow f π (in he reiul nework ): f (π) if (u, v) π f π (u, v) = f (π) if (v, u) π 0 oherwie Clim f = f + f π i flow in F n vl(f ) > vl(f ) 1 / 16
Deriving eer flow uing n ugmening ph 13/20 1/1 17/22 7 1 5 1/10 1/ /8 7/7 11 3 7 8/13 / 11/15 The originl nework flow 5 11 An ugmening ph π wih f (π) = 15 / 16
Deriving eer flow uing n ugmening ph 13/20 1/1 17/22 7 1 5 1/10 1/ /8 7/7 11 3 7 8/13 / 11/15 The originl nework flow 1/1 5 11 An ugmening ph π wih f (π) = 17/20 21/22 3/10 3/ 0/8 7/7 8/13 / 11/15 The upe flow whoe vlue = 25 15 / 16
Deriving eer flow uing n ugmening ph 13/20 1/1 17/22 7 1 5 1/10 1/ /8 7/7 11 3 7 8/13 / 11/15 The originl nework flow 1/1 17/20 21/22 3/10 3/ 0/8 7/7 8/13 / 11/15 The upe flow whoe vlue = 25 5 11 An ugmening ph π wih f (π) = 3 5 7 7 8 1 11 Upe re. grph wih no ug. ph 15 / 16 7 1
The For-Fulkeron heme The For-Fulkeron heme 1: /* Iniilize */ 2: f := 0 3: G f := G : while here i n ugmening ph π in G f o 5: f := f + f π /* Noe hi lo hnge G f */ 6: en while Noe I ll hi heme rher hn n lgorihm ine we hven i how one hooe n ugmening ph ( here n e mny uh ph) 16 / 16