Dominator Tree Certification and Independent Spanning Trees

Size: px
Start display at page:

Download "Dominator Tree Certification and Independent Spanning Trees"

Transcription

1 Domintor Tr Crtiition n Inpnnt Spnnin Tr Louk Gorii 1 Rort E. Trjn 2 rxiv: v3 [.DS] 7 Mr 2013 Otor 29, 2018 Atrt How o on vriy tht th output o omplit prorm i orrt? On n ormlly prov tht th prorm i orrt, ut thi my yon th powr o xitin mtho. Altrntivly on n hk tht th output prou or prtiulr input tii th ir input-output rltion, y runnin hkr on th input-output pir. Thn on only n to prov th orrtn o th hkr. But or om prolm vn uh hkr my too omplit to ormlly vriy. Thr i thir ltrntiv: umnt th oriinl prorm to prou not only n output ut lo orrtn rtiit, with th proprty tht vry impl prorm (who orrtn i y to prov) n u th rtiit to vriy tht th input-output pir tii th ir input-output rltion. W onir th ollowin importnt intn o thi nrl qution: How o on vriy tht th omintor tr o low rph i orrt? Exitin t lorithm or inin omintor r omplit, n vn vriyin th orrtn o omintor tr in th n o itionl inormtion m omplit. W in orrtn rtiit or omintor tr, how how to u it to ily vriy th orrtn o th tr, n how how to umnt t omintor-inin lorithm o tht thy prou orrtn rtiit. W lo rlt th omintor rtiit prolm to th prolm o inin inpnnt pnnin tr in low rph, n w vlop lorithm to in uh tr. All our lorithm run in linr tim. Prviou lorithm pply jut to th pil o only trivil omintor, n thy tk t lt qurti tim. Thi work i rwrittn n xpn omintion o two onrn ppr, Domintor Tr Vriition n Vrtx-Dijoint Pth, Pro. 16th ACM-SIAM Sympoium on Dirt Alorithm, pp , 2005, n Domintor, Dirt Bipolr Orr, n Inpnnt Spnnin Tr, Pro. 39th Intrntionl Colloquium on Automt, Lnu n Prormmin, pp , Dprtmnt o Computr Sin, Univrity o Ionnin, Gr. E-mil: louk@.uoi.r. 2 Dprtmnt o Computr Sin, Printon Univrity, 35 Oln Strt, Printon, NJ, 08540, n Hwltt-Pkr Lortori. E-mil: rt@.printon.u. Rrh t Printon Univrity prtilly upport y NSF rnt CCF n CCF Rrh whil viitin Stnor Univrity prtilly upport y n AFOSR MURI rnt. Th inormtion ontin hrin o not nrily rlt th opinion or poliy o th rl ovrnmnt n no oiil normnt houl inrr. 1

2 G D 1 Introution Fiur 1: A low rph n it omintor tr. A vxin prolm whn runnin omputr prorm i to vriy tht th output prou y th prorm i orrt. On option i to ormlly prov th orrtn o th prorm, ut i th prorm implmnt ophitit lorithm, thi my t t hllnin n t wort yon th powr o urrnt prorm vriition thniqu. A on option i to implmnt hkr [6]: n lorithm tht, ivn n input-output pir, vrii tht it tii th ir input-output rltion. For om prolm vn thi my hr. Thr i thir option: umnt th oriinl lorithm to prou not only th ir output ut lo orrtn rtiit, n implmnt rtiir: n lorithm tht, ivn n input-output pir n rtiit, u th rtiit to vriy tht th pir tii th ir input-output rltion. Th umnt lorithm houl iint th oriinl (to within ontnt tor), n th rtiir houl t lt iint th oriinl lorithm, muh implr, n y to prov orrt. W r th ollowin importnt intn o thi prolm: vriy th orrtn o th omintor tr o low rph. A low rph i irt rph G with int trt vrtx uh tht vry vrtx i rhl rom. A vrtx v omint vrtx w i v i on vry pth rom to w; i v w, v i trit omintor o w. Th omintor rltion in omintor tr D uh tht v omint w i n only i v i n ntor o w in D. (S Fiur 1.) Th omintor tr i ntrl tool in prorm optimiztion n o nrtion [13], n it h pplition in othr ivr r inluin ontrint prormmin [44], iruit ttin [3], thortil ioloy [1], mmory proilin [40], onntivity n pth-trmintion prolm [18, 19, 35], n th nlyi o iuion ntwork [25]. Lnur n Trjn [38] v two nr-linr-tim lorithm or omputin D tht run t in prti [24] n hv n u in mny o th pplition. Th implr o th run in O(mlo (m/n+1) n) tim on n n-vrtx, m-r low rph with n > 1. Th othr run in O(mα m/n (n)) tim. Hr α i untionl invr o Akrmnn untion in ollow: α (n) = min{k > 0 A(k, ) > n}, whr A i in rurivly y A(0,j) = j+1; A(k,0) = A(k 1,1) i k > 0; A(k,j) = A(k 1,A(k,j 1)) i k > 0, j > 0. Thi i liht vrint o Trjn oriinl inition [53]. Suquntly, mor-omplit ut truly linr-tim lorithm to omput D wr iovr [2, 7, 8, 21]. 2

3 Howoonknowthtthtrprouyonothtutomplitlorithm i in t th omintor tr? Thi nturl qution w k o th on uthor y Stv Wk in Rrhr in prorm vriition hv k th m qution [58]. Thi ppr i our nwr. Forml vriition o ny o th t lorithm h to our knowl nvr n on. Int, only muh implr ut muh lowr lorithm h n ormlly vrii [58]. It m hr vn to uil t hkr o th omintor tr. W tk th thir pproh to vriition: umnt th lorithm tht omput th omintor tr to prou in ition orrtn rtiit, uh tht it i impl to vriy th orrtn o th tr with th hlp o th rtiit. Hr wht impl mn i not riorou: in linr tim i nry n uiint or ontrutin th tr n hn or vriyin it, runnin tim nnot th mur o impliity. Our ol i linr-tim rtiir tht voi th thnil omplition o th t omintor-inin lorithm n i impl poil, impl nouh tht on oul ily ormlly prov th orrtn o th rtiir. (W lv thi tk or tho kill in prorm vriition.) Our rtiit i prorr o th vrti o D with rtin proprty, whih w ll low-hih. Sin low-hih orr i prorr, it n m in th rprnttion o D, or it n rprnt prtly. Vriyin tht n orr i low-hih i ntirly trihtorwr n n on ily in linr tim. In ition to proviin rtiir, w vlop linr-tim lorithm to omput low-hih orr ivn G n D. By in on o th lorithm to n lorithm to omput D, on otin rtiyin lorithm [41] to omput D. To otin our rult, w vlop nw thory out omintor n rlt onpt, thory tht h itionl pplition. W otin our inition o low-hih orr y nrlizin notion o Plin [43] n Chriyn n Ri [10], whih thy u in lorithm or ontrutin pir o ijoint pnnin tr. Suppo th omintor tr D i lt; tht i, h vrtx v h only on trit omintor,. Thn only n v r ommon to ll pth rom to v. By Mnr Thorm [42], thr r two pth rom to v ontinin no ommon vrtx othr thn n v. Whitty [57] prov tht uh pth n rliz or ll v y pir o tr: thr r pnnin tr B n R o G, root t, uh tht or ny v th pth rom to v in B n R hr only n v. W ll uh tr ijoint. Whitty tully prov omthin tronr: thr r two ijoint pnnin tr B n R root t uh tht, or ny itint vrti v n w, ithr th pth in B rom to v n th pth in R rom to w hr only, or th pth in R rom to v n th pth in B rom to w hr only. W ll uh tr tronly ijoint. Two tr n ijoint without in tronly ijoint, th xmpl in Fiur 2 how. Plhn[43] n inpnntly Chriyn n Ri[10] v implr proo o Whitty rult uin wht Chriyn n Ri ll irt t-numrin n intrmiry. Givn irt rph with n vrti n two itint vrti n t, irt t-numrin i numrin o th vrti rom 1 to n uh tht i numr 1, t i numr n, n vry othr vrtx v h n ntrin r rom mllr vrtx n n ntrin r rom lrr vrtx. Th proo o Whitty, o Plhn, n o Chriyn n Ri iv polynomil-tim ontrution o irt t-numrin n o tronly ijoint pnnin tr, ut thir ontrution m to rquir Ω(nm) tim in th wort. Huk [28] ltr v n O(nm)- tim lorithm to in two ijoint pnnin tr. Non o th proo or lorithm i 3

4 x y x y x y h i h i h i G B R Fiur 2: A rph with two ijoint ut not tronly ijoint pnnin tr. Grph G h lt omintor tr. Spnnin tr B n R r ijoint, ut th pir,h violt th onition or tron ijointn. pilly impl. Not tht i D i lt, ontrutin it i trivil, ut D provi no hlp in ontrutin two ijoint or tronly ijoint tr. Tht i, ontrutin two uh tr i irnt prolm thn inin D. Furthrmor, vriyin tht two pnnin tr r ijoint or tronly ijoint i not y. W xtn th onpt to ritrry low rph. Lt G low rph with vrtx t V, r t A, n trt vrtx. Lt T tr root t with vrtx t V (not nrily pnnin tr o G), with t(v) th prnt o v in T. A prorr o T i totl orr o it vrti otinl y oin pth-irt trvrl o T n orrin th vrti y irt viit. A prorr i o T i low-hih on G i, or ll v, (t(v),v) A or thr r two r (u,v) A, (w,v) A uh tht u i l thn v, v i l thn w, n w i not nnt o v. Two pnnin tr B n R root t r inpnnt i or ll v, th pth rom to v in B n R hr only th omintor o v; B n R r tronly inpnnt i or vry pir o vrti v n w, ithr th pth in B rom to v n th pth in R rom to w hr only th ommon omintor o v n w, or th pth in R rom to v n th pth in B rom to w hr only th ommon omintor o v n w. (S Fiur 3.) Th thr inition xtn th notion o t-numrin n ijoint n tronly ijoint pnnin tr, rptivly, to low rph with non-lt omintor tr. W prov tht vry low rph h pir o tronly inpnnt pnnin tr n it omintor tr h low-hih orr. W vlop linr-tim lorithm rlt to th onpt, nrlizin n iniintly improvin th prviou rult. W prnt vry impl rtiir tht, ivn low rph n trwithvrtxorr,vriithtthorrilow-hihnthtthtrithomintor tr o th low rph. W prnt n lorithm tht, ivn low rph n it omintor tr with low-hih orr, ontrut pir o tronly inpnnt pnnin tr. Th tr hv th itionl proprty tht thy r r-ijoint xpt or ri. (A ri i n r (u,v) uh tht vry pth rom to v ontin (u,v).) Tht th tr r tronly 4

