Copyright 2000, Kevin Wayne 1

Size: px
Start display at page:

Download "Copyright 2000, Kevin Wayne 1"

Transcription

1 Chptr. Intrvl Shulng Gry Algorthms Sls y Kvn Wyn. Copyrght 005 Prson-Ason Wsly. All rghts rsrv. Intrvl Shulng Intrvl Shulng: Gry Algorthms Intrvl shulng. Jo strts t s n fnshs t f. Two os omptl f thy on't ovrlp. Gol: fn mxmum sust of mutully omptl os. Gry tmplt. Consr os n som orr. Tk h o prov t's omptl wth th ons lry tkn. [Erlst strt tm] Consr os n snng orr of strt tm s. f g h Tm [Erlst fnsh tm] Consr os n snng orr of fnsh tm f. [Shortst ntrvl] Consr os n snng orr of ntrvl lngth f - s. [Fwst onflts] For h o, ount th numr of onfltng os. Shul n snng orr of onflts. 3 Copyrght 000, Kvn Wyn

2 Intrvl Shulng: Gry Algorthms Intrvl Shulng: Gry Algorthm Gry tmplt. Consr os n som orr. Tk h o prov t's omptl wth th ons lry tkn. Gry lgorthm. Consr os n nrsng orr of fnsh tm. Tk h o prov t's omptl wth th ons lry tkn. rks rlst strt tm rks shortst ntrvl rks fwst onflts Sort os y fnsh tms so tht f f... f n. os slt A φ for = to n { f (o omptl wth A) A A {} } rturn A Implmntton. O(n log n). Rmmr o * tht ws lst to A. Jo s omptl wth A f s f *. 5 6 Intrvl Shulng: Anlyss Intrvl Shulng: Anlyss Thorm. Gry lgorthm s optml. Thorm. Gry lgorthm s optml. Pf. (y ontrton) Assum gry s not optml, n lt's s wht hppns. Lt,,... k not st of os slt y gry. Lt,,... m not st of os n th optml soluton wth =, =,..., r = r for th lrgst possl vlu of r. Pf. (y ontrton) Assum gry s not optml, n lt's s wht hppns. Lt,,... k not st of os slt y gry. Lt,,... m not st of os n th optml soluton wth =, =,..., r = r for th lrgst possl vlu of r. o r+ fnshs for r+ o r+ fnshs for r+ Gry: r r+ Gry: r r+ OPT: r r+... OPT: r r+... why not rpl o r+ wth o r+? Proof y nuton tht for h r >= th gr lgorthm stys h of th optml lgorthm soluton stll fsl n optml, ut ontrts mxmlty of r. 7 8 Copyrght 000, Kvn Wyn

3 Intrvl Prttonng. Intrvl Prttonng Intrvl prttonng. Ltur strts t s n fnshs t f. Gol: fn mnmum numr of lssrooms to shul ll lturs so tht no two our t th sm tm n th sm room. Ex: Ths shul uss lssrooms to shul 0 lturs. g h f 9 9:30 0 0:30 :30 :30 :30 :30 3 3:30 :30 Tm 0 Intrvl Prttonng Intrvl Prttonng: Lowr Boun on Optml Soluton Intrvl prttonng. Ltur strts t s n fnshs t f. Gol: fn mnmum numr of lssrooms to shul ll lturs so tht no two our t th sm tm n th sm room. Ex: Ths shul uss only 3. Df. Th pth of st of opn ntrvls s th mxmum numr tht ontn ny gvn tm. Ky osrvton. Numr of lssrooms n pth. Ex: Dpth of shul low = 3 shul low s optml.,, ll ontn 9:30 Q. Dos thr lwys xst shul qul to pth of ntrvls? f f g g h h 9 9:30 0 0:30 :30 :30 :30 :30 3 3:30 :30 Tm 9 9:30 0 0:30 :30 :30 :30 :30 3 3:30 :30 Tm Copyrght 000, Kvn Wyn 3

