Graph Contraction and Connectivity

Size: px
Start display at page:

Download "Graph Contraction and Connectivity"

Transcription

1 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 BFS hs som prlllism sin h lvl n xplor in prlll, ut thr ws no prlllism in DFS. 1 Thr ws lso limit prlllism in Dijkstr s lgorithm, ut thr ws plnty o prlllism in th Bllmn-For lgorithm. In this hptr w will ovr thniqu ll grph ontrtion tht ws spiilly sign to us in prlll lgorithms n llows us to gt polylogrithmi spn or rtin grph prolms Prliminris n Grph Prtitioning Pls rviw th mtril on grphs (Stion 2.4) or proing with th rst o this hptr, spilly th stions on sugrphs n onntivity. Rll tht prtitioning o st S is st T o susts o S suh tht h lmnt o S is in xtly on sust t T. W rr to h lmnt o T s prtition n th st T s prtitioning o S. A vrtx prtitioning o grph is prtitioning o its vrtx st. In th ontxt o grph prtitioning, w rr to h sugrph inu y sust o th vrtis s prtition. W n lso in g prtitioning o grph similrly. In this hptr, w r only onrn with vrtx prtitioning o grphs; w thror us th trm grph prtitioning to rr to vrtx-prtitioning o grph. In grph prtitioning, w n istinguish twn two kins o gs: intrnl gs n ross gs. Intrnl gs r gs tht r within prtition; ross gs r gs tht r twn prtitions. On wy to prtition grph is to mk h onnt omponnt prtition. In suh prtitioning, thr r no ross gs twn th prtitions. 1 In rlity, thr is prlllism in DFS whn grphs r ns in prtiulr, lthough vrtis n to visit squntilly, with som r, th gs n pross in prlll. 295

2 296 CHAPTER 17. GRAPH CONTRACTION AND CONNECTIVITY Somtims it is usul to giv nm or ll to h prtition. A prtitioning o grph n thn sri s st o nms or th prtitions n prtition mp tht mps h vrtx to th nm o its prtition. Th nms n hosn ritrrily, though somtims it is onptully n omputtionlly sir to us vrtx insi prtition s nm (rprsnttiv) or tht prtition. Exmpl Th prtitioning o th vrtis {{,, }, {}, {, }} ins thr prtitions s vrtx-inu sugrphs. Th gs {, }, {, }, n {, } r intrnl gs, n th gs {, }, {, }, {, } n {, } r ross gs. Hving nm th thr prtitions, n, w n spiy this prtitioning with ollowing prtition mp: ({,, }, {,,,,, }) In our xmpl, w gv rsh nms to suprvrtis. It is otn mor onvnint to pik rprsnttiv rom h prtition inst o rsh nm. W n thn rprsnt th prtitioning s mpping rom h vrtx to its rprsnttiv (suprvrtx). For xmpl, w n rprsnt th prtitioning in th xmpl with th ollowing pir onsisting o th nms or st o prtitions n th prtition mp ({,, }, {,,,,, }) Grph Contrtion Grph ontrtion is thniqu or omputing proprtis o grph in prlll. As its nm implis, it is ontrtion thniqu, whr w solv prolm y ruing to smllr instn o th sm prolm. Qustion Cn w solv grph prolms using ivi-n-onqur? Grph ontrtion is spilly importnt us ivi-n-onqur is iiult to pply to grphs iintly. Th iiulty is tht ivi-n-onqur woul rquir rlily prtitioning th grph into smllr grphs. Du to thir irrgulr strutur, grphs r iiult to prtition. In t, grph prtitioning prolms r typilly NP-hr.

3 17.2. GRAPH CONTRACTION 297 In th rst o this stion, w sri th grph-ontrtion sign thniqu n sri two pprohs to ontrting grphs y using g prtitionings n str prtitionings, rily rrr to s g ontrtion n str ontrtion Th Dsign Thniqu As with th ontrtion thniqu tht w hv sn in Chptr 6, grph-ontrtion n us to solv vrity o grph prolms. Th ky i hin grph ontrtion is to shrink th input grph, illy y onstnt tor in siz so tht w n solv th prolm on smllr grph, n thn us th solution to th smllr grph to onstrut th solution or th input grph. This thniqu n sri s n inutiv lgorithm-sign thniqu (Dsign Thniqu 17.3). Algorithm-Dsign Thniqu 17.3 (Grph Contrtion). Bs s : For smll nough grph (.g. no gs rmining), lult th sir rsult irtly. Inutiv s : Contrt th grph into smllr grph, illy onstnt rtion smllr. Rurs on th smllr grph. Us th rsult rom th rursion long with th initil grph to lult th sir rsult. Th ky stp o grph ontrtion is th ontrtion o th grph into smllr grph. Qustion Any is out how w might ontrt grph? On wy to ontrt grph is to mp it to smllr grph y mpping susts o vrtis, s in y prtitioning, to vrtis in smllr grph s ollows. 1. Comput vrtx-prtitioning or th grph. 2. Contrt h prtition into singl vrtx, ll suprvrtx. 3. Drop gs intrnl to prtition. 4. Rrout ross gs to orrsponing suprvrtis.