5 [1] [8] [2] [1] [5] [4] [2] [6] [7] [8] [7] [6] [3] [3] [4] [5] G D [1] [1] [8] [2] [8] [2] [5] [4] [5] [4] [7] [3] [7] [3] [6] [6] B R Fiur 3: Th low rph o Fiur 1, it omintor tr with vrti numr in low-hih orr (numr in rkt), n two tronly inpnnt pnnin tr B n R. inpnnt ollow immitly rom th t tht th orr i low-hih. W prnt thr lorithm to ontrut low-hih orr, ivn low rph n it omintor tr. Th irt ppli only to ruil low rph (in low), l tht inlu yli low rph. Th on n thir pply to ritrry low rph, ut oth rquir itionl input: th on rquir loop-ntin inormtion (in in Stion 5), th thir rquir inormtion out mi-omintor (in in Stion 6). Th thir lorithm u th mi-omintor inormtion to ontrut pir o inpnnt pnnin tr, rom whih it thn ontrut low-hih orrin. Althouh oth tp r impl, th orrtn proo o th irt tp i urpriinly omplit. Mny prorm ontrol low rph r ruil. For th, th irt low-hih orr lorithm n u to rtiy th omintor tr. For ritrry low rph, ithr th on or thir lorithm n u. Mny pplition o omintor n loop inormtion wll; or th, th on lorithm i pproprit, in th loop inormtion mut omput nywy. Th t lorithm or inin omintor o o y omputin mi-omintor, mkin it y to xtn th lorithm to prou th inormtion n y th thir lorithm. I th low rph i not ruil, th pplition o not n loop inormtion, n omintor r omput y impl lorithm tht o not omput mi-omintor, uh th itrtiv lorithm o Coopr t l. [11], th on lorithmn u i loopromput, whih n onin nr-linr tim [54] uin 5

6 ijoint t union [53] or truly linr tim [7] uin itionl thniqu. Thu, pnin on th itution, t lt on o our thr lorithm n u to rtiy th omintor tr. Our ppr i rwrittn n xpn omintion o two onrn ppr [22, 23]. It ontin ix tion in ition to thi introution. Stion 2 introu om trminoloy n vlop om proprti o omintor tr. It lo prnt our lorithm to ontrut pir o tronly inpnnt pnnin tr ivn low-hih orr n to vriy th orrtn o omintor tr with low-hih orr. Stion 3 introu th riv rph, whih in t llow u to ru th prolm o ontrutin low-hih orr to th o lt omintor tr. Stion 4 prnt our lorithm or inin low-hih orr on ruil low rph. A prt o th implmnttion o thi lorithm, w vlop implii linr-tim lorithm or pil o th ynmi lit orr prolm [5, 14]. Thi lorithm my itl hv itionl pplition. Stion 5 n 6 ontin our lorithm to in low-hih orr on n ritrry low rph. Th lorithm in Stion 5 u loop inormtion, n th lorithm in Stion 6 u mi-omintor inormtion. Stion 7 iu othr pplition n opn prolm. 2 Domintor, Low-Hih Orr, n Stronly Inpnnt Spnnin Tr 2.1 Trminoloy Lt T root tr. W not y t(v) th prnt o vrtx v in T; t(v) = null i v i th root o T. I v i n ntor o w, T[v,w] i th pth in T rom v to w. I v i propr ntor o w, T(v,w] i th pth to w rom th hil o v tht i n ntor o w. Tr T i lt i it root i th prnt o vry othr vrtx. A prorr o T i totl orr o th vrti o T uh tht, or vry vrtx v, th nnt o v r orr onutivly, with v irt. Equivlntly, or h non-root vrtx v, t(v) i l thn v, n i x i nnt o v ut y i not, thn y i l thn v or rtr thn x. Th poil prorr o T r xtly tho tht n otin y totlly orrin th hilrn o h vrtx, oin pth-irt trvrl o T, n orrin th vrti in th orr thy r irt viit y th trvrl. Throuhout th rt o thi ppr, G i low rph with vrtx t V, r t A, trt vrtx, n no r ntrin : r ntrin n lt without tin ny o th onpt w tuy. W not y n th numr o vrti n y m th numr o r. To impliy oun w um n > 1. Sin m n 1, thi impli m = Ω(n). W not th omintor tr o G y D: i v, th prnt (v) o v in D i th immit omintor o v, th uniqu trit omintor o v omint y ll trit omintor o v. (Som uthor u iom(v) to not th immit omintor o v.) 2.2 Th prnt n ilin proprti Lt T root tr who vrtx t i ut o V. Tr T h th prnt proprty i or ll (v,w) A, t(w) i n ntor o v in T. Sin h no ntrin r, ut vry othr 6

7 vrtx h t lt on ntrin r (ll vrti r rhl rom ), th prnt proprty impli tht T i root t n h vrtx t xtly V. Tr T h th ilin proprty i v o not omint w or ll ilin v n w. Th prnt n ilin proprti r nry n uiint or tr to th omintor tr. Thorm 2.1. Tr D h th prnt n ilin proprti. Proo. Tr D h th ilin proprty y inition. Trjn [55, Lmm 7] prov tht D h th prnt proprty. For ompltn, w inlu proo hr. Suppo D violt th prnt proprty. Thn thr i n r (v,w) uh tht (w) (th immit omintor o w) i not n ntor o v in D; tht i, (w) o not omint v. But thn thr i pth rom to w tht voi (w), onitin o pth rom to v voiin (w) ollow y r (v, w). Thu (w) o not omint w, ontrition. Lmm 2.2. Suppo T h th prnt proprty. Lt u n v vrti uh tht v n u i not nnt o t(v) in T. Thn ny pth rom u to v ontin t(v). Proo. Conir ny pth rom u to v. Lt (x,y) th irt r on thi pth uh tht y i nnt o t(v) in T. By th prnt proprty, t(y) i n ntor o x in T. But in x i not nnt o t(v) in T, it mut th tht y = t(v). Tht i, th pth ontin t(v). Corollry 2.3. Suppo T h th prnt proprty. I v i n ntor o w in T, thn v omint w. Proo. Suppo v. By Lmm 2.2, ny pth rom to v ontin t(v), o t(v) omint v. Th orollry ollow y th trnitivity o ominn. Corollry 2.4. Suppo T h th prnt proprty n v. I x i vrtx on impl pth P rom t(v) to v, thn x i nnt o t(v) ut not propr nnt o v. Proo. I x wr non-nnt o t(v), th prt o P rom x to v woul ontin t(v) y Lmm 2.2, o P woul not impl. I x wr propr nnt o v, th prt o P rom t(v) to x woul ontin v y Lmm 2.2, o P woul not impl. Thorm 2.5. A tr T h th prnt n ilin proprti i n only i T = D. Proo. Thorm 2.1 iv th i hl o th thorm. Suppo T h th prnt proprty. By Corollry 2.3, i v i n ntor o w in T, thn v omint w. Suppo v omint w ut v i not n ntor o w. Sin v w, w o not omint v. By Corollry 2.3, w i not n ntor o v in T, o v n w r unrlt. Lt u th nrt ommon ntor o v n w in T, n lt x n y th hilrn o u tht r ntor o v n w. By Corollry 2.3, x omint v n y omint w. By th trnitivity o th omintor rltion, x omint w. Sin oth x n y omint w, on mut omint th othr, whih violt th ilin proprty. Thi iv th only i hl o th thorm. By Thorm 2.5, to vriy tht tr T i th omintor tr, it ui to how (1) T i root tr, (2) T h th prnt proprty, n (3) T h th ilin proprty. It i trihtorwr to vriy (1) in O(n) tim, umin tht T i ivn y it prnt untion: 7

8 w jut n to hk tht th prnt untion i in or ll vrti othr thn n tht thr r no yl. It i lo y to vriy (2). Thi tk O(1) tim pr r, or totl o O(m) tim, ivn n O(1)-tim tt o th ntor-nnt rltion. Thr r vrl impl O(1)-tim tt o thi rltion [51]. Th mot onvnint on or u i to numr th vrti rom 1 to n in ny prorr o T, n to omput th numr o nnt o h vrtx v, whih w not y iz(v). I vrti r intii y numr, v i n ntor o w i n only i v w < v+iz(v). I T i ivn y it prnt untion, w n numr th vrti n omput thir iz y irt uilin lit o hilrn or h vrtx n thn oin pth-irt trvrl, ll o whih tk O(n) tim. Th hrt tp in vriition i to how (3). W hll prov tht tr with th prnt proprty h th ilin proprty i n only i it h low-hih orr. W prov uiiny in thi tion n nity in Stion 4 or ruil rph, n in Stion 5 or ritrry rph. Unlik th prnt proprty, whih i y to tt, it i not o y to tt or th xitn o low-hih orr, lthouh it i y to tt i ivn orr i low-hih. Thu w pl th urn o ontrutin uh n orr on th lorithm tht omput th omintor tr, not on th vriition lorithm: th orr rtii th orrtn o th tr. 2.3 Contrution o Two Stronly Inpnnt Spnnin Tr To prov tht tr with th prnt proprty n low-hih orr h th ilin proprty, n u it i intrtin in it own riht, w how how to ontrut pir o tronly inpnnt pnnin tr, ivn tr T with th prnt proprty n low-hih orr. Alorithm 1: Contrution o Two Stronly Inpnnt Spnnin Tr B n R Lt T tr with th prnt proprty n low-hih orr. For h vrtx v, pply xtly on o th ollowin to hoo r ((v),v) in B n (r(v),v) in R (i C 1 n 2 oth pply, pply ithr on): C 1: Thr r two r (u,v) n (w,v) uh tht u < v < w in low-hih orr n w i not nnt o v in T. Choo two uh r, n t (v) = u n r(v) = w. C 2: (t(v),v) i n r n thr i nothr r (u,v) uh tht u < v in low-hih orr. Choo uh n r, n t (v) = u n r(v) = t(v). C 3: (t(v),v) i th only r ntrin v rom non-nnt o v. St (v) = r(v) = t(v). Alorithm1ppli to thrphinfiur1withth low-hihorr infiur3prou th tr hown in Fiur 3. Lmm 2.6. Lt T tr with th prnt proprty n low-hih orr. For ny vrtx 8

