13. Binary tree, height 4, eight terminal vertices 14. Full binary tree, seven vertices v 7 v13. v 19

Size: px
Start display at page:

Download "13. Binary tree, height 4, eight terminal vertices 14. Full binary tree, seven vertices v 7 v13. v 19"

Transcription

1 0. Spnning Trs n Shortst Pths 0. Consir th tr shown blow with root v 0.. Wht is th lvl of v 8? b. Wht is th lvl of v 0? c. Wht is th hight of this root tr?. Wht r th chilrn of v 0?. Wht is th prnt of v 5? f. Wht r th siblings of v? g. Wht r th scnnts of v? 6. Full binry tr, svn vrtics, of which four r intrnl vrtics. Full binry tr, twlv vrtics 8. Full binry tr, nin vrtics 9. Binry tr, hight, svn trminl vrtics 0. Full binry tr, hight, six trminl vrtics v 0. Binry tr, hight, nin trminl vrtics v v. Full binry tr, ight intrnl vrtics, svn trminl vrtics. v v v 5 v8 v 9 v 6 v 0 v v. Binry tr, hight, ight trminl vrtics. Full binry tr, svn vrtics v v v v 5 v 6 v 8 v v 9 5. Full binry tr, nin vrtics, fiv intrnl vrtics 6. Full binry tr, four intrnl vrtics. Drw binry trs to rprsnt th following xprssions:. b (c/( + )) b. /(b c ) In ch of 0 ithr rw grph with th givn spcifictions or xplin why no such grph xists.. Full binry tr, fiv intrnl vrtics 5. Full binry tr, fiv intrnl vrtics, svn trminl vrtics. Binry tr, hight, ightn trminl vrtics 8. Full binry tr, sixtn vrtics 9. Full binry tr, hight, svn trminl vrtics 0. Wht cn you uc bout th hight of binry tr if you know tht it hs th following proprtis?. Twnty-fiv trminl vrtics b. Forty trminl vrtics c. Sixty trminl vrtics Answrs for Tst Yourslf. on vrtx is istinguish from th othrs n is cll th root; th numbr of gs long th uniqu pth btwn it n th root; th mximum lvl of ny vrtx of th tr. vry prnt hs t most two chilrn. vry prnt hs xctly two chilrn. k + ; k + 5.t h, or, quivlntly, log t h 0. Spnning Trs n Shortst Pths I contn tht ch scinc is rl scinc insofr s it is mthmtics. Immnul Knt, 80 An Est Cost irlin compny wnts to xpn srvic to th Miwst n hs rciv prmission from th Frl Avition Authority to fly ny of th routs shown in Figur 0... Minnpolis Milwuk Chicgo Dtroit Cincinnti St. Louis Louisvill Figur 0.. Nshvill

2 0 Chptr 0 Grphs n Trs Th compny wishs to lgitimtly vrtis srvic to ll th citis shown but, for rsons of conomy, wnts to us th lst possibl numbr of iniviul routs to connct thm. On possibl rout systm is givn in Figur 0... Minnpolis Milwuk Chicgo Dtroit Cincinnti St. Louis Louisvill Figur 0.. Nshvill Clrly this systm joins ll th citis. Is th numbr of iniviul routs miniml? Th nswr is ys, n th rson my surpris you. Th fct is tht th grph of ny systm of routs tht stisfis th compny s wishs is tr, bcus if th grph wr to contin circuit, thn on of th routs in th circuit coul b rmov without isconncting th grph (by Lmm 0.5.), n tht woul giv smllr totl numbr of routs. But ny tr with ight vrtics hs svn gs. Thrfor, ny systm of routs tht conncts ll ight vrtics n yt minimizs th totl numbr of routs consists of svn routs. Dfinition A spnning tr for grph G is subgrph of G tht contins vry vrtx of G n is tr. Th prcing iscussion contins th ssnc of th proof of th following proposition: Proposition 0... Evry connct grph hs spnning tr.. Any two spnning trs for grph hv th sm numbr of gs. Proof of (): Suppos G is connct grph. If G is circuit-fr, thn G is its own spnning tr n w r on. If not, thn G hs t lst on circuit C. By Lmm 0.5., th subgrph of G obtin by rmoving n g from C is connct. If this subgrph is circuit-fr, thn it is spnning tr n w r on. If not, thn it hs t lst on circuit C, n, s bov, n g cn b rmov from C to obtin connct subgrph. Continuing in this wy, w cn rmov succssiv gs from circuits, until vntully w obtin connct, circuit-fr subgrph T of G. [This must hppn t som point bcus th numbr of gs of G is finit, n t no stg os rmovl of n g isconnct th subgrph.] Also, T contins vry vrtx of G bcus no vrtics of G wr rmov in constructing it. Thus T is spnning tr for G. Th proof of prt () is lft s n xrcis.

3 Exmpl 0.. Spnning Trs Fin ll spnning trs for th grph G pictur blow. 0. Spnning Trs n Shortst Pths 0 v 5 v v v 0 v v Solution Th grph G hs on circuit v v v v, n rmovl of ny g of th circuit givs tr. Thus, s shown blow, thr r thr spnning trs for G. v 5 v v v 5 v v v 5 v v v 0 v v v 0 v v v 0 v v Minimum Spnning Trs Th grph of th routs llow by th Frl Avition Authority shown in Figur 0.. cn b nnott by ing th istncs (in mils) btwn ch pir of citis. This is on in Figur 0... Minnpolis 55 Milwuk Dtroit 695 Chicgo Cincinnti 8 St. Louis Louisvill 5 Nshvill Figur 0.. Now suppos th irlin compny wnts to srv ll th citis shown, but with rout systm tht minimizs th totl milg. Not tht such systm is tr, bcus if th systm contin circuit, rmovl of n g from th circuit woul not ffct prson s bility to rch vry city in th systm from vry othr (gin, by Lmm 0.5.), but it woul ruc th totl milg of th systm. Mor gnrlly, grph whos gs r lbl with numbrs (known s wights)is cll wigh grph.a minimum-wight spnning tr, or simply minimum spnning tr, is spnning tr for which th sum of th wights of ll th gs is s smll s possibl.