4 Intrvl Prttonng: Gry Algorthm Intrvl Prttonng: Gry Anlyss Gry lgorthm. Consr lturs n nrsng orr of strt tm: ssgn ltur to ny omptl lssroom. Osrvton. Gry lgorthm nvr shuls two nomptl lturs n th sm lssroom. Sort ntrvls y strtng tm so tht s s... s n. 0 numr of llot lssrooms for = to n { f (ltur s omptl wth som lssroom k) shul ltur n lssroom k ls llot nw lssroom + shul ltur n lssroom + + } Thorm. Gry lgorthm s optml. Pf. Lt = numr of lssrooms tht th gry lgorthm llots. Clssroom s opn us w n to shul o, sy, tht s nomptl wth ll - othr lssrooms. Sn w sort y strt tm, ll ths nomptlts r us y lturs tht strt no ltr thn s. Thus, w hv lturs ovrlppng t tm s + ε. Ky osrvton ll shuls us lssrooms. Implmntton. O(n log n). For h lssroom k, mntn th fnsh tm of th lst o. Kp th lssrooms n prorty quu. 3 Shulng to Mnmzng Ltnss. Shulng to Mnmz Ltnss Mnmzng ltnss prolm. Sngl rsour prosss on o t tm. Jo rqurs t unts of prossng tm n s u t tm. If strts t tm s, t fnshs t tm f = s + t. Ltnss: = mx { 0, f - }. Gol: shul ll os to mnmz mxmum ltnss L = mx. Ex: t ltnss = ltnss = 0 mx ltnss = 6 3 = 9 = 8 6 = 5 = 6 5 = = Copyrght 000, Kvn Wyn

5 Mnmzng Ltnss: Gry Algorthms Mnmzng Ltnss: Gry Algorthms Gry tmplt. Consr os n som orr. Gry tmplt. Consr os n som orr. [Shortst prossng tm frst] Consr os n snng orr of prossng tm t. [Erlst ln frst] Consr os n snng orr of ln. [Shortst prossng tm frst] Consr os n snng orr of prossng tm t. t ountrxmpl [Smllst slk] Consr os n snng orr of slk - t. [Smllst slk] Consr os n snng orr of slk - t. t 0 0 ountrxmpl 7 8 Mnmzng Ltnss: Gry Algorthm Mnmzng Ltnss: No Il Tm Gry lgorthm. Erlst ln frst. Osrvton. Thr xsts n optml shul wth no l tm. Sort n os y ln so tht n = = = t 0 for = to n Assgn o to ntrvl [t, t + t ] s t, f t + t t t + t output ntrvls [s, f ] = = 6 = Osrvton. Th gry shul hs no l tm. mx ltnss = = 6 = 8 3 = 9 = 9 5 = 6 = Copyrght 000, Kvn Wyn 5

6 Mnmzng Ltnss: Invrsons Mnmzng Ltnss: Invrsons Df. An nvrson n shul S s pr of os n suh tht: < ut shul for. nvrson Df. An nvrson n shul S s pr of os n suh tht: < ut shul for. nvrson f for swp for swp ftr swp Osrvton. Gry shul hs no nvrsons. Osrvton. If shul (wth no l tm) hs n nvrson, t hs on wth pr of nvrt os shul onsutvly. Clm. Swppng two nt, nvrt os rus th numr of nvrsons y on n os not nrs th mx ltnss. Pf. Lt th ltnss for th swp, n lt ' t ftrwrs. ' k = k for ll k, f' ' If o s lt: # = = f # f f (fnton) ( fnshs t tm f ) ( < ) (fnton) Mnmzng Ltnss: Anlyss of Gry Algorthm Gry Anlyss Strtgs Thorm. Gry shul S s optml. Pf. Dfn S* to n optml shul tht hs th fwst numr of nvrsons, n lt's s wht hppns. Cn ssum S* hs no l tm. If S* hs no nvrsons, thn S = S*. If S* hs n nvrson, lt - n nt nvrson. swppng n os not nrs th mxmum ltnss n strtly rss th numr of nvrsons ths ontrts fnton of S* Gry lgorthm stys h. Show tht ftr h stp of th gry lgorthm, ts soluton s t lst s goo s ny othr lgorthm's. Exhng rgumnt. Grully trnsform ny soluton to th on foun y th gry lgorthm wthout hurtng ts qulty. Struturl. Dsovr smpl "struturl" oun ssrtng tht vry possl soluton must hv rtn vlu. Thn show tht your lgorthm lwys hvs ths oun. 3 Copyrght 000, Kvn Wyn 6