9 v, t lt on o C 1, 2, n 3 ppli. Thu Alorithm 1 in (v) n r(v) or ll v. Proo. Lt v vrtx to whih C 1 o not pply. Th inition o low-hih orr impli tht (t(v),v) A. I (t(v),v) i th only r ntrin v rom non-nnt o v, thn C 3 ppli. Othrwi, thr i n r (u,v) uh tht u t(v) n u i not nnt o v. Sin C 1 o not pply, u < v in low-hih orr, o C 2 ppli. Lmm 2.7. For ny vrtx v, thr i pth in R rom t(v) to v ontinin only t(v) n vrti no l thn v in low-hih orr. Proo. Suppo th lmm i l. Lt v th lrt vrtx in low-hih orr or whih it il. Thn r(v) t(v), o r(v) > v n r(v) i not nnt o v. Lt x th ilin o v tht i n ntor o r(v). Sin r(v) > v n th orr i prorr, ll nnt o x r rtr thn v. Th hoi o v impli tht th lmm hol or x n ll it nnt. It ollow tht thr i pth in R rom t(x) to x to r(v) tht ontin only t(x) n vrti no l thn x. Ain (r(v),v) to thi pth iv pth rom t(v) = t(x) to v tiyin th lmm, ontrition. Thorm 2.8. B n R r tronly inpnnt pnnin tr root t. Proo. Firt w prov tht B n R r pnnin tr root t, thn tht thy r inpnnt, n inlly tht thy r tronly inpnnt. Sin h vrtx v h n ntrin r ((v),v) with (v) < v, B i pnnin tr root t. By Lmm 2.7, vry vrtx i rhl rom in R, o R i lo pnnin tr root t. Suppo B n R r not inpnnt. Lt v th minimum vrtx uh tht B[,v] n R[,v] hr vrtx othr thn omintor o v. By Corollry 2.3, t(v) omint v, o B[,v] n R[,v] oth ontin t(v). By th hoi o v, B[,t(v)] n R[,t(v)] hr only omintor o t(v). By Corollry 2.4, no vrti on B[,t(v)] or R[,t(v)] r propr nnt o t(v), ut ll vrti on B[t(v),v] n R[t(v),v] r nnt o t(v), o B[t(v),v] n R[t(v),v] mut hr vrtx othr thn t(v) n v. But B[t(v),v] ontin only v n vrti l thn v, n y Lmm 2.7, R[t(v),v] ontin only t(v) n vrti no l thn v, o B[t(v),v] n R[t(v),v] hr only t(v) n v, ontrition. Thu B n R r inpnnt. Suppo tht B n R r not tronly inpnnt; lt v n w vrti uh tht v < w n B[,v] n R[,w] hr vrtx othr thn ommon omintor o v n w. Lt u th nrt ommon ntor o v n w in T, whih omint oth. Sin B n R r inpnnt, B[,u] n R[,u] hr only omintor o u, whih r ommon omintor o v n w. By Corollry 2.4, B[,u] n R[,u] ontin no propr nnt o u, ut ll vrti on B[u,v] n R[u,w] r nnt o u, o B[,u] n R[u,w] ontin only u in ommon, o R[,u] n B[u,v]. I ollow tht B[u,v] n R[u,w] hr vrtx othr thn u. Thi impli tht v n w r unrlt. Lt x n y th hilrn o u tht r ntor o v n w, rptivly. All nnt o x r l thn ll nnt o y. Pth B[u,v] ontin only vrti l thn y, n R[u,w] ontin only u n vrti no l thn y, o B[u,v] n R[u,w] hr only u, ontrition. Thu B n R r tronly inpnnt. 9

10 Rmrk: For two itint vrti v n w, th low-hih orr tll u whih pir o pth, B[,v] n R[,w], or R[,v] n B[,w], hr only th ommon omintor v n w: th ormr i v < w, th lttr i v > w. Alorithm 1 run in O(m) tim, ivn n O(1)-tim tt o th ntor-nnt rltion: or h vrtx v, w xmin th ntrin r until inin two tht llow C 1 or 2 to ppli, or runnin out o ntrin r, llowin C 3 to ppli: v mut hv t lt on ntrin r rom non-nnt; i thr i xtly on uh r, it mut (t(v), v). To tt th ntor-nnt rltion, w u th O(1)-tim tt ri ov, with th low-hih orr rvin th prorr. C 3 ppli only whn (t(v),v)i ri (ll pth rom to v ontin (t(v),v)), o B n R r r-ijoint xpt or th ri. Trjn [54] prviouly v nr-linr-tim lorithm, uquntly improv to linr tim [7], to ontrut pir o pnnin tr tht r r-ijoint xpt or th ri. Hi ontrution n not prou inpnnt pnnin tr, howvr. I w r willin to llow B n R to hr non-ri, thn w n impliy Alorithm 1 y ominin C 2 n 3 into on : C 2 : (t(v),v) i n r. St (v) = r(v) = t(v). Thorm 2.9. I T h th prnt proprty n h low-hih orr, thn T h th ilin proprty, n hn T = D. Proo. Apply Alorithm 1 to ontrut two tronly inpnnt pnnin tr B n R root t. Lt v n w ilin with ommon prnt u in T. Aum without lo o nrlity tht v < w. Th pth B[,v] voi w, o w o not omint v. Th pth B[,u] ollow y R[u,w] ontin no vrti rtr thn u n l thn w n hn voi v, o v o not omint w. Thu T h th ilin proprty. By Thorm 2.5 T = D. A qution ri y Alorithm 1 i whthr vry pir o tronly inpnnt pnnin tr i th rult o pplyin Alorithm 1 to om low-hih orr o D. Th nwr i no. Conir th rph G n it pnnin tr B n R hown in Fiur 4. Th omintor tr D o G i lt (v impli (v) = ), n B n R r tronly inpnnt. Dltin r in D rom G n rvrin r in R rult in th yl Γ hown in Fiur 4. I B n R wr ontrutil y Alorithm 1 rom om low-hih orr o D, Γ woul yli. 2.4 Vriition o Domintor Tr with Low-Hih Orr Now w turn to th prolm o vriyin tht vrtx orr i low-hih. Lt tr T pii y it prnt untion, with vrtx orr ivn numrin rom 1 to n. W n vriy tht th orrin i low-hih ollow. Contrut lit o th hilrn o h vrtx in inrin orr, y innin with mpty lit n in h vrtx v in inrin orr to th k o th lit or t(v). Do pth-irt trvrl o T to vriy tht th orrponin prorr i th m th ivn orr. Durin th trvrl, omput th iz o h vrtx. Atr th trvrl, tt tht th orr i low-hih y xminin th r ntrin h vrtx n vriyin th xitn o th on or two r n to mk 10

11 G Γ B R Fiur 4: Two tronly inpnnt pnnin tr not ontrutl y Alorithm 1. th orr low-hih, uin th numr n iz to tt th ntor-nnt rltion in O(1) tim. Thu w otin th ollowin lorithm to vriy omintor tr with low-hih orr: Alorithm 2: Vriition o Domintor Tr D with Low-Hih Orr Stp 1: Vriy tht th ivn tr D i tully tr. Stp 2: Contrut lit o th hilrn o h vrtx in inrin orr. Do pth-irt trvrl o D to vriy tht th prorr nrt y th rh i th m th ivn orr n to omput th iz o h vrtx. Stp 3: Chk tht th r tiy th prnt proprty n tht h vrtx h th on or two ntrin r n to mk th orr low-hih, uin th numr n iz to tt th ntor-nnt rltion in O(1) tim. Stp 1 n 2 tk O(n) tim; Stp 3 tk O(m) tim. W onlu thi tion with lmm out th trutur o tronly onnt urph tht w hll n in Stion 5. A urph o G i tronly onnt i thr i pth rom ny vrtx in th urph to ny othr vrtx in th urph ontinin only vrti in th urph. Lmm Lt T tr with th prnt proprty, n lt S th t o vrti o tronly onnt urph o G. Thn S onit o t o ilin in T n poily om o thir nnt in T. 11

12 G Fiur 5: Th riv rph o th low rph o Fiur 1. Proo. Lt x th nrt ommon ntor in T o th vrti in S. I x S th lmm hol: S ontin x n poily om o it nnt in T. I x S, thr r t lt two hilrn o x in T tht hv vrti in S nnt, n ll vrti in S r nnt o uh hilrn. Any pth rom non-nnt o uh hil o x to nnt mut ontin x y th prnt proprty. Thu ny uh hil mut in S. 3 Th Driv Grph Thorm 2.9 tt tht tr with th prnt proprty n low-hih orr h th ilin proprty n hn i D. It rmin to prov th onvr, nmly tht D h low-hih orr, n to vlop t lorithm to in uh n orr. W o thi in th nxt thr tion. In thi tion w introu th riv rph [55], whih mk our tk ir y in t ruin th prolm o inin low-hih orr to th o lt omintor tr. Lt T tr with th prnt proprty. (Tr T oul D or tr lim to D.) By th inition o th prnt proprty, i (v,w) i n r, th prnt t(w) o w i n ntor o v in T. Th riv r o (v,w) i null i w i n ntor o v, (v,w) othrwi, whr v = v i v = t(w), v i th ilin o w tht i n ntor o v i v t(w). Th riv rph G i th rph with vrtx t V n r t A = {(v,w) (v,w) i th non-null riv r o om r in A}. S Fiur 5. Thi inition ir rom th oriinl [55] in tht it omit l-loop (r o th orm (v,v)), whih r irrlvnt or our purpo. Lmm 3.1. Tr T h th prnt proprty in G. Proo. Eh riv r l rom vrtx to on o it hilrn or ilin. Lmm 3.2. I P i impl pth rom to v in G, thr i impl pth rom to v in G ontinin only vrti on P. Proo. By inution on th numr o r on P. Th lmm i immit i P h no r. Suppo P h t lt on r. Lt (u,v) th lt r on P. Sin P i impl, u nnot nnt o v y Corollry 2.3. Thu (u,v) h non-null riv r (u,v). Sin 12

