Paths, cycles and flows in graphs

Size: px
Start display at page:

Download "Paths, cycles and flows in graphs"

Transcription

1 Chptr 6 Pth, yl n flow in grph Suppo you wnt to fin hortt pth from givn trting point to givn tintion. Thi i ommon nrio in rivr itn ytm (GPS) n n mol on of th mot i omintoril optimiztion prolm, th hortt pth prolm. In thi hptr, w introu irt grph, hortt pth n flow in ntwork. W fou in prtiulr on th mximum-flow prolm, whih i linr progrm tht w olv with irt mtho, vru th implx mtho, n nlyz th running tim of th irt mtho. 6.1 Growth of funtion In th nlyi of lgorithm, it i mor pproprit to invtigt th ymptoti running tim of n lgorithm pning on th input n not th pri running tim itlf. W rviw th O,Ω n Θ-nottion. Dfinition 6.1 (O, Ω, Θ-nottion). Lt T, f : N N two funtion T (n) i in O(f (n)), if thr xit poitiv ontnt n o N n R >0 with T (n) f(n) for ll n n 0. T (n) i in Ω(f (n)), if thr xit ontnt n o N n R >0 with T (n) f(n) for ll n n 0. T (n) i in Θ(f (n)) if T (n) i oth in O(f (n)) n in Ω(f (n)). Exmpl 6.1. Th funtion T (n)=n + n+ 1 i in O(n ), in for ll x 1 on h n + n+ 1 6n. Hr n 0 = 1 n = 6. Similrly T (n) = Ω(n ), in for h n 1 on h n + n+ 1 n. Thu T (n) i in Θ(n ). 55

2 56 6. Grph Dfinition 6.. A irt grph i tupl G = (V, A), whr V i finit t, ll th vrti of G n A (V V ) i th t of r of G. W not n r y it two fining no (u, v) A. Th no u n v r ll til n h of th r (u, v) rptivly. u v z x y Fig. 6.1: Exmpl of irt grph with 5 no n 7 r. Dfinition 6. (Wlk, pth, itn). A wlk i qun of th form P = (v 0, 1, v 1,..., v m 1, m, v m ), whr i = (v i 1, v i ) A for i = 1,...,m. If th no v 0,..., v m r ll iffrnt, thn P i pth. Th lngth of P i m. Th itn of two no u n v i th lngth of hortt pth from u to v. It i not y (u, v). Exmpl 6.. Th following i wlk n pth of th grph in Figur 6.1. u,(u, z), z,(z, x), x,(x,u),u,(u, z), z,(z, y), y u,(u, z), z,(z, y), y 6. Rprnting grph n omputing th itn of two no W rprnt grph with n vrti n rry A[v 1,..., v n ], whr th ntry A[v i ] i pointr to link lit of vrti, th nighor of v i. N (v i ) = {u V : (v i,u) A}. W nxt ri vry i lgorithm, whih omput th itn from V to ll othr no. W lt V i V th t of vrti whih hv itn i from. Lmm 6.1. For i = 0,...,n 1, th t V i+1 i qul to th t of vrti v V \(V 0 V i ) uh tht thr xit n r (u, v) A with u V i.

3 57 u v x y z z u u x x y y Fig. 6.: Ajny lit rprnttion of th grph in Figur 6.1. Proof. Suppo tht v V 0 V i n thr xit n r uv A with u V i. Sin u V i, thr xit pth, 1, v 1,, v,..., i,u of lngth i from to u. Th qun, 1, v 1,, v,..., i,u,uv, v i pth of lngth i+1 from to v n thu v V i+1. If, on th othr hn, v V i+1, thn thr xit pth, 1, v 1,..., i, v i, i+1, v of lngth i+ 1 from to v. W n to how tht v i V i hol. Clrly, in thr xit pth of lngth i from to v i, on h v i V j with j i. If j < i, thn thr xit pth, 1, v 1,..., j, v i of lngth j whih n xtn to pth of lngth j + 1<i+ 1 from to v, 1, v 1,..., j, v i, i+1, v whih ontrit v V i+1. W now ri th rth-firt rh lgorithm, tht omput th itn from trting vrtx to ll othr vrti v V. Th lgorithm mintin rry D[v 1 =, v,..., v n ] π[v 1 =, v,..., v n ] n quu Q whih ontin only in th ginning. Th rry D ontin t trmintion of th lgorithm th itn from to ll othr no n i initiliz with [0,,..., ]. Th rry π ontin pror informtion for hortt pth, in othr wor, whn th lgorithm trmint, π[v]=u, whr uv i n r n D[u]+1= D[v]. Th rry π i initiliz with [0,...,0]. Aftr thi initiliztion, th lgorithm pro follow. whil Q u := h(q) for h v N (u) if (D[v]= ) π[v] := u

4 58 D[v] := D[u]+1 nquu(q, v) quu(q) Hr th funtion h(q) rturn th nxt lmnt in th quu n quu(q) rmov th firt lmnt of Q, whil nquu(q, v) v to th quu lt lmnt. Lmm 6.. Th rth-firt rh lgorithm ign itn ll D orrtly. Proof. Lt v V. W how y inution on (, v) tht th ll r orrtly ign. If (, v) = 0, thn = v n D[v] = 0. If (, v) = 1, thn v i nighor of n D[v]=1 i t orrtly in th firt itrtion of th whil loop. Lt (, v)> 1. Thn thr xit u, v with (,u)=(, v) 1 n uv A. By inution, th ll D[u] = (, u) i t orrtly y th rth-firt-rh lgorithm. Alo, in th rth-firt-rh lgorithm omput for v pth of lngth D[v] from to v, th no v riv ll whih i grtr thn or qul to (, v). If w onir th qun (ovr tim) of ign ll, tht rthfirt-rh i igning, thn it i y to tht thi qun i monotonouly inring, xri 6. Th no v i thu xplor t th ltt, whn u i quu. Thi how tht th ll of v, D[v] i ign orrtly. Dfinition 6.4 (Tr). A irt tr i irt grph T = (V, A) with A = V 1 n thr xit no r T uh tht thr xit pth from r to ll othr no of T. Lmm 6.. Conir th rry D n π ftr th trmintion of th rth-firtrh lgorithm. Th grph T = (V, A ) with V = {v V : D[v] < } n A = {π(v)v : 1 D[v]< } i tr. Dfinition 6.5. Th tr T from ov i th hortt-pth-tr of th (unwight) irt grph G = (V, A). Thorm 6.1. Th rth-firt-rh lgorithm run in tim O( V + A ). Proof. Eh vrtx i quu n quu t mot on. Th quuing oprtion tk ontnt tim h. Thu quuing n quuing ot O( V ) in totl. Whn vrtx u i quu, it nighor r inpt n th oprtion in th if ttmnt ot ontnt tim h. Thu on h n itionl ot of O( A ), in th ontnt-tim oprtion r rri out for h r A. 6.4 Shortt Pth Dfinition 6.6 (Cyl). A wlk in whih trting no n n-no gr i ll yl.

5 59 () Th rth-firt rh lgorithm trt with th quu Q = []. Th itn ll for [,,,,,] r [0,,,,, ] rptivly. () Aftr th firt itrtion of th whil loop th quu i Q = [,] n th itn ll r [0,1,,1,, ] rptivly. () Aftr th on itrtion of th whil loop th quu i Q = [,] n th itn ll r [0,1,,1,, ] rptivly. () Aftr th thir itrtion of th whil loop th quu i Q = [] n th itn ll r unhng, in o not hv ny nighor. () Aftr th fourth itrtion of th whil loop th quu i Q = [,] n th itn ll r [0,1,,1,,] rptivly. (f) Aftr th ixth itrtion of th whil loop th quu i mpty Q = [] n th itn ll rmin unhng. Th lu g not th hortt pth tr. Fig. 6.: An xmpl-run of rth-firt rh Suppo w r givn irt grph D = (V, A) n lngth funtion : A R. Th lngth of wlk W i fin (W )= (). A W W now tuy how to trmin hortt pth in th wight grph D ffiintly, in of th n of yl of ngtiv lngth.

6 60 Thorm 6.. Suppo tht h yl in D h non-ngtiv lngth n uppo thr xit n t-wlk in D. Thn thr xit pth onnting with t whih h minimum lngth mong ll wlk onnting n t. Proof. If thr xit n t-wlk, thn thr xit n t-pth. Sin th numr of r in pth i t mot A, thr mut xit hortt pth P onnting n t. W lim tht (P) (W ) for ll t-wlk W. Suppo tht thr xit n t-wlk W with (W ) < (P). Thn lt W uh wlk with minimum numr of r. Clrly W ontin yl C. If th yl h nonngtiv lngth, thn it n rmov from W to otin wlk who lngth i t mot (W ) n who numr of r i tritly l thn C. W u th nottion W, C, P to not th numr of r in wlk W yl C or pth P. A onluion w n not hr: If thr o not xit ngtiv yl in D, n n t r onnt, thn thr xit hortt wlk trvring t mot V 1 r. Th Bllmn-For lgorithm Lt n= V. W lult funtion f 0, f 1,..., f n : V R { } uivly y th following rul. i) f 0 ()=0, f 0 (v)= for ll v ii) For k < n if f k h n foun, omput for ll v V. f k+1 (v)=min{f k (v), min (u,v) A {f k (u)+(u, v)}} Thorm 6.. For h k = 0,...,n n for h v V f k (v)=min{(p): P i n v-wlk trvring t mot k r}. Corollry 6.1. If D = (V, A) o not ontin ngtiv yl w.r.t., thn f n (v) i qul to th lngth of hortt v-pth. Th numr f n (v) n omput in tim O( V A ). Corollry 6.. In tim O( V A ) on n tt whthr D = (V, A) h ngtiv yl w.r.t. n vntully rturn on.

7 () Th lgorithm i initiliz with itn ll for,,,,, ing [0,,,,, ] rptivly () Aftr th firt itrtion th ll r [0,,,4,, ] () Aftr th on itrtion th ll r [0,,4,4,, ] () Aftr th thir itrtion th ll r [0,,4,,7,6] () Aftr th fourth itrtion th ll r [0,,4,,7,4] (f) Aftr th fifth itrtion th ll r unhng. Th hortt pth itn hv n omput. Fig. 6.4: An xmpl-run of th Bllmn-For lgorithm. Th lu g rprnt th tr who pth hv th orrponing lngth. 6.5 Mximum t -flow W now turn our ttntion to linr progrmming prolm whih w will olv y irt mtho, motivt y th ntur of th prolm. W oftn u th following nottion. If f : A B not funtion n if U A, thn f (U ) i fin f (U )= U f (). Dfinition 6.7 (Ntwork, t-flow). A ntwork with piti onit of irt impl grph D = (V, A) n pity funtion u : A R 0. A funtion f : A R 0 i ll n t-flow, if δ out (v) f ()= δ i n (v) f (), for ll v V {, t}, (6.1)