4 298 CHAPTER 17. GRAPH CONTRACTION AND CONNECTIVITY By slting prtitioning to gui th ontrtion, w mk sur tht h vrtx in th grph is mpp to on uniqu vrtx in th smllr grph (us prtitions r isjoint n thy inlu ll th vrtis). Givn prtitioning, w ontrt th grph y ontrting h prtition into singl vrtx n upting th gs. Mor spiilly, w rt supr vrtx or h prtition. W thn onsir h g in th grph. I th g is intrnl to prtition, w skip it. I it is ross g, w rt nw g twn th suprvrtis rprsnting th prtitions o th vrtis o th g. On inl point tht w hv to rul is uplit gs: sin thr n mny ross gs twn two prtitions, w my n up rting multipl gs twn two suprvrtis. W n rmov suh gs or lv thm in. This pross o intiying prtition n upting th gs is ll roun o grph ontrtion. In grph ontrtion, rouns r rpt until thr r no gs lt. Exmpl On roun o grph ontrtion illustrt. Intiy prtitons Contrt Dlt uplit gs Contrting grph own to singl vrtx in thr rouns: Roun 1 Roun 3 Roun Eg Prtitioning n Eg Contrtion In g prtitoning, w slt h prtition to ithr singl vrtx or two vrtis onnt y n g. A grph ontrtion whr prtitions r slt y g prtitioning is rrr to

5 17.2. GRAPH CONTRACTION 299 s g ontrtion. Exmpl An xmpl g prtitioning in whih vry prtition onsists o two vrtis n n g twn thm. This prtitioning will ru th grph to hl its siz tr ontrtion. Contrt Not tht in gnrl w nnot just hv pirs o vrtis sin th grph might not hv n vn numr o vrtis, ut vn i it os (no pun intn), it is likly tht it nnot prtition into st o pirs join y gs. W thror will stisi y som st o isjoint gs (gs tht o not shr n npoint). Fining suh st is ommon tsk in vrity o grph lgorithms, n hn hs nm. Dinition A vrtx mthing or n unirt grph G = (V, E) is sust o gs M E suh tht no two gs in M shr n npoint. Exmpl A vrtx mthing or our vorit grph (highlight gs) n th orrsponing prtitions. It ins our prtitions (irl), two o thm in y th gs in th mthing, {, } n {, }, n two o thm r th lt ovr vrtis n. Rmrk Th prolm o ining th lrgst vrtx mthing or grph is ll th mximum vrtx mthing prolm. It is wll stui prolms n thr r svrl intrsting lgorithms or th prolm, inluing on tht n solv th prolm in O( V E ) work. For grph ontrtion, w o not n mximum mthing ut on tht it is suiintly lrg.

6 300 CHAPTER 17. GRAPH CONTRACTION AND CONNECTIVITY Qustion Cn you sri n lgorithm or ining vrtx mthing? On wy to in vrtx mthing is to go through th gs on y on mintining n initilly mpty st M n or h g, i no g in M is lry inint on its npoints thn it to M, othrwis toss it. Th prolm with this pproh is tht it is squntil sin h ision pns on prvious isions. Qustion Cn you think o wy to in vrtx mthing in prlll? I w wnt to in th vrtx mthing in prlll w will likly n to mk lol isions t h vrtx. On possiility is in or h vrtx in prlll to pik on o its nighors to pir up with. Qustion Wht is th prolm with this pproh? Th prolm with this pproh is tht multipl vrtis might pik gs tht onnt to th sm othr vrtx. W thror n wy to rk th symmtry tht riss whn two vrtis try to pir up with th sm vrtx. Qustion Cn you think o wy to us rnomiztion to rk this symmtry? It turns out tht w n us rnomiztion to rk th symmtry. On pproh or intiying vrtx mthing in prlll is to lip oin or h g n pik th g i it lips hs n ll th gs inint on its npoints lip tils. This gurnts tht no two gs inint on th sm vrtx r slt. Lt us nlyz how tiv this pproh is in slting rsonly lrg st o gs. W irst onsir yl grphs, onsisting o singl yl n no othr gs. In suh grph vry vrtx hs xtly two nighors. Exmpl A grph onsisting o singl yl. T T H H T T Eh g lips oin tht oms up ithr hs (H) or tils (T ). W pik n g i it turns up hs n ll othr gs inint on its npoints r tils. In th xmpl th gs {, } n {, } r slt.