13 u i n ntor o u in T, u i on P y Corollry 2.3. By th inution hypothi, thr i impl pth P rom to u in G ontinin only vrti on th prt o P rom to u. Ain (u,v) to thi pth iv th ir pth P. Corollry 3.3. Grph G i low rph. Proo. By Lmm 3.2, in G ll vrti r rhl rom. Lmm 3.4. I (v,w) i th non-null riv r o n r (v,w), thr i pth in G rom v to w ontinin only w n nnt o v in T. Proo. By Corollry 2.3, v omint v. Sin G i low rph, thr i pth P rom to v. Pth P ontin v. By Corollry 2.4, th prt o P rom v to v ontin only nnt o v in T. Ain (v,w) to th n o thi pth iv pth tiyin th lmm. Corollry 3.5. I G i yli, o i G. Proo. I G ontin yl, o woul G y Lmm 3.4. Lmm 3.6. Tr T h th ilin proprty in G i n only i it h th ilin proprty in G. Tht i, T i th omintor tr o G i n only i it i th omintor tr o G. Proo. Lt v n w ilin in T. Suppo thr i impl pth P rom to w in G tht voi v. Thn th pth P rom to w in G ivn y Lmm 3.2 lo voi v. Suppo thr i impl pth P rom to w in G tht voi v. Lt u th ommon prnt o v n w. By Corollry 2.4, thr i pth in G rom to u tht ontin no propr nnt o u n hn voi v. Thu ll w n to how i tht thr i pth rom u to w in G tht voi v. Th prt o P rom u to w onit o n r rom u to hil o u, ollow y qun o r rom on hil o u to nothr, no uh hil in v. Th irt uh r i lo n r o G. Conir on o th riv r (x,y) on P rom on hil o u to nothr. By Lmm 3.4 thr i pth in G rom x to y tht ontin only y n nnt o x in T, n hn voi v. Thu w n rpl h r o th prt o P rom u to w y v-voiin pth in G. Thror thr i pth in G rom to w tht voi v. Lmm 3.7. A prorr o T i low-hih on G i n only i it i low-hih on G. Proo. Lt v. Suppo th orr i low-hih on G. By Thorm 2.9, T = D. Lt v. I (t(v),v) A, thn (t(v),v) A. I (t(v),v) A, thr r r (u,v) n (w,v) uh tht u < v < w in th ivn prorr n w i not nnt o v in T. Vrtx u i not nnt o v in it i numr l thn v. Thu (u,v) n (w,v) hv non-null riv r (u,v) n (w,v), u n w r ilin o v in T, n u < v < w in th ivn prorr. Thu th orr i low-hih on G. Suppo th orr i low-hih on G. Lt v. I (t(v),v) A, thn (t(v),v) A. I (t(v),v) A, thr r r (u,v) n (w,v) in G with non-null riv r (u,v) n (w,v) uh tht u < v < w in th ivn prorr n u n v r ilin o v in T. Sin th orr i prorr, u < v < w in th prorr. Furthrmor w i not nnt o v. Thu th orr i low-hih on G. 13

14 Alorithm 3: Contrution o Driv Ar Stp 1: Lt T tr with th prnt proprty. Numr th vrti o T rom 1 to n in prorr n omput th iz o h vrtx. Intiy vrti y numr. Stp 2: Dlt h r (v,w) uh tht v i nnt o w in T. Stp 3: For h r (v,w) uh tht v = t(w), lt (v,w) it riv r. Stp 4: Forhr(v,w)uhthtv nwrunrlt, ontruttripl(t(w),v,w). For h vrtx u > 1, ontrut tripl (t(u),u,0). Stp 5: Sort th tripl in inrin lxiorphi orr y oin thr-p rix ort. Stp 6: Pro th tripl in inrin orr. To pro tripl o th orm(t(u),u,0), t x = u, whr x i lol vril. To pro tripl o th orm (t(w),v,w), lt (x,w) th riv r o (v,w). W n in th riv r in O(m) tim with Alorithm 3. Thorm 3.8. Alorithm 3 i orrt. Proo. Stp 2 n 3 orrtly hnl th r (v,w) uh tht v n w r rlt in T. Conir n r (v,w) uh tht v n w r unrlt in T. Lt (v,w) th riv r o (v,w). Thn t(v ) = t(w) n v v, o tripl (t(v ),v,0) pr (t(w),v,w) on th tripl r ort lxiorphilly. Suppo thr i tripl (t(u),u,0) ollowin (t(v ),v,0) ut prin (t(w),v,w). Thn t(u) = t(v ) n v < u v. But vrti r numr in prorr, o u mut nnt o v, ontrition. Hn thr i no uh tripl (t(u),u,0), whih impli x = v whn (t(w),v,w) i pro, o Stp 6 orrtly omput th riv r o (v,w). 4 Ruil Flow Grph A ruil low rph [27, 52] i on in whih vry tronly onnt urph S h inl ntry vrtx v uh vry pth rom to vrtx in S ontin v. Thr r mny quivlnt hrtriztion o ruil low rph [52], n thr r lorithm to tt ruiility in nr-linr[52] n truly linr[7] tim. On notion o trutur prorm i tht it low rph i ruil. Ruiility implii mny omputtion, lthouh not th omputtion o omintor, r w n tll. A low rph i ruil i n only i it om yli whn vry r (v,w) uh tht w omint v i lt [52]. Dltion o uh r o not hn th omintor tr, in no uh r n on impl pth rom. Dltin uh r thu ru th prolm o inin low-hih orr on ruil low rph to th m prolm on n yli rph. Suh rph h topoloil orr ( totl orr uh tht i (x,y) i n r, x i orr or y) [36]. 14

15 Th ollowin lmm provi wy to in th r n to tiy th low-hih proprty on ruil rph: Lmm 4.1. Lt T tr with th prnt proprty, n lt G th orrponin riv rph. Suppo T h th ilin proprty in G (or in G ). I v, thn (t(v),v) A (n in A ) or v h in-r t lt two in G. Proo. Sin T h th ilin proprty, T = D. Suppo th lmm i l or om v. Sin v i rhl rom y impl pth, thr i n r (u,v) uh tht v o not omint u. Lt (u,v) th riv r o (u,v). Sin th lmm i l or v, u (v), n thr i no othr r (w,v) with riv r (w,v) uh tht w u. But thn u omint v, ontritin th ilin proprty. Lmm 4.1 hol or ritrry rph. For ruil rph, th onition in Lmm 4.1 i not only nry ut uiint or tr T with th prnt proprty to hv th ilin proprty: Lmm 4.2. Suppo G i ruil. Lt T tr with th prnt proprty, n lt G th orrponin riv rph. Thn T h th ilin proprty i, or ll vrti v, (t(v),v) A or v h in-r t lt two in G. Proo. Dlt ll r (x,y) uh tht y omint x. Thi o not hn th omintor, nit mk thrphyli. Suppoth lmm i l. Lt u, v pir oilin uh tht u omint v, with v minimum in om topoloil orr (n orr uh tht i (x,y) i n r, x i orr or y). Thr i pth rom to t(v) tht voi u y Corollry 2.4. Thu i (t(v),v) A, u o not omint v, ontrition. I (t(v),v) A, thr i n r (x,v) in G with riv r (x,v) uh tht x i ilin o u n v ut x u. By th hoi o v, u o not omint x, o it nnot omint v, ontrition. 4.1 Low-hih orr on ruil low rph To in low-hih orr on ruil rph, w lt r (x,y) uh tht y omint x, mkin th rph yli. W thn ontrut or h vrtx n orr lit o it hilrn in D y proin th vrti othr thn in topoloil orr n inrtin h vrtx into it t o ilin in poition trmin y th r or r who xitn i urnt y Lmm 4.1. Atr uilin th orr lit o hilrn, w otin low-hih orr y oin pth-irt trvrl o D. Thi pproh iv u Alorithm 4. Fiur 6 how how thi lorithm work. Thorm 4.3. Alorithm 4 i orrt. Proo. Atr Stp 1, G i yli n vry r h riv r. I (v,w) i n r with riv r (v,w), v i n ntor o v, o thr i pth rom v to v. It ollow tht whn vrtx v i pro in Stp 2, x i in C((v)) or vry riv r (x,v) uh tht x (v). By th onition in Lmm 4.2, ithr ((v),v) i n r or thr r riv r (u,v) n (w,v) uh tht u w. Thu th inrtion o v into C(v) will u. Stp 4 prou prorr o T. Lt v ny vrtx othr thn. I ((v),v) A, thr r 15