8 6 whr, t V. Th flow i fil, if f () u() for ll A. Th vlu of f i fin v lu(f )= δ out () f () δ i n () f (). Th mximum t-flow prolm i th prolm of trmining mximum fil t-flow. Hr, for U V, δ in (U ) not th r whih r ntring U n δ out (U ) not th r whih r lving U. Ar t of th form δ out (U ) r ll ut of D. Th pity of ut u(δ out (U )) i th um of th piti of it r. Thu th mximum flow prolm i linr progrm of th form mx δ out () δ out (v) x() δ i n () x() = δ i n (v) x() (6.) x(), for ll v V {, t} (6.) x() u(), for ll A (6.4) x() 0, for ll A (6.5) Dfinition 6.8 (x funtion). For ny f : A R, th x funtion i th funtion x f : V R fin y x f (U )= δ i n (U ) f () δ out (U ) f (). Thorm 6.4. Lt D = (V, A) igrph, lt f : A R n lt U V, thn x f (U )= x f (v). (6.6) v U Proof. An r whih h oth npoint in U i ount twi with iffrnt priti on th right, n thu nl out. An r whih h it til in U i utrt on on th right n on on th lft. An r whih h it h in U i on on th right n on on th lft. A ut δ out (U ) with U n t U i ll n t-ut. Thorm 6.5 (Wk ulity). Lt f fil t-flow n lt δ out (U ) n t-ut, thn v lu(f ) u(δ out (U )). Proof. v lu(f )= x f ()= x f (U )= f (δ out (U )) f (δ in (U )) f (δ out (U )) u(δ out (U )). For n r = (u, v) A th r 1 not th r (v,u). Dfinition 6.9 (Riul grph). Lt f : A R, n u : A R whr 0 f u. Conir th t of r A f = { A, f ()<u()} { 1 A, f ()>0}. (6.7) Th igrph D(f )=(V, A f ) i ll th riul grph of f (for piti u). Corollry 6.. Lt f fil t-flow n uppo tht D(f ) h no pth from to t, thn f h mximum vlu.

9 Proof. Lt U th t of no whih r rhl in D(f ) from. Clrly δ out (U ) i n t-ut. Now v lu(f )= f (δ out (U )) f (δ in (U ). Eh r lving U i not n r of D(f ) n thu f (δ out (U ))=u(δ out (U )). Eh r ntring U o not rry ny flow n thu f (δ in (U )=0. It follow tht v lu(f ) = u(δ out (U )) n f i optiml y Thorm 6.5. Dfinition 6.10 (unirt wlk). An unirt wlk i qun of th form P = (v 0, 1, v 1,..., v m 1, m, v m ), whr i A for i = 1,...,m n i = (v i 1, v i ) or i = (v i, v i 1 ). If th no v 0,..., v m r ll iffrnt, thn P i n unirt pth. Any irt pth P in D(f ) yil n unirt pth in D. Dfin for uh pth P th vtor χ P {0,±1} A 1 if P trvr, χ P ()= 1 if P trvr 1, 0 if P trvr nithr or 1. 6 (6.8) Thorm 6.6 (mx-flow min-ut thorm, trong ulity). Th mximum vlu of fil t-flow i qul to th minimum pity of n t ut. Proof. Lt f mximum t-flow. Conir th riul grph D(f ). If thi riul grph ontin n t-pth P, thn w n rout flow long thi pth. Mor prily, thr xit n ǫ>0 uh tht f +ǫχ P i fil. W hv v lu(f + ǫχ P )= v lu(f )+ǫ. Thi ontri th mximlity of f thu thr xit no tpth in D(f ). Lt U th no rhl from in D(f ). Thn v lu(f )=u(δ out (U )) n δ out (U ) i n t-ut of minimum pity y th wk ulity thorm. Thi uggt th lgorithm of For n Fulkron to fin mximum flow. Strt with f = 0. Nxt itrtivly pply th following flow ugmnttion lgorithm. Lt P irt t-pth in D(f ). St f f + ǫχ P, whr ǫ i lrg poil to mintin 0 f u. Exri 6.1. Dfin riul pity for D( f ). Thn trmin th mximum ǫ uh tht 0 f u. Thorm 6.7. If ll piti r rtionl, thi lgorithm trmint.

10 64 u M M 1 t M M v Th xmpl ov how tht, if th ugmnting pth r hon in ivntgou wy, thn th For-Fulkron lgorithm my tk Ω(M) itrtion, whr M i th lrgt pity in th ntwork. Thi hppn if ll ugmnting pth u th r uv or vu rptivly in th riul ntwork. Corollry 6.4 (intgrity thorm). If u() N for h A, thn thr xit n intgr mximum flow (f () N for ll A). Proof. Thi follow from th ft tht th riul piti rmin intgrl n thu th ugmnt flow i lwy intgrl. Thorm 6.8. If w hoo in h itrtion hortt t-pth in D(f ) flowugmnting pth, th numr of itrtion i t mot V A. Dfinition Lt D = (V, A) igrph,, t V n lt µ(d) not th lngth of hortt pth from to t. Lt α(d) not th t of r ontin in t lt on hortt t pth. Thorm 6.9. Lt D = (V, A) igrph n, t V. Dfin D = (V, A α(d) 1 ). Thn µ(d)=µ(d ) n α(d)=α(d ). Proof. It uffi to how tht µ(d) n α(d) r invrint if w 1 to D for on r α(d). Suppo not, thn thr i irt t-pth P 1 trvring 1 of lngth t mot µ(d). A α(d) thr i pth P trvring of lngth µ(d). If w follow P until th til of i rh n from thron follow P 1, w otin nothr t pth P in D. Similrly if w follow P 1 until th h of i rh n thn follow P, w otin fourth t pth P 4 in D. Howvr P or P 4 h lngth l thn µ(d). Thi i ontrition. Proof (of Thorm 6.8). Lt u ugmnt flow f long hortt t-pth P in D(f ) otining flow f. Th riul grph D f i ugrph of D = (V, A f α(d(f )) 1 ). Hn µ(d f ) µ(d )=µ(d(f )). If µ(d f )=µ(d(f )), thn α(d f ) α(d )=α(d(f )). At lt on r of P o not long to D f, (th r of minimum riul pity!) thu th inluion i trit. Sin µ(d( f )) inr t mot V tim n, long µ(d(f )) o not hng, α(d(f )) r t mot A tim, w hv th thorm.

11 65 In th following lt m= A n n= V. Corollry 6.5. A mximum flow n foun in tim O(n m ). 6.6 Minimum ot ntwork flow, MCNFP In ontrt to th mximum t-flow prolm, th gol hr i to rout flow, whih om from vrl our n ink through ntwork with piti n ot in uh wy, tht th totl ot i minimiz. Exmpl 6.. Suppo you r givn irt grph with r wight D = (V, A), : A R 0 n your tk i to omput hortt pth from prtiulr no to ll othr no in th grph n um tht uh pth xit. Thn on n mol thi MCNFP y ning flow of vlu V 1 into th our no n y ltting flow of vlu 1 lv h no. Th ot on th r r fin y. Th r hv infinit piti. W will ltr, tht thi minimum ot ntwork flow prolm h n intgrl olution whih orrpon to th hortt pth from to ll othr no. 1/ /4 1/ / / 7/ Fig. 6.5: A Ntwork with in/out-flow, ot n piti n fil flow of ot 1.

12 66 Hr i forml finition of minimum ot ntwork flow prolm. In thi nottion, vrti r inx with th lttr i, j,k n r r not y thir til n h rptivly, for xmpl (i, j ) not th r from i to j. A ntwork i now irt grph D = (V, A) togthr with pity funtion u : A Q 0, ot funtion : A Q n n xtrnl flow : V Q. Th vlu of (i ) not th mount of flow whih om from th xtrior. If (i )>0, thn thr i flow from th outi, ntring th ntwork through no i. If (i )<0, thr i flow whih lv th ntwork through i. In th following w oftn u th nottion f (i, j ) for th flow-vlu on th r (i, j ) (int of f ((i, j ))). Similrly w writ (i, j ) n u(i, j ). A fil flow i funtion f : A Q 0 whih tifi th following ontrint. δ out (i) f () j δ i n (i) f ()= i for ll i V, 0 f () u() for ll A. Th gol i to fin fil flow with minimum ot: minimiz A ()f () ujt to δ out (i) f () δ i n (i) f ()= (i ) for ll i V, 0 f () u() for ll () A Exmpl 6.4. Imgin you r pilot n fly pngr irpln in hop from irport 1 to irport to irport n o on, until irport n. At irport i thr r i j pngr tht wnt to trvl to irport j, whr j > i. You my i how mny of th i j pngr you will tk on or. Eh of th pngr will py i j ollr for th trip. Th irpln n ommot p popl. You r gry pilot n think of pln to pik up n livr pngr on your hop from 1 to n whih mximiz your rvnu. Fining thi pln n mol minimum ot ntwork flow prolm. Your ntwork h no 1,...,n n r (i,i + 1),i = 1,...,n 1 with piti p n without ot. Th no o not hv in/out-flow from th outi. You furthrmor hv no i j for i < j n i, j {1,...,n} whih r x no with in-flow i j from th outi. Eh no i j i onnt to i n to j with irt r. Th piti on th r r infinit. Th ot of th r (i j,i ) i i j. Th ot of th r (i j, j ) i zro. Th outflow on th no j i th totl numr of pngr tht wnt to fly to no j. An intgrl optiml flow to thi prolm i n optiml pln for you. Throughout thi hptr w mk th following umption. 1. All t (ot, upply, mn n pity) r intgrl.. Th ntwork ontin n inpitt irt pth twn vry pir of no.. Th uppli/mn t th no tify th onition i V (i ) = 0 n th MCNFP h fil olution. 4. All r ot r nonngtiv. 5. Th grph o not ontin pir of rvr r.

13 Exri 6.. Show how to trnform MCNFP on igrph with pir of rvr r into MCNFP on igrph with no pir of rvr r. Th numr of r n no houl ymptotilly rmin th m. An r-flow of D i flow vtor, tht tifi th nonngtivity n pity ontrint. δ i n (i) f () δ out (i) f ()= (i ) for ll i V, 0 f () u() for ll A. If (i )>0, thn i i n x no (mor inflow thn outflow). If (i )<0, thn i i fiit no (mor outflow thn inflow). If (i )=0 thn i i ll ln. Exri 6.. Prov tht i V (i )=0 hol n thu tht fil flow only xit if th um of th (i ) i qul to zro. Lt P th olltion of irt pth of D n lt C th olltion of irt yl of D. A pth-flow i funtion β : P C R 0 whih ign flow vlu to pth n yl. For (i, j ) A n P P lt δ (i,j ) (P) 1 if (i, j ) P n 0 othrwi. For C C lt δ (i,j ) (C) 1 if (i, j ) C n 0 othrwi. A pth-flow β trmin uniqu r-flow f (i, j )= P P δ (i,j ) (P)β(P)+ δ (i,j ) (C)β(C). Thorm Evry pth n yl flow h uniqu rprnttion nonngtiv r-flow. Convrly, vry nonngtiv r flow f n rprnt pth n yl flow with th following proprti: 1. Evry irt pth with poitiv flow onnt fiit no with n x no.. At mot n+ m pth n yl hv nonzro flow n t mot m yl hv nonzro flow. If th r flow f i intgrl, thn o r th pth n yl flow into whih it ompo. Proof. S iuion ov. Lt f n r flow. Suppo i 0 i fiit no. Thn thr xit n inint r (i 0,i 1 ) whih rri poitiv flow. If i 1 i n x no, w hv foun pth from fiit to x no. Othrwi, th flow ln ontrint t i 1 impli tht thr xit n r (i 1,i ) with poitiv flow. Rpting thi prour, w finlly mut rriv t n x no or rviit no. Thi mn tht w C C 67

14 68 ithr hv ontrut irt pth P from fiit no to x no or irt yl C, oth involving only r with tritly poitiv flow. In th firt, lt P = i 0,...,i k th irt pth from fiit no i 0 to x no i k. W t β(p) = min{ i0, ik,min{f (i, j ) (i, j ) P}} n f (i, j )= f (i, j ) β(p), (i, j ) P. In th on, t β(c)=min{f (i, j ) (i, j ) C n f (i, j )= f (i, j ) β(c), (i, j ) C. Rpt thi prour until ll no imln r zro. Now fin n r with poitiv flow n ontrut yl C y following only poitiv r from thr. St β(c) = min{f (i, j ) (i, j ) C} n f (i, j )= f (i, j ) β(c), (i, j ) C}. Rpt thi pro until thr r no poitiv flow-r lft. Eh tim pth or yl i intifi, th x/fiit of om no i t to zro or om r i t to zro. Thi impli tht w ompo into t mot n + m pth n yl. Sin yl ttion t n r to zro w hv t mot m yl. An r flow f with (i ) = 0 for h i V i ll irultion. Corollry 6.6. A irultion n ompo into t mot m yl flow. Lt D = (V, A) ntwork with piti u(i, j ), (i, j ) A n ot (i, j ), (i, j ) A n lt f fil flow of th ntwork. Th riul ntwork D(f ) i fin follow. W rpl h r (i, j ) A with two r (i, j ) n (j,i ). Th r (i, j ) h ot (i, j ) n riul pity r (i, j )= u(i, j ) f (i, j ). Th r (j,i ) h ot (i, j ) n riul pity r (j,i )= f (i, j ). Dlt ll r whih o not hv tritly poitiv riul pity. A irt yl in D(f ) i ll n ugmnting yl of f. Lmm 6.4. Suppo tht f n f r fil flow, thn f f i irultion in D(f ). Hr f f i th flow mx{0, f () f ()}, if A(D) (f f )()= mx{0, f () f ()}, if 1 A(D) 0, othrwi. Proof. It i vry y to tht th flow f f tifi th pity ontrint. On lo h for h v V δ out (v)(f () f ()) (f () f ())=0. δ i n (v) If trm (f () f ()) i ngtiv, it i rpl y it olut vlu n hrg flow on th r 1 in D(f ) whih lv it ontriution to th um ov invrint.

15 69 /4 1/1 1/ 1/ 1/1 / /1 /1 7/ Fig. 6.6: Th riul ntwork of th flow in Figur 6.5 n ngtiv yl mrk y th r g. 4//4 1 /4/4 1/1 1 1/4 1 Fig. 6.7: Two r 1, A ll with f ()/f ()/u() n th orrponing flow on th r (or thir rvr) in D(f ). Ar in D(f ) r ll with flow n pity vlu rptivly. Thorm 6.11 (Augmnting Cyl Thorm). Lt f n f ny two fil flow of ntwork flow prolm. Thn f qul f plu th flow of t mot m irt yl in D(f ). Furthrmor th ot of f qul th ot of f plu th ot of flow on th ugmnting yl. Proof. Thi n n y pplying flow ompoition on th flow f f in D(f ). Thorm 6.1 (Ngtiv Cyl Optimlity Conition). A fil flow f i n optiml olution of th minimum ot ntwork flow prolm, if n only if it tifi th ngtiv yl optimlity onition: Th riul ntwork D(f ) ontin no irt yl of ngtiv ot. Proof. Suppo tht f i fil flow n tht D(f ) ontin ngtiv irt yl. Thn f nnot optiml, in w n ugmnt poitiv flow

16 70 long th orrponing yl in th ntwork. Thrfor, if f i n optiml flow, thn D(f ) nnot ontin ngtiv irt yl. Suppo now tht f i fil flow n uppo tht D(f ) o not ontin ngtiv yl. Lt f n optiml flow with f f. Th vtor f f i irultion in D(f ) with non-poitiv ot T (f f ) 0. It follow from Thorm 6.11 tht th ot of f qul th ot of f plu th ot of irt yl in th riul ntwork D(f ). Th ot of th yl i nonngtiv, n thrfor (f ) (f ) whih impli tht f i optiml Fig. 6.8: Th rult of ugmnting flow of on long th ngtiv yl in Figur 6.6. Thi flow h ot 1 ut i not optiml, in th riul ntwork till ontin ngtiv yl. Algorithm 6.1 (Cyl Cnling Algorithm). 1. tlih fil flow f in th ntwork. WHILE D( f ) ontin ngtiv yl. tt ngtiv yl C in D( f ). δ=min{r (i, j ) (i, j ) C}. ugmnt δ unit of flow long th yl C. upt D(f ). RETURN f Thorm 6.1. Th yl nling lgorithm trmint ftr finit numr of tp if th MCNFP h n optiml olution. Proof. Th yl nling lgorithm ru th ot in h itrtion. W hv um tht th input t i intgrl. Thu th ot r y t lt on unit h itrtion. Thrfor th numr of itrtion i finit. Corollry 6.7. If th piti r intgrl n if th MCNFP h optiml flow, thn it h n optiml flow with intgr vlu only.

17 Lt π : V R funtion (no potntil). Th ru ot of n r (i, j ) w.r.t. π i π ((i, j )) = ((i, j ))+π(i ) π(j ). Th potntil π i ll fil if π ((i, j )) 0 for ll r (i, j ) A. Lmm 6.5. Lt D = (V, A) igrph with r wight : A R. Thn D o not hv ngtiv yl if n only if thr xit fil no potntil π of D with r wight. Proof. Conir irt pth P = i 0,i 1,...,i k. Th ot of thi pth i (P)= k ((i j 1,i j )). j=1 Th ru ot of thi pth i qul to π (P)= k ((i j 1,i j ))+π(i 0 ) π(i k ). j=1 If P i yl, thn i 0 n i k r qul, whih mn tht it ot n ru ot oini. Thu, if thr xit fil no potntil, thn thr o not xit ngtiv yl. On th othr hn, uppo tht D, o not ontin ngtiv yl. A vrtx to D n th r (,i ) for ll i V. Th wight (ot) of ll th nw r i 0. Noti tht in thi wy, no nw yl r rt, thu till thr o not xit ngtiv yl. Thi mn w n omput th hortt pth from to ll othr no i V. Lt π th funtion whih ign th hortt pth lngth. Clrly π ((i, j ))=π(i ) π(j )+((i, j )) 0, in th hortt-pth lngth to j i t mot th hortt-pth lngth to i + ((i, j )). Thi mn tht w hv gin ni wy to prov tht flow i optiml. Simply quip th riul ntwork with fil no potntil. Corollry 6.8 (Ru Cot Optimlity Conition). A fil flow f i optiml if n only if thr xit no potntil π uh tht th ru ot π (i, j ) of h rh (i, j ) of D( f ) r nonngtiv. Th yl nling lgorithm i only puopolynomil. If w oul lwy ho minimum yl (yl with t improvmnt) n ugmnting yl, w woul hv polynomil numr of itrtion. Fining minimum yl i N P-hr. Int w ugmnt long minimum mn yl. On n fin minimum mn yl in polynomil tim. Th mn ot of yl C C i th ot of C ivi y th numr of r in C: ( (i, j ))/ C. (i,j ) C Algorithm 6. (Minimum Mn Cyl Cnling, MMCC). 71

18 7 1. tlih fil flow f in th ntwork. WHILE D( f ) ontin ngtiv yl. tt minimum mn yl C in D( f ). δ=min{r (i, j ) (i, j ) C}. ugmnt δ unit of flow long th yl C. upt D(f ). RETURN f W now nlyz th MMCC-lgorithm. Lt µ(f ) not th minimum mnwight of yl in D(f ). Lmm 6.6 (S Kort & Vygn [8]). Lt f 1, f,... qun of fil flow uh tht f i+1 rult from f i y ugmnting flow long C i, whr C i i minimum mn yl of D(f i ), thn 1. µ(f k ) µ(f k+1 ) for ll k.. µ(f k ) n n 1 µ(f l ), whr k < l n C k C l ontin pir of rvr r. Proof. 1): Suppo f k n f k+1 r two uqunt flow in thi qun. Conir th multi-grph H whih rult from C k n C k+1 y lting pir of oppoing r. Th r of H r ut of th r of D(f k ), in n r of C k+1 whih i not in D(f k ) mut rvr r of C k. Eh no in H h vn gr. Thu H n ompo into yl, h of mn wight t lt µ(f k ). Thu w hv (A(H)) µ(f k ) A(H). Sin th totl wight of h rvr pir of r i zro w hv (A(H))=(C k )+(C k+1 )=µ(f k ) C k +µ(f k+1 ) C k+1. Sin A(H) C k + C k+1 w onlu µ(f k )( C k + C k+1 ) µ(f k ) A(H) (A(H)) = µ(f k ) C k +µ(f k+1 ) C k+1. Thu µ(f k ) µ(f k+1 ). ): By th firt prt of th thorm, it i nough to prov th ttmnt for k,l uh tht C i C l o not ontin pir of rvr r for h i, k < i < l. Agin, onir th grph H rulting from C k n C l y lting pir of oppoing r. H i ugrph of D(f k ), in ny r of C l whih o not long to D(f k ) mut rvr r of C k,c k+1,...,c l 1. But only C k ontin rvr r of C l. So ov w hv (A(H))=(C k )+(C l )=µ(f k ) C k +µ(f l ) C k+1. Sin A(H) C k + C l w hv A(H) n 1 n ( C k + C l ). Thu w gt