7 17.2. GRAPH CONTRACTION 301 W wnt to trmin th proility tht n g is slt in suh grph. Sin th oins r lipp inpnntly t rnom, n th vrtis t h npoint h hv on othr nighor, th proility tht n g piks hs n its two nighoring gs pik tils is = 1. W now wnt to nlyz how mny gs r slt in xpttion. Lt R 2 8 n initor rnom vril noting whthr is slt or not, tht is R = 1 i is slt n 0 othrwis. Rll tht th xpttion o initor rnom vrils is th sm s th proility it hs vlu 1 (tru). Thror w hv E[R ] = 1/8. Thus summing ovr ll gs, w onlu tht xpt numr o gs lt is m (not, m = n in yl grph). 8 In th hptr on rnomiz lgorithms Stion 9.3 w rgu tht i h roun o n lgorithm shrinks th siz y onstnt rtion in xpttion, n i th rnom hois in th rouns r inpnnt, thn th lgorithm will inish in O(log n) rouns with high proility. Rll tht ll w n to o is multiply th xpt rtion tht rmin ross rouns n thn us Mrkov s inqulity to show tht tr som k log n rouns th proility tht th prolm siz is lst 1 is vry smll. For yl grph, this thniqu ls to n lgorithm or grph ontrtion with linr work n O(log 2 n) spn lt s n xris. Qustion Cn you think o wy to improv th xpt numr o gs lt? Thr r svrl wys to improv th numr o lt gs. On wy is or h g to pik on o its nighors n to slt n g (u, v) i it ws pik y oth u n v. In th s o irl, this inrss th xpt numr o lt gs to m. Anothr wy is lt h 4 g pik rnom numr in som rng n thn slt n g i it is th lol mximum, i.., it pik th highst numr mong ll th gs inint on its n points. This inrss th xpt numr o gs ontrt in irl to m. 3 Although g prtitioning works quit wll with yl grphs, or squntilly with th pproprit t struturs, w shoul sk i it works wll in prlll with ritrry grphs? Unortuntly it os not. Th prolm is tht only on g inint on vrtx n ontrt on h roun. Thror vrtis with high grs, will hv to ontrt thir nighors on t tim. For xmpl, onsir th ollowing kin o grph, ll str grph. Exmpl A str grph with ntr v n ight stllits. v Mor prisly, w n in str grph s ollows.

8 302 CHAPTER 17. GRAPH CONTRACTION AND CONNECTIVITY Dinition (Str Grph). A str grph G = (V, E) is n unirt grph with ntr vrtx v V, n st o gs E tht tth v irtly to th rst o th vrtis, ll stllits, i.. E = {{v, u} : u V \ {v}}. Not tht singl vrtx n singl g r oth str grphs. It is not iiult to onvin ourslvs tht on str grph with n vrtis 1 ntr n n 1 stllits ny g prtitioning lgorithm will tk Ω(n) rouns. To ix this prolm w n to l to orm prtitions tht onsist o mor thn just gs. Rmrk An strt t typ ll isjoint sts is otn us to ontrt grphs squntilly. Disjoint sts supply two untions: union, whih joins two omponnts, n in, whih ins wht omponnt vrtx is in. In our rmwork, th union oprtion is simply g ontrtion ross singl g, n th in is just lookup in th prtition mp. Smntilly or prtition mp P w n in union s: union(p, u, v) = {u i (v = u) thn v ls v : (u v ) P } whr hr w hv m v th nw rprsnttiv o th suprvrtx {u, v}, n hv upt ll vrtis tht us to point to u to now point to v. Implmnting th union this wy, howvr, is iniint sin it n rquir upting lot o vrtis. It turns out tht th oprtions n n implmnt muh mor iintly. In on n implmnt t strutur tht only rquirs mortiz O(α(n)) work pr oprtion, whr α(n) (th invrs Akrmnn untion) is untion tht is vry los ot O(1), n n is th numr o oprtions Str Prtitioning n Str Contrtion Sin prtitions must isjoint, g prtitioning prvnts ontrting th grph signiintly, us i w slt n g inint on vrtx v s prtition, thn non o th othr gs inint on tht vrtx n thir own prtition. This is unmntl limittion, us grphs n hv high-gr vrtis. Thus, to in thniqu tht works mor roly, w n to llow or high-gr vrtis to prt o prtition. W onsir mor ggrssiv orm o prtitoning ll str prtitioning, whr prtitions r trmin y slting strs. For xmpl in Exmpl 17.16, th whol grph n singl prtition. W rr to grph ontrtion whr prtitions r slt y strt prtitioning n str ontrtion.