16 Alorithm 4: Contrution o Low-Hih Orr on Ruil Flow Grph Stp 1: Dlt vry r (v,w) uh tht w i n ntor o v in D, n in th riv r (v,w) o h rminin r (v,w) with rpt to D. Stp 2: For h vrtx v, initiliz it lit o hilrn C(v) to mpty. Apply th ollowin tp to h vrtx v in topoloil orr on G (or on G ): I ((v),v) A, inrt v nywhr in C((v)). Othrwi, in riv r (u,v) n (w,v) uh tht u w. Inrt v jut or u in C((v)) i w i or u in C((v)), jut tr u othrwi. Stp 3: Do pth-irt trvrl o D, viitin th hilrn o h vrtx v in thir orr in C(v). Numr th vrti rom 1 to n thy r viit. Th rultin orr i low-hih on G. r (u,v) n (w,v) in A with riv r (u,v) n (w,v), rptivly, uh tht v i orr twn u n w, n u n w r ilin in T. Sin th orr i prorr, v i orr twn u n w. Thu th orr i low-hih. Whn uin Alorithm 4 in omintion with th omintor rtiition lorithm (Alorithm 2), w n omit Stp 3 in Alorithm 4, in Stp 2 in Alorithm 2 o th m tr trvrl n numrin. Tht i, it ui to rprnt th low-hih orr y th orr lit o hilrn prou y Stp 2. Rmrk: I w wnt to vriy th omintor tr o ruil rph ut r not intrt in ontrutin low-hih orr, w n o th vriition uin Lmm 4.2. Givn D, w vriy tht D i tr with th prnt proprty in Stion 2, omput th riv rph in Stion 3 (vriyin th orrtn o th riv rph uin ntor-nnt tt), n vriy th onition in Lmm 4.2. Th totl tim or vriition y thi mtho i O(m). It i y to implmnt mot o Alorithm 4 to run in O(m) tim. In Stp 1 w in th r to lt uin n O(1)-tim ntor-nnt tt iu prviouly, n w in th riv r uin Alorithm 3. In Stp 2, inin topoloil orr tk O(m) tim uin ithr uiv ltion o vrti o in-r zro [36, 37] or pth-irt rh [51]. Finin th n r in Stp 2 tk O(1) tim pr r, or totl o O(m) tim. Stp 3 tk O(m) tim. Th only hr prt i ontrutin th lit o hilrn in Stp O-lin ynmi lit mintnn For ontrutin th lit o hilrn, w n t trutur tht mintin lit ujt to inrtion n orr quri: ivn x n y in th lit, whih our irt? Thi i th ynmi lit mintnn prolm. Thr r olution to thi prolm tht upport 16

17 (,) (,,) (,,,) (,,,,) (,,,,,) (,,,,,,) (,,,,,,,) Fiur 6: Computtion o low-hih orr trtin with n yli riv rph. Vrti r pro in th topoloil orr (,,,,,,,); th vrtx pro t h pplition o Stp 2 i hown ill. inrtion n orr tt in O(1) tim, ithr mortiz or wort- [5, 14]. Unortuntly, th olution r rthr omplit, pilly tho with n O(1) wort- tim oun. Fortuntly, w only n olution to pil o ynmi lit mintnn, in whih thr r no ltion n, mor importntly, th qun o oprtion i ivn o-lin in n pproprit n. For thi vrion o th prolm thr i impl olution, whih w now ri. Givn n initil lit with no itm, w wnt to prorm o-lin n intrmix qun o th ollowin thr kin o intrution, n thn numr th itm in th inl lit onutivly rom 1. tr(x,y): Rturn tru i x i tr y in th urrnt lit, l othrwi. Itm x n y mut in th urrnt lit. inrt(x): Inrt x nywhr in th lit. 17

18 inrt(x,y,tt): I tt i tru, inrt x jut tr y; othrwi, inrt x jut or y. Itm y ut not x mut in th urrnt lit; tt i Booln omintion o tru n ix numr o tr quri. Alorithm 5 iv impl n iint olution to thi prolm. Alorithm 5: O-Lin Exution o Squn o Inrt n Atr Intrution Stp 1 (o-lin): Contrut root tr with on non-root vrtx or h itm vr in th lit, n root. Th prnt o itm x i th root i thr i n intrution inrt(x), or y i thr i n intrution inrt(x,y,tt). For h no x, lt iz(x) th numr o no in it utr. Stp 2 (on-lin): Exut th intrution in qun whil mintinin n intrvl [i,j] or th root n or h itm urrntly in th lit. Hr i n j r intr uh tht i j. Th intrvl will ijoint. Initilly th root h intrvl [0, iz(root)]. Givn qury tr(x, y), nwr tru i th intrvl or x ollow tht o y, l othrwi. Givn n intrution inrt(x) uh tht th root h intrvl [i,j], rpl th intrvl or th root y [i,j iz(x)] n iv x th intrvl [j iz(x)+1,j]. (Thi orrpon to inrtin x irt in th lit.) Givn n intrution inrt(x,y,tt) uh tht y h intrvl [i,j], i tt i tru rpl th intrvl or y y [i,j iz(x)] n iv x th intrvl [j iz(x) + 1,j]; i tt i l iv x th intrvl [i,i + iz(x) 1] n rpl th intrvl or y y [i+iz(x),j]. (Th ormr orrpon to inrtin x tr y, th lttr to inrtin x or y.) Stp 3: Atr Stp 2, th root h intrvl [0,0], n h itm x h n intrvl [i,i] or om i > 0, i itint or h x. I itm x h intrvl [i,i], in numr i to x. Thi numr th itm onutivly rom 1 in lit orr. Thorm 4.4. Alorithm 5 i orrt. Proo. W n viw Stp 2 trtin with th tr ontrut in Stp 1, uttin th r (root,x) whn inrt(x) our, n uttin th r (y,x) whn inrt(x,y,tt) our. Th itm urrntly in th lit r xtly th root o th tr into whih th initil tr h n ut, xluin th initil root. Eh r ut onnt root with hil. Th intrvl o root ontin xtly mny intr th numr o vrti in it urrnt tr, plu on i it i th initil root. It ollow tht h intrvl [i,j] h i j, whih urnt tht th implmnttion i orrt. W u Alorithm 5 to implmnt Stp 2 o Alorithm 4 ollow. For h v, w ontrut qun o th oprtion tht vrti to C(v), ollow: For h ition o vrtx x to C(v) in n ritrry poition, w ontrut n oprtion inrt(x). For h ition o vrtx x or or tr nothr vrtx y pnin on whthr tt i tru, w 18

19 ontrut n oprtion inrt(x,y,tt). Eh uh tt i inl tr qury; thr r no othr quri. W o th lit oprtion uin Alorithm 5. At th n o Alorithm 5, th itm in C(v) will numr onutivly in lit orr. U o Alorithm 5 limint th n to u omplit on-lin ynmi lit orr lorithm. Alorithm 5 my hv othr pplition wll. 5 Low-Hih Orr rom Loop Ntin Inormtion In thi tion w xtn th low-hih orrin lorithm o Stion 4 to ritrry low rph. To o o w mut ovrom th irulrity u y yl. Rmlinn [46] h hown how to ru th prolm o omputin omintor on n ritrry low rph to omputin omintor on n yli rph. Hi rution run in O(mα m/n (n)) tim n n improv to run in O(m) tim: it i n xtnion o th omputtion o loop ntin ort tht w iu low. Rmlinn rution hn th rph n hn t th low-hih orr. For thi ron w o not u hi rution ut our ontrution irtly on th loop ntin ort. Th rouh i i to rptly ontrt tronly onnt urph to inl vrti until no yl xit. Thn w pply th lorithm o Stion 4 to th rultin yli rph, ut whn vrtx orrponin to ontrt urph i to pro, w xpn th urph n pro it vrti, rurivly xpnin h uh vrtx tht itl orrpon to ontrt urph. To otin qun o urph to ontrut, w u th notion o loop ntin ort. Thr r vrl wy to in uh ort [26, 39, 46, 49, 50, 54]. Th on w u w irt prnt y Trjn [54] n ltr riovr y Hvlk [26]. It i prtiulr o mor nrl inition [39, 46]. Lt F th pnnin tr nrt y pth-irt rh o G trtin rom, with (v) th prnt o vrtx v in F. Evry yl in G ontin n r rom nnt to n ntor in F [51]. Suh n r i ll k r. Numr th vrti rom 1 to n in rvr potorr with rpt to th rh, n intiy vrti y numr. (Potorr, lo known inihin orr, i th orr in whih th rh inih it vrtx viit. S [51].) An r i k r i n only i it l rom lrr to mllr vrtx [51]. Dltin th k r mk th rph yli, n mk th vrtx orr ivn y th numrin topoloil [51]. Th h h(v) o vrtx v i th mximum propr ntor u o v in F uh tht thr i pth romv to u ontinin only nnt o u in F; i thr i no uh u, h(v) = null. Th h in loop ntin ort H: h(v) i th prnt o v in H. Grph G i yli i n only i ll h r null. For h vrtx v tht i not l in H, th nnt o v in H inu non-trivil tronly onnt urph o G, ll loop. Bu H i tr, ny two loop r ithr ijoint or on ontin th othr. Fiur 7 illutrt th onpt. In nrl H pn on F. Grph G i ruil i n only i vry F in th m H. Fort H in ontrtion qun ollow. For h vrtx v in rin orr, i v i not l in H, ontrt th urph inu y v n ll it hilrn into inl vrtx v. Thi urph i th intrvl o v. Th intrvl o v i tronly onnt (jut or it i ontrt), n ll it vrti r nnt o v in F. I ll r lvin v r lt rom it intrvl, th intrvl om yli, n v i th uniqu vrtx with 19

20 h i j k l G [1] [1] [2] [2] [3] [3] [10] [4] [10] [4] i[13] [11] h[6] [5] i[13] [11] h[6] [5] j[12] l[8] [7] j[12] l[8] [7] k[9] k[9] F H Fiur 7: A rph, pth-irt pnnin tr (tr r r oli, non-tr r r h) with vrti numr in rvr potorr(in rkt), n th orrponin loop ntin ort. Thr r iv loop, with h,,, h,. 20