19 7 µ(f k ) n 1 n ( C k + C l ) µ(f k ) A(H) (A(H)) = µ(f k ) C k +µ(f l ) C l µ(f l )( C k + C l ) Thi impli tht µ(f k ) n n 1 µ(f l ). Corollry 6.9. During th xution of th MMCC-lgorithm, µ( f ) r y ftor of 1/ vry n m itrtion. Proof. Lt C 1,C,... th qun of ugmnting yl. Evry m-th itrtion, thr mut n r of th yl, whih i rvr to on of th uing m 1 yl, u vry itrtion, on r of th riul ntwork will lt. Thu ftr n m itrtion, th olut vlu of µ h ropp y ( ) n 1 n n 1 1/. Corollry If ll t r intgrl, thn th MMCC-lgorithm run in polynomil tim. Proof. A lowr oun on µ i th mllt ot min µ rop y 1/ vry m n itrtion. Aftr mn logn min itrtion, olut vlu of minimum mn wight yl rop low 1/n, thu i zro. W n to prov tht minimum mn yl n foun in polynomil tim Thi i o-ll wkly polynomil oun, in th inry noing lngth of th numr in th input (hr th ot) influn th running tim. W now prov tht th MMCC-lgorithm i trongly polynomil. Thorm 6.14 (S Kort & Vygn [8]). Th MMCC-lgorithm rquir O(m n logn) itrtion (mn wight yl nlltion). Proof. On how tht vry m n( log n +1) itrtion, t lt on r i fix, whih mn tht th flow through thi r o not hng nymor. Lt f 1 om flow t om itrtion n lt f th flow m n( logn +1) itrtion ltr. It follow from Corollry 6.9 tht µ(f 1 ) n µ(f ) (6.9) hol. Dfin th ot () = () µ(f ) for th riul ntwork D(f ). Thr xit no ngtiv yl in D(f ) w.r.t. thi ot. ( A yl C h wight (C) = C () C µ(f ) n thu (C)/ C = C ()/ C µ(f ) 0). By Lmm 6.5