9 17.2. GRAPH CONTRACTION 303 Exmpl In th grph low (lt), w n in 2 isjoint strs (right). Th ntrs r highlight (with olor whit), th rst o th vrtis r stllits. Intrnl gs, whih will rsi insi prtition n will rmov uring ontrtion, r rwn in shs; ross gs rmin soli. Not tht th intrnl gs o h str is not lwys qul to th gs o th str. Qustion How n w str prtition grph? As with g prtitioning, it is possil to onstrut str prtitionings squntilly. For xmpl, w n strt with n ritrry vrtx n tth ll its nighors to str. W woul thn rmov th str rom th grph, n rpt (until ll vrtis r ount or) y piking nothr ritrry vrtx. Not tht vrtx is th simplst orm o str. So i w hv isolt vrtis rmining thy orm trivil strs. Qustion How n w str prtition grph? W n lso onstrut str prtitionings in prlll y mking lol inpnnt isions in prlll. As in g prtitionings, w n us rnomiztion to rk symmtry. Qustion Cn you think o rnomiz pproh or slting strs? For xmpl, to trmin th ntrs, w n lip oin or h vrtx. I th oin oms up hs, tht vrtx is th ntr o str. W n thn mk vrtx tht hs lipp tils stllit y tthing it to on o its nighors tht is ntr. I no suh nighor xists (ll nighors hv lipp tils) thn w mk th vrtx ntr s wll. I vrtx hs multipl ntrs s nighors, w n pik on ritrrily. This pproh my not optiml in th sns tht it my not rt th smllst numr o strs ut this is ptl or our purposs, us w r only intrst in ruing th siz o th ontrt grph y onstnt tor not minimizing it.