7 Optml Offln Chng.3 Optml Chng Chng. Ch wth pty to stor k tms. Squn of m tm rqusts,,, m. Ch ht: tm lry n h whn rqust. Ch mss: tm not lry n h whn rqust: must rng rqust tm nto h, n vt som xstng tm, f full. Gol. Evton shul tht mnmzs numr of h msss. Ex: k =, ntl h =, rqusts:,,,,,,,. Optml vton shul: h msss. rqusts h 6 Optml Offln Chng: Frthst-In-Futur Ru Evton Shuls Frthst-n-futur. Evt tm n th h tht s not rqust untl frthst n th futur. Df. A ru shul s shul tht only nsrts n tm nto th h n stp n whh tht tm s rqust. urrnt h: f futur qurs: g f f g h... h mss t ths on Thorm. [Blly, 960s] FF s optml vton shul. Pf. Algorthm n thorm r ntutv; proof s sutl. Intuton. Cn trnsform n unru shul nto ru on wth no mor h msss. x x n unru shul ru shul 7 8 Copyrght 000, Kvn Wyn 7

8 Frthst-In-Futur: Anlyss Thorm. FF s optml vton lgorthm. Pf. (y nuton on numr or rqusts ). Shortst Pths n Grph Invrnt: Thr xsts n optml ru shul S tht mks th sm vton shul s S FF through th frst + rqusts. Lt S ru shul tht stsfs nvrnt through rqusts. W prou S' tht stsfs nvrnt ftr + rqusts. Consr (+) st rqust = +. Sn S n S FF hv gr up untl now, thy hv th sm h ontnts for rqust +. Cs : ( s lry n th h). S' = S stsfs nvrnt. Cs : ( s not n th h n S n S FF vt th sm lmnt). S' = S stsfs nvrnt. shortst pth from Prnton CS prtmnt to Enstn's hous 30 Shortst Pth Prolm Dkstr's Algorthm Shortst pth ntwork. Drt grph G = (V, E). Sour s, stnton t. Lngth = lngth of g. Shortst pth prolm: fn shortst rt pth from s to t. Dkstr's lgorthm. Mntn st of xplor nos S for whh w hv trmn th shortst pth stn (u) from s to u. Intlz S = { s }, (s) = 0. Rptly hoos unxplor no v whh mnmzs π ( v) = mn = ( u, v) : u S ( u) +, ost of pth = sum of g osts n pth v to S, n st (v) = π(v). shortst pth to som u n xplor prt, follow y sngl g (u, v) s Cost of pth s--3-5-t = = 8. S s (u) u v 7 t Copyrght 000, Kvn Wyn 8

9 Dkstr's Algorthm Dkstr's Algorthm: Proof of Corrtnss Dkstr's lgorthm. Mntn st of xplor nos S for whh w hv trmn th shortst pth stn (u) from s to u. Intlz S = { s }, (s) = 0. Rptly hoos unxplor no v whh mnmzs π ( v) = mn = ( u, v) : u S v to S, n st (v) = π(v). ( u) +, shortst pth to som u n xplor prt, follow y sngl g (u, v) Invrnt. For h no u S, (u) s th lngth of th shortst s-u pth. Pf. (y nuton on S ) Bs s: S = s trvl. Inutv hypothss: Assum tru for S = k. Lt v nxt no to S, n lt u-v th hosn g. Th shortst s-u pth plus (u, v) s n s-v pth of lngth π(v). Consr ny s-v pth P. W'll s tht t's no shortr thn π(v). Lt x-y th frst g n P tht lvs S, n lt P' th supth to x. P s lry too long s soon s t lvs S. P' x P y S s (u) u v (P) (P') + (x,y) (x) + (x, y) π(y) π(v) s S u v nonngtv wghts nutv hypothss fn of π(y) Dkstr hos v nst of y Dkstr's Algorthm: Implmntton For h unxplor no, xpltly mntn π(v) = mn (u) +. = (u,v) : u S Nxt no to xplor = no wth mnmum π(v). Whn xplorng v, for h nnt g = (v, w), upt π(w) = mn { π(w), π(v)+ }. Extr Sls Effnt mplmntton. Mntn prorty quu of unxplor nos, prortz y π(v). Prorty Quu PQ Oprton Insrt ExtrtMn ChngKy Dkstr n n m Arry n n Bnry hp log n log n log n -wy Hp log n log n log n F hp log n IsEmpty n Totl n m log n m log m/n n m + n log n Invul ops r mortz ouns 0 Copyrght 000, Kvn Wyn 9