21 no outoin r. Thu, i on trt rom ny vrtx in th intrvl othr thn v n ollow ny pth in th intrvl, on vntully rh v without rptin vrtx. S Fiur 8. Not tht intrvl r in in th ontrt rph, whr loop r in in th oriinl rph. Mny pplition o omintor n loop ntin ort wll [7, 17, 35, 46, 54]. Suh ort n omput in O(mα m/n (n)) tim ([54], ltr riovr [45]) or y mor-omplit lorithm in O(m) tim [7]. Th lorithm rquir l mhinry thn th t lorithm or inin omintor ( [7]), ut thy r not ntirly trihtorwr. It i y to xtn th lorithm to in, or h vrtx v tht i not root o H, n outoin r rom v in th intrvl o h(v), lon with th orrponin oriinl r; in, th ort-ontrution lorithm pro y trvrin uh outoin r kwr, oin o y xminin th orrponin oriinl r. W hll um tht loop ntin ort, oit outoin r, n th orrponin oriinl r r vill; i not, thy n omput y on o th it lorithm. Lmm 5.1. Lt u vrtx, n lt (v,w) n r uh tht w i nnt o u in H. Thn v i nnt o u in H i n only i v u. Proo. Sin ll nnt o u in H r lo nnt o u in F, w > u. I v > w, thn (v,w) i k r n v i nnt o w in H n hn nnt o u in H. Suppo v < w. I v u, v i nnt o u in F n hn nnt o u in H. Suppo v < u. Thn v i not nnt o u in F, n hn nnot nnt o u in H. Lmm 5.2. Lt T tr with th prnt proprty. Lt u, n lt (v,w) n r uh tht w ut not v i nnt o u in H. Thn w i u or ilin o u in T. Proo. By th prnt proprty, i x i n ntor o y in T, thn x omint y. Thi impli x i n ntor o y in F, o x < y. Th t S o nnt o u in H inu tronly onnt urph o G. By Lmm 2.10, S onit o t o ilin n poily om o thir nnt in T. Sin v i not uh nnt, th prnt proprty impli tht w i on o th ilin. Sin u i minimum in S, u i lo on o th ilin. To urnt th xitn o r to tiy th low-hih proprty, w n n nlou o Lmm 4.1. For h vrtx u, w not y ( (u),u) th riv r o ((u),u), whih i non-null u th pth in F rom to (u) voi u. Lmm 5.3. Lt T tr with th prnt proprty. Thn T h th ilin proprty i n only i, or h u, (u) = t(u) or thr i n r (y,w) with riv r (y,w) uh tht w i nnt o u in H, y < u, n y (u). Proo. I x omint z, x mut n ntor o z in F, o x z. Thu i r (x,v) h riv r (x,v), x x. Suppo T h th ilin proprty. Lt u uh tht (u) t(u). Thn (u) i ilin o u in T. By th ilin proprty, (u) o not omint u, o thr i pth rom to u voiin (u). Lt (y,w) th irt r on thi pth with w nnt o u in H. By Lmm 5.1, y < u w, o w o not omint y, whih mn tht (y,w) h riv r (y,w). Sin y i on th pth rom to w, y (u). Thu T tii th onition in th lmm. 21

22 [1] [1] [2] [2] [3] [3] [10] [4] [10] [4] i[13] [11] h[6] [5] i[13] [11] h[6] [5] j[12] l[8] [7] l[8] [7] k[9] k[9] [1] [1] [2] [2] [3] [3] [10] h[6] [4] [5] [10] h[6] [4] [5] l[8] [7] k[9] [1] [1] [2] [2] [3] [10] [4] [4] Fiur 8: Contrtion qun n intrvl (tronly onnt urph) orrponin to th loop ntin ort in Fiur 7. 22

23 Convrly, uppo T tii th onition in th lmm. Suppo thr r ilin v, u uh tht v omint u. Choo uh pir with u minimum. By Corollry 2.4 thr i pth rom to t(u) tht voi v. I (u) = t(u) thn v o not omint u. I (u) t(u), y th onition in th lmm thr i n r (y,w) with riv r (y,w) uh tht w i nnt o u in H, y < u, n y (u). By Lmm 5.2, w i u or ilin o u in T. Thu y i t(u) or ilin o u n v in T. I y = t(u), v o not omint u. I y i ilin o u, thn v o not omint y y th hoi o u, whih impli tht v o not omint u. Thu in ny v o not omint u, o th ilin proprty hol. Alorithm 6, our low-hih orrin lorithm uin loop ntin ort, i lik Alorithm 4; it uil or h vrtx n orr lit o it hilrn in th omintor tr D n thn o pth-irt trvrl o D to in low-hih orr. It inrt th vrti in inrin orr into th lit o hilrn in wy tht iv th low-hih proprty. A prt o th inrtion pro, it in, or h vrtx u, riv r ll th pivot r o u. I th pivot r o u i not ((u),u), it lo in nothr riv r ll th tt r o u. O th pivot n tt r or u, on i ( (u),u), n th othr i th riv r (y,w) o n r (y,w) tiyin Lmm 5.3. Th tt r or u i in jut or u i inrt into lit o hilrn. Th pivot r or u i in ithr jut or u i inrt or rlir, whn yl ontinin u i (impliitly) xpn. Th pivot n tt r trmin whr to inrt u in it lit o ilin. An xmpl i hown in Fiur 9. Thorm 5.4. Alorithm 6 i orrt. Proo. Conir th hoi o pivot r (x,v) or vrtx u. W lim tht (x,v) i th riv r o n oriinl r (x,v) uh tht x < u n v i nnt o u in H. Thi i immit i (x,v) i hon in Stp 2. In Stp 2, v i nnt o z in H n x < u < z, o th hoi o (x,v) th pivot r or z tii th lim. Alo in Stp 2, h oriinl r (p,q) orrponin to n r on P ntrin vrtx x i i uh tht q i nnt o x i in H ut p i not. Lmm 5.1 impli p < x i, o th hoi o (p,q) th pivot r or x i tii th lim. I (x,v) = ((u),u) in Stp 2, u will tiy th low-hih proprty. Conir th proin o vrtx u uh tht it pivot r (x,v) ((u),u). I (x,v) = ( (u),u), (u) (u),othrinr(y,w)tiyinlmm5.3,nthlorithmwilluully hoo th riv r (y,w) o uh n r th tt r or u. On o v n w i u; th othr i u or ilin o u in D y Lmm 5.2. Thu h o x n y i (u) or ilin o u in D. Furthrmor oth r l thn u, o thy hv lry n inrt into lit o hilrn whn u i out to inrt. Hn th inrtion o u i wll in. I v = w = u, th inrtion poition o u urnt tht u tii th low-hih proprty. It rmin to how tht u tii th low-hih proprty vn i on o v n w i not u. Th hoi o itionl pivot r in Stp 2 i wht urnt thi. I (u) = (u), u will tiy th low-hih proprty, in thn it o not mttr whr u i inrt into C((u)). Thu uppo (u) (u). Thn (u) i ilin o u in D. Conir th r (x,v) in Stp 2 (tr th onitionl wp in Stp 2 mk (x,v) ( (u),u)). Sin v u, v i ilin o u in D, n z i v or ilin o v in D, o z i ilin o u in D. Ar (x,v) om th pivot r o z. 23

24 Alorithm 6: Contrution o Low-Hih Orr uin Loop Ntin Fort Lt F pth-irt pnnin tr o G, with vrti numr in rvr potorr n intii y numr. Lt H th loop ntin ort in y F, with oit outoin r n orrponin oriinl r. Stp 1: Contrut th riv rph G with rpt to th omintor tr D. Stp 2: For h vrtx u, initiliz it lit o hilrn C(u) to mpty. Apply th ollowin tp to h vrtx u in inrin orr: Stp 2: Lt (x,v) th pivot r o u; i u o not yt hv pivot r, lt (x,v) = ( (u),u). Stp 2: I (x,v) = ((u),u), inrt u irt on C((u)), ompltin Stp 2. Othrwi, pro to Stp 2. Stp 2: I (x,v) ( (u),u), lt th tt r (y,w) o u ( (u),u); othrwi, lt th tt r o u th riv r (y,w) o n r (y,w) with y < u, w nnt o u in H, n y (u). Stp 2: I x = (u), inrt u irt in C((u)). Othrwi, inrt u jut or x in C((u)) i y = (u) or y pr x in C((u)), jut tr x othrwi. Swp (x,v) n (y,w) i nry o tht (y,w) = ( (u),u). I v = u, thi omplt Stp 2; othrwi, pro to Stp 2. Stp 2: Lt z th hil o u in H tht i n ntor o v. Mk (x,v) th pivot roz. FinpthP ovrti z = x 0,x 1,...,x k = uinthintrvl ou y trtin t z n ollowin outoin r in th intrvl until rhin u. For h vrtx x i othr thn z n u on P, in th oriinl r (p,q) orrponin to th r ntrin x i on P, n lt th pivot r o x i th riv r (p,q) o (p,q). Stp 3: Do pth-irt trvrl o D, viitin th hilrn o h vrtx v in thir orr in C(v). Numr th vrti rom 1 to n thy r viit. Th rultin orr i low-hih on G. 24

25 y x (,,,) h v w h w y x (,,,h,,) l v k [1] [1] [13] [2] [12] [7] [3] [6] [2] [7] h[8] l[9] k[10] [11] [12] [13] [11] k[10] h[8] l[9] i[4] j[5] [3] i[4] j[5] [6] D G Fiur 9: Computtion o low-hih orr (ini th rkt) o th low rph o Fiur 7, uin th intrvl o Fiur 8. Whn vrtx i pro, Alorithm 6 t (,) th pivot r in Stp 2 n (,) th tt r in Stp 2. In Stp 2 it in th pth P = (,h,) (hown with ol r) ini th intrvl o n t (,) th pivot r o h, whih i th oriinl r orrponin to (, h). Whn vrtx h i pro, Alorithm 6 t (,h) th tt r in Stp 2. In Stp 2 it in th pth P = (,l,k,h) (hown with ol r) ini th intrvl o h n t (,l) n (l,k) th pivot r o l n k rptivly. 25

