A Space-Economic Representation of Transitive Closures in Relational Databases

Size: px
Start display at page:

Download "A Space-Economic Representation of Transitive Closures in Relational Databases"

Transcription

1 A Sp-Eonomi Rprsnttion o Trnsitiv Closurs in Rltionl Dtss Ynjun Chn* Dpt. Appli Computr Sin, Univrsity o Winnip, 515 Port Av. Winnip, Mnito, Cn R3B E9 yhn@uwinnip. ABSTRACT A omposit ojt rprsnt s irt rph (irph or short) is n importnt t strutur tht rquirs iint support in CAD/CAM, CASE, oi systms, sotwr mnmnt, w tss, n oumnt tss. It is umrsom to hnl suh ojts in rltionl ts systms whn thy involv nstor-snnt rltionships (or sy, rursiv rltionships). In this ppr, w prsnt nw noin mtho to ll irph, whih rus th ootprints o ll prvious strtis. This mtho is s on tr llin mtho n th onpt o rnhins tht r us in rph thory or inin th shortst onntion ntworks. A rnhin is surph o ivn irph tht is in t orst, ut ovrs ll th nos o th rph. On th on hn, th propos noin shm hivs th smllst sp rquirmnts mon ll prviously pulish strtis or ronizin rursiv rltionships. On th othr hn, it ls to nw lorithm or omputin trnsitiv losurs or DAGs (irt yli rph) in O( ) tim n O(n ) sp, whr n rprsnts th numr o th nos o DAG, th numrs o th s, n th DAG s rth. In ition, this mtho n xtn to yli irphs n is spilly suitl or rltionl nvironmnt. Kywors: Dirt Grphs, Trs, Trnsitiv Closurs, Brnhins, Grph Enoin 1. INTRODUCTION It is nrl opinion tht rltionl ts systms r inqut or mnipultin omposit ojts tht ris in novl pplitions suh s w n oumnt tss [3, 1, 13, 35, 49], CAD/CAM, CASE, oi systms n sotwr mnmnt [8, 8, 43]. Espilly, whn rursiv rltionships r involv, it is umrsom to hnl thm in rltionl tss, whih sts urrnt rltionl systms r hin th nvitionl ons [31]. A omposit ojt n nrlly rprsnt s irt rph (irph). For xmpl, in CAD ts, omposit ojt orrspons to omplx sin, whih is ompos o svrl susins [8]. Otn, susins r shr y mor thn on hihr-lvl sins, n st o sin hirrhis thus orms irt yli rph (DAG). As nothr xmpl, th * Th uthor is support y NSERC (453) (Nturl Sins n Eninrin Counil o Cn). ittion inx o sintii litrtur, rorin rrn rltionships twn uthors, onstruts irt yli rph. As thir xmpl, w onsir th tritionl orniztion o ompny, with vril numr o mnr-suorint lvls, whih n rprsnt s tr hirrhy. In rltionl systm, omposit ojts must rmnt ross mny rltions, rquirin joins to thr ll th prts. A typil pproh to improvin join iiny is to quip rltions with hin pointr ils or ouplin th tupls to join [11]. Th so-ll join inx is nothr uxiliry ss pth to mitit this iiulty [46, 47]]. Also, svrl vn join lorithms hv n sust, s on hshin n lr min mmory. In ition, irnt kin o ttmpts to ttin ompromis solution is to xtn rltionl tss with nw turs, suh s lustrin o omposit ojts, y whih th ontnt orin kys o nstor pths r stor in primry ky (s [3, 33, 39] or til sription). Anothr xtnsion to rltionl systm is nst rltions (or NF rltions, s,.., [18]). Althouh it n us to rprsnt omposit ojts without sriiin th rltionl thory, it surs rom th prolm tht surltions nnot shr. Morovr, rursiv rltionships nnot rprsnt y simpl nstin us th pth is not ix. Finlly, utiv tss n ojt-rltionl tss n onsir s two quit irnt xtnsions to hnl this prolm [9, 37, 15]. In this ppr, w isuss nw noin pproh to pk nstor pths in rltionl nvironmnt. Th min i o this mtho is tr llin, y mns o whih w ssoit h no v with pir o intrs (α, β) suh tht i v, nothr no ssoit with (α, β ), is snnt o v, som rithmtil rltionship twn α n α, s wll s β n β n trmin. Thn, suh rltionships n us to in ll snnts o no, n th rursiv losur w.r.t. tr n omput vry iintly. This mtho n nrliz to DAGs or irphs ontinin yls y omposin rph into sris o trs, or whih th pproh sri ov n mploy. As w n s ltr, nw mtho or omputin rursion iintly in rltionl nvironmnt n vlop s on ths thniqus. In t, it is nw lorithm to hnl this prolm with rprsnttion o trnsitiv losurs irnt rom tritionl ons. It ns only O( ) tim n O(n ) sp, whr is th rth o th rph, in to th lst numr o isjoin pths tht ovr ll th nos o rph. This omputtionl omplxity is ttr thn ny xistin mtho or this prolm, inluin th rph-s lorithms [0, 1, 34, 36, 38], th rph noin [1,, 6, 7, 14, 16, 46, 46] n th mtrix-s lorithms [4, 3, 44, ISSN: SYSTEMICS, CYBERNETICS AND INFORMATICS VOLUME 4 - NUMBER 5 1

2 45]. (S Stion 6 or til omprison.) Th rminr o th ppr is orniz s ollows. Stion spiis th prolm to solv. Stion 3 introus th onpt o tr llin, n pplis it to simpl tr-strutur rursion hirrhis. Stion 4 lorts th thniqu to ritrry rursion pttrn. In Stion 5, w rss how to hn lls whn nw no or nw is insrt into DAG. In Stion 6, w isuss n ompr th rlvnt work. Stion 7 rports tst rsults. Finlly, short onlusion is st orth in Stion 8.. TASK DEFINITION W onsir omposit ojts rprsnt y irph, whr nos stn or ojts n s or prnt-hil rltionships, stor in inry rltion. In mny pplitions, th trnsitiv losur o irph ns to omput, whih is in to ll nstor-snnt pirs. Lt G = (V, E) irt rph (irph or short). Dirph G* = (V, E*) is th rlxiv, trnsitiv losur o G i (v, w) E* i thr is pth rom v to w in G. For xmpl, th rph shown in Fi. 1() is th trnsitiv losur o th rph shown in Fi. 1(). A lot o rsrh hs n on on this issu. Amon thm, th smi-niv [10] n th lorithmi [46] r typil lorithmi solutions. Anothr min pproh is th mtriliztion o trnsitiv losur, ithr prtilly or ompltly [1,, 5, 6, 7, 49]. Th implmnttion o th trnsitiv losur lorithms in rltionl nvironmnt hs riv xtnsiv ttntion, inluin prormn n th pttion o th tritionl lorithms [, 4, 5, 6, 19, 6, 43]. Th mtho propos in this ppr n hrtriz s prtil mtriliztion mtho. Givn no, w wnt to omput ll its snnts iintly s on spiliz t strutur. Th ollowin is typil strutur to ommot prt-suprt rltionships [17]: - Prt(Prt-i,...) - Conntion(Prnt-i, Chil-i,...) whr Prnt-i n Chil-i r oth orin kys, rrrin to Prt-i. In orr to sp up th rursion vlution, w ll ssoit h no with pir o intrs, whih hlps to roniz nstor-snnt rltionships. In th rst o th ppr, th ollowin thr typs o irphs will isuss. (i) (ii) v 3 v 5 () v 1 v v4 Tr hirrhy, in whih th prnt-hil rltionship is o on-to-mny typ, i.., h no hs t most on prnt. Dirt yli rph (DAG), whih ours whn th rltionship is o mny-to-mny typ, with th rstrition tht prt nnot su/suprprt o itsl (irtly or in- v 3 v 1 v 5 () Fi. 1. A DAG n its trnsitiv losur v v4 irtly). (iii) Dirt yli rph, whih ontins yls. Ltr w ll us th trm rph to rr to th irt rph, sin w o not isuss non-irt ons t ll. 3. TREE LABELING AND RECURSION COMPUTATION In this stion, w isuss how to ll tr to sp up th omputtion o rursion in rltionl nvironmnt. Consir tr T. By trvrsin T in prorr, h no v will otin numr (it n n intr or rl numr) pr(v) to ror th orr in whih th nos o th tr r visit. In similr wy, y trvrsin T in postorr, h no v will t nothr numr post(v). Ths two numrs n us to hrtriz th nstor-snnt rltionships s ollows. Proposition 1. Lt v n v two nos o tr T. Thn, v is snnt o v i pr(v ) > pr(v) n post(v ) < post(v). Proo. S Exris.3.-0 in [30]. I v is snnt o v, thn w know tht pr(v ) > pr(v) orin to th prorr srh. Now w ssum tht post(v ) > post(v). Thn, orin to th postorr srh, ithr v is in som sutr on th riht si o v, or v is in th sutr root t v, whih ontrits th t tht v is snnt o v. Thror, post(v ) must lss thn post(v). Th ollowin xmpl hlps or illustrtion. Exmpl 1. S th pirs ssoit with th nos o th rph shown in Fi.. Th irst lmnt o h pir is th prorr numr o th orrsponin no n th son is its postorr numr. With suh lls, th nstor-snnt rltionships n sily hk. For instn, y hkin th ll ssoit with inst th ll or, w s tht is n nstor o in trms o Proposition 1. Not tht s ll is (, 4 ) n s ll is (5, ), n w hv < 5 n 4 >. W lso s tht sin th pirs ssoit with n o not stisy th onition ivn in Proposition 1, must not n nstor o n vi vrs. (3, 1) Dinition 1. (ll pir susumption) Lt (p, q) n (p, q ) two pirs ssoit with nos u n v. W sy tht (p, q) is susum y (p, q ), not (p, q) (p, q ), i p > p n q < q. Thn, u is snnt o v i (p, q) is susum y (p, q ). To th st o our knowl, this ni proprty hs nvr n utiliz in th ts rsrh or in th sutypin tsts to roniz th nstor-snnt rltionships. Althouh in th rltiv numrin [40] th postorr numrs r us, it works in quit irnt wy. With this strty, h no v is ll with two numrs: th lrst n th smllst postorr numrs in th sutr root t v. It is mor omplit llin pross thn th tr llin shown ov. Th rn-omprssion [] is nrliztion o th rltiv numrin to DAGs. Its sp r (, 4) (7, 6) (6, 5) h (4, 3) (5, ) (1, 7) Fi.. Llin tr SYSTEMICS, CYBERNETICS AND INFORMATICS VOLUME 4 - NUMBER 5 ISSN:

3 quirmnt is on O(n ) n it is irnt rom our nrl strty to isuss in th nxt stion. In [49], to sp up vlution o ontinmnt quris, no v (whih rprsnts n lmnt in oumnt tr) is ssoit with tripl (in, n, lvl), whr in is in t prorr numr, n is th lrst prorr numr in th sutr root t v, n lvl is th pth, t whih v is lot. Thror, it is lso quit irnt rom our mtho. Aorin to th tr llin isuss ov, th rltionl shm to hnl rursion n onsists o only on rltion o th ollowin orm: No(No_i, ll_pir,...), whr ll_pir is us to ommot th prorr n th postorr numrs o th nos o rph, not ll_pir.prorr n ll_pir.postorr, rsptivly. Thn, to rtriv th snnts o no x, w issu two quris s low. Q 1 : SELECT ll_pir FROM No WHERE No_i = x Lt th ll pir otin y vlutin Q 1 y. Thn, th son qury is o th ollowin orm: Q : SELECT * FROM No WHERE ll_pir.prorr > y.prorr n ll_pir.postorr < y.postorr From this, w n s tht with th tr llin, th rursion w.r.t. tr n hnl onvnintly in rltionl nvironmnt. 4. GENERALIZATION Now w isuss how to roniz th nstor-snnt rltionships w.r.t. nrl strutur: DAG or rph ontinin yls. First, w rss th prolm o DAGs in 4.1. Thn, yli rphs will isuss in is vot to th omputtion o trnsitiv losurs. 4.1 Rursion w.r.t. DAGs Wht w wnt is to pply th thniqu isuss ov to DAG. To this n, w stlish rnhin o th DAG s ollows. Dinition. (rnhin [T4]) A surph B = (V, E ) o irph G = (V, E) is ll rnhin i it is yl-r n inr(v) 1 or vry v V. Clrly, i or only on no r, inr (r) = 0, n or ll th rst o th nos, v, inr (v) = 1, thn th rnhin is irt tr with root r. Normlly, rnhin is st o irt trs. Now, w ssin vry sm ost (.., lt ost () = 1 or vry ). W will in rnhin or whih th sum o th osts, E For xmpl, th trs shown in Fi. 3() r mximl rnh ( ), is mximum. in o th rph shown in Fi. 3() i h hs sm ost. Assum tht th mximl rnhin or G = (V, E) is st o trs T i with root r i (i = 1,..., m). W introu virtul root r or th rnhin n n r r i or h T i, otinin tr G r, ll th rprsnttion o G. For instn, th tr shown in Fi. 3() is th rprsnttion o th rph shown in Fi. 3(). Usin Trjn s lorithm or inin optimum rnhins [4], w n lwys in mximl rnhin or irt rph in O( E ) tim i th ost or vry is qul to h othr. Thror, th rprsnttiv tr or DAG n onstrut in linr tim. By trvrsin G r in prorr, h no v will otin numr pr(v); n y trvrsin G r in postorr, h no v will t nothr numr post(v). Ths two numrs n us to roniz th nstor-snnt rltionships o ll G r s nos s isuss in Stion 3. () () () Fi. 3. A DAG n its rnhin In G r (or som G), no v n onsir s rprsnttion o th sutr root t v, not T su (v); n th pir (pr, post) ssoit with v n onsir s pointr to v, n thus to T su (v). (In prti, w n ssoit pointr with suh pir to point to th orrsponin no in G r.) In th ollowin, wht w wnt is to onstrut pir squn: (pr 1, post 1 ),..., (pr k, post k ) or h no v in G, rprsntin th union o th sutrs (in G r ) root rsptivly t (pr j, post j ) (j = 1,..., k), whih ontins ll th snnts o v. In this wy, th sp ovrh or storin th snnts o no is rmtilly ru. Ltr w will shown tht pir squn ontins t most O() pirs, whr is th rth o G. (Th rth o irph is in to th lst numr o th isjoint pths tht ovr ll th nos o th rph.) Exmpl. Th rprsnttiv tr G r o th DAG G shown in Fi. 3() n ll s shown in Fi. 4(). Thn, h o th nrt pirs n onsir s rprsnttion o som sutr in G r. For instn, pir (3, 3) rprsnts th sutr root t in Fi. 4(). (1, 8) (, 5) (7, 7) (3, 3) (6, 4) (8, 6) (4, 1) (5, ), 5 4, 1 5, 6, 4 7, 7 3, 3 4, 1 5, 6, 4 8, 6 4, 1 5, 4, 1 5, 6, 4 () T su () T su () T su () T su () T su () T su () T su () T su () T su () T su () T su () T su () () Fi. 4. Tr llin n illustrtion or trnsitiv losur rprsnttion r T su () T su () T su () ISSN: SYSTEMICS, CYBERNETICS AND INFORMATICS VOLUME 4 - NUMBER 5 3