20 74 thr xit fil no potntil π for th wight. On h 0 π () = π () µ(f ) n thu π () µ(f ), for ll A(D(f )). (6.10) Lt C minimum mn yl of D(f 1 ). On h π (C)=(C)=µ(f 1 ) C n µ(f ) C. (6.11) It follow tht thr xit n r 0 of C uh tht hol. Th inquliti (6.10) imply tht 0 A(D(f )) W now mk th following lim: π ( 0 ) n µ(f ) (6.1) Lt f fil flow uh tht 0 D(f ), thn µ(f ) µ(f ). If w hv hown thi lim, thn it follow from Lmm 6.6 tht 0 nnot nymor in th riul ntwork of flow ftr f. Thu th flow long th r 0 (or 0 1 ) i fix. Lt f flow uh tht 0 A(D(f )). Rll tht f f i irultion in D(f ) whr 0 D(f ), 0 1 D(f ) n thi irultion n flow ovr 0 1. Thi irultion n ompo into yl n on of th yl C ontin 0 1. On h π(0 1)= π( 0 ) n µ(f ) (q. (6.1)). Uing (6.10) on otin (C) = C π () (6.1) n µ(f )+(n 1)µ(f ) (6.14) = (n+ 1)µ(f ) (6.15) > n µ(f ). (6.16) Th rvr of C i n ugmnting yl for f with totl wight t mot n µ(f ) n thu with mn wight t mot µ(f ). Thu µ(f ) µ(f ). 6.7 Computing minimum ot-to-profit rtio yl Givn igrph D = (V, A) with ot : A Z n profit p : A N >0, th tk i to omput yl C C with minimum rtio (C) p(c). (6.17) Noti tht thi i th lrgt numr β Q whih tifi

21 75 β (C), for ll C C. (6.18) p(c) By rwriting thi inqulity, w unrtn thi to th lrgt numr β Q uh tht (C) βp(c) 0 for ll C C. (6.19) In othr wor, w rh th lrgt numr β Q uh tht th igrph D = (V, A) with ot β : A Q, whr β ()=() βp(). W n routin to hk whthr D h ngtiv yl for givn wight funtion. For thi w um w.l.o.g. tht h vrtx i rhil from th vrtx, if nry y intruuing nw vrtx from whih thr i n r with ot n profit 0 to ll othr no. Th minimum ot-to-profit rtion yl w.r.t. thi nw grph i thn th minimum ot to profit rtio yl w.r.t. th originl grph, in i not vrtx of ny yl. Rll th following ingl-our hortt-pth lgorithm of Bllmn-For whih w now pply with wight β : Lt n= V. W lult funtion f 0, f 1,..., f n : V R { } uivly y th following rul. i) f 0 ()=0, f 0 (v)= for ll v ii) For k < n if f k h n foun, omput for ll v V. f k+1 (v)=min{f k (v), min (u,v) A {f k (u)+ β (u, v)} Thr xit ngtiv yl w.r.t. β if n only if f n (v)< f k (v) for om v V n 1 k < n. Thu w n tt in O(m n) tp whthr D, β ontin ngtiv yl. W now pply th following i to rh for th orrt vlu of β. W kp n intrvl I = [L,U ] with th invrint tht th vlu β tht w r rhing li in thi intrvl I. A trting vlu, w n ho L = min n U = mx, whr min n mx r th mllt n lrgt ot rptivly. In on itrtion w omput M = (L+U )/. W thn hk whthr D, togthr with M ontin ngtiv yl. If y, w know tht β i t lt M n w t L M. If not, thn β i t mot M n w upt th uppr oun U M. Whn n w top thi prour? W n top it, if w n ur tht only on vli ot-to-profit rtio yl li in [L,U ]. Suppo tht C 1 n C hv iffrnt ot-to-profit rtio. Thn (C 1 )/p(c 1 ) (C )/p(c ) = (C 1 ) p(c ) (C )p(c 1 ) (p(c 1 ) p(c )) (6.0) 1/(n pmx ). (6.1) Thu w n top our pro, if U L < 1/(n p mx ), in w know thn tht thr n only on yl C with (C)/p(C) [L,U ].

22 76 Suppo tht [L,U ] i th finl intrvl. W know thn tht L (C)/p(C) for ll C C n U > (C)/p(C) hol for om C C. Lt C minimum wight yl w.r.t. th r ot L. Clrly U > (C)/p(C) L hol n thu C i th minimum ot-to-profit yl w hv n looking for. Lt u nlyz th numr of rquir itrtion. W n to hlv th trting intrvl-lngth, whr i th lrgt olut vlu of ot, until th lngth i t mot 1/(n pmx ). W rh th miniml i N uh tht (1/) i 1/(n pmx ). (6.) Thi how u tht w n O(log( p mx n )) itrtion whih i O(logn log K ), whr K i th lrgt olut vlu of ot or profit. Thorm 6.15 (Lwlr [9]). Lt D igrph with ot : A Z n profit p : A N >0 n lt K N uh tht () + p() K for ll N. A minimum ot-to-profit rtio yl of G n omput in tim O(m n logn log K ). But w knw wkly polynomil lgorithm for MCNFP from th xri. So you urly k: Cn w o ttr for minimum ot-to-profit yl omputtion? Th nwr i Y! Prmtri rh Lt u firt roughly ri th i on how to otin trongly polynomil lgorithm, [1]. Th Bllmn-For lgorithm tll u whthr our urrnt β i too lrg or too mll, pning on whthr D with wight β ontin ngtiv yl or not. Rll tht th B-F lgorithm omput ll f i (v) for v V n 1 i n. If th ll r omput with ot β, thn thy r piwi linr funtion in β n w not thm y f i (v)[β]. Dnot th optiml β tht w look for y β n uppo tht w know n intrvl I with uh tht β I n h funtion f i (v)[β] i linr if it i rtrit to thi omin I. Thn w n trmin β follow. Lt I = [L,U ] th intrvl n rmmr tht w r rhing for th lrgt vlu of β I uh tht f n (v)[β]= f n 1 (v)[β] hol for h v V. Clrly thi hol for β = L. Thu w only n to hk whthr β = U y omputing th vlu f n (v)[u ] n f n 1 (v)[u ] for h v V n hk whthr on of th pir onit of iffrnt numr. Th i i now to omput uh n intrvl I = [L,U ] in trongly polynomil tim. Conir th funtion f 1 (v)[β]. Clrly on h

23 77 f 1 (v)[β]= { (, v) β p(, v) if (, v) A, othrwi. Thi how tht f 1 (v)[β] i linr funtion in β for h v V. Now uppo tht i 1 n tht w hv omput n intrvl I = [L,U ] with β I n h funtion f i (v)[β] i linr funtion if β i rtrit to I. Now onir th funtion f i+1 (v)[β] for prtiulr v V. Rll th formul f i+1 (v)[β]=min{f i (v)[β], min (u,v) A {f i (u)[β]+(u, v) β p(u, v)}}. (6.) Eh of th funtion f i (v)[β] n f i (u)[β]+(u, v) β p(u, v) r linr on I. Th funtion f i (v)[β] n rtriv y omputing hortt pth P i (v) from to v with r wight β for om β in (L,U ) whih u t mot i r. If β i thn llow to vry, th lin whih i fin y f i (v)[β] on I i thn th lngth of thi pth P with prmtr β. Similrly w n rtriv th funtion (lin) f i (u)[β]+(u, v) β p(u, v) for h (u, v) A. With th Bllmn-For lgorithm, thi mount to running tim of O(m n). W now hv n lin n n now omput th lowr nvlop of th lin in tim O(n log n) ltrntivly w n lo omput ll intrtion point of th lin n ort thm w.r.t. inring β-oorint. Thi woul mount to O(n log n). Lt β 1,...,β k th ort lit of th β-oorint. Now β tr i l := β k/ n hk whthr β > β tr i l. If y, w n rpl L y β tr i l n w n lt th numr β 1,...,β k/ 1. Othrwi, w rpl U y β tr i l n lt β k/ +1,..., k. In ny, w hlv th numr of poil β-oorint n ontinu in thi wy. Suh hk rquir ngtiv yl tt in th grph D with r wight β tr i l n ot O(m n). In th n w hv two onutiv β-oorint n hv n intrvl [L,U ] on whih f i+1 (v)[β] i linr. To fin n intrvl I uh tht f i+1 (v)[β] i linr on I n β I ot thu O(m n log n) tp. W now ontinu to tightn thi intrvl uh tht ll funtion f i+1 (v)[β], v V r linr on [L,U ]. Thu in tp i+ 1 thi mount to running tim of Th totl running tim i thu O ( n (m n log n) ). O(n m log n). Thorm Lt D = (V, A) irt grph n lt : A R n p : A R >0 funtion. On n omput yl C of D minimizing (C)/p(C) in tim O(n m log n).

24 Exri 1) Show tht thr r no two iffrnt pth from r to nothr no in irt tr T = (V, A). ) Prov Lmm 6.. ) Why n w um without lo of gnrlity tht minimum ot ntwork h pth from i to j for ll i j V whih i inpitt? 4) Provi n xmpl of MCNFP for whih th impl yl-nling lgorithm from ov n rquir n xponntil numr of nl, if th yl r hon in ivntgou wy. 5) Provi proof of Thorm ) Lt Q =< u 1,...,u k > th quu for n itrtion of th whil loop of th rth-firt-rh lgorithm. Show tht D[u i ] i monotonouly inring n tht D[u 1 ]+1 D[u k ]. Conlu tht th qun of ign ll (ovr tim) i monotonouly inring qun.

25 89 Rfrn 1. J. Emon. Mximum mthing n polyhron with 0,1-vrti. Journl of Rrh of th Ntionl Buru of Stnr, 69:15 10, J. Emon. Pth, tr n flowr. Cnin Journl of Mthmti, 17: , F. Einrn, A. Krrnur, n C. Xu. Algorithm for longr ol liftim. In C. Dmtru, itor, 6th Intrntionl Workhop on Exprimntl Algorithm, WEA07, volum 455 of Ltur Not in Computr Sin, pg Springr, M. Gröthl, L. Lováz, n A. Shrijvr. Gomtri Algorithm n Comintoril Optimiztion, volum of Algorithm n Comintori. Springr, L. Khhiyn. A polynomil lgorithm in linr progrmming. Dokly Akmii Nuk SSSR, 44: , V. Kl n G. J. Minty. How goo i th implx lgorithm? In Inquliti, III (Pro. Thir Sympo., Univ. Cliforni, Lo Angl, Clif., 1969; it to th mmory of Thoor S. Motzkin), pg Ami Pr, Nw York, T. Koh. Rpi Mthmtil Progrmming. PhD thi, Thnih Univrität Brlin, 004. ZIB-Rport B. Kort n J. Vygn. Comintoril optimiztion, volum 1 of Algorithm n Comintori. Springr-Vrlg, Brlin, on ition, 00. Thory n lgorithm. 9. E. L. Lwlr. Comintoril optimiztion: ntwork n mtroi. Holt, Rinhrt n Winton, Nw York, L. Lováz. Grph thory n intgr progrmming. Annl of Dirt Mthmti, 4: , J. E. Mrn n M. J. Hoffmn. Elmntry Clil Anlyi. Frmn, ition, J. Mtouk n B. Gärtnr. Unrtning n Uing Linr Progrmming (Univritxt). Springr-Vrlg Nw York, In., Suu, NJ, USA, N. Mgio. Comintoril optimiztion with rtionl ojtiv funtion. Mth. Opr. R., 4(4):414 44, A. S. Nmirovkiy n D. B. Yuin. Informtionl omplxity of mthmtil progrmming. Izvtiy Akmii Nuk SSSR. Tkhnihky Kirntik, (1):88 117, A. Shrijvr. Thory of Linr n Intgr Progrmming. John Wily, N. Z. Shor. Cut-off mtho with p xtnion in onvx progrmming prolm. Cyrnti n ytm nlyi, 1(1):94 96, 1977.