10 304 CHAPTER 17. GRAPH CONTRACTION AND CONNECTIVITY Algorithm (Str Prtition). 1 untion strprtition(g = (V, E), i) = 2 lt 3 % slt gs tht go rom stllit to ntr 4 vl TH = {(u, v) E hs(u, i) hs(v, i)} 5 % Us tl mrg to mk mpping rom stllits to ntrs, rmoving uplits 6 vl P = (u,v) TH {u v} 7 % Th suprvrtis ntrs n unmth stllits 8 vl V = V \ omin(p ) 9 % Mp suprvrtis to thmslvs 10 vl P = {u u : u V } 11 in (V, P P ) n Exmpl An xmpl str prtition. Vrtis tht lipp hs om ntrs (vrtis,. A vrtx (vrtis n ) tht lipp tils ttmpts to om stllit y ining ntr mong its nighors, rking tis ritrrily. I non xist (xmpl: vrtx ), it oms ntr. W n up orming thr prtitions th str with ntr (with no stllits), th str with ntr (with two stllits), n th singlton. H T H T T H T H T T oin lips hoos strs rsulting prtitions Bor sriing th lgorithm or prtitioning grph into strs, w n to sy oupl wors out th sour o rnomnss. Wht w will ssum is tht h vrtx is givn (potntilly ininit) squn o rnom n inpnnt oin lips. Th i th lmnt o th squn n ss hs(v, i) : V Z B. Th untion rturns tru i th i th lip on vrtx v is hs n ls othrwis. Sin most mhins on t hv tru sours o rnomnss, in prti this n implmnt with psuornom numr gnrtor or vn with goo hsh untion. Th lgorithm or str prtitioning is givn in Algorithm It tks in grph n roun numr, n rturns grph prtitioning o th sort rturn y prtitiongrph. Th

11 17.2. GRAPH CONTRACTION 305 lgorithm lips oins on h vrtx n slts th irt gs tht point rom til (stllit) to h (ntr) this givs TH. In this st o gs thr might multipl gs rom th sm stllit n w wnt to hoos on o thm. Lin 6 os this y rting st o singlton tls n mrging thm. In prtiulr th union is shorthn or th ollowing mrg: St.Ru (Tl.mrg (n (x,y) x)) {{u v} : (u, v) TH } This tivly is or h stllit on o th ntrs it will point to. All th ntrs n ny potntil stllits tht o not gt mpp to ntr, sin thy o not nighor ntr, r mpp to thmslvs (Lin 10). Finlly w mrg th tl or th rmpp stllits n th othr vrtis. Exmpl Rturning to Exmpl n ssuming th sm lips s givn in tht xmpl, w hv tht: TH = {(, ), (, ), (, )}. Ths r th (irt) gs rom stllits to ntrs. Now w onvrt h g into singlton mp, n mrg thm into th mpping: P = {, }. Not tht th g (, ) hs n rmov sin th mrging o th mp slts only on lmnt or h ky in th omin. Now or ll rmining vrtis V = V \ omin(p ) = {,, } w mp thm to thmslvs, giving: P = {,, }. Th P n P r mrg to giv th inl mpping: P P = {,,,, }. Anlysis o Str Prtitioning. Whn th strs oun y strprtition r ontrt, h str oms on vrtx, so th numr o vrtis rmov is th siz o P. In xpttion, how ig is P? Th ollowing lmm shows tht on grph with n non-isolt vrtis, th siz o P or th numr o vrtis rmov in on roun o str ontrtion is t lst n/4 in xpttion. Lmm For grph G with n non-isolt vrtis, lt X n th rnom vril initing th numr o vrtis rmov y strprtition(g, r). Thn, E [X n ] n/4.

12 306 CHAPTER 17. GRAPH CONTRACTION AND CONNECTIVITY Proo. Consir ny non-isolt vrtx v V (G). Lt H v th vnt tht vrtx v oms up hs, T v tht it oms up tils, n R v tht v omin(p ) (i., it is rmov). By inition, w know tht non-isolt vrtx v hs t lst on nighor u. So, w hv tht T v H u implis R v sin i v is til n u is h v must ithr join u s str or som othr str. Thror, Pr [R v ] Pr [T v ] Pr [H u ] = 1/4. By th linrity o xpttion, w hv tht th numr o rmov vrtis is [ ] E I {R v } = E [I {R v }] n/4 v:v non-isolt sin w hv n vrtis tht r non-isolt. v:v non-isolt Cost Spiition (Str Prtitioning). Bs on rry-s ost spiition or squns n singl-tr squns, th ost o strprtition is O(n+m) work n O(log n) spn or grph with n vrtis n m gs Conntivity vi Grph Contrtion An importnt, wll-stui prolm, ll (grph) onntivity prolm, is to trmin th onnt omponnts o grph. Prolm (Th Grph Conntivity (GC) Prolm). Givn n unirt grph G = (V, E) rturn ll o its onnt omponnts (mximl onnt sugrphs). A grph onntivity lgorithm woul rturn th onnt omponnts o grph, y or xmpl spiying th st o vrtis in h omponnt. Qustion Cn you solv th grph-onntivity prolm y using on o th thniqus rntly ovr in this lss? Th grph onntivity prolm n solv y using grph srh. In prtiulr, w n strt t ny vrtx n in, using DFS or BFS, ll vrtis rhl rom it to rt th irst omponnt. W thn mov onto th nxt vrtx n i it hs not lry n srh, srh rom it to rt th son omponnt, n so on w rpt until w xhustivly onsir ll th vrtis. Qustion Woul ths pprohs yil goo prlllism? Wht woul th spn o th lgorithm?

13 17.3. CONNECTIVITY VIA GRAPH CONTRACTION 307 Using grph srh ls to prtly snsil squntil lgorithms or grph onntivity, ut thy r not goo prlll lgorithms. Rll tht DFS hs linr spn. Qustion How out BFS? Do you rll th spn o BFS? BFS tks spn proportionl to th imtr o th grph. In th ontxt o our lgorithm th spn woul th imtr o omponnt (th longst istn twn two vrtis). Qustion How lrg n th imtr o omponnt? Cn you giv n xmpl? Th imtr o omponnt n s lrg s n 1. A hin o n vrtis will hv imtr n 1. Qustion How out in ss whn th imtr is smll, or xmpl whn th grph is just isonnt olltion o gs. Whn th imtr o grph is smll, w my us BFS to prorm h grph srh, ut w still hv to itrt ovr th omponnts on y on. Thus th spn in th worst s n linr in th numr o omponnts, whih n lrg. W woul lik to in prlll lgorithm or onntivity tht hs smll spn n ll grphs. To this n, w will us th grph-ontrtion thniqu with str prtitioning. To spiy th lgorithm, w will us n g-st rprsnttion or grphs, whr vry g is rprsnt s pir o vrtis, in oth orrs. This is tivly quivlnt to irt grph rprsnttion o unirt grphs with two rs pr g. Exmpl Th rprsnttion o n unirt grph s st o orr pirs, with h g ppring in oth irtions. V = {,,,,, } E = {(, ), (, ), (, ), (, ), (, ), (, ), (, ), (, ), (, ), (, )} W n now writ givn n lgorithm s on grph ontrtion tht ounts th numr o onnt omponnts in grph (Algorithm Eh ontrtion on Lin 4 rturns th

14 308 CHAPTER 17. GRAPH CONTRACTION AND CONNECTIVITY Algorithm (Counting Componnts using Grph Contrtion). 1 untion ountcomponnts(g = (V, E)) = 2 i E = 0 thn V 3 ls lt 4 (V, P ) = strprtition(v, E) 5 E = {(P [u], P [v]) : (u, v) E P [u] P [v]} 6 in 7 ountcomponnts(v, E ) 8 n st o suprvrtis V n tl P mpping vry v V to v V. Lin 5 upts ll gs so tht th two npoints r in V y looking thm up in P : this is wht (P [u], P [v]) is. Sonly it rmovs ll sl gs: this is wht th iltr P [u] P [v] os. On th gs r upt, th lgorithm rurss on th smllr grph. Th trmintion onition is whn thr r no gs. At this point h omponnt hs shrunk own to singlton vrtx. Exmpl Th vlus o V, P, n E tr h roun o th ontrtion shown in Exmpl V = {,, } roun 1 P = {,,,,, } E = {(, ), (, ), (, ), (, ), (, ), (, )} V = {, } roun 2 P = {,, } E = {(, ), (, )} V = {} roun 3 P = {, } E = {} Our prvious lgorithm just ount th numr o omponnts. It turns out w n moiy th lgorithm slightly to omput th omponnts thmslvs inst o rturning thir ount. To this n, w r going to onstrut th mpping rom vrtis to thir omponnts rursivly. This is possil us w n otin th mpping y omposing th mpping rom vrtis to thir suprvrtis n th mpping rom suprvrtis to thir omponnts, whih w otin rursivly. Algorithm shows th lgorithm.

15 17.3. CONNECTIVITY VIA GRAPH CONTRACTION 309 Algorithm (Contrtion-s grph onntivity). 1 untion onntcomponnts(g = (V, E)) = 2 i E = 0 thn (V, {v v : v V }) 3 ls lt 4 vl (V, P ) = strprtition(v, E) 5 vl E = {(P [u], P [v]) : (u, v) E P [u] P [v]} 6 vl (V, P ) = onntcomponnts(v, E ) 7 in 8 (V, {v P [s] : (v s) P }) 9 n Exmpl onntcomponnts might rturn: ({}, {,,,,, }) sin thr is singl omponnt n ll vrtis will mp to tht omponnt ll. In this s ws pik s th rprsnttiv, ut ny o th initil vrtis is vli rprsnttiv, in whih s ll vrtis woul mp to it. Th only irns rom ountcomponnts r moiition to th s s, n th xtr lin (Lin 8) tr th rursiv ll. In th s s inst o rturning th siz o V rturns ll vrtis in V long with mpping rom h on to itsl. This is vli nswr sin i thr r no gs h vrtx is its own omponnt. In th inutiv s, whn rturning rom th rursion, Lin 8 upts th mpping P rom vrtis to suprvrtis y looking up th omponnt tht th suprvrtx longs to, whih is givn y P. This simply involvs th look up P [s] or vry (v s) P. Not tht i you viw mpping s untion, thn this is quivlnt to untion omposition, i.. P P.

16 310 CHAPTER 17. GRAPH CONTRACTION AND CONNECTIVITY Exmpl Consir our xmpl grph (Exmpl 17.38), n ssum tht strprtition rturns: V = {,, } P = {,,,,, }. Sin th grph is onnt, th rursiv ll to onntcomponnts(v, E ) will mp ll vrtis in V to th sm vrtx. Lts sy this vrtx is giving: V = {} P = {,, }. Now {v P [s] : (v s) P } will or h vrtx-suprvrtx pir in P, look up wht tht suprvrtx got mpp to in th rursiv ll. For xmpl, vrtx mps to vrtx in P so w look up in P, whih givs us so w know tht is in th omponnt. Ovrll th rsult is: {,,,,, }. Now lts nlyz th ost o ountcomponnts n onntcomponnts whn using strprtition. Lt n n th numr o non-isolt vrtis. Noti tht on vrtx oms isolt (u to ontrtion), it stys isolt until th inl roun (ontrtion only rmovs gs). Thror, w hv th ollowing spn rurrn (w ll look t work ltr): S(n n ) = S(n n) + O(log n) whr n n = n n X n X is th numr o vrtis rmov (s in rlir in th lmm out strprtition). But E [X] = n n /4 so E [n n] = 3n/4. This is milir rurrn, whih w know solvs to O(log 2 n n ), n thus O(log 2 n). As or work, illy, w woul lik to show tht th ovrll work is linr sin w might hop tht th siz is going own y onstnt rtion on h roun. Unortuntly, this is not th s. Although w hv shown tht on n rmov onstnt rtion o th non-isolt vrtis on on str ontrt roun, w hv not shown nything out how mny gs w rmov. W n rgu tht th numr o gs rmov is t lst qul to th numr o vrtis sin rmoving stllit lso rmovs th g tht tths it to its str s ntr. But this os not hlp symptotilly oun th numr o gs rmov. Consir th ollowing

17 17.3. CONNECTIVITY VIA GRAPH CONTRACTION 311 squn o rouns: roun vrtis gs 1 n m 2 n/2 m n/2 3 n/4 m 3n/4 4 n/8 m 7n/8 In this xmpl, it is lr tht th numr o gs os not rop low m n, so i thr r m > 2n gs to strt with, th ovrll work will O(m log n). In, this is th st oun w n show symptotilly. To oun th work, w will onsir non-isolt n isolt vrtis sprtly. For th non-isolt vrtis, w hv th ollowing work rurrn: W (n n, m) W (n n, m) + O(n n + m), whr n n is th rmining numr o non-isolt vrtis s in in th spn rurrn. This solvs to E [W (n n, m)] = O(n n + m log n n ) = O(n + m log n). To oun th work on isolt vrtis, w not tht thr t most n o thm t h roun n thus, th itionl work is O(n log n). This nlysis givs us th ollowing thorm. Thorm For grph G = (V, E), ountcomponnts using strprtition grph ontrtion with n rry squn works in O( V + E log V ) work n O(log 2 V ) spn. Rmrk In gnrl th grph ontrtion thniqus os not spiy how to prorm th prtitioning n t h stp. For xmpl, in this hptr, w ovr two thniqus or prtitioning. Dpning on th prolm, othr thniqus n us s wll. For grph ontrtion to pplil to prolm, howvr, it is importnt tht th grph ontrt t h roun stisy rtin proprtis. For xmpl, whn solving grph onntivity with th lgorithms sri hr, w hv to rul tht th prtitioning mintins onntivity: omponnt shoul onnt tr roun o grph ontrtion i n only i it ws onnt or th roun. To nsur this, w will n to us prtitioning lgorithm tht nsurs tht h prtition is onnt. For xmpl, o th prtitionings o th grphs shown low, th son on os not mintin onntivity, whrs th irst on os. Th prtitioning on th lt is pproprit or grph ontrtion sin h prtition is onnt. Th prtition on th right is not sin is not onnt to n.

18 312 CHAPTER 17. GRAPH CONTRACTION AND CONNECTIVITY 17.4 Tr Contrtion Our nlysis in th prvious stion ws or gnrl grphs. Wht i w r ontrting orst o trs inst. Rll tht n unirt grph is orst i it hs no yls n is tr i it hs no yls n is onnt. A tr on n vrtis lwys hs xtly n 1 gs, n orst hs t most n 1 gs. Sin it hs no yls, str is tr. Th sm onntcomponnts lgorithm s on str prtitoning n us or orst or tr ut with trs, th work oun is ttr. This is us th numr o gs is orst is nvr mor thn th numr o vrtis, n hn th numr o gs rs gomtrilly (in xpttion) in h roun, s o th numr o vrtis. Th ovrl xpt work is thror gomtri sum o th orm: E [W (n, m)] = i=0 ( ) i 3 kn = O(n), 4 inst o O(m log n) or gnrl grphs. Th spn is not t. For grph G = (V, E) onsir sust o gs T E tht orms orst (i.. hs no yl). Suh sust ins prtitioning o th orginl grph, whr h tr is its own prtition. Thror on wy to ontrt grph is to intiy suh sust T, n thn us onntcomponnts(v, T ), whih os linr work s xplin ov, inst o our strprtition routin. W will us this i in n lgorithm or Minimum Spnning Trs sri in Chptr 18. Exmpl A grph n sust o th gs T (in ol) tht in st o thr isjoint trs, h implying prtition: g i g i g h j h j i I w run onntcomponnts on T (th mil igrm) w r lt with th sir prtitioning with suprvrtis {, g, i} n th mpping: {,,,,,, g g, h i, i u, j i} This n us to ontrt th originl grph wht is shown on th right.

19 17.5. EXERCISES AND PROBLEMS Exriss n Prolms Exris Thr r 18 sugrphs or tringl onsisting o thr vrtis n thr gs onnting thm, inluing th mpty grph n th grph itsl. List thm ll. Exris In str ontrtion, wht is th proility tht vrtx with gr is rmov. Exris Fin n xmpl grph, whr str-s grph ontrtion rmovs smll numr o gs on h roun.

20 314 CHAPTER 17. GRAPH CONTRACTION AND CONNECTIVITY.

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

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

More information

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

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

More information

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

, 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

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

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

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

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

More information

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

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

(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

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

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

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

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

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

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

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

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

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

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

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

# 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

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

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

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

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

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

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

More information

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

More information

Minimum Spanning Trees

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

More information

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

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

More information

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Chapter 9. Graphs. 9.1 Graphs

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

More information

Computational Biology, Phylogenetic Trees. Consensus methods

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

More information

Section 3: Antiderivatives of Formulas

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

More information

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

Graph Theory. Vertices. Vertices are also known as nodes, points and (in social networks) as actors, agents or players.

Graph Theory. Vertices. Vertices are also known as nodes, points and (in social networks) as actors, agents or players. Stphn P. Borgtti Grph Thory A lthough grph thory is on o th youngr rnhs o mthmtis, it is unmntl to numr o ppli ils, inluing oprtions rsrh, omputr sin, n soil ntwork nlysis. In this hptr w isuss th si onpts

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

Formal Concept Analysis

Formal Concept Analysis Forml Conpt Anlysis Conpt intnts s losd sts Closur Systms nd Implitions 4 Closur Systms 0.06.005 Nxt-Closur ws dvlopd y B. Gntr (984). Lt M = {,..., n}. A M is ltilly smllr thn B M, if B A if th smllst

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

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

On Local Transformations in Plane Geometric Graphs Embedded on Small Grids

On Local Transformations in Plane Geometric Graphs Embedded on Small Grids On Lol Trnsformtions in Pln Gomtri Grphs Em on Smll Gris Mnul Allns Prosnjit Bos Alfro Grí Frrn Hurto Pro Rmos Euro Rivr-Cmpo Jvir Tjl Astrt Givn two n-vrtx pln grphs G 1 = (V 1, E 1 ) n G 2 = (V 2, E

More information

GREEDY TECHNIQUE. Greedy method vs. Dynamic programming method:

GREEDY TECHNIQUE. Greedy method vs. Dynamic programming method: Dinition: GREEDY TECHNIQUE Gry thniqu is gnrl lgorithm sign strtgy, uilt on ollowing lmnts: onigurtions: irnt hois, vlus to in ojtiv untion: som onigurtions to ithr mximiz or minimiz Th mtho: Applil to

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

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

Construction 11: Book I, Proposition 42

Construction 11: Book I, Proposition 42 Th Visul Construtions of Euli Constrution #11 73 Constrution 11: Book I, Proposition 42 To onstrut, in givn rtilinl ngl, prlllogrm qul to givn tringl. Not: Equl hr mns qul in r. 74 Constrution # 11 Th

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

CSI35 Chapter 11 Review

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

More information

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