4 I w n onstrut, or h no v, pir squn s shown in Fi. 4(), whr it is stor s link list, th snnts o th nos n rprsnt in n onomil wy. Lt L = (pr 1, post 1 ),..., (pr k, post k ) pir squn n h (pr i, post i ) is pir llin v i (i = 1,..., k). Thn, L orrspons to th union o th sutrs T su (v 1 ),..., n T su (v k ). For xmpl, th pir squn (4, 1)(5, )(6, 4)(8, 6) ssoit with in Fi. 4() rprsnts union o 4 sutrs: T su (), T su (), T su () n T su (), whih ontins ll th snnts o in G. Th qustion is how to onstrut suh pir squn or h no v so tht it orrspons to union o som sutrs in G r, whih ontins ll th snnts o v in G. First, w noti tht y llin G r, h no in G = (V, E) will initilly ssoit with pir s illustrt in Fi. 5. Tht is, i no v is ll with (pr, post) in G r, it will initilly ll with th sm pir (pr, post) in G. To omput th pir squn or h no, w sort th nos o G topoloilly, i.., (v i, v j ) Ε implis tht v j pprs or v i in th squn o th nos. Th pirs to nrt or no v r simply stor in link list A v. Initilly, h A v ontins only on pir prou y llin G r. W sn th topoloil squn o th nos rom th innin to th n n t h stp w o th ollowin: Lt v th no in onsir. Lt v 1,..., v k th hilrn o v. Mr A v with h A vl or th hil no v l (l = 1,..., k) s ollows. Assum A v = p 1 p... p n = q 1 q... q h, s shown in Fi. 6. Assum tht A vl oth A v n Avl r inrsinly orr. (W sy pir p is lrr thn nothr pir p, not p > p i p.pr > p.pr n p.post > p.post.) A v : W stp throuh oth A v n (, 5) (7, 7) (3, 3) (6, 4) (8, 6) (4, 1) (5, ) Fi. 5. Grph llin p 1 p p A v i : q 1 q q h Fi. 6. link lists ssoit with nos in G A vl rom lt to riht. Lt p i n q j th pirs nountr. W ll mk th ollowin hkins. (1) I p i.pr > q j.pr n p i.post > q j.post, insrt q j into A v tr p i-1 n or p i n mov to q j+1. () I p i.pr > q j.pr n p i.post < q j.post, rmov p i rom A v n mov to p i+1. (*p i is susum y q j.*) (3) I p i.pr < q j.pr n p i.post > q j.post, inor q j n mov to q j+1. (*q j is susum y p i ; ut it shoul not rmov A vi rom.*) (4) I p i.pr < q j.pr n p i.post < q j.post, inor p i n mov to p i+1. (5) I p i = p j n q i = q j, inor oth (p i, q i ) n (p j, q j ), n mov to (p i+1, q i+1 ) n (p j+1, q j+1 ), rsptivly. In trms o th ov isussion, w hv th ollowin lorithm to mr two pir squns tothr. Alorithm pir-squn-mr(a 1, A ) Input: A 1 n A - two link lists ssoit with v 1 n v. Output: A - moii A 1, otin y mrin A into A 1, ontinin ll th pirs in A 1 n A with ll th susum pirs rmov. in 1 p irst-lmnt(a 1 ); q irst-lmnt(a ); 3 whil p nil o{ 4 whil q nil o{ 5 i (p.pr > q.pr p.post > q.post) thn 6 {insrt q into A 1 or p; 7 q nxt(q);} (*nxt(q) rprsnts th pir nxt to q in A.*) 8 ls i (p.pr > q.pr p.post < q.post) thn 9 {p p; (*p is susum y q; rmov p rom A 1.*) 10 rmov p rom A 1 ; 11 p nxt(p );} (*nxt(p ) rprsnts th pir nxt to p in A 1.*) 1 ls i (p.pr < q.pr p.post > q.post) thn 13 {q nxt(q);} (*q is susum y p; mov to th nxt lmnt o q.*) 14 ls i (p.pr < q.pr p.post < q.post) thn 15 {p nxt(p);} 16 ls i (p.pr = q.pr p.post = q.post) 17 thn {p nxt(p); q nxt(q);} 18 i p = nil q nil thn {tth th rst o A to th n o A 1 ;} n Th ollowin xmpl hlps or illustrtion. Exmpl 3. Assum tht A 1 = (7, 7)(11, 8) n A = (4, 3)(8, 5)(10, 11). Thn, A = pir-squn-mr(a 1, A ) = (4, 3)(7, 7)(10, 11). Fi. 7 shows th ntir mrin pross. A 1 : A : p (7, 7)(11, 8) (4, 3)(8, 5)(10, 11) q p (4, 3)(7, 7)(11, 8) (4, 3)(8, 5)(10, 11) q (4, 3)(7, 7)(11, 8) (4, 3)(8, 5)(10, 11) In h stp, th A 1 -pir point y p n th A -pir point y q p q p = nil (4, 3)(7, 7)(10, 11) (4, 3)(8, 5)(10, 11) p (4, 3)(7, 7)(11, 8) (4, 3)(8, 5)(10, 11) () () () () q () Fi. 7. An ntir mrin pross A q 4 SYSTEMICS, CYBERNETICS AND INFORMATICS VOLUME 4 - NUMBER 5 ISSN:

5 r ompr. In th irst stp, (7, 7) in A 1 will hk inst (4, 3) in A (s Fi. 7()). Sin (4, 3) is smllr thn (7, 7), it will insrt into A 1 or (7, 7) (s Fi. 7()). In th son stp, (7, 7) in A 1 will hk inst (8, 5) in A. Sin (8, 5) is susum y (7, 7), w mov to (10, 11) in A (s Fi. 7()). In th thir stp, (7, 7) is smllr thn (10, 11) n w mov to (11, 8) in A 1 (s Fi. 7()). In th ourth stp, (11, 8) in A 1 is hk inst (10, 11) in A. Sin (11, 8) is susum y (10, 11), it will rmov rom A 1 n p oms nil (s Fi. 7()). In this s, (10, 11) will tth to A 1 (s lin 18 o Alorithm pir-squn-mr( )), ormin th rsult A = (4, 3)(7, 7)(10, 11) (s Fi. 7()). Fi. 8 is pitoril illustrtion o th rsult o mrin A into A 1. A 1 : A : (4, 3) (7, 7) (8, 5) (10, 11) (11, 8) rnhin Fi. 8. Illustrtion o mrin two pir squns From this, w n s tht A 1 rprsnts th union o two sutrs rsptivly root t (7, 7) n (10, 11) whil A rprsnts th union o thr sutrs root t (4, 3), (8, 3) n (10, 11), rsptivly. Th rsult A ot y mrin A into A 1 is th union o thr sutrs root t (4, 3), (7, 7) n (10, 14), rsptivly (s th sh rrows in Fi. 7). In th ollowin, w stlish svrl propositions to lriy th proprtis o th ov lorithm. Proposition. Lt A 1 n A two pir squns sort in inrsin orr. Lt A th rsult otin y mrin A into A 1 usin Alorithm pir-squn-mr( ). Thn, A is lso sort inrsinly. Proo. Durin th xution o th lorithm, som pirs my rmov rom A 1 n som pir o A my insrt into A 1. Oviously, rmovin pir rom A 1 will not hn th orrin o A 1. Lt q pir o A insrt into A 1. It my on t lin 6 or t lin 18. I it is on t lin 6, thr must pir p in A 1 suh tht p > q. Consir th pir p or p. W hv p < q; othrwis, q will insrt or p or will not insrt into A 1 t ll. In this s, th proposition hols. I q is insrt into A 1 y xutin lin 18, ll th pirs in A 1 must us up or th lin 18 is rri out. W noti tht t this momnt, ll th pirs in A 1 r inrsinly orr n smllr thn ll th rminin pirs in A, whih r oriinlly in inrsin orr. Thror, in this s, th proposition hols, too. Proposition 3. Lt A 1 n A two pir squns sort in inrsin orr. Lt A th rsult otin y mrin A into A 1 usin Alorithm pir-squn-mr( ). I v is no in sutr o G r, whih is root t som no ll with pir in A, thn thr must pir in A suh tht th sutr root t it A: ontins v. Proo. Assum tht v is in sutr root t u ll with (pr, post) tht pprs in A. I (pr, post) pprs in A, th proposition hols. Suppos tht (pr, post) os not ppr in A. In this s, thr must pir (pr, post ) in A 1, whih susums (pr, post). Noti tht (pr, post ) nnot susum y ny pir in A sin it susums (pr, post). Othrwis, w will hv pir (pr, post ) in A suh tht pr < pr n post > post. But w hv (pr, post) < (pr, post ) or (pr, post) > (pr, post ). In th ormr s, w hv pr < pr < pr. It ontrits th t tht (pr, post ) susums (pr, post). In th lttr s, w hv post > post > post. It lso ontrits th t tht (pr, post ) susums (pr, post). Thror, (pr, post ) will ppr in A. Sin v is in th sutr root t (pr, post), it must in th sutr root t (pr, post ). Thus, th proposition hols. Proposition 4. Lt A 1 n A two pir squns sort in inrsin orr. Lt A th rsult otin y mrin A into A 1 usin Alorithm pir-squn-mr( ). I v is no in sutr o G r, whih is root t som no ll with pir in A 1, thn thr must pir in A suh tht th sutr root t it ontins v. Proo. Similr to Proposition 3. Proposition 5. Th tim omplxity o Alorithm pir-squnmr is oun y O( A 1 + A ). Proo. Durin th xution o th lorithm, h pir in A 1 n A is visit t most on. Bs on th mrin oprtion isuss ov, th pir squns or ll th nos in DAG n omput s ollows. Alorithm ll-squn-nrtion in 1 Lt v n, v n-1,..., v 1 th topoloil squn o th nos o G; or i rom n ownto 1 o 3 {lt,..., th hil nos o v i ; 4 or j rom 1 to k o 5 ll pir-squn-mr(a i, ); 6 } n v i1 v ik Proposition 6. Th sp omplxity o Alorithm ll-squnnrtion is oun y O(n ), whr is th rth o G n n is th numr o th nos o G. Proo. In th lorithm, h no v is ssoit with link list A v. W lim tht th siz o A v is oun y. Assum tht A v ontins + 1 pirs tht r irnt rom h othr. Thn, thr must xist two pirs p n q so tht p susums q or vi vrs. Thror, on o thm will rmov. Thus, th sp n or Alorithm ll-squn-nrtion is oun y O(n ). Proposition 7. Th tim omplxity o Alorithm ll-squnnrtion is oun y O( ), whr is th rth o G n is th numr o th s o G. A ij ISSN: SYSTEMICS, CYBERNETICS AND INFORMATICS VOLUME 4 - NUMBER 5 5

6 Proo. In th out or-loop o th lorithm, n stps r prorm. In h stp, i mr oprtions r m or h v i, whr i rprsnts th outr o v i. Thror, th tim spnt or h stp is O( i ). Th whol tim omplxity is thus O( ) = O( ). Sin th omposition n th llin o DAG n only O() tim n O() sp, th whol tim omplxity o our lorithm is oun y O( ) orin to Proposition 7, n th sp omplxity is oun y O(n ) orin to Proposition 6. This omputtionl omplxity is suprior to ny xistin ons. W ompr our lorithm with th rlvnt work in Stion 6. Proposition 8. Lt v no in G. Any snnt u o v must in sutr o G r root t no ll with pir in A v onstrut y Alorithm ll-squn-nrtion. proo. Assum tht v n v n-1... v 1 is topoloil squn o G. W prov th proposition y inution on th orinl numr l in th topoloil squn. Bsis. Whn l = 1, v n is l no in G n its link list ontins only on ll ssoit with v n. Th proposition hols. Hypothsis. Suppos tht whn m k th proposition hols. Tht is, h link list A i ssoit with v i (i = n,..., n - k) ontins ll th pirs ovrin ll th snnts o v i. Consir l = k + 1. Aorin to th proprty o th topoloil squn, ll th hil nos o v n-k-1 must ppr in {v n, v n-1,..., v n-k }. Thn, rom lins 3-6 o Alorithm ll-squn-nrtion, s wll s Proposition, 3 n 4, w n s tht th link list A n-k-1 ssoit with v n-k-1 must ontin ll th pirs ovrin ll th snnts o v n-k-1. It omplts th proo. Exmpl 4. A possil topoloil squn or th rph shown in Fi. 3() is:. Th pirs ssoit with thm r: (4, 1), (5, ), (6, 4), (3, 3), (8, 6), (, 5) n (7, 7), rsptivly. Thy r otin y llin th tr shown in Fi. 4(). Applyin Alorithm ll-squn-nrtion to this squn, w will prou link list or h o thm s shown in Fi. 9. topoloil orr 4, 1 5, 4, 1 5, 6, 4 3, 3 4, 1 5, 6, 4 8, 6, 5 4, 1 5, 6, 4 7, 7 W n stor physilly th ll pir or h no, s wll s its ll pir squn prou usin Alorithm ll-squn-nrtion. Conrtly, th rltionl shm to hnl rursion w.r.t. DAG n stlish in th ollowin orm: No(No_i, ll, ll_squn,...), Fi. 9. link lists rprsntin pir squns whr ll n ll_squn r us to ommot th ll pirs n th ll pir squns ssoit with th nos o rph, rsptivly. Thn, to rtriv th snnts o no i x, w issu two quris. Th irst qury is similr to Q 1 : Q 3 : SELECT ll_squn FROM No WHERE No_i = x. Lt th ll squn otin y vlutin Q 3 y. Thn, th son qury will o th ollowin orm: Q 4 : SELECT * FROM No WHERE φ(ll, y), whr φ(p, s) is ooln untion with th input: p n s, whr p is pir n s pir squn. I thr xists pir p in s suh tht p p (i.., p.pr > p.pr n p.post < p.post), thn φ(p, s) rturns tru; othrwis ls. W not tht h xution o φ untion ns only O(lo s ) tim. This n on s ollows. Assum s = p 1 p... A v 1 p, whih is stor in two rrys n : on or ll th p i prs n th othr or ll th p i posts. To hk whthr p is susum y p i, w mk inry srh o to in th lrst i suh tht p i pr < p pr. Thn, w srh rom th 1st to th ith lmnt to in whthr thr xists j suh tht p j post < p post. I it is th s, p is susum y som pir in s; othrwis not. Oviously, th tim omplxity o this pross is O(lo s ). Sin s is oun y th rth o th rph, this mtho rquirs only O(n lo ) tim to in ll th snnts o ivn no. 4. Rursion w.r.t. yli rphs Bs on th mtho isuss in th prvious sustion, w n sily vlop n lorithm to omput rursion or yli rphs. First, w us Trjn s lorithm or intiyin stronly onnt omponnts (SCCs) to in th yls o yli rph [41] (whih ns only O(n + ) tim). Thn, w tk h SCC s sinl no (i.., onns h SCC to no) n trnsorm yli rph into DAG. Nxt, w hnl th DAG s isuss in 4.1. In this wy, howvr, ll nos in n SCC will ssin th sm pir (n th sm pir squn). For this rson, th mtho or omputin th rursion t som no x shoul slihtly hn. In th ollowin, Q 5 is th sm s Q 3, ut Q 6 is irnt rom Q 4. Q 5 : SELECT ll_squn FROM No WHERE No_i = x Lt th ll squn otin y vlutin Q 5 y. Thn, th son qury will o th ollowin orm: Q 6 : SELECT * FROM No WHERE γ(ll, y), whr γ(t, s) is ooln untion with th input: t n s, whr t is pir n s pir squn. I thr xists pir t in s suh tht t.pr t.pr n t.post t.post, thn γ(t, s) rturns tru; othrwis ls. W not tht γ( ) is slihtly irnt rom φ( ) in in 4.1. A v 1 A v A v 6 SYSTEMICS, CYBERNETICS AND INFORMATICS VOLUME 4 - NUMBER 5 ISSN:

7 In Q 6, ny two nos in th sm SCC r onsir to th snnts o h othr. Finlly, w point out tht th tim omplxity o omputin rursion w.r.t. yli rph is still O( ) sin Trjn s lorithm runs in O(n + ) tim [41]. 4.3 Aout omputtion o trnsitiv losurs Th lorithm isuss in 4.1 is in ssn nw strty with rprsnttion o trnsitiv losurs quit irnt rom th tritionl mthos. As mntion in 4.1, h pir in pir squn ssoit with no in G n onsir s pointr to sutr in G r. (In prti, h pir n ssoit with physil pointr s illustrt in Fi. 10().) Thn, th union o ll th sutrs point to y th pirs in pir squn ssoit with no v ontins ll th snnts o v. 4, 1 5,. 4, 1 5, 6, 4 3, 3 4, 1 5, 6, 4 8, 6, 5 4, 1 5, 6, 4 7, 7 () For n intuitiv xplntion, s th pir (, 5) ssoit with in Fi. 10(). It is pointr to th no in th rnhin, initin tht ll th nos in th sutr root t (in th rnhin) r th snnts o in th oriinl rph. As nothr xmpl, s th pir squn or tht ontins 4 pirs, rprsntin 4 pointrs s shown in th iur. From th oriinl rph shown in Fi. 3(), w s tht th union o th sutrs point to y ths 4 pointrs ontins rlly ll th snnts o. In this wy, w n only O(n ) sp to stor trnsitiv losur, whr is th rth o th rph. As isuss in 4.1, th tim spnt to nrt th pir squns or ll th nos in rph is O( ). In tritionl mtho, howvr, th trnsitiv losur o rph is rprsnt y st o lists n h list ontins ll th snnts o som no (s Fi. 10()) or y n n ooln mtrix Thror, th sp rquirmnt or storin trnsitiv losur is O(n ). 5. INCREMENTAL CHANGES TO GRAPHS In ynmi nvironmnt, th t in ts n rquntly hn. With stti noin, th romputtion o lls is n, whih is normlly vry tim onsumin. Howvr, in our mtho, in no to DAG ns only O() tim or lultin its ll. Ain n is mor iiult sin it my us O(n ) s in th trnsitiv losur o rph (s [7]). In our mtho, it ns O() tim in th st s n O(n ) tim in th worst s. But or n onsutiv insrtions o s, it tks only O(n ) tim. Thror, th vr tim or insrtin n is O(). In th ollowin, w isuss th no insrtion r : : : [] [] [,, ] : [,, ] : [,,, ] : : [,,,, ] [,,,, ] () Fi. 10. link lists rprsntin pir squns n th insrtion in 5.1 n 5., rsptivly. 5.1 No insrtion W noti tht ll n rl numr, not lwys n intr. Btwn two onsutiv intrs, w hv ininitly mny rl numrs. Thn, whn nw no is insrt into rph, w n ssin rl numr to no s its prorr or postorr numr, whih will not twist th mhnism isuss in th prin stion. Howvr, ininitly mny numrs r not implmntl. Dpnin on irnt pplitions, w st irnt numrs o iits to th riht o th iml point or th possil insrtion. It n onsir s n xtnsion to th i isuss in [], whih lvs ps twn h pir o sussiv postnumrs or insrtin nos. In th ollowin, w irst isuss th no insrtion into tr. Thn, th no insrtion into DAG is rily outlin. - No insrtion into tr First, w onsir two ss o no insrtion into tr. 1. A nw no v is insrt into tr T s irt riht silin o som no u.. A nw no v is insrt into tr T s prnt o som no u. In ths two ss, th pir (pr, post) ssoit with v is lult s ollows. Lt th pir ssoit with u (p, q). Lt th pir ssoit with th no s prin u (orin to th prorr numrin) (p s, q s ). Lt th pir ssoit with th no t nxt to s (orin to th postorr numrin) (p t, q t ). W hv p p s q t q pr = p s , n post = q t Oviously, i h no kps pointr to its prssor (orin to th prorr numrin) n pointr to its sussor (orin to th postorr numrin), this oprtion ns only onstnt tim. Now w onsir nothr two ss tht r ul to s 1 n, rsptivly. 3. A nw no v is insrt into tr T s irt lt silin o som no u. 4. A nw no v is insrt into tr T s hil o som no u n th prnt o on o u s hilrn. Lt th pir ssoit with u (p, q). Lt th pir ssoit with th no s prin u (orin to th postorr numrin) (p s, q s ). Lt th pir ssoit with th no t nxt to s (orin to th prorr numrin) (p t, q t ). W hv p t p q q s pr = p , n post = q No insrtion into DAG To lult th pir n th pir squn or nw no insrt into DAG, w hv to trmin whr to insrt th no in th orrsponin rnhin. This n on y hkin th prnt o th nw no, whih is n sy tsk sin th inormtion on its prnt must spii. Two ss will onsir: 1. Th no is insrt s hil o som no in th rnhin.. Th no is insrt twn n (u, v) (i.., it is insrt s hil o u n th prnt o v.) ISSN: SYSTEMICS, CYBERNETICS AND INFORMATICS VOLUME 4 - NUMBER 5 7

8 For oth ss, w omput th pir or th nw no usin th mtho isuss ov; ut yt w n to mr th pir squn o its hil with its pir or s. Th tim omplxity is O(). 5. E insrtion Now w onsir th insrtion o n into DAG G. Lt = (u, v). Lt A u n A v th ll squns or u n v, rsptivly. Th ollowin lorithm hns th lls o G whn is insrt into it. Alorithm insrtin-on-(g, ) in ll pir-squn-mr(a v, A u );(*pir-squn-mr(a v, A u ) ws isuss in Stion 3.*) i A v is not hn thn rturn; ls {Lt v n, v n-1,..., v 1 th topoloil squn o th nos o G; Assum v = v l or som l; or i rom l ownto 1 o(*hn th lls o th nos lon th topoloil orr.*) {lt,..., th hil nos o v i ; v i1 v ik A ij or j rom 1 to k o * i is not hn thn ll pir-squnmr(a i, Aij ); ** i thr r onsutiv ll squns not hn (* rprsnts th rth o G.*) thn rturn; } n This lorithm is similr to th Alorithm ll-squn-nrtion. Th min irn is th lin mrk with *, whr whthr A ij is hn is hk or pir-squnmr(a i, A ij ) is invok. Anothr irn is th lin mrk with **, whr w hk whthr thr r onsutiv ll squns not hn ( rprsnts th rth o G). I it is th s, th lorithm trmints. Rll tht th tim omplxity o Alorithm pir-squn-mr( ) is O(). Thror, w n only O() tim or insrtin n in th s tht A v is not hn tr A u is mr into it. In th worst s, w will xut th lorithm pir-squn-mr( ) l tims (i v is th lth no in th topoloil squn o G). For h o ths nos, w will mr ll thos hn pir squns o its hilrn with its pir squn. (S th lin mrk * in th ov lorithm.) Sin t most n pir squns my hn, th tim omplxity is oun y O(n ). W noti tht insrtin m (m > 1) s onsutivly into DAG G os not rquir mor tim thn insrtin only on. This is us tr hnin th ll squns or ll th nos involv, w n to sn th topoloil squn o G only on. Thror, th tim omplxity o insrtin m s n into G is oun y O(m ). min{ mn, } In prtiulr, i m = n, th tim omplxity is O(n ). 6. RELEVANT WORK AND COMPARISON In th pst svrl s, th trnsitiv losur o rph hs xtnsivly rsrh n lot o irnt strtis hv n propos, suh s th rph-s lorithms [0, 1, 34, 36, 38], th rph noin [1,, 7, 14, 16, 7, 43, 48] n th mtrixs mthos [4, 3, 44, 45]. In th ollowin, w minly isuss th rph noin n th mtrix-s mthos sin thy uniormly outprorm th rph-s mthos. - Grph noin Prhps th most lnt lorithm or noin is rltiv numrin [40] (lso ll Shurt s numrin), y mns o whih h no v is ssoit with n intrvl [q v, p v ] to ilitt th hkin o nstor-snnt rltionships, whr p v is th postorr numr o v n q v is th lst postorr numr o th sutr root t v. This mtho ws nrliz to DAGs y Arwl, Bori n Jish [] into wht is ll rn-omprssion. In this mtho, h no v is ssoit with postorr numr p v n two rrys A v n B v suh tht i thr xists nothr no u stisyin th ollowin onition or som i: A u [i] < p v < B u [i], v is snnt o u. Sin th siz o A v (or B v ) is on th orr O(n), th sp ovrh o this noin is O(n ). To nrt suh rrys, ll th s hv to ss. Thus, th tim ovrh o this mtho is O(n ). In ition, y lvin ps twn h pir o sussiv postorr numrs, insrtin no n on iintly. Howvr, or nw no, its rrys hs to rt n thror, t lst, O(n) tim is n. To insrt n is mor iiult sin th t struturs or ll th snnts hv to romput, whih ns in th worst s O(n ) tim. Finlly, O(n) tim is n or pth hkin sin oth th rrys ssoit with no will snn. Bomml n Bk [7] improvs th mtho propos in [] only y sttin suitl ps. Thror, thir mtho hs th sm omputtionl omplxitis s []. In [7], Jish isuss irnt rph noin, y mns o whih, or ny pir o nos u n v with lls (i, j) n (k, j), i i < k, thr xists irt pth rom u to v. Sin or ll th nos on h pth (ll hin in [7]) suh lls r stlish, th sp ovrh is O( n), whr is th numr o pths ovrin ll th nos o rph. Sin th pths my not isjoin (i.., no my ppr on mor thn on pth), th numr o th lls ssoit with no is on th orr O(n) in th worst s. Th tim omplxity o this mtho is O(n ) n it ns O( n) tim to insrt n. Finlly, insrtin no ns t lst O(n) tim sin or h pth whr th no pprs th lls hv to rt, n th lls or ll th snnts s wll s ll th nstors hv to hn. In th mtho propos y Aim [1], no v is ssoit with two intr squns o th sm lnth: p = p 1,..., p k n s = s 1,..., s k, whr k is th numr o th isjoin pths ovrin th rph. Eh p i in p is th numr o th nos on pth P i, whih r th prssors o v whil h s j in s is qul to P j - su j (v) + 1, whr P j is th numr o nos on P j n su j (v) is th numr o th sussors o v on P j. With suh squns ssoit with th nos, th pth hkin n on in O(k) tim. Howvr, this mtho mintins th trnsitiv losur o 8 SYSTEMICS, CYBERNETICS AND INFORMATICS VOLUME 4 - NUMBER 5 ISSN:

9 rph in O(k + n min{n, }) tim n O(k n) sp; n ns O(n ) tim to moiy rlvnt su j (v) s whn insrtin n. In [43], Tuhol isuss n intrstin it-squn noin. In this mtho, h no v is ssoit with n intrvl (l, h), whr l n h r two sinturs h onsistin o it strin. Ths it strins r onstrut in suh wy tht i th intrvl ssoit with snnt o v is (l, h ), thn l l n h h hol. In th s o DAGs, th sp n tim ovrh o this mtho r oun rsptivly y O( n) n O( ), whr is th lnth o sintur. Howvr, th lnth o sintur is snsitiv to th hiht o rph (whih is in to th lonst pth in rph) n th outrs o th nos. Thror, in th worst s, insrtin no or n ns to hn ll th sinturs o th rph, lin to n O( ) tim omplxity. Oviously, th pth hkin only ns O() tim. Th min prolm o this mtho is tht th rph omposition is not lrly in, whih is n to ll rph usin sinturs. Bsis th ov mthos, svrl othr noins hv n vlop in th ontxt o prormmin lnus to sp up typ-sutyp hkins, suh s Cohn s noin [16], Pk- Enoin (lso ll PE-Enoin) [14] n PQ-Enoin [48]. Cohn s noin n us only or tr struturs; n PE- Enoin is it-vtor s strty. Th lnth o it-vtor is on O(n), whr n is th numr o th typs (sutyps) in hirrhy. Th PE-Enoin ws propos y Ziin n Gil in 001 [48], whih ssoits h no v with n rry o intrs A v n n intrvl [l v, h v ] suh tht or ny nstor u o v w hv l u < A v [i] < h u or som i. Th lnth o th rry is shortn y omposin rph into slis in suh wy tht thr is only n ntry in th rry or h sli. This noin is s on th onpt o PQ-trs, t strutur propos in [9], whih is us to tst or th onsutiv 1 s proprty in inry mtris. Howvr, sin th siz o sli is oun y onstnt, th lnth o th rry is on O(n/), whr rprsnts vr numr o nos in sli. Thror, th sp ovrh o th PQ- Enoin is on O(n /). Th tim ovrh shoul O(n /). Insrtin n n insrtin no r iiult sin in th worst s, th slis hv to rin, lin to tim omplxity o O(n /). In trms o th nlysis o [48], pth hkin ns O(lon) tim. From th isussion in Stion 3, w n s tht our lorithm is nw rph noin irnt rom ny on outlin ov n ns only O( ) tim n O(n ) sp to omput th trnsitiv losur o rph. Th tim or Insrtin no is oun y O(). In ition, w n only O(lo) tim or pth hkin n O(m ) tim or insrtin m s sus- n min{ mn, } sivly. Tl 1 shows th omputtionl omplxitis o ll th min rph noin lorithms. Tl 1. Comprison o omputtion omplxitis. - Mtrix-s mthos In th omputin rph thory, th trnsitiv losur hs n lon n intrstin topi. Mny mthos hv n propos s on th mtrix rprsnttion, suh s th mthos isuss in [4, 3, 44, 43]. In suh mthos, trnsitiv losur is mintin s mtrix M with M[i, j] = 1 initin tht thr xists pth rom no i to no j in G. Amon ll ths lorithms, th most intrstin is Wrrn s [45]. It improvs th tim omplxity o Wshll s [45] rom O(n 3 ) to O(n ). Sin th trnsitiv losur o rph is stor in mtrix, th tim or pth hkin is oun y onstnt. Howvr, th sp ovrh is O(n ). In ition, vn pplyin th wll-known st-union lorithm, insrtin m s sussivly ns O(mα(m +, n) + + n) tim, whr α(x, y) is vry slowly rowin untion. Ain no is lso iiult sin n n mtrix will hn to (n + 1) (n + 1) on. Thror, it ns t lst O(n) tim. Arwl Bori Bomml Ziin Jish Bk Jish Am Tuhol Gil our rph llin tim O(n ) O(n ) O(n ) O(k + n min{n, }) O( ) O(n /) O( ) sp pth hk O(n ) O(n) O(n ) O(n) O( n) O(n) O(k n) O(k) O( n) O() O(n /) O(lon) O( n) O(lo) insrt n O(n ) O(n ) O( n) O(n ) O( ) O(n /) O((n/min{m, n}) ) insrt no O(n) O(n) O(n) O(n) O( ) O(n /) O() Th mtho propos y Irki n Ktoh [4] mintins th trnsitiv losur o rph in th sm omputtion omplxity s Wrrn s. Howvr, it ns only O(n 3 ) tim to insrt q s sussivly y usin spil it oprtion. Whn th orr o m is lrr, O(n 3 ) is ttr thn O(mα(m +, n) + + n). In Itlino s mtho [5], n n n mtrix o pointrs is us. Eh o thm points to spnnin tr. Thror, mor tim n sp thn Wrrn s r n. Th ol o Itlino s ws to t ttr mortiz tim omplxity or two oprtions: insrtin n n hkin pth (i suh pth xists, rturn it). Usin Itlino s t strutur, h o th ov two oprtions n on in O(n) mortiz tim. Th mtho isuss in [3] is mor omplit strty. Inst o omputin th trnsitiv losur o G = (V, E), this mtho omputs th trnsitiv losur o G s rution G - = (V, E - ), whr E - is in s ollows: E - = E / {(u, v) (u, v) (u, v) E n thr is pth P rom u to v with P }. Oviously, E - E. Thror, th omputtion o th trnsitiv losur o G - ns lss tim thn G. But th tim omplxity is still on th orr o O(n ). In ition, urin th omputtion, two mtris r us n thus mor sp thn Wrrn s is n. Th tim or insrtin m s sussivly is O(m n). Tl shows th omputtionl omplxitis o ll th min mtrix-s lorithms. Tl. Comprison o omputtion omplxitis Irki n L Poutr n Wrrn Ktoh Itlino Luwn tim sp pth hk O(n ) O(n ) O(1) O(n ) O(n ) O(1) O(n ) O(n ) O(n) O(n ) O(n ) O(1) insrt m s O(mα(m +, n) + + n) O(n 3 ) O(m n) O(m n) insrt no O(n) O(n) O(n) O(n) ISSN: SYSTEMICS, CYBERNETICS AND INFORMATICS VOLUME 4 - NUMBER 5 9

10 7. EXPERIMENT RESULTS W hv implmnt tst in C++, with our own ur mnmnt (with irst-in-irst-out rplmnt poliy) n B+tr strutur. Th omputr ws Intl Pntium III, runnin stnlon. W hv tst two mthos: th mtho s on sinturs (Tuhol s), n th mtho s on rph llin (th on isuss in this ppr). W hos Tuhol s mtho or tstin sin it hs st sp omplxity ovr th othrs. W us two strutur typs: Trs n DAGs, n msur th physil I/O quot s wll s th pu tim. W i not hk yli irphs sin in [43] no orml mtho ws sust to hnl this s usin sinturs. In t, vn or DAGs, it ws not xpliitly isuss in [43] how to ompos irph into st o spnnin trs (s in in tht rtil). W o or th spii t sttin sri in [43]; ut it is not nrl strty. Alon with [43], w hv tst th ollowin thr ss: (1) orst o 18 trs with thr hilrn pr nonl; iht lvls, nos, n 590 onntions; () orst o 18 trs with our hilrn pr nonl; iht lvls, nos, n onntions; (3) DAG o 640 roots with thr hilrn pr nonl; two prnts pr nonroot, iht lvls, 3155 nos n onntions. For th two mthos tst, th t ils r sin littl it irntly s shown in Fi. 11. In oth th t ils, no is rprsnt y no intiir tht is in t n intr rprsnt s it squn. Th il or tstin Tuhol s mtho ontins, or h no, 3 or 64 its or its sintur plus 4 its or th lvl, t whih th no pprs. In this il, only th low vlu ( sintur) o th intrvl ssoit with no is stor; n th hih vlu o th intrvl n lult usin th low vlu n th orrsponin lvl numr. Th il or tstin th rph-llin mtho ontins prorr numr n postorr numr or h no. Eh o thm is 18 or its lon. For th tsts, th ur is o 50 ps n h p is o siz 4096 yts. il strutur us or tstin Tuhol s mtho: 4 its 8 its n its 4 its no intiir sintur lvl il strutur us 4 its 8 its m its m its or tstin rph-lllin mtho: no intiir pr-numr post-numr or s (1) n (3): n = 3, m = 18 or s (): n = 64, m = Fi. 11. Fil struturs Fi. 1 shows th tst rsults o s (1). For this tst, h o th sinturs or Tuhol s is 3 its lon whil h o th prorr (postorr) numrs or th rph-llin tks 18 its. From this, w n s tht in th s o trs, i th sinturs o Tuhol s mtho hv th sm lnth s th lls o th rphllin mtho, thy hv lmost th sm prormn. Howvr, i th sinturs om lonr, th prormn o Tuhol s rs. S Fi. 13 or illustrtion. This iur shows th tst rsults o s (). For this tst, h sintur is 64 its lon whil h prorr (postorr) numr tks its. Espilly, thr is shrp inrs o p sss o Tuhol s mtho rom lvl 6 onwrs. It is us in ths ss, th umult impt o lon sinturs oms vint. p ss p ss Th tst rsults o s (3) r thr in Tl 1. In this tst, ll th snnts o root (3041 nos on vr) r rtriv. strutur Tuhol s rph-llin lvl Tuhol s rph-llin Tl 3: Tst rsults o DAGs no ss tim (s.) Fi. 1. Tst rsults o s (1) Tuhol s p pu tim sss (s.) rph-llin p pu tim sss (s.) DAG From Tl 3, w n s tht in th s o DGAs, Tuhol s mtho is muh wors thn ours. It is us DAG hs to ompos into sris o spnnin trs to us Tuhol s mtho. For h ompos tr, th sinturs ssoit with th nos n us to hk snnts; ut th hil sintur o h ss onntion must hk. I it is outsi th [Low, Hih] rn o th sinturs o th urrnt tr, thn th hil lons to nothr tr, n nw qury is issu inst it. This ls to lot o xtr p sss. Howvr, or th rphllin mtho, th rph omposition is utiliz only or th nrtion o pir squns, no xtr p ss is us. But w noti tht in th DAG s, lthouh th numr o p ss o this mtho is not muh lrr thn th s o trs, th tim irn o ths two ss is rltivly i. It is us or DAG h no is ssoit with squn o ll pirs n h hk o ll pir squns ns mor tim. Fi. 14 shows th tst rsults or th trs with irnt outrs. Th orst ontins 18 trs h o 380 nos. W hn th outr o th nos or h run n just th sinturs so tht h tim th sinturs hv irnt lnth. In ontrst, th ll lnth o our lorithm rmins unhn. This rrnmnt is rsonl sin th lnth o th nos sinturs t lvl (in tr) pns on th lrst outr t this lvl tim (s.) Tuhol s rph-llin lvl lvl lvl Fi. 13. Tst rsults o s () 10 Tuhol s rph-llin 10 SYSTEMICS, CYBERNETICS AND INFORMATICS VOLUME 4 - NUMBER 5 ISSN:

11 I thr is no t lvl hs lr outr, th sinturs or ll th nos t tht lvl must st vry lon orin to th sintur onstrution propos in [43]. Howvr, th lnth o lls us in ours pns only on th lls vlus. Th lrst ll is qul to th numr o th nos o rph. Finlly, w mphsiz tht th mi mrit o th propos mtho os not only onsists in spin-up th rursion in rltionl nvironmnt, ut lso in th nw rprsnttion o rursiv losurs, whih ls to ttr omputtionl omplxity thn ny xistin strtis or this prolm. tim (s.) Tuhol s rph-llin outr Fi. 14. Tst rsults 8. CONCLUSION In this ppr, nw llin thniqu hs n propos. Usin this thniqu, th rursion w.r.t. tr hirrhy n omput without join oprtions. Th propos mtho n xtn to omput th rursion w.r.t. DAGs n rphs ontinin yls. Givn DAG, w n lwys in mximl rnhin s its rprsnttion, whih is in t tr (or orst) n thus n lwys ll. To in th rursiv losur o th DAG, w onstrut squn o ll pirs or h no, whih n on in topoloil orr o th DAG in O( ) tim n O(n ) sp, whr n rprsnts th numr o th nos o th DAG, th numrs o th s, n th DAG s rth. To omput th rursion w.r.t. yli rph, w irst us Trjn s lorithm [41] to in ll its SCCs; n thn onns h SCC onto sinl no, rsultin in DAG. Sin Trjn s lorithm ns only O(n + ) tim, th tim omplxity or inin th squns o ll pirs or ll nos o yli rph is thortilly oun y O( ). Finlly, w noti tht th squns o ll pirs r in t nw rprsnttion o th trnsitiv losur o rph with muh lss sp ovrh thn ny xistin strty. Thror, th mtho isuss in this ppr n onsir s nw mtho or omputin trnsitiv losurs with optiml tim n sp omplxitis. REFERENCES [1] S. Aim, On Inrmntl Computtion o Trnsitiv Closur n Gry Alinmnt, in: Pro. 8th Symp. Comintoril Pttrn Mthin,. Alrto Apostolio n Jotun Hin, 1997, pp [] R. Arwl, A. Bori n H.V. Jish, Eiint mnmnt o trnstiv rltionships in lr t n knowl ss, Pro. o th 1989 ACM SIGMOD Intl. Con. on Mnmnt o Dt, Oron, 1989, pp [3] S. Aitoul, S. Clut, V. Christophis, T. Milo, G. Morkott, J. Simon, Qurin oumnts in ojt tss, Int. J. Diitl Lirris, Vol. 1, No. 1, April 1997, pp [4] R. Arwl, S. Dr, H.V. Jish, Dirt trnsitiv losur lorithms: Dsin n prormn vlution, ACM Trns. Dts Syst. 15, 3 (Spt. 1990), pp [5] R. Arwl n H.V. Jish, Mtriliztion n Inrmntl Upt o Pth Inormtion, in: Pro. 5th Int. Con. Dt Eninrin, Los Anls, 1989, pp [6] R. Arwl n H.V. Jish, Hyri trnsitiv losur lorithms, In Pro. o th 16th Int. VLDB Con., Brisn, Austrli, Au. 1990, pp [7] M.F. vn Bomml n T.J. Bk, Inrmntl Enoin o Multipl Inhritn Hirrhis Supportin Ltti Oprtions, Linkopin Eltroni Artils in Computr n Inormtion Sin, [8] J. Bnrj, W. Kim, S. Kim n J.F. Grz, Clustrin DAG or CAD Dtss, IEEE Trns. on Knowl n Dt Eninrin, Vol. 14, No. 11, Nov. 1988, pp [9] K.S. Booth n G.S. Lukr, Tstin or th onsutiv ons proprty, intrvl rphs, n rph plnity usin PQ-tr lorithms, J. Comput. Sys. Si., 13(3): , D [10] F. Bnihon n R. Rmkrishnn, An Amturs Introution to Rursiv Qury Prossin Strtis, in: Pro. ACM SIGMOD Con., Wshinton D.C., 1986, pp [11] M. Cry t l., An Inrmntl Join Atthmnt or Strurst, in: Pro. 16th VLDB Con., Brisn, Austrli, 1990, pp [1] Y. Chn, K. Arr, Lyr Inx Struturs in Doumnt Dts Systms, Pro. 7th Int. Conrn on Inormtion n Knowl Mnmnt (CIKM), Bths, MD, USA: ACM, 1998, pp [13] Y. Chn n K. Arr, Cominin Pt-Trs n Sintur Fils or Qury Evlution in Doumnt Dtss, in: Pro. o 10th Int. DEXA Con. on Dts n Exprt Systms Applition, Florn, Itly: Sprinr Vrl, Spt pp [14] L. Crlli, J. Donhu, M. Jorn, B. Klsow, n G. Nlson, Th Moul-3 typ systm, Pro. o 16th Simposium on Prinipls o Prormmin Lnus, POPL 89, ACM SIGPLAN, Austin, Txs, Jn. 1989, pp [15] Y. Chn, On th Grph Trvrsl n Linr Binry-hin Prorms, IEEE Trnstions on Knowl n Dt Eninrin, Vol. 15, No. 3, My 003, pp [16] N.H. Cohn, Typ-xtnsion tsts n prorm in onstnt tim, ACM Trnstions on Prormmin Lnus n Systms, 13:66-69, [17] R.G.G. Cttll n J. Skn, Ojt Oprtions Bnhmrk, ACM Trns. Dts Systms, Vol. 17, no. 1, pp. 1-31, 199. [18] P. Dm t l., A DBMS Prototyp to Support Extn NF Rltions: An Intrt Viw on Flt Tls n Hirrhis, Pro. ACM SIGMOD Con., Wshinton D.C., 1986, pp [19] S. Dr n R. Rmrkrishnn, A Prormn Stuy o Trnsitiv Closur Alorithm, in Pro. o SIGMOD Int. Con., Minnpolis, Minnsot, USA, 1994, pp [0] J. Dzikiwiz, An Alorithm or Finin th Trnsitiv Closur o Dirph, Computin 15, 75-79, ISSN: SYSTEMICS, CYBERNETICS AND INFORMATICS VOLUME 4 - NUMBER 5 11

12 [1] J. Ert, A Snsitiv Trnsitiv losur Alorithm, In. Pross Lttrs 1, 5 (1981). [] J. Ev n R. Kurki-Suonio, On Computin th Trnsitiv Closur o Rltion, At Inormti 8, , [3] R.L. Hskin n R.A. Lori, On Extnin th Funtions o Rltionl Dts Systm, Pro. ACM SIGMOD Con., Orlno, Fl., 198, pp [4] T. Irki n N. Ktoh, On-lin Computtion o trnsitiv losur or rphs, Inormtion Prossin Lttrs, 16:95-97, [5] G.F. Itlino, Amortiz iiny o pth rtrivl t strutur, Thortil Computr Sin, 48:73-81, [6] Y.E. Ionniis, R. Rmkrishnn n L. Winr, Trnsitiv Closur Alorithms Bs on Dpth-First Srh, ACM Trns. Dts Syst., Vol. 18. No. 3, 1993, pp [7] H.V. Jish, A Comprssion Thniqu to Mtriliz Trnsitiv Closur, ACM Trns. Dts Systms, Vol. 15, No. 4, 1990, pp [8] T. Kllr, G. Gr n D. Mir, Eiint Assmly o Complx Ojts, Pro. ACM SIGMOD on. Dnvr, Colo., 1991, pp [9] W. Kim, Ojt-Orint Dts Systms: Promiss, Rlity, n Futur, Pro. 19th VLDB on., Dulin, Irln, 1993, pp [30] D.E. Knuth, Th Art o Computr Prormmin, Vol.1, Aison-Wsly, Rin, [31] H.A. Kuno n E.A. Runnstinr, Inrmntl Mintnn o Mtriliz Ojt-Orint Viws in MultiViw: Strtis n Prormn Evlution, IEEE Trnstions on Knowl n Dt Eninrin, vol. 10. No. 5, 1998, pp [3] A. L Poutr n J. vn Luwn, Mintnn o Trnsitiv losur n trnsitiv rution o rphs, in Pro. Workshop on Grph-Thorti Conpts in Computr Sin, pp Ltur Nots in Computr Sin 314, Sprinr-Vrl, [33] B. Linsy, J. MPhrson n H. Pirhsh, A Dt Mnmnt Extnsion Arhittur, Pro. ACM SIGMOD on., 1987, pp [34] K. Mhlhorn, Grph Alorithms n NP-Compltnss: Dt Strutur n Alorithm Sprinr-Vrl, Brlin, [35] A.O. Mnlzon, G.A. Mihil, T. Milo, Quryin th Worl Wi W, Int. J. Diitl Lirris, Vol. 1, No. 1, April 1997, pp [36] P. Purom, A Trnsitiv Closur Alorithm, BIT 10, 76-94, [37] R. Rmkrishnn n J.D. Ullmn, A Survy o Rsrh in Dutiv Dts Systms, J. Loi Prormmin, My, 1995, pp [38] L. Shmitz, An Improv Trnsitiv Closur Alorithm, Computin 30, (1983). [39] M. Stonrkr, L. Row n M. Hirohm, Th Implmnttion o POSTGRES, IEEE Trns. Knowl n Dt En., vol., no. 1, 1990, pp [40] M.A. Shurt n J. Tuhr, Dtrmin typ, prt, olour, n tim rltionship, 16 (spil issu on Knowl Rprsnttion):53-60, Ot [41] R. Trjn: Dpth-irst Srh n Linr Grph Alorithms, SIAM J. Compt. Vol. 1. No.. Jun 197, pp [4] J. Trjn: Finin Optimum Brnhin, Ntworks, , pp [43] J. Tuhol, Pth Sinturs: A Wy to Sp up Rursion in Rltionl Dtss, IEEE Trns. on Knowl n Dt Eninrin, Vol. 8, No. 3, Jun 1996, pp [44] S. Wrshll, A Thorm on Booln Mtris, JACM, 9. 1(Jn. 196), [45] H.S. Wrrn, A Moiition o Wrshll s Alorithm or th Trnsitiv Closur o Binry Rltions, Commun. ACM 18, 4 (April 1975), [46] P. Vluriz n H. Borl, Evlution o Rursiv Quris Usin Join Inis, in: Pro. 1st Workshop on Exprt Dts Systms, Chrlston, S.C., 1986, pp [47] P. Vluriz, S. Khoshin n G. Copln, Implmnttion Thniqus o Complx Ojts, Pro. 1th VLDB Con., Kyoto, Jpn, 1986, pp [48] Y. Ziin n J. Gil, Eiint Sutypin Tsts with PQ-Enoin, Pro. o th 001 ACM SIGPLAN on. on Ojt- Orint Prormmin Systms, Lnus n Applition, Flori, Otor 14-18, 001, pp [49] C. Zhn, J. Nuhton, D. DWitt, Q. Luo n G. Lohmn, On Supportin Continmnt Quris in Rltionl Dts Mnmnt Systms, in Pro. o ACM SIGMOD Intl. Con. on Mnmnt o Dt, Cliorni, USA, SYSTEMICS, CYBERNETICS AND INFORMATICS VOLUME 4 - NUMBER 5 ISSN:

, 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

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

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

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

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

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

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

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

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

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

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

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 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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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/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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

ECE 407 Computer Aided Design for Electronic Systems. Circuit Modeling and Basic Graph Concepts/Algorithms. Instructor: Maria K. Michael.

ECE 407 Computer Aided Design for Electronic Systems. Circuit Modeling and Basic Graph Concepts/Algorithms. Instructor: Maria K. Michael. 0 Computr i Dsign or Eltroni Systms Ciruit Moling n si Grph Conptslgorithms Instrutor: Mri K. Mihl MKM - Ovrviw hviorl vs. Struturl mols Extrnl vs. Intrnl rprsnttions Funtionl moling t Logi lvl Struturl

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

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

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

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

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

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

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

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

# 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

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

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

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

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

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

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

RAM Model. I/O Model. Real Machine Example: Nehalem : Algorithms in the Real World 4/9/13

RAM Model. I/O Model. Real Machine Example: Nehalem : Algorithms in the Real World 4/9/13 4//3 RAM Mol 5-853: Algorithms in th Rl Worl Lolity I: Ch-wr lgorithms Introution Sorting List rnking B-trs Bur trs Stnr thortil mol or nlyzing lgorithms: Ininit mmory siz Uniorm ss ost Evlut n lgorithm

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

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

XML and Databases. Outline. Recall: Top-Down Evaluation of Simple Paths. Recall: Top-Down Evaluation of Simple Paths. Sebastian Maneth NICTA and UNSW

XML and Databases. Outline. Recall: Top-Down Evaluation of Simple Paths. Recall: Top-Down Evaluation of Simple Paths. Sebastian Maneth NICTA and UNSW Smll Pth Quiz ML n Dtss Cn you giv n xprssion tht rturns th lst / irst ourrn o h istint pri lmnt? Ltur 8 Strming Evlution: how muh mmory o you n? Sstin Mnth NICTA n UNSW

More information

Register Allocation. How to assign variables to finitely many registers? What to do when it can t be done? How to do so efficiently?

Register Allocation. How to assign variables to finitely many registers? What to do when it can t be done? How to do so efficiently? Rgistr Allotion Rgistr Allotion How to ssign vrils to initly mny rgistrs? Wht to o whn it n t on? How to o so iintly? Mony, Jun 3, 13 Mmory Wll Disprity twn CPU sp n mmory ss sp improvmnt Mony, Jun 3,

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

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

Decimals DECIMALS.

Decimals DECIMALS. Dimls DECIMALS www.mthltis.o.uk ow os it work? Solutions Dimls P qustions Pl vlu o imls 0 000 00 000 0 000 00 0 000 00 0 000 00 0 000 tnths or 0 thousnths or 000 hunrths or 00 hunrths or 00 0 tn thousnths

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

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

A 4-state solution to the Firing Squad Synchronization Problem based on hybrid rule 60 and 102 cellular automata

A 4-state solution to the Firing Squad Synchronization Problem based on hybrid rule 60 and 102 cellular automata A 4-stt solution to th Firing Squ Synhroniztion Prolm s on hyri rul 60 n 102 llulr utomt LI Ning 1, LIANG Shi-li 1*, CUI Shung 1, XU Mi-ling 1, ZHANG Ling 2 (1. Dprtmnt o Physis, Northst Norml Univrsity,

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

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

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

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

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

Improving Union. Implementation. Union-by-size Code. Union-by-Size Find Analysis. Path Compression! Improving Find find(e)

Improving Union. Implementation. Union-by-size Code. Union-by-Size Find Analysis. Path Compression! Improving Find find(e) POW CSE 36: Dt Struturs Top #10 T Dynm (Equvln) Duo: Unon-y-Sz & Pt Comprsson Wk!! Luk MDowll Summr Qurtr 003 M! ZING Wt s Goo Mz? Mz Construton lortm Gvn: ollton o rooms V Conntons twn t rooms (ntlly

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

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

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

Tangram Fractions Overview: Students will analyze standard and nonstandard

Tangram Fractions Overview: Students will analyze standard and nonstandard ACTIVITY 1 Mtrils: Stunt opis o tnrm mstrs trnsprnis o tnrm mstrs sissors PROCEDURE Skills: Dsriin n nmin polyons Stuyin onrun Comprin rtions Tnrm Frtions Ovrviw: Stunts will nlyz stnr n nonstnr tnrms

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

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

Weighted Graphs. Weighted graphs may be either directed or undirected.

Weighted Graphs. Weighted graphs may be either directed or undirected. 1 In mny ppltons, o rp s n ssot numrl vlu, ll wt. Usully, t wts r nonntv ntrs. Wt rps my tr rt or unrt. T wt o n s otn rrr to s t "ost" o t. In ppltons, t wt my msur o t lnt o rout, t pty o ln, t nry rqur

More information

Liqiong Wei, Zhanping Chen, and Kaushik Roy. Yibin Ye and Vivek De. logic circuits more feasible.

Liqiong Wei, Zhanping Chen, and Kaushik Roy. Yibin Ye and Vivek De. logic circuits more feasible. _ Mix-V th (MVT) CMOS Ciruit Dsin Mthooloy or Low Powr Applitions Liqion Wi, Zhnpin Chn, n Kushik Roy Shool o Eltril n Computr Eninrin Puru Univrsity, W. Lytt, IN 47907-1285 Yiin Y n Vivk D Intl Corp.,

More information

Generating Balanced Parentheses and Binary Trees by Prefix Shifts

Generating Balanced Parentheses and Binary Trees by Prefix Shifts Gnrtin Bln Prnthss n Binr Trs Pri Shits Frnk usk 1 Aron Willims 2 Dprtmnt o Computr Sin Univrsit o Vitori, Vitori BC, V8W 3P6, Cn, 1 UL: http://www.s.uvi./~rusk 2 Emil: hron@uvi. Astrt W show tht th st

More information

SD-Rtree: A Scalable Distributed Rtree

SD-Rtree: A Scalable Distributed Rtree SD-Rtr: A Sll Distriut Rtr Céri u Mouz Witol Litwin Philipp Riux CEDRIC, CNAM CERIA, Univ. Pris-Duphin LAMSADE, Univ. Pris-Duphin Pris, Frn Pris, Frn Pris, Frn umouz@nm.r witol.litwin@uphin.r philipp.riux@uphin.r

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

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

A PROPOSAL OF FE MODELING OF UNIDIRECTIONAL COMPOSITE CONSIDERING UNCERTAIN MICRO STRUCTURE

A PROPOSAL OF FE MODELING OF UNIDIRECTIONAL COMPOSITE CONSIDERING UNCERTAIN MICRO STRUCTURE 18 TH INTERNATIONAL CONFERENCE ON COMPOSITE MATERIALS A PROPOSAL OF FE MODELING OF UNIDIRECTIONAL COMPOSITE CONSIDERING UNCERTAIN MICRO STRUCTURE Y.Fujit 1*, T. Kurshii 1, H.Ymtsu 1, M. Zo 2 1 Dpt. o Mngmnt

More information

The University of Sydney MATH 2009

The University of Sydney MATH 2009 T Unvrsty o Syny MATH 2009 APH THEOY Tutorl 7 Solutons 2004 1. Lt t sonnt plnr rp sown. Drw ts ul, n t ul o t ul ( ). Sow tt s sonnt plnr rp, tn s onnt. Du tt ( ) s not somorp to. ( ) A onnt rp s on n

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

for Performance Potsdam, NY Urbana, IL can be connected to the inputs and outputs of the LUT to

for Performance Potsdam, NY Urbana, IL can be connected to the inputs and outputs of the LUT to Thnoloy Mppin o Squntil Ciruits or LUT-s FPGAs or Prormn Pihn Pn C. L. Liu Dpt. o Eltril & Computr En. Dpt. o Computr Sin Clrkson Univrsity Univrsity o Illinois t Urn-Chmpin Potsm, NY 13699 Urn, IL 61801

More information