Weighted graphs -- reminder. Data Structures LECTURE 15. Shortest paths algorithms. Example: weighted graph. Two basic properties of shortest paths

Weighted graphs -- reminder. Data Structures LECTURE 15. Shortest paths algorithms. Example: weighted graph. Two basic properties of shortest paths Dt Strutur LECTURE Shortt pth lgorithm Proprti of hortt pth Bllmn-For lgorithm Dijktr lgorithm Chptr in th txtook (pp ). Wight grph -- rminr A wight grph i grph in whih g hv wight (ot) w(v i, v j ) >.

More information

Paths. Connectivity. Euler and Hamilton Paths. Planar graphs.

Paths. Connectivity. Euler and Hamilton Paths. Planar graphs. Pths.. Eulr n Hmilton Pths.. Pth D. A pth rom s to t is squn o gs {x 0, x 1 }, {x 1, x 2 },... {x n 1, x n }, whr x 0 = s, n x n = t. D. Th lngth o pth is th numr o gs in it. {, } {, } {, } {, } {, } {,

More information

CSE 373: More on graphs; DFS and BFS. Michael Lee Wednesday, Feb 14, 2018

CSE 373: More on graphs; DFS and BFS. Michael Lee Wednesday, Feb 14, 2018 CSE 373: Mor on grphs; DFS n BFS Mihl L Wnsy, F 14, 2018 1 Wrmup Wrmup: Disuss with your nighor: Rmin your nighor: wht is simpl grph? Suppos w hv simpl, irt grph with x nos. Wht is th mximum numr of gs

More information

V={A,B,C,D,E} E={ (A,D),(A,E),(B,D), (B,E),(C,D),(C,E)}

V={A,B,C,D,E} E={ (A,D),(A,E),(B,D), (B,E),(C,D),(C,E)} Introution Computr Sin & Enginring 423/823 Dsign n Anlysis of Algorithms Ltur 03 Elmntry Grph Algorithms (Chptr 22) Stphn Sott (Apt from Vinohnrn N. Vriym) I Grphs r strt t typs tht r pplil to numrous

More information

COMP108 Algorithmic Foundations

COMP108 Algorithmic Foundations Grdy mthods Prudn Wong http://www.s.liv..uk/~pwong/thing/omp108/01617 Coin Chng Prolm Suppos w hv 3 typs of oins 10p 0p 50p Minimum numr of oins to mk 0.8, 1.0, 1.? Grdy mthod Lrning outoms Undrstnd wht

More information

Graph Isomorphism. Graphs - II. Cayley s Formula. Planar Graphs. Outline. Is K 5 planar? The number of labeled trees on n nodes is n n-2

Graph Isomorphism. Graphs - II. Cayley s Formula. Planar Graphs. Outline. Is K 5 planar? The number of labeled trees on n nodes is n n-2 Grt Thortil Is In Computr Sin Vitor Amhik CS 15-251 Ltur 9 Grphs - II Crngi Mllon Univrsity Grph Isomorphism finition. Two simpl grphs G n H r isomorphi G H if thr is vrtx ijtion V H ->V G tht prsrvs jny

More information

V={A,B,C,D,E} E={ (A,D),(A,E),(B,D), (B,E),(C,D),(C,E)}

V={A,B,C,D,E} E={ (A,D),(A,E),(B,D), (B,E),(C,D),(C,E)} s s of s Computr Sin & Enginring 423/823 Dsign n Anlysis of Ltur 03 (Chptr 22) Stphn Sott (Apt from Vinohnrn N. Vriym) s of s s r strt t typs tht r pplil to numrous prolms Cn ptur ntitis, rltionships twn

More information

b. How many ternary words of length 23 with eight 0 s, nine 1 s and six 2 s?

b. How many ternary words of length 23 with eight 0 s, nine 1 s and six 2 s? MATH 3012 Finl Exm, My 4, 2006, WTT Stunt Nm n ID Numr 1. All our prts o this prolm r onrn with trnry strings o lngth n, i.., wors o lngth n with lttrs rom th lpht {0, 1, 2}.. How mny trnry wors o lngth

More information

Exam 1 Solution. CS 542 Advanced Data Structures and Algorithms 2/14/2013

Exam 1 Solution. CS 542 Advanced Data Structures and Algorithms 2/14/2013 CS Avn Dt Struturs n Algorithms Exm Solution Jon Turnr //. ( points) Suppos you r givn grph G=(V,E) with g wights w() n minimum spnning tr T o G. Now, suppos nw g {u,v} is to G. Dsri (in wors) mtho or

More information

CS 461, Lecture 17. Today s Outline. Example Run

CS 461, Lecture 17. Today s Outline. Example Run Prim s Algorithm CS 461, Ltur 17 Jr Si Univrsity o Nw Mxio In Prim s lgorithm, th st A mintin y th lgorithm orms singl tr. Th tr strts rom n ritrry root vrtx n grows until it spns ll th vrtis in V At h

More information

Garnir Polynomial and their Properties

Garnir Polynomial and their Properties Univrsity of Cliforni, Dvis Dprtmnt of Mthmtis Grnir Polynomil n thir Proprtis Author: Yu Wng Suprvisor: Prof. Gorsky Eugny My 8, 07 Grnir Polynomil n thir Proprtis Yu Wng mil: uywng@uvis.u. In this ppr,

More information

CSC Design and Analysis of Algorithms. Example: Change-Making Problem

CSC Design and Analysis of Algorithms. Example: Change-Making Problem CSC 801- Dsign n Anlysis of Algorithms Ltur 11 Gry Thniqu Exmpl: Chng-Mking Prolm Givn unlimit mounts of oins of nomintions 1 > > m, giv hng for mount n with th lst numr of oins Exmpl: 1 = 25, 2 =10, =

More information

CS200: Graphs. Graphs. Directed Graphs. Graphs/Networks Around Us. What can this represent? Sometimes we want to represent directionality:

CS200: Graphs. Graphs. Directed Graphs. Graphs/Networks Around Us. What can this represent? Sometimes we want to represent directionality: CS2: Grphs Prihr Ch. 4 Rosn Ch. Grphs A olltion of nos n gs Wht n this rprsnt? n A omputr ntwork n Astrtion of mp n Soil ntwork CS2 - Hsh Tls 2 Dirt Grphs Grphs/Ntworks Aroun Us A olltion of nos n irt

More information

Math 61 : Discrete Structures Final Exam Instructor: Ciprian Manolescu. You have 180 minutes.

Math 61 : Discrete Structures Final Exam Instructor: Ciprian Manolescu. You have 180 minutes. Nm: UCA ID Numr: Stion lttr: th 61 : Disrt Struturs Finl Exm Instrutor: Ciprin nolsu You hv 180 minuts. No ooks, nots or lultors r llow. Do not us your own srth ppr. 1. (2 points h) Tru/Fls: Cirl th right

More information

10/30/12. Today. CS/ENGRD 2110 Object- Oriented Programming and Data Structures Fall 2012 Doug James. DFS algorithm. Reachability Algorithms

10/30/12. Today. CS/ENGRD 2110 Object- Oriented Programming and Data Structures Fall 2012 Doug James. DFS algorithm. Reachability Algorithms 0/0/ CS/ENGRD 0 Ojt- Orint Prormmin n Dt Strutur Fll 0 Dou Jm Ltur 9: DFS, BFS & Shortt Pth Toy Rhility Dpth-Firt Srh Brth-Firt Srh Shortt Pth Unwiht rph Wiht rph Dijktr lorithm Rhility Alorithm Dpth Firt

More information

Module graph.py. 1 Introduction. 2 Graph basics. 3 Module graph.py. 3.1 Objects. CS 231 Naomi Nishimura

Module graph.py. 1 Introduction. 2 Graph basics. 3 Module graph.py. 3.1 Objects. CS 231 Naomi Nishimura Moul grph.py CS 231 Nomi Nishimur 1 Introution Just lik th Python list n th Python itionry provi wys of storing, ssing, n moifying t, grph n viw s wy of storing, ssing, n moifying t. Bus Python os not

More information

CSE 373. Graphs 1: Concepts, Depth/Breadth-First Search reading: Weiss Ch. 9. slides created by Marty Stepp

CSE 373. Graphs 1: Concepts, Depth/Breadth-First Search reading: Weiss Ch. 9. slides created by Marty Stepp CSE 373 Grphs 1: Conpts, Dpth/Brth-First Srh ring: Wiss Ch. 9 slis rt y Mrty Stpp http://www.s.wshington.u/373/ Univrsity o Wshington, ll rights rsrv. 1 Wht is grph? 56 Tokyo Sttl Soul 128 16 30 181 140

More information

CS61B Lecture #33. Administrivia: Autograder will run this evening. Today s Readings: Graph Structures: DSIJ, Chapter 12

CS61B Lecture #33. Administrivia: Autograder will run this evening. Today s Readings: Graph Structures: DSIJ, Chapter 12 Aministrivi: CS61B Ltur #33 Autogrr will run this vning. Toy s Rings: Grph Struturs: DSIJ, Chptr 12 Lst moifi: W Nov 8 00:39:28 2017 CS61B: Ltur #33 1 Why Grphs? For xprssing non-hirrhilly rlt itms Exmpls:

More information

12/3/12. Outline. Part 10. Graphs. Circuits. Euler paths/circuits. Euler s bridge problem (Bridges of Konigsberg Problem)

12/3/12. Outline. Part 10. Graphs. Circuits. Euler paths/circuits. Euler s bridge problem (Bridges of Konigsberg Problem) 12/3/12 Outlin Prt 10. Grphs CS 200 Algorithms n Dt Struturs Introution Trminology Implmnting Grphs Grph Trvrsls Topologil Sorting Shortst Pths Spnning Trs Minimum Spnning Trs Ciruits 1 Ciruits Cyl 2 Eulr

More information

Why the Junction Tree Algorithm? The Junction Tree Algorithm. Clique Potential Representation. Overview. Chris Williams 1.

Why the Junction Tree Algorithm? The Junction Tree Algorithm. Clique Potential Representation. Overview. Chris Williams 1. Why th Juntion Tr lgorithm? Th Juntion Tr lgorithm hris Willims 1 Shool of Informtis, Univrsity of Einurgh Otor 2009 Th JT is gnrl-purpos lgorithm for omputing (onitionl) mrginls on grphs. It os this y

More information

Algorithmic and NP-Completeness Aspects of a Total Lict Domination Number of a Graph

Algorithmic and NP-Completeness Aspects of a Total Lict Domination Number of a Graph Intrntionl J.Mth. Comin. Vol.1(2014), 80-86 Algorithmi n NP-Compltnss Aspts of Totl Lit Domintion Numr of Grph Girish.V.R. (PES Institut of Thnology(South Cmpus), Bnglor, Krntk Stt, Ini) P.Ush (Dprtmnt

More information

5/9/13. Part 10. Graphs. Outline. Circuits. Introduction Terminology Implementing Graphs

5/9/13. Part 10. Graphs. Outline. Circuits. Introduction Terminology Implementing Graphs Prt 10. Grphs CS 200 Algorithms n Dt Struturs 1 Introution Trminology Implmnting Grphs Outlin Grph Trvrsls Topologil Sorting Shortst Pths Spnning Trs Minimum Spnning Trs Ciruits 2 Ciruits Cyl A spil yl

More information

12. Traffic engineering

12. Traffic engineering lt2.ppt S-38. Introution to Tltrffi Thory Spring 200 2 Topology Pths A tlommunition ntwork onsists of nos n links Lt N not th st of nos in with n Lt J not th st of nos in with j N = {,,,,} J = {,2,3,,2}

More information

Jonathan Turner Exam 2-10/28/03

Jonathan Turner Exam 2-10/28/03 CS Algorihm n Progrm Prolm Exm Soluion S Soluion Jonhn Turnr Exm //. ( poin) In h Fioni hp ruur, u wn vrx u n i prn v u ing u v i v h lry lo hil in i l m hil o om ohr vrx. Suppo w hng hi, o h ing u i prorm

More information

Planar Upward Drawings

Planar Upward Drawings C.S. 252 Pro. Rorto Tmssi Computtionl Gomtry Sm. II, 1992 1993 Dt: My 3, 1993 Sri: Shmsi Moussvi Plnr Upwr Drwings 1 Thorm: G is yli i n only i it hs upwr rwing. Proo: 1. An upwr rwing is yli. Follow th

More information

CSE 373: AVL trees. Warmup: Warmup. Interlude: Exploring the balance invariant. AVL Trees: Invariants. AVL tree invariants review

CSE 373: AVL trees. Warmup: Warmup. Interlude: Exploring the balance invariant. AVL Trees: Invariants. AVL tree invariants review rmup CSE 7: AVL trs rmup: ht is n invrint? Mihl L Friy, Jn 9, 0 ht r th AVL tr invrints, xtly? Disuss with your nighor. AVL Trs: Invrints Intrlu: Exploring th ln invrint Cor i: xtr invrint to BSTs tht

More information

Graphs. CSC 1300 Discrete Structures Villanova University. Villanova CSC Dr Papalaskari

Graphs. CSC 1300 Discrete Structures Villanova University. Villanova CSC Dr Papalaskari Grphs CSC 1300 Disrt Struturs Villnov Univrsity Grphs Grphs r isrt struturs onsis?ng of vr?s n gs tht onnt ths vr?s. Grphs n us to mol: omputr systms/ntworks mthm?l rl?ons logi iruit lyout jos/prosss f

More information

(2) If we multiplied a row of B by λ, then the value is also multiplied by λ(here lambda could be 0). namely

(2) If we multiplied a row of B by λ, then the value is also multiplied by λ(here lambda could be 0). namely . DETERMINANT.. Dtrminnt. Introution:I you think row vtor o mtrix s oorint o vtors in sp, thn th gomtri mning o th rnk o th mtrix is th imnsion o th prlllppi spnn y thm. But w r not only r out th imnsion,

More information

Outline. 1 Introduction. 2 Min-Cost Spanning Trees. 4 Example

Outline. 1 Introduction. 2 Min-Cost Spanning Trees. 4 Example Outlin Computr Sin 33 Computtion o Minimum-Cost Spnnin Trs Prim's Alorithm Introution Mik Joson Dprtmnt o Computr Sin Univrsity o Clry Ltur #33 3 Alorithm Gnrl Constrution Mik Joson (Univrsity o Clry)

More information

The University of Sydney MATH2969/2069. Graph Theory Tutorial 5 (Week 12) Solutions 2008

The University of Sydney MATH2969/2069. Graph Theory Tutorial 5 (Week 12) Solutions 2008 Th Univrsity o Syny MATH2969/2069 Grph Thory Tutoril 5 (Wk 12) Solutions 2008 1. (i) Lt G th isonnt plnr grph shown. Drw its ul G, n th ul o th ul (G ). (ii) Show tht i G is isonnt plnr grph, thn G is

More information

Outline. Circuits. Euler paths/circuits 4/25/12. Part 10. Graphs. Euler s bridge problem (Bridges of Konigsberg Problem)

Outline. Circuits. Euler paths/circuits 4/25/12. Part 10. Graphs. Euler s bridge problem (Bridges of Konigsberg Problem) 4/25/12 Outlin Prt 10. Grphs CS 200 Algorithms n Dt Struturs Introution Trminology Implmnting Grphs Grph Trvrsls Topologil Sorting Shortst Pths Spnning Trs Minimum Spnning Trs Ciruits 1 2 Eulr s rig prolm

More information

0.1. Exercise 1: the distances between four points in a graph

0.1. Exercise 1: the distances between four points in a graph Mth 707 Spring 2017 (Drij Grinrg): mitrm 3 pg 1 Mth 707 Spring 2017 (Drij Grinrg): mitrm 3 u: W, 3 My 2017, in lss or y mil (grinr@umn.u) or lss S th wsit or rlvnt mtril. Rsults provn in th nots, or in

More information

Graphs. Graphs. Graphs: Basic Terminology. Directed Graphs. Dr Papalaskari 1

Graphs. Graphs. Graphs: Basic Terminology. Directed Graphs. Dr Papalaskari 1 CSC 00 Disrt Struturs : Introuon to Grph Thory Grphs Grphs CSC 00 Disrt Struturs Villnov Univrsity Grphs r isrt struturs onsisng o vrs n gs tht onnt ths vrs. Grphs n us to mol: omputr systms/ntworks mthml

More information

An undirected graph G = (V, E) V a set of vertices E a set of unordered edges (v,w) where v, w in V

An undirected graph G = (V, E) V a set of vertices E a set of unordered edges (v,w) where v, w in V Unirt Grphs An unirt grph G = (V, E) V st o vrtis E st o unorr gs (v,w) whr v, w in V USE: to mol symmtri rltionships twn ntitis vrtis v n w r jnt i thr is n g (v,w) [or (w,v)] th g (v,w) is inint upon

More information

Section 3: Antiderivatives of Formulas

Section 3: Antiderivatives of Formulas Chptr Th Intgrl Appli Clculus 96 Sction : Antirivtivs of Formuls Now w cn put th is of rs n ntirivtivs togthr to gt wy of vluting finit intgrls tht is ct n oftn sy. To vlut finit intgrl f(t) t, w cn fin

More information

Solutions for HW11. Exercise 34. (a) Use the recurrence relation t(g) = t(g e) + t(g/e) to count the number of spanning trees of v 1

Solutions for HW11. Exercise 34. (a) Use the recurrence relation t(g) = t(g e) + t(g/e) to count the number of spanning trees of v 1 Solutions for HW Exris. () Us th rurrn rltion t(g) = t(g ) + t(g/) to ount th numr of spnning trs of v v v u u u Rmmr to kp multipl gs!! First rrw G so tht non of th gs ross: v u v Rursing on = (v, u ):

More information

Problem solving by search

Problem solving by search Prolm solving y srh Tomáš voo Dprtmnt o Cyrntis, Vision or Roots n Autonomous ystms Mrh 5, 208 / 3 Outlin rh prolm. tt sp grphs. rh trs. trtgis, whih tr rnhs to hoos? trtgy/algorithm proprtis? Progrmming

More information

Outline. Computer Science 331. Computation of Min-Cost Spanning Trees. Costs of Spanning Trees in Weighted Graphs

Outline. Computer Science 331. Computation of Min-Cost Spanning Trees. Costs of Spanning Trees in Weighted Graphs Outlin Computr Sin 33 Computtion o Minimum-Cost Spnnin Trs Prim s Mik Joson Dprtmnt o Computr Sin Univrsity o Clry Ltur #34 Introution Min-Cost Spnnin Trs 3 Gnrl Constrution 4 5 Trmintion n Eiiny 6 Aitionl

More information

1 Introduction to Modulo 7 Arithmetic

1 Introduction to Modulo 7 Arithmetic 1 Introution to Moulo 7 Arithmti Bor w try our hn t solvin som hr Moulr KnKns, lt s tk los look t on moulr rithmti, mo 7 rithmti. You ll s in this sminr tht rithmti moulo prim is quit irnt rom th ons w

More information

COMPLEXITY OF COUNTING PLANAR TILINGS BY TWO BARS

COMPLEXITY OF COUNTING PLANAR TILINGS BY TWO BARS OMPLXITY O OUNTING PLNR TILINGS Y TWO RS KYL MYR strt. W show tht th prolm o trmining th numr o wys o tiling plnr igur with horizontl n vrtil r is #P-omplt. W uil o o th rsults o uquir, Nivt, Rmil, n Roson

More information

Section 10.4 Connectivity (up to paths and isomorphism, not including)

Section 10.4 Connectivity (up to paths and isomorphism, not including) Toy w will isuss two stions: Stion 10.3 Rprsnting Grphs n Grph Isomorphism Stion 10.4 Conntivity (up to pths n isomorphism, not inluing) 1 10.3 Rprsnting Grphs n Grph Isomorphism Whn w r working on n lgorithm

More information

Page 1. Question 19.1b Electric Charge II Question 19.2a Conductors I. ConcepTest Clicker Questions Chapter 19. Physics, 4 th Edition James S.

Page 1. Question 19.1b Electric Charge II Question 19.2a Conductors I. ConcepTest Clicker Questions Chapter 19. Physics, 4 th Edition James S. ConTst Clikr ustions Chtr 19 Physis, 4 th Eition Jms S. Wlkr ustion 19.1 Two hrg blls r rlling h othr s thy hng from th iling. Wht n you sy bout thir hrgs? Eltri Chrg I on is ositiv, th othr is ngtiv both

More information

CS 241 Analysis of Algorithms

CS 241 Analysis of Algorithms CS 241 Anlysis o Algorithms Prossor Eri Aron Ltur T Th 9:00m Ltur Mting Lotion: OLB 205 Businss HW6 u lry HW7 out tr Thnksgiving Ring: Ch. 22.1-22.3 1 Grphs (S S. B.4) Grphs ommonly rprsnt onntions mong

More information

TOPIC 5: INTEGRATION

TOPIC 5: INTEGRATION TOPIC 5: INTEGRATION. Th indfinit intgrl In mny rspcts, th oprtion of intgrtion tht w r studying hr is th invrs oprtion of drivtion. Dfinition.. Th function F is n ntidrivtiv (or primitiv) of th function

More information

Numbering Boundary Nodes

Numbering Boundary Nodes Numring Bounry Nos Lh MBri Empori Stt Univrsity August 10, 2001 1 Introution Th purpos of this ppr is to xplor how numring ltril rsistor ntworks ffts thir rspons mtrix, Λ. Morovr, wht n lrn from Λ out

More information

Announcements. Not graphs. These are Graphs. Applications of Graphs. Graph Definitions. Graphs & Graph Algorithms. A6 released today: Risk

Announcements. Not graphs. These are Graphs. Applications of Graphs. Graph Definitions. Graphs & Graph Algorithms. A6 released today: Risk Grphs & Grph Algorithms Ltur CS Spring 6 Announmnts A6 rls toy: Risk Strt signing with your prtnr sp Prlim usy Not grphs hs r Grphs K 5 K, =...not th kin w mn, nywy Applitions o Grphs Communition ntworks

More information

5/7/13. Part 10. Graphs. Theorem Theorem Graphs Describing Precedence. Outline. Theorem 10-1: The Handshaking Theorem

5/7/13. Part 10. Graphs. Theorem Theorem Graphs Describing Precedence. Outline. Theorem 10-1: The Handshaking Theorem Thorm 10-1: Th Hnshkin Thorm Lt G=(V,E) n unirt rph. Thn Prt 10. Grphs CS 200 Alorithms n Dt Struturs v V (v) = 2 E How mny s r thr in rph with 10 vrtis h of r six? 10 * 6 /2= 30 1 Thorm 10-2 An unirt

More information

# 1 ' 10 ' 100. Decimal point = 4 hundred. = 6 tens (or sixty) = 5 ones (or five) = 2 tenths. = 7 hundredths.

# 1 ' 10 ' 100. Decimal point = 4 hundred. = 6 tens (or sixty) = 5 ones (or five) = 2 tenths. = 7 hundredths. How os it work? Pl vlu o imls rprsnt prts o whol numr or ojt # 0 000 Tns o thousns # 000 # 00 Thousns Hunrs Tns Ons # 0 Diml point st iml pl: ' 0 # 0 on tnth n iml pl: ' 0 # 00 on hunrth r iml pl: ' 0

More information

Cycles and Simple Cycles. Paths and Simple Paths. Trees. Problem: There is No Completely Standard Terminology!

Cycles and Simple Cycles. Paths and Simple Paths. Trees. Problem: There is No Completely Standard Terminology! Outlin Computr Sin 331, Spnnin, n Surphs Mik Joson Dprtmnt o Computr Sin Univrsity o Clry Ltur #30 1 Introution 2 3 Dinition 4 Spnnin 5 6 Mik Joson (Univrsity o Clry) Computr Sin 331 Ltur #30 1 / 20 Mik

More information

Similarity Search. The Binary Branch Distance. Nikolaus Augsten.

Similarity Search. The Binary Branch Distance. Nikolaus Augsten. Similrity Srh Th Binry Brnh Distn Nikolus Augstn nikolus.ugstn@sg..t Dpt. of Computr Sins Univrsity of Slzurg http://rsrh.uni-slzurg.t Vrsion Jnury 11, 2017 Wintrsmstr 2016/2017 Augstn (Univ. Slzurg) Similrity

More information

Constructive Geometric Constraint Solving

Constructive Geometric Constraint Solving Construtiv Gomtri Constrint Solving Antoni Soto i Rir Dprtmnt Llngutgs i Sistms Inormàtis Univrsitt Politèni Ctluny Brlon, Sptmr 2002 CGCS p.1/37 Prliminris CGCS p.2/37 Gomtri onstrint prolm C 2 D L BC

More information

CS September 2018

CS September 2018 Loil los Distriut Systms 06. Loil los Assin squn numrs to msss All ooprtin prosss n r on orr o vnts vs. physil los: rport tim o y Assum no ntrl tim sour Eh systm mintins its own lol lo No totl orrin o

More information

The Cost Optimal Solution of the Multi-Constrained Multicast Routing Problem

The Cost Optimal Solution of the Multi-Constrained Multicast Routing Problem Pulition Intrn l IRISA ISSN : 2102-6327 PI 1957 Otor 2010 Th Cot Optiml Solution of th Multi-Contrin Multit Routing Prolm Mikló Molnár *, Ali Bll **, Smr Lhou *** miklo.molnr@lirmm.fr, li.ll@iri.fr, mr.lhou@iri.fr

More information

CSE303 - Introduction to the Theory of Computing Sample Solutions for Exercises on Finite Automata

CSE303 - Introduction to the Theory of Computing Sample Solutions for Exercises on Finite Automata CSE303 - Introduction to th Thory of Computing Smpl Solutions for Exrciss on Finit Automt Exrcis 2.1.1 A dtrministic finit utomton M ccpts th mpty string (i.., L(M)) if nd only if its initil stt is finl

More information

A Simple Code Generator. Code generation Algorithm. Register and Address Descriptors. Example 3/31/2008. Code Generation

A Simple Code Generator. Code generation Algorithm. Register and Address Descriptors. Example 3/31/2008. Code Generation A Simpl Co Gnrtor Co Gnrtion Chptr 8 II Gnrt o for singl si lok How to us rgistrs? In most mhin rhitturs, som or ll of th oprnsmust in rgistrs Rgistrs mk goo tmporris Hol vlus tht r omput in on si lok

More information

(a) v 1. v a. v i. v s. (b)

(a) v 1. v a. v i. v s. (b) Outlin RETIMING Struturl optimiztion mthods. Gionni D Mihli Stnford Unirsity Rtiming. { Modling. { Rtiming for minimum dly. { Rtiming for minimum r. Synhronous Logi Ntwork Synhronous Logi Ntwork Synhronous

More information

14 Shortest Paths (November 8)

14 Shortest Paths (November 8) CS G Ltur : Shortt Pth Fll 5 Shortt Pth (Novmr ). Introution Givn wight irt grph G = (V, E, w) with two pil vrti, our n trgt t, w wnt to in th hortt irt pth rom to t. In othr wor, w wnt to in th pth p

More information

Minimum Spanning Trees

Minimum Spanning Trees Minimum Spnning Trs Minimum Spnning Trs Problm A town hs st of houss nd st of rods A rod conncts nd only houss A rod conncting houss u nd v hs rpir cost w(u, v) Gol: Rpir nough (nd no mor) rods such tht:

More information

QUESTIONS BEGIN HERE!

QUESTIONS BEGIN HERE! Points miss: Stunt's Nm: Totl sor: /100 points Est Tnnss Stt Univrsity Dprtmnt of Computr n Informtion Sins CSCI 710 (Trnoff) Disrt Struturs TEST for Fll Smstr, 00 R this for strtin! This tst is los ook

More information

S i m p l i f y i n g A l g e b r a SIMPLIFYING ALGEBRA.

S i m p l i f y i n g A l g e b r a SIMPLIFYING ALGEBRA. S i m p l i y i n g A l g r SIMPLIFYING ALGEBRA www.mthltis.o.nz Simpliying SIMPLIFYING Algr ALGEBRA Algr is mthmtis with mor thn just numrs. Numrs hv ix vlu, ut lgr introus vrils whos vlus n hng. Ths

More information

Announcements. These are Graphs. This is not a Graph. Graph Definitions. Applications of Graphs. Graphs & Graph Algorithms

Announcements. These are Graphs. This is not a Graph. Graph Definitions. Applications of Graphs. Graphs & Graph Algorithms Grphs & Grph Algorithms Ltur CS Fll 5 Announmnts Upoming tlk h Mny Crrs o Computr Sintist Or how Computr Sin gr mpowrs you to o muh mor thn o Dn Huttnlohr, Prossor in th Dprtmnt o Computr Sin n Johnson

More information

, each of which is a tree, and whose roots r 1. , respectively, are children of r. Data Structures & File Management

, each of which is a tree, and whose roots r 1. , respectively, are children of r. Data Structures & File Management nrl tr T is init st o on or mor nos suh tht thr is on sint no r, ll th root o T, n th rminin nos r prtition into n isjoint susts T, T,, T n, h o whih is tr, n whos roots r, r,, r n, rsptivly, r hilrn o

More information

INTEGRALS. Chapter 7. d dx. 7.1 Overview Let d dx F (x) = f (x). Then, we write f ( x)

INTEGRALS. Chapter 7. d dx. 7.1 Overview Let d dx F (x) = f (x). Then, we write f ( x) Chptr 7 INTEGRALS 7. Ovrviw 7.. Lt d d F () f (). Thn, w writ f ( ) d F () + C. Ths intgrls r clld indfinit intgrls or gnrl intgrls, C is clld constnt of intgrtion. All ths intgrls diffr y constnt. 7..

More information

NP-Completeness. CS3230 (Algorithm) Traveling Salesperson Problem. What s the Big Deal? Given a Problem. What s the Big Deal? What s the Big Deal?

NP-Completeness. CS3230 (Algorithm) Traveling Salesperson Problem. What s the Big Deal? Given a Problem. What s the Big Deal? What s the Big Deal? NP-Compltnss 1. Polynomil tim lgorithm 2. Polynomil tim rution 3.P vs NP 4.NP-ompltnss (som slis y P.T. Um Univrsity o Txs t Dlls r us) Trvling Slsprson Prolm Fin minimum lngth tour tht visits h ity on

More information

Aquauno Video 6 Plus Page 1

Aquauno Video 6 Plus Page 1 Connt th timr to th tp. Aquuno Vio 6 Plus Pg 1 Usr mnul 3 lik! For Aquuno Vio 6 (p/n): 8456 For Aquuno Vio 6 Plus (p/n): 8413 Opn th timr unit y prssing th two uttons on th sis, n fit 9V lklin ttry. Whn

More information

More Foundations. Undirected Graphs. Degree. A Theorem. Graphs, Products, & Relations

More Foundations. Undirected Graphs. Degree. A Theorem. Graphs, Products, & Relations Mr Funtins Grphs, Pruts, & Rltins Unirt Grphs An unirt grph is pir f 1. A st f ns 2. A st f gs (whr n g is st f tw ns*) Friy, Sptmr 2, 2011 Ring: Sipsr 0.2 ginning f 0.4; Stughtn 1.1.5 ({,,,,}, {{,}, {,},

More information

Greedy Algorithms, Activity Selection, Minimum Spanning Trees Scribes: Logan Short (2015), Virginia Date: May 18, 2016

Greedy Algorithms, Activity Selection, Minimum Spanning Trees Scribes: Logan Short (2015), Virginia Date: May 18, 2016 Ltur 4 Gry Algorithms, Ativity Sltion, Minimum Spnning Trs Sris: Logn Short (5), Virgini Dt: My, Gry Algorithms Suppos w wnt to solv prolm, n w r l to om up with som rursiv ormultion o th prolm tht woul

More information

Register Allocation. Register Allocation. Principle Phases. Principle Phases. Example: Build. Spills 11/14/2012

Register Allocation. Register Allocation. Principle Phases. Principle Phases. Example: Build. Spills 11/14/2012 Rgistr Allotion W now r l to o rgistr llotion on our intrfrn grph. W wnt to l with two typs of onstrints: 1. Two vlus r liv t ovrlpping points (intrfrn grph) 2. A vlu must or must not in prtiulr rhitturl

More information

Present state Next state Q + M N

Present state Next state Q + M N Qustion 1. An M-N lip-lop works s ollows: I MN=00, th nxt stt o th lip lop is 0. I MN=01, th nxt stt o th lip-lop is th sm s th prsnt stt I MN=10, th nxt stt o th lip-lop is th omplmnt o th prsnt stt I

More information

ECE COMBINATIONAL BUILDING BLOCKS - INVEST 13 DECODERS AND ENCODERS

ECE COMBINATIONAL BUILDING BLOCKS - INVEST 13 DECODERS AND ENCODERS C 24 - COMBINATIONAL BUILDING BLOCKS - INVST 3 DCODS AND NCODS FALL 23 AP FLZ To o "wll" on this invstition you must not only t th riht nswrs ut must lso o nt, omplt n onis writups tht mk ovious wht h

More information

Designing A Concrete Arch Bridge

Designing A Concrete Arch Bridge This is th mous Shwnh ri in Switzrln, sin y Rort Millrt in 1933. It spns 37.4 mtrs (122 t) n ws sin usin th sm rphil mths tht will monstrt in this lsson. To pro with this lsson, lik on th Nxt utton hr

More information

Seven-Segment Display Driver

Seven-Segment Display Driver 7-Smnt Disply Drivr, Ron s in 7-Smnt Disply Drivr, Ron s in Prolm 62. 00 0 0 00 0000 000 00 000 0 000 00 0 00 00 0 0 0 000 00 0 00 BCD Diits in inry Dsin Drivr Loi 4 inputs, 7 outputs 7 mps, h with 6 on

More information

Trees as operads. Lecture A formalism of trees

Trees as operads. Lecture A formalism of trees Ltur 2 rs s oprs In this ltur, w introu onvnint tgoris o trs tht will us or th inition o nroil sts. hs tgoris r gnrliztions o th simpliil tgory us to in simpliil sts. First w onsir th s o plnr trs n thn

More information

Solutions to Homework 5

Solutions to Homework 5 Solutions to Homwork 5 Pro. Silvia Frnánz Disrt Mathmatis Math 53A, Fall 2008. [3.4 #] (a) Thr ar x olor hois or vrtx an x or ah o th othr thr vrtis. So th hromati polynomial is P (G, x) =x (x ) 3. ()

More information

Integration Continued. Integration by Parts Solving Definite Integrals: Area Under a Curve Improper Integrals

Integration Continued. Integration by Parts Solving Definite Integrals: Area Under a Curve Improper Integrals Intgrtion Continud Intgrtion y Prts Solving Dinit Intgrls: Ar Undr Curv Impropr Intgrls Intgrtion y Prts Prticulrly usul whn you r trying to tk th intgrl o som unction tht is th product o n lgric prssion

More information

Computational Biology, Phylogenetic Trees. Consensus methods

Computational Biology, Phylogenetic Trees. Consensus methods Computtionl Biology, Phylognti Trs Consnsus mthos Asgr Bruun & Bo Simonsn Th 16th of Jnury 2008 Dprtmnt of Computr Sin Th univrsity of Copnhgn 0 Motivtion Givn olltion of Trs Τ = { T 0,..., T n } W wnt

More information

FSA. CmSc 365 Theory of Computation. Finite State Automata and Regular Expressions (Chapter 2, Section 2.3) ALPHABET operations: U, concatenation, *

FSA. CmSc 365 Theory of Computation. Finite State Automata and Regular Expressions (Chapter 2, Section 2.3) ALPHABET operations: U, concatenation, * CmSc 365 Thory of Computtion Finit Stt Automt nd Rgulr Exprssions (Chptr 2, Sction 2.3) ALPHABET oprtions: U, conctntion, * otin otin Strings Form Rgulr xprssions dscri Closd undr U, conctntion nd * (if

More information

Using the Printable Sticker Function. Using the Edit Screen. Computer. Tablet. ScanNCutCanvas

Using the Printable Sticker Function. Using the Edit Screen. Computer. Tablet. ScanNCutCanvas SnNCutCnvs Using th Printl Stikr Funtion On-o--kin stikrs n sily rt y using your inkjt printr n th Dirt Cut untion o th SnNCut mhin. For inormtion on si oprtions o th SnNCutCnvs, rr to th Hlp. To viw th

More information

Weighted Matching and Linear Programming

Weighted Matching and Linear Programming Wightd Mtching nd Linr Progrmming Jonthn Turnr Mrch 19, 01 W v sn tht mximum siz mtchings cn b found in gnrl grphs using ugmnting pths. In principl, this sm pproch cn b pplid to mximum wight mtchings.

More information

a b c cat CAT A B C Aa Bb Cc cat cat Lesson 1 (Part 1) Verbal lesson: Capital Letters Make The Same Sound Lesson 1 (Part 1) continued...

a b c cat CAT A B C Aa Bb Cc cat cat Lesson 1 (Part 1) Verbal lesson: Capital Letters Make The Same Sound Lesson 1 (Part 1) continued... Progrssiv Printing T.M. CPITLS g 4½+ Th sy, fun (n FR!) wy to tch cpitl lttrs. ook : C o - For Kinrgrtn or First Gr (not for pr-school). - Tchs tht cpitl lttrs mk th sm souns s th littl lttrs. - Tchs th

More information

Chapter 9. Graphs. 9.1 Graphs

Chapter 9. Graphs. 9.1 Graphs Chptr 9 Grphs Grphs r vry gnrl lss of ojt, us to formliz wi vrity of prtil prolms in omputr sin. In this hptr, w ll s th sis of (finit) unirt grphs, inluing grph isomorphism, onntivity, n grph oloring.

More information

Nefertiti. Echoes of. Regal components evoke visions of the past MULTIPLE STITCHES. designed by Helena Tang-Lim

Nefertiti. Echoes of. Regal components evoke visions of the past MULTIPLE STITCHES. designed by Helena Tang-Lim MULTIPLE STITCHES Nrtiti Ehos o Rgl omponnts vok visions o th pst sign y Hln Tng-Lim Us vrity o stiths to rt this rgl yt wrl sign. Prt sping llows squr s to mk roun omponnts tht rp utiully. FCT-SC-030617-07

More information

EE1000 Project 4 Digital Volt Meter

EE1000 Project 4 Digital Volt Meter Ovrviw EE1000 Projt 4 Diitl Volt Mtr In this projt, w mk vi tht n msur volts in th rn o 0 to 4 Volts with on iit o ury. Th input is n nlo volt n th output is sinl 7-smnt iit tht tlls us wht tht input s

More information

Walk Like a Mathematician Learning Task:

Walk Like a Mathematician Learning Task: Gori Dprtmnt of Euction Wlk Lik Mthmticin Lrnin Tsk: Mtrics llow us to prform mny usful mthmticl tsks which orinrily rquir lr numbr of computtions. Som typs of problms which cn b on fficintly with mtrics

More information

16.unified Introduction to Computers and Programming. SOLUTIONS to Examination 4/30/04 9:05am - 10:00am

16.unified Introduction to Computers and Programming. SOLUTIONS to Examination 4/30/04 9:05am - 10:00am 16.unii Introution to Computrs n Prormmin SOLUTIONS to Exmintion /30/0 9:05m - 10:00m Pro. I. Kristin Lunqvist Sprin 00 Grin Stion: Qustion 1 (5) Qustion (15) Qustion 3 (10) Qustion (35) Qustion 5 (10)

More information

WORKSHOP 6 BRIDGE TRUSS

WORKSHOP 6 BRIDGE TRUSS WORKSHOP 6 BRIDGE TRUSS WS6-2 Workshop Ojtivs Lrn to msh lin gomtry to gnrt CBAR lmnts Bom fmilir with stting up th CBAR orinttion vtor n stion proprtis Lrn to st up multipl lo ss Lrn to viw th iffrnt

More information

Winter 2016 COMP-250: Introduction to Computer Science. Lecture 23, April 5, 2016

Winter 2016 COMP-250: Introduction to Computer Science. Lecture 23, April 5, 2016 Wintr 2016 COMP-250: Introduction to Computr Scinc Lctur 23, April 5, 2016 Commnt out input siz 2) Writ ny lgorithm tht runs in tim Θ(n 2 log 2 n) in wors cs. Explin why this is its running tim. I don

More information

This chapter covers special properties of planar graphs.

This chapter covers special properties of planar graphs. Chptr 21 Plnr Grphs This hptr ovrs spil proprtis of plnr grphs. 21.1 Plnr grphs A plnr grph is grph whih n b rwn in th pln without ny gs rossing. Som piturs of plnr grph might hv rossing gs, but it s possibl

More information

Chapter 16. 1) is a particular point on the graph of the function. 1. y, where x y 1

Chapter 16. 1) is a particular point on the graph of the function. 1. y, where x y 1 Prctic qustions W now tht th prmtr p is dirctl rltd to th mplitud; thrfor, w cn find tht p. cos d [ sin ] sin sin Not: Evn though ou might not now how to find th prmtr in prt, it is lws dvisl to procd

More information

APPLICATIONS OF THE LAPLACE-MELLIN INTEGRAL TRANSFORM TO DIFFERNTIAL EQUATIONS

APPLICATIONS OF THE LAPLACE-MELLIN INTEGRAL TRANSFORM TO DIFFERNTIAL EQUATIONS Intrntionl Journl o Sintii nd Rrh Publition Volum, Iu 5, M ISSN 5-353 APPLICATIONS OF THE LAPLACE-MELLIN INTEGRAL TRANSFORM TO DIFFERNTIAL EQUATIONS S.M.Khirnr, R.M.Pi*, J.N.Slun** Dprtmnt o Mthmti Mhrhtr

More information

The Z transform techniques

The Z transform techniques h Z trnfor tchniqu h Z trnfor h th rol in dicrt yt tht th Lplc trnfor h in nlyi of continuou yt. h Z trnfor i th principl nlyticl tool for ingl-loop dicrt-ti yt. h Z trnfor h Z trnfor i to dicrt-ti yt

More information

arxiv: v1 [cs.ds] 20 Feb 2008

arxiv: v1 [cs.ds] 20 Feb 2008 Symposium on Thortil Aspts of Computr Sin 2008 (Borux), pp. 361-372 www.sts-onf.org rxiv:0802.2867v1 [s.ds] 20 F 2008 FIXED PARAMETER POLYNOMIAL TIME ALGORITHMS FOR MAXIMUM AGREEMENT AND COMPATIBLE SUPERTREES

More information

QUESTIONS BEGIN HERE!

QUESTIONS BEGIN HERE! Points miss: Stunt's Nm: Totl sor: /100 points Est Tnnss Stt Univrsity Dprtmnt o Computr n Inormtion Sins CSCI 2710 (Trno) Disrt Struturs TEST or Sprin Smstr, 2005 R this or strtin! This tst is los ook

More information

DUET WITH DIAMONDS COLOR SHIFTING BRACELET By Leslie Rogalski

DUET WITH DIAMONDS COLOR SHIFTING BRACELET By Leslie Rogalski Dut with Dimons Brlt DUET WITH DIAMONDS COLOR SHIFTING BRACELET By Lsli Roglski Photo y Anrw Wirth Supruo DUETS TM from BSmith rt olor shifting fft tht mks your work tk on lif of its own s you mov! This

More information

CS 103 BFS Alorithm. Mark Redekopp

CS 103 BFS Alorithm. Mark Redekopp CS 3 BFS Aloritm Mrk Rkopp Brt-First Sr (BFS) HIGHLIGHTED ALGORITHM 3 Pt Plnnin W'v sn BFS in t ontxt o inin t sortst pt trou mz? S?? 4 Pt Plnnin W xplor t 4 niors s on irtion 3 3 3 S 3 3 3 3 3 F I you

More information

Chapter 18. Minimum Spanning Trees Minimum Spanning Trees. a d. a d. a d. f c

Chapter 18. Minimum Spanning Trees Minimum Spanning Trees. a d. a d. a d. f c Chptr 8 Minimum Spnning Trs In this hptr w ovr importnt grph prolm, Minimum Spnning Trs (MST). Th MST o n unirt, wight grph is tr tht spns th grph whil minimizing th totl wight o th gs in th tr. W irst

More information

Clustering for Processing Rate Optimization

Clustering for Processing Rate Optimization Clustring for Prossing Rt Optimiztion Chun Lin, Ji Wng, n Hi Zhou Eltril n Computr Enginring Northwstrn Univrsity Evnston, IL 60208 Astrt Clustring (or prtitioning) is ruil stp twn logi synthsis n physil

More information

CS553 Lecture Register Allocation I 3

CS553 Lecture Register Allocation I 3 Low-Lvl Issus Last ltur Intrproural analysis Toay Start low-lvl issus Rgistr alloation Latr Mor rgistr alloation Instrution shuling CS553 Ltur Rgistr Alloation I 2 Rgistr Alloation Prolm Assign an unoun

More information

CSI35 Chapter 11 Review

CSI35 Chapter 11 Review 1. Which of th grphs r trs? c f c g f c x y f z p q r 1 1. Which of th grphs r trs? c f c g f c x y f z p q r . Answr th qustions out th following tr 1) Which vrtx is th root of c th tr? ) wht is th hight

More information

Outline. Binary Tree

Outline. Binary Tree Outlin Similrity Srh Th Binry Brnh Distn Nikolus Austn nikolus.ustn@s..t Dpt. o Computr Sins Univrsity o Slzur http://rsrh.uni-slzur.t 1 Binry Brnh Distn Binry Rprsnttion o Tr Binry Brnhs Lowr Boun or

More information