10 Con Chngng Con Chngng Gol. Gvn urrny nomntons:, 5, 0, 5, 00, vs mtho to py mount to ustomr usng fwst numr of ons. Ex: 3. Gr s goo. Gr s rght. Gr works. Gr lrfs, uts through, n pturs th ssn of th volutonry sprt. - Goron Gko (Mhl Dougls) Cshr's lgorthm. At h trton, on of th lrgst vlu tht os not tk us pst th mount to p. Ex: $ Con-Chngng: Gry Algorthm Con-Chngng: Anlyss of Gry Algorthm Cshr's lgorthm. At h trton, on of th lrgst vlu tht os not tk us pst th mount to p. Sort ons nomntons y vlu: < < < n. ons slt S φ whl (x 0) { lt k lrgst ntgr suh tht k x f (k = 0) rturn "no soluton foun" x x - k S S {k} } rturn S Thorm. Gr s optml for U.S. ong:, 5, 0, 5, 00. Pf. (y nuton on x) Consr optml wy to hng k x < k+ : gry tks on k. W lm tht ny optml soluton must lso tk on k. f not, t ns nough ons of typ,, k- to up to x tl low nts no optml soluton n o ths Prolm rus to on-hngng x - k nts, whh, y nuton, s optmlly solv y gry lgorthm. k k All optml solutons must stsfy Mx vlu of ons,,, k- n ny OPT P - 5 N 3 0 N + D + 5 = 9 Q. Is shr's lgorthm optml? Q 3 no lmt 0 + = 75 + = 99 5 Copyrght 000, Kvn Wyn 0

11 /7/ Con-Chngng: Anlyss of Gry Algorthm Osrvton. Gry lgorthm s su-optml for US postl nomntons:, 0,, 3, 70, 00, 350, 5, 500. Countrxmpl. 0. Gry: 00, 3,,,,,,. Optml: 70, Copyrght 000, Kvn Wyn

4.1 Interval Scheduling. Chapter 4. Greedy Algorithms. Interval Scheduling: Greedy Algorithms. Interval Scheduling. Interval scheduling.

4.1 Interval Scheduling. Chapter 4. Greedy Algorithms. Interval Scheduling: Greedy Algorithms. Interval Scheduling. Interval scheduling. Cptr 4 4 Intrvl Suln Gry Alortms Sls y Kvn Wyn Copyrt 005 Prson-Ason Wsly All rts rsrv Intrvl Suln Intrvl Suln: Gry Alortms Intrvl suln! Jo strts t s n nss t! Two os omptl ty on't ovrlp! Gol: n mxmum sust

More information

Copyright 2000, Kevin Wayne 1

Copyright 2000, Kevin Wayne 1 Chptr 4 4. Intrvl hulng Gry Algorthms ls y Kvn Wyn. Copyrght 005 Prson-Ason Wsly. All rghts rsrv. Intrvl hulng Intrvl hulng: Gry Algorthms Intrvl shulng. Jo strts t s n fnshs t f. Two os omptl f thy on't

More information

Copyright 2000, Kevin Wayne 1