26 W lim tht tr ll inrtion into C((u)), u i twn (u) n z. To prov th lim, w onir thr. I x = (u) n (x,v) i th pivot r o u, thn u will inrt irt in C((u)), in ront o (u), n ltr z will inrt irt, o u i twn (u) n z. I x = (u) n (x,v) i th tt r o u, thn ( (u),u) i th pivot r o u, o u will inrt in ront o (u) n ltr z will inrt irt, o in u i twn (u) n z. Th thir i x (u). Thn u will inrt twn (u) n x. Sin (x,v) i th pivot r o z, z will vntully inrt nxt to x, lvin u twn (u) n z in thi wll. Now onir th vrti z = x 0,x 1,...,x k = u on P. Lt S i th t o nnt o x i in H, n lt S th union o th S i. Lt (x,v) th oriinl r who riv r i (x,v). Thr r u-voiin pth rom to ll vrti in S, vi th pth in F rom to x ollow y (x,v) ollow y pth mon vrti in S. Thu u omint no vrtx in S. But (u) mut omint ll vrti in S, in othrwi thr woul pth rom to u voiin (u). Thu ll vrti in S r nnt o (u) in D. W lim tht S onit o t o ilin o u in D n poily om o thir nnt. Thi i tru o S 0, in y Lmm 2.10 S 0 onit o t o ilin in D n poily om o thir nnt, x 0 mut on o th ilin in it i minimum in S 0, n z = x 0 i ilin o u. Suppo th lim i l. Lt x i minimum uh tht om vrtx in S i i nnt o ilin o u in D ut tht ilin i not in S. By Lmm 2.10, S i onit o t o ilin in D n poily om o thir nnt. Lt (p,q) th oriinl r orrponin to th r ntrin x i on P. Thn p i in S i 1. By th hoi o x i, p i nnt in D o ilin o u tht i in S. Eithr q i nnt o in D, in whih ll vrti in S i r nnt o in D, or q i not nnt o. In th lttr, th prnt proprty impli tht q i ilin o n hn o u, n S i onit o t o ilin o n hn o u, n poily om o thir nnt. W onlu tht thr i no uh x i, vriyin th lim. Finlly w lim tht ll o th ilin o u in S r on th m i o u in C((u)) z = x 0. Thi impli tht u h th low-hih proprty, u u will twn (u) n p, whr (p,u) i th riv r o th oriinl r (p,u) orrponin to th r ntrin u on P. Suppo th lim i l or om ilin o u in S. Lt th minimum uh ilin. Lt th pivot r o th riv r (,) o oriinl r (,). Eithr (,) = (x,v), or n r in S. In th ormr, i x = (u), will inrt t th ront o C((u)) omtim tr z w inrt t th ront, o will on th m i o u z; i x i ilin o u, will inrt nxt to x omtim tr z w inrt nxt to x, o in will on th m i o u z. In th lttr, y Lmm 5.2 i ilin o n hn o u, n in i in S, i lo ilin o u. Furthrmor <, o i on th m i o u z y th hoi o. Th inrtion o nxt to put it on th m i wll. Thorm 5.5. A tr with th prnt proprty h th ilin proprty, n hn i th omintor tr, i n only i it h low-hih orr with rpt to G. Proo. Immit rom Thorm 2.9 n 5.4. Exluin th omputtion o th loop ntin ort n oit inormtion, it i trihtorwr to implmnt Alorithm 6 to run in O(m) tim. To in tt r in Stp 26

27 2, w omput, or h vrtx u, two riv r (x,v) n (y,w) with v n w nnt o u in H, x y, n x n y minimum, i two uh r xit; othrwi, (u) = (u). W n o thi y proin th vrti o H ottom-up (rom lv to root). Thi tk O(m) tim. W o th inrtion into th lit o hilrn uin th o-lin mtho vlop in Stion 4.2. W n i w wih run Alorithm 6 on th riv rph int o th oriinl rph. Thi i pplin i th loop ntin ort i not ivn ut mut omput, in it implii th trutur o th tronly onnt urph n implii Stp 2. In th riv rph, vry r l rom vrtx to hil or ilin in D, o th vrtx t o vry tronly onnt urph onit o t o ilin in D. Furthrmor vry uh urph with t lt two vrti h t lt two ntry vrti rom. To run Alorithm 6 on th riv rph, w in y omputin th riv rph G. Thn w o pth-irt rh o G to nrt pth-irt pnnin tr F n to numr th vrti in rvr prorr. Nxt w ontrut th loop ntin ort o G in y F, lon with oit in-tr n orrponin oriinl r. Finlly, w run Stp 2 n 3, inorin th itintion twn oriinl r n riv r: in G, vry r i it own riv r. Rmrk: Iwwnttovriythomintortronritrryrphutrnotintrt in ontrutin low-hih orr, w n o th vriition uin Lmm 5.3. Givn D, w vriy tht D i tr with th prnt proprty in Stion 2, omput th riv rph in Stion 3, (vriyin th orrtn o th riv rph uin ntor-nnt tt), ontrut loop ntin ort H (or ithr th oriinl or riv rph) n vriy th onition in Lmm 5.3, whih n on y proin th vrti o H rom lv to root. Th totl tim or vriition y thi mtho i O(m). Thi mtho um tht th loop ntin ort i orrt. To vriy tht it i, w vriy or h u tht ll it hilrn in H r nnt o u in F, tht th intrvl o u i tronly onnt, n tht it om yli whn u i lt. Thi lo tk O(m) tim. 6 Low-Hih Orr rom Smi-Domintor 6.1 Low-hih orr rom inpnnt pnnin tr In thi tion w vlop n ltrntiv lorithm or inin low-hih orr in n ritrry rph. Int o uin loop ntin inormtion, th lorithm u mi-omintor inormtion. Thi inormtion i omput y th t lorithm or inin omintor[2, 7, 38], mkin it y to xtn th lorithm to in not only th omintor tr, ut lowhih orr wll. Th lorithm h two tp. Th irt tp u th mi-omintor inormtion to uil two inpnnt pnnin tr. Th on tp u two inpnnt pnnin tr to in low-hih orr. Sin th two tp r inpnnt n th on tp rquir no nw i n i muh ir to prov orrt, w in with it. Lt B n R two inpnnt pnnin tr: or h vrtx v, th pth in B n R rom to v hv only th omintor o v in ommon. W not y (v) n r(v) th prnt o v in B n R, rptivly. W in y lihtly moiyin B n R: or h 27

28 vrtx v, i ((v),v) A w rpl (v) n r(v) y (v). Thn w in th riv r o th r in B n R. Lt G th urph who vrtx t i V n who r r th riv r o tho in B n R. Lt B n R th urph o G in y th riv r o B n R, rptivly. S Fiur 10. Lmm 6.1. Surph B n R r inpnnt pnnin tr in G. Proo. Any pth rom to v in B or R ontin (v), o i ((v),v) A, rplin (v) n r(v) y (v) lv B n R tr. Furthrmor uh rplmnt only limint vrti rom pth in B n R, o B n R rmin inpnnt. Similrly, or ny vrtx v, v o not omint (v) or r(v), o vry r in B n R h riv r. I v, (v) (r (v)) i on ny pth rom to (v) (r(v)), n hn on th pth rom to v in B (R). It ollow tht rplin ll th r in B n R y thir riv r prou two inpnnt pnnin tr in G. A in Alorithm 4 n 6, th tr- low-hih orrin lorithm, Alorithm 7, uil orr lit o th hilrn in D o h vrtx v. It u th r in B n R to trmin th inrtion poition. It inrt vrti in n orr trmin rurivly, unlik th itrtiv orr u in Alorithm 4 n 6 (topoloil orr in Alorithm 4, rvr potorr in Alorithm 6). Fiur 11 illutrt how thi lorithm work. Thorm 6.2. Th vrtx orr omput y Alorithm 7 i low-hih on G n hn on G. Proo. W lim tht Stp 4 mintin th invrint tht (i) B n R r inpnnt pnnin tr root t ; (ii) or vry v, ithr (v) = r (v) = (v), or (v), r (v), n (v) r ll itint; n (iii) h r in B or R i it own riv r. Lt u nonl o D ll o who hilrn in D r lv o D. Lt X th t o hilrn o u in D, nlt Y thut ox thtonit othvrti y uhtht (y) = r (y) = (y) = u. Th invrint impli tht h vrtx in Y h in-r 1 in G n h vrtx in X Y h in-r 2 in G. Sin h r in B or R i it own riv r, h r in G lvin vrtx in X ntr vrtx in X. Sin t lt on r rom u ntr X, thr mut vrtx v in X who in-r in G x it out-r in G. W lim tht v n lt in Stp 4. In, v n lt i i l in oth B n R. I not, thn v mut hv in-r 2 n out-r 1 in G. But thn v mut l in ithr B or R ; i not, it ommon hil w in B n R woul violt th invrint; B n R woul not inpnnt pnnin tr, in v i n ntor o w in oth B n R, ut v n w r ilin in D. Hn v n lt in thi lo. It ollow tht rplin (w) y (v) n ltin v prrv th invrint. Finlly, w lim tht th omput orr i low-hih. Thi i immit i G h two vrti. Suppo thi i tru i G h k 2 vrti. Lt G hv k + 1 vrti n lt v th vrtx hon or ltion. Th inrtion poition o v urnt tht v h th low-hih proprty. All vrti in G tr th ltion o v hv th low-hih proprty in th nw G y th inution hypothi, o thy hv th low-hih proprty in th ol G with th poil xption o w, on o who inomin r ir in th ol n th nw G. Suppo (w) ir; th rumnt i ymmtri i r (w) ir. By th rumnt ov, 28

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

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

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

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

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

, 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

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

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

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

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

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

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

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

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

Organization. Dominators. Control-flow graphs 8/30/2010. Dominators, control-dependence. Dominator relation of CFGs

Organization. Dominators. Control-flow graphs 8/30/2010. Dominators, control-dependence. Dominator relation of CFGs Orniztion Domintors, ontrol-pnn n SSA orm Domintor rltion o CFGs postomintor rltion Domintor tr Computin omintor rltion n tr Dtlow lorithm Lnur n Trjn lorithm Control-pnn rltion SSA orm Control-low rphs

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

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