4 0 Chptr 0 Grphs n Trs Dfinition A wight grph is grph for which ch g hs n ssocit positiv rl numbr wight. Th sum of th wights of ll th gs is th totl wight of th grph. A minimum spnning tr for connct wight grph is spnning tr tht hs th lst possibl totl wight compr to ll othr spnning trs for th grph. If G is wigh grph n is n g of G, thn w() nots th wight of n w(g) nots th totl wight of G. Th problm of fining minimum spnning tr for grph is crtinly solvbl. On solution is to list ll spnning trs for th grph, comput th totl wight of ch, n choos on for which this totl is minimum. (Not tht th wll-orring principl for th intgrs gurnts th xistnc of such minimum totl.) This solution, howvr, is infficint in its us of computing tim bcus th numbr of istinct spnning trs is so lrg. For instnc, complt grph with n vrtics hs n n spnning trs. Evn using th fstst computrs vilbl toy, xmining ll such trs in grph with pproximtly 00 vrtics woul rquir mor tim thn is stimt to rmin in th lif of th univrs. In 956 n 95 Josph B. Kruskl n Robrt C. Prim ch scrib much mor fficint lgorithms to construct minimum spnning trs. Evn for lrg grphs, both lgorithms cn b implmnt so s to tk rltivly short computing tims. Josph Kruskl (born 98) Courtsy of Josph Kruskl Kruskl s Algorithm In Kruskl s lgorithm, th gs of connct wight grph r xmin on by on in orr of incrsing wight. At ch stg th g bing xmin is to wht will bcom th minimum spnning tr, provi tht this ition os not crt circuit. Aftr n gs hv bn (whr n is th numbr of vrtics of th grph), ths gs, togthr with th vrtics of th grph, form minimum spnning tr for th grph. Algorithm 0.. Kruskl Input: G [ connct wight grph with n vrtics, whr n is positiv intgr] Algorithm Boy: [Buil subgrph T of G to consist of ll th vrtics of G with gs in orr of incrsing wight. At ch stg, lt m b th numbr of gs of T.]. Initiliz T to hv ll th vrtics of G n no gs.. Lt E b th st of ll gs of G, n lt m := 0.. whil (m < n ). Fin n g in E of lst wight. b. Dlt from E. c. if ition of to th g st of T os not prouc circuit thn to th g st of T n st m := m + n whil Output: T [T is minimum spnning tr for G.]

5 0. Spnning Trs n Shortst Pths 05 Th following xmpl shows how Kruskl s lgorithm works for th grph of th irlin rout systm. Exmpl 0.. Action of Kruskl s Algorithm Dscrib th ction of Kruskl s lgorithm on th grph shown in Figur 0.., whr n = 8. Minnpolis 55 Milwuk 695 Chicgo St. Louis Figur 0.. Dtroit 0 06 Cincinnti 8 Louisvill 5 Nshvill Solution Itrtion Numbr Eg Consir Wight Action Tkn Chicgo Milwuk Louisvill Cincinnti 8 Louisvill Nshvill 5 Cincinnti Dtroit 0 5 St. Louis Louisvill 6 St. Louis Chicgo 6 Chicgo Louisvill 69 not 8 Louisvill Dtroit 06 not 9 Louisvill Milwuk 8 not 0 Minnpolis Chicgo 55 Th tr prouc by Kruskl s lgorithm is shown in Figur Minnpolis 55 Milwuk Chicgo 6 St. Louis Figur 0..5 Dtroit 0 Cincinnti 8 Louisvill 5 Nshvill Whn Kruskl s lgorithm is us on grph in which som gs hv th sm wight s othrs, mor thn on minimum spnning tr cn occur s output. To mk

6 06 Chptr 0 Grphs n Trs th output uniqu, th gs of th grph cn b plc in n rry n gs hving th sm wight cn b in th orr thy ppr in th rry. It is not obvious from th scription of Kruskl s lgorithm tht it os wht it is suppos to o. To b spcific, wht gurnts tht it is possibl t ch stg to fin n g of lst wight whos ition os not prouc circuit? An if such gs cn b foun, wht gurnts tht thy will ll vntully connct? An if thy o connct, wht gurnts tht th rsulting tr hs minimum wight? Of cours, th mr fct tht Kruskl s lgorithm is print in this book my l you to bliv tht vrything works out. But th qustions bov r rl, n thy srv srious nswrs. Thorm 0.. Corrctnss of Kruskl s Algorithm Whn connct, wight grph is input to Kruskl s lgorithm, th output is minimum spnning tr. Proof: Suppos tht G is connct, wight grph with n vrtics n tht T is subgrph of G prouc whn G is input to Kruskl s lgorithm. Clrly T is circuitfr [sinc no g tht complts circuit is vr to T]. Also T is connct. For s long s T hs mor thn on connct componnt, th st of gs of G tht cn b to T without crting circuit is nonmpty. [Th rson is tht sinc G is connct, givn ny vrtx v in on connct componnt C of T n ny vrtx v in nothr connct componnt C, thr is pth in G from v to v.sincc n C r istinct, thr is n g of this pth tht is not in T. Aing to T os not crt circuit in T, bcus ltion of n g from circuit os not isconnct grph n ltion of woul.] Th prcing rgumnts show tht T is circuit-fr n connct. Sinc by construction T contins vry vrtx of G, T is spnning tr for G. Nxt w show tht T hs minimum wight. Lt T b ny minimum spnning tr for G such tht th numbr of gs T n T hv in common is mximum. Suppos tht T = T. Thn thr is n g in T tht is not n g of T. [Sinc trs T n T both hv th sm vrtx st, if thy iffr t ll, thy must hv iffrnt, but sm-siz, g sts.] Now ing to T proucs grph with uniqu circuit (s xrcis 9 t th n of this sction). Lt b n g of this circuit such tht is not in T. [Such n g must xist bcus T is tr n hnc circuit-fr.] Lt T b th grph obtin from T by rmoving n ing. This sitution is illustrt blow. ' (rmov from T to form T.) ( to T to form T.) Th ntir grph is G. T hs blck gs. is in T but not T. is in T but not T. Not tht T hs n gs n n vrtics n tht T is connct [sinc by Lmm 0.5. th subgrph obtin by rmoving n g from circuit in connct grph is connct]. Consquntly, T is spnning tr for G. In ition, w(t ) = w(t ) w( ) + w(). Now w() w( ) bcus t th stg in Kruskl s lgorithm whn ws to T, ws vilbl to b [sinc it ws not lry in T, n t tht stg its