Copyright 2000, Kevin Wayne 1 Rp: Grphs 80: Algorthm Dsgn n Anlyss Jrmh Blok Puru Unvrsty prng 09 Dfnton of Grph Rprsnttons Any Mtrx Any Lst onntvty, yls Trs (onnt + No yls) Root Trs/Bnry Trs/Bln Bnry Trs Brth Frst rh BF Tr O(m+n)

More information

Chapter Interval Scheduling. Greedy Algorithms. What is a Greedy Algorithm? Interval Scheduling

Chapter Interval Scheduling. Greedy Algorithms. What is a Greedy Algorithm? Interval Scheduling Wht s Grdy Algorthm? Chptr Grdy Algorthms Grdy lgorthm Hrd to gv prs dfnton It ulds up soluton n smll stps, hoosng dson t h stp to optmz som undrlyng rtron Mk lol dsons, nd mglly gt glol optmum Vry ffnt

More information

Greedy Algorithms. Greedy Algorithms. Piyush Kumar

Greedy Algorithms. Greedy Algorithms. Piyush Kumar Gree s goo. Gree s rght. Gree works. Gree lrfes, uts through, n ptures the essene of the evolutonry sprt. - Goron Geko (Mhel Dougls) Anlyss of Algorthms Pyush Kumr (Leture 4: Greey Algorthms) Welome to

More information

Minimum Spanning Trees

Minimum Spanning Trees Mnmum Spnnng Trs Spnnng Tr A tr (.., connctd, cyclc grph) whch contns ll th vrtcs of th grph Mnmum Spnnng Tr Spnnng tr wth th mnmum sum of wghts 1 1 Spnnng forst If grph s not connctd, thn thr s spnnng

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

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

Preview. Graph. Graph. Graph. Graph Representation. Graph Representation 12/3/2018. Graph Graph Representation Graph Search Algorithms

Preview. Graph. Graph. Graph. Graph Representation. Graph Representation 12/3/2018. Graph Graph Representation Graph Search Algorithms /3/0 Prvw Grph Grph Rprsntton Grph Srch Algorthms Brdth Frst Srch Corrctnss of BFS Dpth Frst Srch Mnmum Spnnng Tr Kruskl s lgorthm Grph Drctd grph (or dgrph) G = (V, E) V: St of vrt (nod) E: St of dgs

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

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

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

Spanning Trees. BFS, DFS spanning tree Minimum spanning tree. March 28, 2018 Cinda Heeren / Geoffrey Tien 1

Spanning Trees. BFS, DFS spanning tree Minimum spanning tree. March 28, 2018 Cinda Heeren / Geoffrey Tien 1 Spnnn Trs BFS, DFS spnnn tr Mnmum spnnn tr Mr 28, 2018 Cn Hrn / Gory Tn 1 Dpt-rst sr Vsts vrts lon snl pt s r s t n o, n tn ktrks to t rst junton n rsums own notr pt Mr 28, 2018 Cn Hrn / Gory Tn 2 Dpt-rst

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

(Minimum) Spanning Trees

(Minimum) Spanning Trees (Mnmum) Spnnn Trs Spnnn trs Kruskl's lortm Novmr 23, 2017 Cn Hrn / Gory Tn 1 Spnnn trs Gvn G = V, E, spnnn tr o G s onnt surp o G wt xtly V 1 s mnml sust o s tt onnts ll t vrts o G G = Spnnn trs Novmr

More information

Minimum Spanning Trees (CLRS 23)

Minimum Spanning Trees (CLRS 23) Mnmum Spnnn Trs (CLRS 3) T prolm Rll t nton o spnnn tr: Gvn onnt, unrt rp G = (V, E), sust o s o G su tt ty onnt ll vrts n G n orm no yls s ll spnnn tr (ST) o G. Any unrt, onnt rp s spnnn tr. Atully, rp

More information

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

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

More information

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

Strongly connected components. Finding strongly-connected components