(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

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

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

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

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

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

MAT3707. Tutorial letter 201/1/2017 DISCRETE MATHEMATICS: COMBINATORICS. Semester 1. Department of Mathematical Sciences MAT3707/201/1/2017

MAT3707. Tutorial letter 201/1/2017 DISCRETE MATHEMATICS: COMBINATORICS. Semester 1. Department of Mathematical Sciences MAT3707/201/1/2017 MAT3707/201/1/2017 Tutoril lttr 201/1/2017 DISCRETE MATHEMATICS: COMBINATORICS MAT3707 Smstr 1 Dprtmnt o Mtmtil Sins SOLUTIONS TO ASSIGNMENT 01 BARCODE Din tomorrow. univrsity o sout ri SOLUTIONS TO ASSIGNMENT

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

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

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

N=4 L=4. Our first non-linear data structure! A graph G consists of two sets G = {V, E} A set of V vertices, or nodes f

N=4 L=4. Our first non-linear data structure! A graph G consists of two sets G = {V, E} A set of V vertices, or nodes f lulu jwtt pnlton sin towr ounrs hpl lpp lu Our irst non-linr t strutur! rph G onsists o two sts G = {V, E} st o V vrtis, or nos st o E s, rltionships twn nos surph G onsists o sust o th vrtis n s o G jnt

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

learning objectives learn what graphs are in mathematical terms learn how to represent graphs in computers learn about typical graph algorithms

learning objectives learn what graphs are in mathematical terms learn how to represent graphs in computers learn about typical graph algorithms rp loritms lrnin ojtivs loritms your sotwr systm sotwr rwr lrn wt rps r in mtmtil trms lrn ow to rprsnt rps in omputrs lrn out typil rp loritms wy rps? intuitivly, rp is orm y vrtis n s twn vrtis rps r

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

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

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

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

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

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

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

# 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

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

Combinatorial Optimization

Combinatorial Optimization Cominoril Opimizion Prolm : oluion. Suppo impl unir rp mor n on minimum pnnin r. Cn Prim lorim (or Krukl lorim) u o in ll o m? Explin wy or wy no, n iv n xmpl. Soluion. Y, Prim lorim (or Krukl lorim) n

More information

Complete Solutions for MATH 3012 Quiz 2, October 25, 2011, WTT

Complete Solutions for MATH 3012 Quiz 2, October 25, 2011, WTT Complt Solutions or MATH 012 Quiz 2, Otor 25, 2011, WTT Not. T nswrs ivn r r mor omplt tn is xpt on n tul xm. It is intn tt t mor omprnsiv solutions prsnt r will vlul to stunts in stuyin or t inl xm. In

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

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

Yehuda Lindell Bar-Ilan University

Yehuda Lindell Bar-Ilan University Wintr Shool on Sur Computtion n iiny Br-Iln Unirsity, Isrl 3//2-/2/2 Br Iln Unirsity Dpt. o Computr Sin Yhu Linll Br-Iln Unirsity Br Iln Unirsity Dpt. o Computr Sin Protool or nrl sur to-prty omputtion

More information

Multipoint Alternate Marking method for passive and hybrid performance monitoring

Multipoint Alternate Marking method for passive and hybrid performance monitoring Multipoint Altrnt Mrkin mtho or pssiv n hyri prormn monitorin rt-iool-ippm-multipoint-lt-mrk-00 Pru, Jul 2017, IETF 99 Giuspp Fiool (Tlom Itli) Muro Coilio (Tlom Itli) Amo Spio (Politnio i Torino) Riro

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

Round 7: Graphs (part I)

Round 7: Graphs (part I) Roun 7: Grphs (prt I) Tommi Junttil Alto Univrsity Shool o Sin Dprtmnt o Computr Sin CS-A40 Dt Struturs n Alorithms Autumn 207 Tommi Junttil (Alto Univrsity) Roun 7 CS-A40 / Autumn 207 / 55 Topis: Grphs

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

CSE 421 Algorithms. Warmup. Dijkstra s Algorithm. Single Source Shortest Path Problem. Construct Shortest Path Tree from s

CSE 421 Algorithms. Warmup. Dijkstra s Algorithm. Single Source Shortest Path Problem. Construct Shortest Path Tree from s CSE Alorihm Rihr Anron Dijkr lorihm Sinl Sor Shor Ph Prolm Gin rph n r r Drmin in o ry r rom Iniy hor ph o h r Epr onily hor ph r Eh r h poinr o pror on hor ph Conr Shor Ph Tr rom Wrmp - - I P i hor ph

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

5/1/2018. Huffman Coding Trees. Huffman Coding Trees. Huffman Coding Trees. Huffman Coding Trees. Huffman Coding Trees. Huffman Coding Trees

5/1/2018. Huffman Coding Trees. Huffman Coding Trees. Huffman Coding Trees. Huffman Coding Trees. Huffman Coding Trees. Huffman Coding Trees /1/018 W usully no strns y ssnn -lnt os to ll rtrs n t lpt (or mpl, 8-t on n ASCII). Howvr, rnt rtrs our wt rnt rquns, w n sv mmory n ru trnsmttl tm y usn vrl-lnt non. T s to ssn sortr os to rtrs tt our

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

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

Paths, cycles and flows in graphs

Paths, cycles and flows in graphs 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

More information

Graph Algorithms and Combinatorial Optimization Presenters: Benjamin Ferrell and K. Alex Mills May 7th, 2014

Graph Algorithms and Combinatorial Optimization Presenters: Benjamin Ferrell and K. Alex Mills May 7th, 2014 Grp Aloritms n Comintoril Optimiztion Dr. R. Cnrskrn Prsntrs: Bnjmin Frrll n K. Alx Mills My 7t, 0 Mtroi Intrstion In ts ltur nots, w mk us o som unonvntionl nottion or st union n irn to kp tins lnr. In

More information

SAMPLE PAGES. Primary. Primary Maths Basics Series THE SUBTRACTION BOOK. A progression of subtraction skills. written by Jillian Cockings

SAMPLE PAGES. Primary. Primary Maths Basics Series THE SUBTRACTION BOOK. A progression of subtraction skills. written by Jillian Cockings PAGES Primry Primry Mths Bsis Sris THE SUBTRACTION BOOK A prorssion o sutrtion skills writtn y Jillin Cokins INTRODUCTION This ook is intn to hlp sur th mthmtil onpt o sutrtion in hilrn o ll s. Th mstry

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

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

CMSC 451: Lecture 2 Graph Basics Thursday, Aug 31, 2017

CMSC 451: Lecture 2 Graph Basics Thursday, Aug 31, 2017 Dv Mount CMSC 45: Ltur Grph Bsis Thursy, Au, 07 Rin: Chpt. in KT (Klinr n Tros) n Chpt. in DBV (Dsupt, Ppimitriou, n Vzirni). Som o our trminoloy irs rom our txt. Grphs n Dirphs: A rph G = (V, E) is strutur

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

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

Lecture 20: Minimum Spanning Trees (CLRS 23)

Lecture 20: Minimum Spanning Trees (CLRS 23) Ltur 0: Mnmum Spnnn Trs (CLRS 3) Jun, 00 Grps Lst tm w n (wt) rps (unrt/rt) n ntrou s rp voulry (vrtx,, r, pt, onnt omponnts,... ) W lso suss jny lst n jny mtrx rprsntton W wll us jny lst rprsntton unlss

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

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

Two Approaches to Analyzing the Permutations of the 15 Puzzle

Two Approaches to Analyzing the Permutations of the 15 Puzzle Two Approhs to Anlyzin th Prmuttions o th 15 Puzzl Tom How My 2017 Astrt Th prmuttions o th 15 puzzl hv n point o ous sin th 1880 s whn Sm Lloy sin spin-o o th puzzl tht ws impossil to solv. In this ppr,

More information

d e c b a d c b a d e c b a a c a d c c e b

d e c b a d c b a d e c b a a c a d c c e b FLAT PEYOTE STITCH Bin y mkin stoppr -- sw trou n pull it lon t tr until it is out 6 rom t n. Sw trou t in witout splittin t tr. You soul l to sli it up n own t tr ut it will sty in pl wn lt lon. Evn-Count

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

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

Steinberg s Conjecture is false

Steinberg s Conjecture is false Stinrg s Conjtur is als arxiv:1604.05108v2 [math.co] 19 Apr 2016 Vinnt Cohn-Aa Mihal Hig Danil Král Zhntao Li Estan Salgao Astrat Stinrg onjtur in 1976 that vry planar graph with no yls o lngth our or

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

Grade 7/8 Math Circles March 4/5, Graph Theory I- Solutions

Grade 7/8 Math Circles March 4/5, Graph Theory I- Solutions ulty o Mtmtis Wtrloo, Ontrio N ntr or ution in Mtmtis n omputin r / Mt irls Mr /, 0 rp Tory - Solutions * inits lln qustion. Tr t ollowin wlks on t rp low. or on, stt wtr it is pt? ow o you know? () n

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

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

Depth First Search. Yufei Tao. Department of Computer Science and Engineering Chinese University of Hong Kong

Depth First Search. Yufei Tao. Department of Computer Science and Engineering Chinese University of Hong Kong Dprtmnt o Computr Sn n Ennrn Cns Unvrsty o Hon Kon W v lry lrn rt rst sr (BFS). Toy, w wll suss ts sstr vrson : t pt rst sr (DFS) lortm. Our susson wll on n ous on rt rps, us t xtnson to unrt rps s strtorwr.

More information

Graph Contraction and Connectivity

Graph Contraction and Connectivity Chptr 17 Grph Contrtion n Conntivity So r w hv mostly ovr thniqus or solving prolms on grphs tht wr vlop in th ontxt o squntil lgorithms. Som o thm r sy to prllliz whil othrs r not. For xmpl, w sw tht

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

1. Determine whether or not the following binary relations are equivalence relations. Be sure to justify your answers.

1. Determine whether or not the following binary relations are equivalence relations. Be sure to justify your answers. Mth 0 Exm - Prti Prolm Solutions. Dtrmin whthr or not th ollowing inry rltions r quivln rltions. B sur to justiy your nswrs. () {(0,0),(0,),(0,),(,),(,),(,),(,),(,0),(,),(,),(,0),(,),(.)} on th st A =

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

Shortest Paths. CSE 421 Algorithms. Bottleneck Shortest Path. Negative Cost Edge Preview. Compute the bottleneck shortest paths

Shortest Paths. CSE 421 Algorithms. Bottleneck Shortest Path. Negative Cost Edge Preview. Compute the bottleneck shortest paths Shor Ph CSE Alorihm Rihr Anron Lr 0- Minimm Spnnin Tr Ni Co E Dijkr lorihm m poii o For om ppliion, ni o mk n Shor ph no wll in i rph h ni o yl - - - Ni Co E Priw Topoloil Sor n or olin h hor ph prolm

More information