7 0. Spnning Trs n Shortst Pths 0 ition coul not prouc circuit sinc ws not in T ], n woul hv bn h its wight bn lss thn tht of. Thus w(t ) = w(t ) [w( ) w()] }{{} 0 w(t ). But T is minimum spnning tr. Sinc T is spnning tr with wight lss thn or qul to th wight of T, T is lso minimum spnning tr for G. Finlly, not tht by construction, T hs on mor g in common with T thn T os, which contricts th choic of T s minimum spnning tr for G with mximum numbr of gs in common with T. Thus th supposition tht T = T is fls, n hnc T itslf is minimum spnning tr for G. Robrt Prim (born 9) Courtsy of Alctl-Lucnt Tchnologis Prim s Algorithm Prim s lgorithm works iffrntly from Kruskl s. It buils minimum spnning tr T by xpning outwr in connct links from som vrtx. On g n on vrtx r t ch stg. Th g is th on of lst wight tht conncts th vrtics lry in T with thos not in T, n th vrtx is th npoint of this g tht is not lry in T. Algorithm 0.. Input: G [ connct wight grph with n vrtics whr n is positiv intgr] Algorithm Boy: [Buil subgrph T of G by strting with ny vrtx v of G n ttching gs (with thir npoints) on by on to n s-yt-unconnct vrtx of G, ch tim choosing n g of lst wight tht is jcnt to vrtx of T.]. Pick vrtx v of G n lt T b th grph with on vrtx, v, n no gs.. Lt V b th st of ll vrtics of G xcpt v.. for i := to n. Fin n g of G such tht () conncts T to on of th vrtics in V, n () hs th lst wight of ll gs conncting T to vrtx in V.Ltw b th npoint of tht is in V. b. A n w to th g n vrtx sts of T, n lt w from V. nxt i Output: T [T is minimum spnning tr for G.] Th following xmpl shows how Prim s lgorithm works for th grph of th irlin rout systm. Exmpl 0.. Action of Prim s Algorithm Dscrib th ction of Prim s lgorithm for th grph in Figur 0..6 using th Minnpolis vrtx s strting point.

8 08 Chptr 0 Grphs n Trs Minnpolis 55 Milwuk Dtroit 695 Chicgo Cincinnti 8 St. Louis Louisvill 5 Nshvill Figur 0..6 Solution Itrtion Numbr Vrtx A Eg A Wight 0 Minnpolis Chicgo Minnpolis Chicgo 55 Milwuk Chicgo Milwuk St. Louis Chicgo St. Louis 6 Louisvill St. Louis Louisvill 5 Cincinnti Louisvill Cincinnti 8 6 Nshvill Louisvill Nshvill 5 Dtroit Cincinnti Dtroit 0 Not tht th tr obtin is th sm s tht obtin by Kruskl s lgorithm, but th gs r in iffrnt orr. As with Kruskl s lgorithm, in orr to nsur uniqu output, th gs of th grph coul b plc in n rry n thos with th sm wight coul b in th orr thy ppr in th rry. It is not hr to s tht whn connct grph is input to Prim s lgorithm, th rsult is spnning tr. Wht is not so clr is tht this spnning tr is minimum. Th proof of th following thorm stblishs tht it is. Thorm 0.. Corrctnss of Prim s Algorithm Whn connct, wight grph G is input to Prim s lgorithm, th output is minimum spnning tr for G. Proof: Lt G b connct, wight grph, n suppos G is input to Prim s lgorithm. At ch stg of xcution of th lgorithm, n g must b foun tht conncts vrtx in subgrph to vrtx outsi th subgrph. As long s thr r vrtics outsi th subgrph, th connctnss of G nsurs tht such n g cn lwys b foun. [For if on vrtx in th subgrph n on vrtx outsi it r chosn, thn by th connctnss of G thr is wlk in G linking th two. As on trvls long this wlk, t som point on movs long n g from vrtx insi th subgrph to vrtx outsi th subgrph.] Now it is clr tht th output T of Prim s lgorithm is tr bcus th g n vrtx to T t ch stg r connct to othr gs n vrtics of T

9 0. Spnning Trs n Shortst Pths 09 n bcus t no stg is circuit crt sinc ch g conncts vrtics in two isconnct sts. [Consquntly, rmovl of nwly g proucs isconnct grph, whrs by Lmm 0.5., rmovl of n g from circuit proucs connct grph.] Also, T inclus vry vrtx of G bcus T, bing trwithn gs, hs n vrtics [n tht is ll G hs]. Thus T is spnning tr for G. Nxt w show tht T hs minimum wight. Lt T b minimum spnning tr for G such tht th numbr of gs T n T hv in common is mximum. Suppos tht T = T. Thn thr is n g in T tht is not n g of T. [Sinc trs T n T both hv th sm vrtx st if thy iffr t ll, thy must hv iffrnt, sm-siz g sts.] Of ll such gs, lt b th lst tht ws whn T ws construct using Prim s lgorithm. Lt S b th st of vrtics of T just bfor th ition of. Thn on npoint, sy v of, isins n th othr, sy w, is not. Sinc T is spnning tr, thr is pth in T joining v to w. An sinc v S n w S, s on trvls long this pth, on must ncountr n g tht joins vrtx in S to on tht is not in S n tht thrfor is not in T bcus ws th lst g to T. Now t th stg whn ws to T, coul lso hv bn n it woul hv bn inst of h its wight bn lss thn tht of. Sinc ws not t tht stg, w conclu tht w( ) w(). Lt T b th grph obtin from T by rmoving n ing. [Thus T hs on mor g in common with T thn T os.] Not tht T is tr. Th rson is tht sinc is prt of pth in T from v to w, n conncts v n w, ing to T crts circuit. Whn is rmov from this circuit, th rsulting subgrph rmins connct. In fct, T is spnning tr for G sinc no vrtics wr rmov in forming T from T. Th rgumnt showing tht w(t ) w(t ) is lft s n xrcis. [It is virtully inticl to prt of th proof of Thorm 0...] It follows tht T is minimum spnning tr for G. By construction, T hs on mor g in common with T thn T, os which contricts th choic of T s minimum spnning tr for G withmximum numbr of gs in common with T. It follows tht T = T, n hnc T itslf is minimum spnning tr for G. Exmpl 0.. Fining Minimum Spnning Trs Fin ll minimum spnning trs for th following grph. Us Kruskl s lgorithm n Prim s lgorithm strting t vrtx. Inict th orr in which gs r to form ch tr. b c f Solution Whn Kruskl s lgorithm is ppli, gs r in on of th following two orrs:. {, f }, {, c}, {, b}, {c, }, {, }. {, f }, {, c}, {b, c}, {c, }, {, }

10 0 Chptr 0 Grphs n Trs Whn Prim s lgorithm is ppli strting t, gs r in on of th following two orrs:. {, c}, {, b}, {c, }, {, f }, {, }. {, c}, {b, c}, {c, }, {, f }, {, } Thus, s shown blow, thr r two istinct minimum spnning trs for this grph. b c b 5 f 5 f c ( ) (b) Dijkstr s Shortst Pth Algorithm Although th trs prouc by Kruskl s n Prim s lgorithms hv th lst possibl totl wight compr to ll othr spnning trs for th givn grph, thy o not lwys rvl th shortst istnc btwn ny two points on th grph. For instnc, ccoring to th complt rout systm shown in Figur 0.., on cn fly irctly from Nshvill to Minnpolis for istnc of 695 mils, whrs if you us th minimum spnning tr shown in Figur 0..5 th only wy to fly from Nshvill to Minnpolis is by going through Louisvill, St. Louis, n Chicgo, which givs totl istnc of =, 00 mils n th unplsntnss of thr chngs of pln. In 959 th computing pionr, Esgr Dijkstr (s Sction 5.5), vlop n lgorithm to fin th shortst pth btwn strting vrtx n n ning vrtx in wight grph in which ll th wights r positiv. It is somwht similr to Prim s lgorithm in tht it works outwr from strting vrtx, ing vrtics n gs on by on to construct tr T. Howvr, it iffrs from Prim s lgorithm in th wy it chooss th nxt vrtx to, nsuring tht for ch vrtx v, th lngth of th shortst pth from to v hs bn intifi. At th strt of xcution of th lgorithm, ch vrtx u of G is givn lbl L(u), which inicts th currnt bst stimt of th lngth of th shortst pth from to u. L() is initilly st qul to 0 bcus th shortst pth from to hs lngth zro, but, bcus thr is no prvious informtion bout th lngths of th shortst pths from to ny othr vrtics of G, th lbl L(u) of ch vrtx u othr thn is initilly st qul to numbr, not, tht is grtr thn th sum of th wights of ll th gs of G. As xcution of th lgorithm progrsss, th vlus of L(u) r chng, vntully bcoming th ctul lngths of th shortst pths from to u in G. Bcus T is built up outwr from, t ch stg of xcution of th lgorithm th only vrtics tht r cnits to join T r thos tht r jcnt to t lst on vrtx of T. Thus t ch stg of Dijkstr s lgorithm, th grph G cn b thought of s ivi into thr prts: th tr T tht is bing built up, th st of fring vrtics tht r jcnt to t lst on vrtx of th tr, n th rst of th vrtics of G. Ech fring vrtx is cnit to b th nxt vrtx to T. Th on tht is chosn is th on for which th lngth of th shortst pth to it from through T is minimum mong ll th vrtics in th fring. An ssntil obsrvtion unrlying Dijkstr s lgorithm is tht ftr ch ition of vrtxv to T, th only fring vrtics for which shortr pth from might b foun r thos tht r jcnt to v [bcus th lngth of th pth from to v ws minimum mong ll th pths from to vrtics in wht ws thn th fring]. So ftr ch ition of vrtx v to T, ch fring vrtx u jcnt to v is xmin n two numbrs r

11 0. Spnning Trs n Shortst Pths compr: th currnt vlu of L(u) n th vlu of L(v) + w(v, u), whr L(v) is th lngth of th shortst pth to v (in T ) n w(v, u) is th wight of th g joining v n u. IfL(v) + w(v, u) <L(u), thn th vlu of L(u) is chng to L(v) + w(v, u). At th bginning of xcution of th lgorithm, th tr consists only of th vrtx, n L() = 0. Whn xcution trmints, L(z) is th lngth of shortst pth from to z. As with Kruskl s n Prim s lgorithms for fining minimum spnning trs, thr is simpl but rmticlly infficint wy to fin th shortst pth from to z: comput th lngths of ll th pths n choos on tht is shortst. Th problm is tht vn for rltivly smll grphs using this mtho to fin shortst pth coul rquir billions of yrs, whrs Dijkstr s lgorithm coul o th job in fw scons. Algorithm 0.. Dijkstr Input: G[ connct simpl grph with positiv wight for vry g], [ numbr grtr thn th sum of th wights of ll th gs in th grph], w(u,v) [th wight of g {u,v}],[th strting vrtx], z[th ning vrtx] Algorithm Boy:. Initiliz T to b th grph with vrtx n no gs. Lt V (T ) b th st of vrtics of T, n lt E(T ) b th st of gs of T.. Lt L() = 0, n for ll vrtics in G xcpt, lt L(u) =. [Th numbr L(x) is cll th lbl of x.]. Initiliz v to qul n F to b {}. [Th symbol v is us to not th vrtx most rcntly to T.]. whil (z V (T )). F := (F {v}) {vrtics tht r jcnt to v n r not in V (T )} [Th st F is cll th fring. Ech tim vrtx is to T, it is rmov from th fring n th vrtics jcnt to it r to th fring if thy r not lry in th fring or th tr T.] b. For ch vrtx u tht is jcnt to v n is not in V (T ), if L(v) + w(v, u) <L(u) thn L(u) := L(v) + w(v, u) D(u) := v Not Th uniqu pth in th tr T from to z is th shortst pth in G from to z. [Not tht ing v to T os not ffct th lbls of ny vrtics in th fring F xcpt thos jcnt to v. Also, whn L(u) is chng to smllr vlu, th nottion D(u) is introuc to kp trck of which vrtx in T gv ris to th smllr vlu.] c. Fin vrtx x in F with th smllst lbl A vrtx x to V (T ), n g {D(x), x} to E(T ) v := x [This sttmnt sts up th nottion for th nxt itrtion of th loop.] n whil Output: L(z) [L(z), nonngtiv intgr, is th lngth of th shortst pth from toz.] Th ction of Dijkstr s lgorithm is illustrt by th flow of th rwings in Exmpl 0..5.

12 Chptr 0 Grphs n Trs Exmpl 0..5 Action of Dijkstr s Algorithm Show th stps in th xcution of Dijkstr s shortst pth lgorithm for th grph shown blow with strting vrtx n ning vrtx z. b 6 5 z c 6 Solution Stp : Going into th whil loop: V (T ) ={}, E(T ) =, n F ={} b c 5 6 z During itrtion: F ={b, c}, L(b) =, L(c) =. Sinc L(b) <L(c), b is to V (T ) n {, b} is to E(T ). Stp : Going into th whil loop: V (T ) ={, b}, E(T ) ={{, b}} b c 5 6 z During itrtion: F = {c,, }, L(c) =, L() = 9, L() = 8. Sinc L(c) <L() n L(c) <L(), c is to V (T ) n {, c} is to E(T ). Stp : Going into th whil loop: V (T ) ={, b, c}, E(T ) ={{, b}, {, c}} b 6 During itrtion: F ={, }, L() = 9, L() = 5 L() bcoms 5 bcus c, which hs 5 z lngth 5, is shortr pth to thn b, which hs lngth 8. c Sinc L() <L(), is to V (T ) n {c, } is to E(T ). Stp : Going into th whil loop: V (T ) ={, b, c, }, E(T ) ={{, b}, {, c}, {c, }} During itrtion: b 6 F ={, z}, L() =, L(z) = L() bcoms bcus c, which hs 5 z lngth, is shortr pth to thn b, which hs lngth 9. c Sinc L() <L(z), is to V (T ) n {, } is to E(T ). Stp 5: Going into th whil loop: V (T ) ={, b, c,, }, E(T ) ={{, b},{, c}, {c, }, {, }} During itrtion: F ={z}, L(z) = b 6 L(z) bcoms bcus cz, which hs lngth, is shortr pth to thn 5 z bz, which hs lngth. Sinc z is th only vrtx in F, its lbl c is minimum, n so z is to V (T ) n {, z} is to E(T ).

13 0. Spnning Trs n Shortst Pths Excution of th lgorithm trmints t this point bcus z V (T ). Th shortst pth from to z hs lngth L(z) =. Kping trck of th stps in tbl is convnint wy to show th ction of Dijkstr s lgorithm. Tbl 0.. os this for th grph in Exmpl Tbl 0.. Stp V (T ) E(T ) F L() L(b) L(c) L() L() L(z) 0 {} {} 0 {} {b, c} 0 {, b} {{, b}} {c,, } {, b, c} {{, b}, {, c}} {, } {, b, c, } {{, b}, {, c}, {c, }} {, z} {, b, c,, } {{, b}, {, c}, {c, }, {, }} {z} {, b, c,,, z} {{, b}, {, c}, {c, }, {, }, {, z}} It is clr tht Dijkstr s lgorithm kps ing vrtics to I until it hs z.th proof of th following thorm shows tht whn th lgorithm trmints, th lbl z gos th lngth of th shortst pth to it from. Thorm 0.. Corrctnss of Dijkstr s Algorithm Whn connct, simpl grph with positiv wight for vry g is input to Dijkstr s lgorithm with strting vrtx n ning vrtx z, th output is th lngth of shortst pth from to z. Proof: Lt G b connct, wight grph with no loops or prlll gs n with positiv wight for vry g. Lt T b th grph built up by Dijkstr s lgorithm, n for ch vrtx u in G, ltl(u) b th lbl givn by th lgorithm to vrtx u. For ch intgr n 0, lt th proprty P(n) b th sntnc Aftr th nth itrtion of th whil loop in Dijkstr s lgorithm, () T is tr, n () for vry vrtx v in T, L(v) is th lngth of P(n) shortst pth in G from to v. W will show by mthmticl inuction tht P(n) is tru for ll intgrs n from 0 through th trmintion of th lgorithm. Show tht P(0) istru:whn n = 0, th grph T is tr bcus it is fin to consist only of th vrtx n no gs. In ition, L() is th lngth of th shortst pth from to bcus th initil vlu of L() is 0. Show tht for ll intgrs k 0, if P(k) is tru thn P(k + ) is lso tru: Lt k b ny intgr with k 0 n suppos tht Aftr th kth itrtion of th whil loop in Dijkstr s lgorithm, () T P(k) is tr, n () for vry vrtx v in T, L(v) is th lngth of inuctiv hypothsis shortst pth in G from to v. W must show tht Aftr th (k + )st itrtion of th whil loop in Dijkstr s lgorithm, () T is tr, n () for vry vrtx v in T, P(k + ) L(v) is th lngth of shortst pth in G from to v. continu on pg

14 Chptr 0 Grphs n Trs So suppos tht ftr th (k + )st itrtion of th whil loop in Dikjstr s lgorithm, th vrtx v n g {x,v} hv bn to T, whr x is in V (T ). Clrly th nw vlu of T is tr bcus ing nw vrtx n g to tr os not crt circuit n os not isconnct th tr. By inuctiv hypothsis for ch vrtx y in th tr bfor th ition of v, L(y) is th lngth of shortst pth from to y. So it rmins only to show tht L(v) is th lngth of shortst pth from to v. Now, ccoring to th lgorithm, th finl vlu of L(v) = L(x) + w(x,v). Consir ny shortst pth from to v, n lt {s, t} b th first g in this pth to lv T, whr s V (T ) n t V (T ). This sitution is illustrt blow. s t x Lt LSP(, v)b th lngth of shortst pth from to v, n lt LSP(, s) b th lngth of shortst pth from to s. Obsrv tht LSP(, v) LSP(, s) + w(s, t) bcus th pth from t to v hs lngth 0 L(s) + w(s, t) by inuctiv hypothsis bcus s is vrtx in T t is in th fring of th tr, n so if L(s)+w(s, t) L(x) + w(x,v) wr lss thn L(x)+w(x,v)thnt woul hv bn to T inst of v. On th othr hn bcus L(x)+w(x, v) is th lngth of pth from L(x) + w(x, v) LSP(,v) to v n so it is grtr thn or qul to th lngth of th shortst pth from to v. It follows tht LSP(,v) = L(x) + w(x,v), n, sinc L(v) = L(x) + w(x,v), L(v) is th lngth of shortst pth from to v. This complts th proof by mthmticl inuction. Th lgorithm trmints s soon s z is in T, n, sinc w hv prov tht th lbl of vry vrtx in th tr givs th lngth of th shortst pth to it from, thn, in prticulr, L(z) is th lngth of shortst pth from to z. v Tst Yourslf. A spnning tr for grph G is.. A wight grph is grph for which, n th totl wight of th grph is.. A minimum spnning tr for connct, wight grph is.. In Kruskl s lgorithm, th gs of connct, wight grph r xmin on by on in orr of strting with. 5. In Prim s lgorithm, minimum spnning tr is built by xpning outwr from n in squnc of. 6. In Dijkstr s lgorithm, vrtx is in th fring if it is vrtx in th tr tht is bing built up.. At ch stg of Dijkstr s lgorithm, th vrtx tht is to th tr is vrtx in th fring whos lbl is.

15 0. Spnning Trs n Shortst Pths 5 Exrcis St 0. Fin ll possibl spnning trs for ch of th grphs in n.. b. v 0 v c v v Fin spnning tr for ch of th grphs in n.. b c. z g r s t y x w f v Us Kruskl s lgorithm to fin minimum spnning tr for ch of th grphs in 5 n 6. Inict th orr in which gs r to form ch tr. 5. b c g 6 f 6. v 0 v 0 5 v 0 5 v v v 8 5 v 6 v 8 9 Us Prim s lgorithm strting with vrtx or v 0 to fin minimum spnning tr for ch of th grphs in n 8. Inict th orr in which gs r to form ch tr.. Th grph of xrcis Th grph of xrcis 6. For ch of th grphs in 9 n 0, fin ll minimum spnning trs tht cn b obtin using () Kruskl s lgorithm n (b) Prim s lgorithm strting with vrtx or t. Inict th orr in which gs r to form ch tr. 9. g 5 f b u c 0 0. t u 5 8 w 5 x y 5 z v 0. A piplin is to b built tht will link six citis. Th cost (in hunrs of millions of ollrs) of constructing ch potntil link pns on istnc n trrin n is shown in th wight grph blow. Fin systm of piplins to connct ll th citis n yt minimiz th totl cost. Slt Lk City.5 Chynn Dnvr Amrillo Phonix Albuqurqu. Us Dijkstr s lgorithm for th irlin rout systm of Figur 0.. to fin th shortst istnc from Nshvill to Minnpolis. Mk tbl similr to Tbl 0.. to show th ction of th lgorithm. Us Dijkstr s lgorithm to fin th shortst pth from to z for ch of th grphs in 6. In ch cs mk tbls similr to Tbl 0.. to show th ction of th lgorithm.. b c 8 5 z 0. b c 8 f 5. Th grph of xrcis 9 with = n z = f 6. Th grph of xrcis 0 with = u n z = w. Prov prt () of Proposition 0..: Any two spnning trs for grph hv th sm numbr of gs. 8. Givn ny two istinct vrtics of tr, thr xists uniqu pth from on to th othr.. Giv n informl justifiction for th bov sttmnt. b. Writ forml proof of th bov sttmnt. g 0 z

16 6 Chptr 0 Grphs n Trs 9. Prov tht if G is grph with spnning tr T n is n g of G tht is not in T, thn th grph obtin by ing to T contins on n only on st of gs tht forms circuit. 0. Suppos G is connct grph n T is circuit-fr subgrph of G. Suppos lso tht if ny g of G not in T is to T, th rsulting grph contins circuit. Prov tht T is spnning tr for G... Suppos T n T r two iffrnt spnning trs for grphg. MustT n T hv n g in common? Prov or giv countrxmpl. b. Suppos tht th grph G in prt () is simpl. Must T n T hv n g in common? Prov or giv countrxmpl. H. Prov tht n g is contin in vry spnning tr for connct grph G if, n only if, rmovl of isconncts G.. Consir th spnning trs T n T in th proof of Thorm 0... Prov tht w(t ) w(t ).. Suppos tht T is minimum spnning tr for connct, wight grph G n tht G contins n g (not loop) tht is not in T.Ltv n w b th npoints of.byxrcis 8 thr is uniqu pth in T from v to w. Lt b ny g of this pth. Prov tht w( ) w(). H Prov tht if G is connct, wight grph n is n g of G (not loop) tht hs smllr wight thn ny othr g of G, thn is in vry minimum spnning tr for G. If G is connct, wight grph n no two gs of G hv th sm wight, os thr xist uniqu minimum spnning tr for G? Us th rsult of xrcis 9 to hlp justify your nswr.. Prov tht if G is connct, wight grph n is n g of G tht () hs grtr wight thn ny othr g of G n () is in circuit of G, thn thr is no minimum spnning tr T for G such tht is in T. 8. Suppos isconnct grph is input to Kruskl s lgorithm. Wht will b th output? 9. Suppos isconnct grph is input to Prim s lgorithm. Wht will b th output? 0. Prov tht if connct, wight grph G is input to Algorithm 0.. (shown blow), th output is minimum spnning tr for G. Algorithm 0.. Input: G [ connct grph] Algorithm Boy:. T := G.. E := th st of ll gs of G, m := th numbr of gs of G.. whil (m > 0). Fin n g in E tht hs mximl wight. b. Rmov from E n st m := m. c. if th subgrph obtin whn is rmov from th g st of T is connct thn rmov from th g st of T n whil Output: T [ minimum spnning tr for G]. Moify Algorithm 0.. so tht th output consists of th squnc of gs in th shortst pth from to z. Answrs for Tst Yourslf. subgrph of G tht contins vry vrtx of G n is tr.. ch g hs n ssocit positiv rl numbr wight; th sum of th wights of ll th gs of th grph. spnning tr tht hs th lst possibl totl wight compr to ll othr spnning trs for th grph. wight; n g of lst wight 5. initil vrtx; jcnt vrtics n gs 6. jcnt to. minimum mong ll thos in th fring

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

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

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

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

Walk Like a Mathematician Learning Task:

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

More information

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

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

Examples and applications on SSSP and MST

Examples and applications on SSSP and MST Exampls an applications on SSSP an MST Dan (Doris) H & Junhao Gan ITEE Univrsity of Qunslan COMP3506/7505, Uni of Qunslan Exampls an applications on SSSP an MST Dijkstra s Algorithm Th algorithm solvs

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

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

# 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

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

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

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

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

Weighted Matching and Linear Programming

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

More information

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

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

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

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

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

ME 522 PRINCIPLES OF ROBOTICS. FIRST MIDTERM EXAMINATION April 19, M. Kemal Özgören

ME 522 PRINCIPLES OF ROBOTICS. FIRST MIDTERM EXAMINATION April 19, M. Kemal Özgören ME 522 PINCIPLES OF OBOTICS FIST MIDTEM EXAMINATION April 9, 202 Nm Lst Nm M. Kml Özgörn 2 4 60 40 40 0 80 250 USEFUL FOMULAS cos( ) cos cos sin sin sin( ) sin cos cos sin sin y/ r, cos x/ r, r 0 tn 2(

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

Lecture 11 Waves in Periodic Potentials Today: Questions you should be able to address after today s lecture:

Lecture 11 Waves in Periodic Potentials Today: Questions you should be able to address after today s lecture: Lctur 11 Wvs in Priodic Potntils Tody: 1. Invrs lttic dfinition in 1D.. rphicl rprsnttion of priodic nd -priodic functions using th -xis nd invrs lttic vctors. 3. Sris solutions to th priodic potntil Hmiltonin

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

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

TOPIC 5: INTEGRATION

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

More information

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

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

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

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

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

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

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

Instructions for Section 1

Instructions for Section 1 Instructions for Sction 1 Choos th rspons tht is corrct for th qustion. A corrct nswr scors 1, n incorrct nswr scors 0. Mrks will not b dductd for incorrct nswrs. You should ttmpt vry qustion. No mrks

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

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

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

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

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

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

More information

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

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

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

SOLVED EXAMPLES. be the foci of an ellipse with eccentricity e. For any point P on the ellipse, prove that. tan

SOLVED EXAMPLES. be the foci of an ellipse with eccentricity e. For any point P on the ellipse, prove that. tan LOCUS 58 SOLVED EXAMPLES Empl Lt F n F th foci of n llips with ccntricit. For n point P on th llips, prov tht tn PF F tn PF F Assum th llips to, n lt P th point (, sin ). P(, sin ) F F F = (-, 0) F = (,

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

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

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

More information

Minimum Spanning Trees

Minimum Spanning Trees Yufi Tao ITEE Univrsity of Qunslan In tis lctur, w will stuy anotr classic prolm: finin a minimum spannin tr of an unirct wit rap. Intrstinly, vn tou t prolm appars ratr iffrnt from SSSP (sinl sourc sortst

More information

The second condition says that a node α of the tree has exactly n children if the arity of its label is n.

The second condition says that a node α of the tree has exactly n children if the arity of its label is n. CS 6110 S14 Hanout 2 Proof of Conflunc 27 January 2014 In this supplmntary lctur w prov that th λ-calculus is conflunt. This is rsult is u to lonzo Church (1903 1995) an J. arkly Rossr (1907 1989) an is

More information

Linear Algebra Existence of the determinant. Expansion according to a row.

Linear Algebra Existence of the determinant. Expansion according to a row. Lir Algbr 2270 1 Existc of th dtrmit. Expsio ccordig to row. W dfi th dtrmit for 1 1 mtrics s dt([]) = (1) It is sy chck tht it stisfis D1)-D3). For y othr w dfi th dtrmit s follows. Assumig th dtrmit

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

Searching Linked Lists. Perfect Skip List. Building a Skip List. Skip List Analysis (1) Assume the list is sorted, but is stored in a linked list.

Searching Linked Lists. Perfect Skip List. Building a Skip List. Skip List Analysis (1) Assume the list is sorted, but is stored in a linked list. 3 3 4 8 6 3 3 4 8 6 3 3 4 8 6 () (d) 3 Sarching Linkd Lists Sarching Linkd Lists Sarching Linkd Lists ssum th list is sortd, but is stord in a linkd list. an w us binary sarch? omparisons? Work? What if

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

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

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

10. EXTENDING TRACTABILITY

10. EXTENDING TRACTABILITY Coping with NP-compltnss 0. EXTENDING TRACTABILITY ining small vrtx covrs solving NP-har problms on trs circular arc covrings vrtx covr in bipartit graphs Q. Suppos I n to solv an NP-complt problm. What

More information

First order differential equation Linear equation; Method of integrating factors

First order differential equation Linear equation; Method of integrating factors First orr iffrntial quation Linar quation; Mtho of intgrating factors Exampl 1: Rwrit th lft han si as th rivativ of th prouct of y an som function by prouct rul irctly. Solving th first orr iffrntial

More information

Oppgavesett kap. 6 (1 av..)

Oppgavesett kap. 6 (1 av..) Oppgvstt kp. 6 (1 v..) hns.brnn@go.uio.no Problm 1 () Wht is homognous nucltion? Why dos Figur 6.2 in th book show tht w won't gt homognous nucltion in th tmosphr? ˆ Homognous nucltion crts cloud droplts

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

Analysis of Algorithms - Elementary graphs algorithms -

Analysis of Algorithms - Elementary graphs algorithms - Analysis of Algorithms - Elmntary graphs algorithms - Anras Ermahl MRTC (Mälaralns Ral-Tim Rsach Cntr) anras.rmahl@mh.s Autumn 00 Graphs Graphs ar important mathmatical ntitis in computr scinc an nginring

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

Analysis of Algorithms - Elementary graphs algorithms -

Analysis of Algorithms - Elementary graphs algorithms - Analysis of Algorithms - Elmntary graphs algorithms - Anras Ermahl MRTC (Mälaralns Ral-Tim Rsarch Cntr) anras.rmahl@mh.s Autumn 004 Graphs Graphs ar important mathmatical ntitis in computr scinc an nginring

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

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

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

CS 491 G Combinatorial Optimization

CS 491 G Combinatorial Optimization CS 49 G Cobinatorial Optiization Lctur Nots Junhui Jia. Maiu Flow Probls Now lt us iscuss or tails on aiu low probls. Thor. A asibl low is aiu i an only i thr is no -augnting path. Proo: Lt P = A asibl

More information

Chem 104A, Fall 2016, Midterm 1 Key

Chem 104A, Fall 2016, Midterm 1 Key hm 104A, ll 2016, Mitrm 1 Ky 1) onstruct microstt tl for p 4 configurtion. Pls numrt th ms n ml for ch lctron in ch microstt in th tl. (Us th formt ml m s. Tht is spin -½ lctron in n s oritl woul writtn

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

CONTINUITY AND DIFFERENTIABILITY

CONTINUITY AND DIFFERENTIABILITY MCD CONTINUITY AND DIFFERENTIABILITY NCERT Solvd mpls upto th sction 5 (Introduction) nd 5 (Continuity) : Empl : Chck th continuity of th function f givn by f() = + t = Empl : Emin whthr th function f

More information

Week 3: Connected Subgraphs

Week 3: Connected Subgraphs Wk 3: Connctd Subgraphs Sptmbr 19, 2016 1 Connctd Graphs Path, Distanc: A path from a vrtx x to a vrtx y in a graph G is rfrrd to an xy-path. Lt X, Y V (G). An (X, Y )-path is an xy-path with x X and y

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

cycle that does not cross any edges (including its own), then it has at least

cycle that does not cross any edges (including its own), then it has at least W prov th following thorm: Thorm If a K n is drawn in th plan in such a way that it has a hamiltonian cycl that dos not cross any dgs (including its own, thn it has at last n ( 4 48 π + O(n crossings Th

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

, between the vertical lines x a and x b. Given a demand curve, having price as a function of quantity, p f (x) at height k is the curve f ( x,

, between the vertical lines x a and x b. Given a demand curve, having price as a function of quantity, p f (x) at height k is the curve f ( x, Clculus for Businss nd Socil Scincs - Prof D Yun Finl Em Rviw vrsion 5/9/7 Chck wbsit for ny postd typos nd updts Pls rport ny typos This rviw sht contins summris of nw topics only (This rviw sht dos hv

More information

Case Study VI Answers PHA 5127 Fall 2006

Case Study VI Answers PHA 5127 Fall 2006 Qustion. A ptint is givn 250 mg immit-rls thophyllin tblt (Tblt A). A wk ltr, th sm ptint is givn 250 mg sustin-rls thophyllin tblt (Tblt B). Th tblts follow on-comprtmntl mol n hv first-orr bsorption

More information

Mathematics 1110H Calculus I: Limits, derivatives, and Integrals Trent University, Summer 2018 Solutions to the Actual Final Examination

Mathematics 1110H Calculus I: Limits, derivatives, and Integrals Trent University, Summer 2018 Solutions to the Actual Final Examination Mathmatics H Calculus I: Limits, rivativs, an Intgrals Trnt Univrsity, Summr 8 Solutions to th Actual Final Eamination Tim-spac: 9:-: in FPHL 7. Brought to you by Stfan B lan k. Instructions: Do parts

More information

Combinatorial Networks Week 1, March 11-12

Combinatorial Networks Week 1, March 11-12 1 Nots on March 11 Combinatorial Ntwors W 1, March 11-1 11 Th Pigonhol Principl Th Pigonhol Principl If n objcts ar placd in hols, whr n >, thr xists a box with mor than on objcts 11 Thorm Givn a simpl

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

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

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

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

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

The Matrix Exponential

The Matrix Exponential Th Matrix Exponntial (with xrciss) by Dan Klain Vrsion 28928 Corrctions and commnts ar wlcom Th Matrix Exponntial For ach n n complx matrix A, dfin th xponntial of A to b th matrix () A A k I + A + k!

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

The Matrix Exponential

The Matrix Exponential Th Matrix Exponntial (with xrciss) by D. Klain Vrsion 207.0.05 Corrctions and commnts ar wlcom. Th Matrix Exponntial For ach n n complx matrix A, dfin th xponntial of A to b th matrix A A k I + A + k!

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

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

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

This chapter covers special properties of planar graphs.

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

More information

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

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

More information

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

Chapter Finding Small Vertex Covers. Extending the Limits of Tractability. Coping With NP-Completeness. Vertex Cover

Chapter Finding Small Vertex Covers. Extending the Limits of Tractability. Coping With NP-Completeness. Vertex Cover Coping With NP-Compltnss Chaptr 0 Extning th Limits o Tractability Q. Suppos I n to solv an NP-complt problm. What shoul I o? A. Thory says you'r unlikly to in poly-tim algorithm. Must sacriic on o thr

More information

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

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

More information

Ch 1.2: Solutions of Some Differential Equations

Ch 1.2: Solutions of Some Differential Equations Ch 1.2: Solutions of Som Diffrntil Equtions Rcll th fr fll nd owl/mic diffrntil qutions: v 9.8.2v, p.5 p 45 Ths qutions hv th gnrl form y' = y - b W cn us mthods of clculus to solv diffrntil qutions of

More information

CS 241 Analysis of Algorithms

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

More information

QUESTIONS BEGIN HERE!

QUESTIONS BEGIN HERE! Points miss: Stunt's Nm: Totl sor: /100 points Est Tnnss Stt Univrsity Dprtmnt 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

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

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