Strongly connected components. Finding strongly-connected components Stronly onnt omponnts Fnn stronly-onnt omponnts Tylr Moor stronly onnt omponnt s t mxml sust o rp wt rt pt twn ny two vrts SE 3353, SMU, Dlls, TX Ltur 9 Som sls rt y or pt rom Dr. Kvn Wyn. For mor normton

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

Lecture II: Minimium Spanning Tree Algorithms

Lecture II: Minimium Spanning Tree Algorithms Ltur II: Mnmum Spnnn Tr Alortms Dr Krn T. Hrly Dprtmnt o Computr Sn Unvrsty Coll Cork Aprl 0 KH (/0/) Ltur II: Mnmum Spnnn Tr Alortms Aprl 0 / 5 Mnmum Spnnn Trs Mnmum Spnnn Trs Spnnn Tr tr orm rom rp s

More information

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

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

More information

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

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

More information

CSE 373: 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

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

Shortest Paths in Graphs. Paths in graphs. Shortest paths CS 445. Alon Efrat Slides courtesy of Erik Demaine and Carola Wenk

Shortest Paths in Graphs. Paths in graphs. Shortest paths CS 445. Alon Efrat Slides courtesy of Erik Demaine and Carola Wenk S 445 Shortst Paths n Graphs lon frat Sls courtsy of rk man an arola Wnk Paths n raphs onsr a raph G = (V, ) wth -wht functon w : R. Th wht of path p = v v v k s fn to xampl: k = w ( p) = w( v, v + ).

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

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

Interval Scheduling. Chapter 4. Greedy Algorithms. Interval Scheduling: Greedy Algorithms. Interval Scheduling

Interval Scheduling. Chapter 4. Greedy Algorithms. Interval Scheduling: Greedy Algorithms. Interval Scheduling hptr Intrvl huling Gry Algorithms lis y Kvin Wyn. opyright 00 Prson-Aison Wsly. All rights rsrv. Th originl vrsion n offiil vrsions r t http://www.s.printon.u/~wyn/ Intrvl huling Intrvl huling: Gry Algorithms

More information

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

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

More information

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

V={A,B,C,D,E} E={ (A,D),(A,E),(B,D), (B,E),(C,D),(C,E)} 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

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

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

Spanning Tree. Preview. Minimum Spanning Tree. Minimum Spanning Tree. Minimum Spanning Tree. Minimum Spanning Tree 10/17/2017.

Spanning Tree. Preview. Minimum Spanning Tree. Minimum Spanning Tree. Minimum Spanning Tree. Minimum Spanning Tree 10/17/2017. 0//0 Prvw Spnnng Tr Spnnng Tr Mnmum Spnnng Tr Kruskl s Algorthm Prm s Algorthm Corrctnss of Kruskl s Algorthm A spnnng tr T of connctd, undrctd grph G s tr composd of ll th vrtcs nd som (or prhps ll) of

More information

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

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

More information

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

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

More information

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

(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

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

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

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

Graph Search (6A) Young Won Lim 5/18/18

Graph Search (6A) Young Won Lim 5/18/18 Grp Sr (6A) Youn Won Lm Copyrt () 2015 2018 Youn W. Lm. Prmon rnt to opy, trut n/or moy t oumnt unr t trm o t GNU Fr Doumntton Ln, Vron 1.2 or ny ltr vron pul y t Fr Sotwr Founton; wt no Invrnt Ston, no

More information

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

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

More information

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

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

minimize c'x subject to subject to subject to

minimize c'x subject to subject to subject to z ' sut to ' M ' M N uostrd N z ' sut to ' z ' sut to ' sl vrls vtor of : vrls surplus vtor of : uostrd s s s s s s z sut to whr : ut ost of :out of : out of ( ' gr of h food ( utrt : rqurt for h utrt

More information

Minimum Spanning Trees (CLRS 23)

Minimum Spanning Trees (CLRS 23) Mnmum Spnnn Trs (CLRS 3) T prolm Gvn onnt, unrt rp G = (V, E), sust o s o G su tt ty onnt ll vrts n G n orm no yls s ll spnnn tr (ST) o G. Clm: Any unrt, onnt rp s spnnn tr (n nrl rp my v mny spnnn trs).

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

# 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

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

, 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

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

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

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

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

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

CMPS 2200 Fall Graphs. Carola Wenk. Slides courtesy of Charles Leiserson with changes and additions by Carola Wenk

CMPS 2200 Fall Graphs. Carola Wenk. Slides courtesy of Charles Leiserson with changes and additions by Carola Wenk CMPS 2200 Fll 2017 Grps Crol Wnk Sls ourtsy o Crls Lsrson wt ns n tons y Crol Wnk 10/23/17 CMPS 2200 Intro. to Alortms 1 Grps Dnton. A rt rp (rp) G = (V, E) s n orr pr onsstn o st V o vrts (snulr: vrtx),

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

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

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

Graph Search Algorithms

Graph Search Algorithms Grp Sr Aortms 1 Grp 2 No ~ ty or omputr E ~ ro or t Unrt or Drt A surprsny r numr o omputton proms n xprss s rp proms. 3 Drt n Unrt Grps () A rt rp G = (V, E), wr V = {1,2,3,4,5,6} n E = {(1,2), (2,2),

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

Exam 2 Solutions. Jonathan Turner 4/2/2012. CS 542 Advanced Data Structures and Algorithms

Exam 2 Solutions. Jonathan Turner 4/2/2012. CS 542 Advanced Data Structures and Algorithms CS 542 Avn Dt Stutu n Alotm Exm 2 Soluton Jontn Tun 4/2/202. (5 ont) Con n oton on t tton t tutu n w t n t 2 no. Wt t mllt num o no tt t tton t tutu oul ontn. Exln you nw. Sn n mut n you o u t n t, t n

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

b.) v d =? Example 2 l = 50 m, D = 1.0 mm, E = 6 V, " = 1.72 #10 $8 % & m, and r = 0.5 % a.) R =? c.) V ab =? a.) R eq =?

b.) v d =? Example 2 l = 50 m, D = 1.0 mm, E = 6 V,  = 1.72 #10 $8 % & m, and r = 0.5 % a.) R =? c.) V ab =? a.) R eq =? xmpl : An 8-gug oppr wr hs nomnl mtr o. mm. Ths wr rrs onstnt urrnt o.67 A to W lmp. Th nsty o r ltrons s 8.5 x 8 ltrons pr u mtr. Fn th mgntu o. th urrnt nsty. th rt vloty xmpl D. mm,.67 A, n N 8.5" 8

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

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

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

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

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

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

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

In which direction do compass needles always align? Why?

In which direction do compass needles always align? Why? AQA Trloy Unt 6.7 Mntsm n Eltromntsm - Hr 1 Complt t p ll: Mnt or s typ o or n t s stronst t t o t mnt. Tr r two typs o mnt pol: n. Wrt wt woul ppn twn t pols n o t mnt ntrtons low: Drw t mnt l lns on

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

The R-Tree. Yufei Tao. ITEE University of Queensland. INFS4205/7205, Uni of Queensland

The R-Tree. Yufei Tao. ITEE University of Queensland. INFS4205/7205, Uni of Queensland Yu To ITEE Unvrsty o Qunsln W wll stuy nw strutur ll t R-tr, w n tout o s mult-mnsonl xtnson o t B-tr. T R-tr supports ntly vrty o qurs (s w wll n out ltr n t ours), n s mplmnt n numrous ts systms. Our

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

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

Single Source Shortest Paths (with Positive Weights)

Single Source Shortest Paths (with Positive Weights) Snl Sour Sortst Pts (wt Postv Wts) Yuf To ITEE Unvrsty of Qunslnd In ts ltur, w wll rvst t snl sour sortst pt (SSSP) problm. Rll tt w v lrdy lrnd tt t BFS lortm solvs t problm ffntly wn ll t ds v t sm

More information

Applications of trees

Applications of trees Trs Apptons o trs Orgnzton rts Attk trs to syst Anyss o tr ntworks Prsng xprssons Trs (rtrv o norton) Don-n strutur Mutstng Dstnton-s orwrng Trnsprnt swts Forwrng ts o prxs t routrs Struturs or nt pntton

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

Algorithm Design and Analysis

Algorithm Design and Analysis Algorithm Design nd Anlysis LECTURE 8 Mx. lteness ont d Optiml Ching Adm Smith 9/12/2008 A. Smith; sed on slides y E. Demine, C. Leiserson, S. Rskhodnikov, K. Wyne Sheduling to Minimizing Lteness Minimizing

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

Last time: introduced our first computational model the DFA.

Last time: introduced our first computational model the DFA. Lctur 7 Homwork #7: 2.2.1, 2.2.2, 2.2.3 (hnd in c nd d), Misc: Givn: M, NFA Prov: (q,xy) * (p,y) iff (q,x) * (p,) (follow proof don in clss tody) Lst tim: introducd our first computtionl modl th DFA. Tody

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

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

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

More information

The Mathematics of Harmonic Oscillators

The Mathematics of Harmonic Oscillators Th Mhcs of Hronc Oscllors Spl Hronc Moon In h cs of on-nsonl spl hronc oon (SHM nvolvng sprng wh sprng consn n wh no frcon, you rv h quon of oon usng Nwon's scon lw: con wh gvs: 0 Ths s sos wrn usng h

More information

Garnir Polynomial and their Properties

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

More information

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

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

Convergence Theorems for Two Iterative Methods. A stationary iterative method for solving the linear system: (1.1)

Convergence Theorems for Two Iterative Methods. A stationary iterative method for solving the linear system: (1.1) Conrgnc Thors for Two Itrt Mthods A sttonry trt thod for solng th lnr syst: Ax = b (.) ploys n trton trx B nd constnt ctor c so tht for gn strtng stt x of x for = 2... x Bx c + = +. (.2) For such n trton

More information

CSE 332. Data Structures and Parallelism

CSE 332. Data Structures and Parallelism Am Blnk Ltur 20 Wntr 2017 CSE 332 Dt Struturs n Prlllsm CSE 332: Dt Struturs n Prlllsm Grps 1: Wt s Grp? DFS n BFS LnkLsts r to Trs s Trs r to... 1 Wr W v Bn Essntl ADTs: Lsts, Stks, Quus, Prorty Quus,

More information

CSE 332. Graphs 1: What is a Graph? DFS and BFS. Data Abstractions. CSE 332: Data Abstractions. A Graph is a Thingy... 2

CSE 332. Graphs 1: What is a Graph? DFS and BFS. Data Abstractions. CSE 332: Data Abstractions. A Graph is a Thingy... 2 Am Blnk Ltur 19 Summr 2015 CSE 332: Dt Astrtons CSE 332 Grps 1: Wt s Grp? DFS n BFS Dt Astrtons LnkLsts r to Trs s Trs r to... 1 A Grp s Tny... 2 Wr W v Bn Essntl ADTs: Lsts, Stks, Quus, Prorty Quus, Hps,

More information

23 Minimum Spanning Trees

23 Minimum Spanning Trees 3 Mnmum Spnnn Trs Eltron rut sns otn n to mk t pns o svrl omponnts ltrlly quvlnt y wrn tm totr. To ntronnt st o n pns, w n us n rrnmnt o n wrs, onntn two pns. O ll su rrnmnts, t on tt uss t lst mount o

More information

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

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

More information

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

Algorithm Design and Analysis

Algorithm Design and Analysis Algorithm Design nd Anlysis LECTURE 5 Supplement Greedy Algorithms Cont d Minimizing lteness Ching (NOT overed in leture) Adm Smith 9/8/10 A. Smith; sed on slides y E. Demine, C. Leiserson, S. Rskhodnikov,

More information

2 Trees and Their Applications

2 Trees and Their Applications Trs n Tr Appltons. Proprts o trs.. Crtrzton o trs Dnton. A rp s ll yl (or orst) t ontns no yls. A onnt yl rp s ll tr. Quston. Cn n yl rp v loops or prlll s? Notton. I G = (V, E) s rp n E, tn G wll not

More information