Graphs and Graph Searches

Size: px
Start display at page:

Download "Graphs and Graph Searches"

Transcription

1 Graphs an Graph Sarhs CS 320, Fall 2017 Dr. Gri Gorg, Instrutor 320 Graphs&GraphSarhs 1

2 Stuy Ais Gnral graph nots: Col s Basi Graph Nots.pf (Progrss pag) Dpth first gui: Dpth First Sarh Gui.pf (Progrss pag) Dmonstration wsit: Graphs&GraphSarhs 2

3 Graph Typs irt/unirt? yli/ayli? a a In grs/ a out grs? 320 Graphs&GraphSarhs 3

4 Graph Rprsntations G = (E, V) How shoul w a rprsnt: nos, gs, g attriut, ajany, in/out gr, Possil ata struturs: list, matrix, hash, How muh work: 1) to fin numr of ajant nos? 2) whih nos ar ajant? 3) sink nos? 4) itrat through V, E? 320 Graphs&GraphSarhs 4

5 Graph Typs a Crat an ajany list for this graph, thn an ajany matrix for it. How an you tll how many in grs/out grs for ah no? 320 Graphs&GraphSarhs 5

6 Smantis of Eg Dirtion a Look at g (,) what os th arrow tll you? Now onsir (,). How oul you intrprt it? 320 Graphs&GraphSarhs 6

7 Transposing a Graph to Math a Tak th ajany matrix you rat prviously, an transpos it: A T [i][j] = 1 whn A[j][i] = 1. Now rat th graph G T from this matrix. Compar it to this graph. 320 Graphs&GraphSarhs 7

8 Miro Survy Rsults 1 Whn to hoos ajany matrix vs list? List whn you hav a graph with << n 2 gs (osn t tak Θ(n 2 ) spa lik a matrix; taks O(m + n) spa) List whn you hav an algorithm that has to xamin all gs inint to a no Matrix has O(1) tim to hk if g (u,v) is in th graph; list has follow list at no u; tim is proportional to th gr (in an out) of th no ut an fin nxt no in list in onstant tim 320 Graphs&GraphSarhs 8

9 Miro Survy Rsults 2 Smantis: oms for ( ) an pns on ( ) Us transpos to hang from on to th othr BFS rath first sarh (fins shortst path from sour to all nos it an rah) Symol NIL or NULL Colors us to show whih nos hav n isovr, ar ing work on, or ar finish Uss a quu nquu an quu Masur of progrss if thr ar nos in th quu (nos with gs to pross) 320 Graphs&GraphSarhs 9

10 Brath First Sarh of a graph W n: V, Aj, Quu For ah vrtx u: s (# gs to gt to u from s: ), (prssor of u: ), olor (whit, g gray, lak: w) Visit all nos in a rath first way an uil a rath first tr of shortst paths (u.) from s to ah no (via u. ). f 320 Graphs&GraphSarhs 10

11 Aj={ s: [,, g] : [, ] : [, f] : [, s] : [, ] f: [] g: []} Num gs m = 13 Brath First Data No info: u ol s w w w w w f w g w s g V ={s,,,,, f, g} Num nos n = 7 f 320 Graphs&GraphSarhs 11

12 for ah u G.V {s} u. = whit, u. =, u. = s. = gray, s. = 0 Q = ENQUEUE (Q,s) whil Q u= DEQUEUE (Q) for ah v G.Aj[u] if v.olor == whit v.olor = gray v. = u. + 1 v. = u ENQUEUE (Q,v) u.olor = lak Brath First Algorithm 320 Graphs&GraphSarhs 12

13 for ah u G.V {s} u. = whit, u. =, u. = s. = gray, s. = 0 Q = ENQUEUE (Q,s) whil Q u= DEQUEUE (Q) for ah v G.Aj[u] if v.olor == whit v.olor = gray v. = u. + 1 v. = u ENQUEUE (Q,v) u.olor = lak s g f u aj s,,g w, w,f w,s w, w f w g w 320 Graphs&GraphSarhs 13

14 for ah u G.V {s} u. = whit, u. =, u. = s. = gray, s. = 0 Q = ENQUEUE (Q,s) whil Q u= DEQUEUE (Q) for ah v G.Aj[u] if v.olor == whit v.olor = gray v. = u. + 1 v. = u ENQUEUE (Q,v) u.olor = lak Q = {s} s Q = { } s g f u aj s,,g w g 0 X, w,f w,s w, w f w g w 320 Graphs&GraphSarhs 14

15 for ah u G.V {s} u. = whit, u. =, u. = s. = gray, s. = 0 Q = ENQUEUE (Q,s) whil Q u= DEQUEUE (Q) for ah v G.Aj[u] if v.olor == whit v.olor = gray v. = u. + 1 v. = u ENQUEUE (Q,v) u.olor = lak Q = {s} s Q = { } Q = {} s g f u aj s,,g w g 0 X X, wg 1 s,f w,s w, w f w g w 320 Graphs&GraphSarhs 15

16 for ah u G.V {s} u. = whit, u. =, u. = s. = gray, s. = 0 Q = ENQUEUE (Q,s) whil Q u= DEQUEUE (Q) for ah v G.Aj[u] if v.olor == whit v.olor = gray v. = u. + 1 v. = u ENQUEUE (Q,v) u.olor = lak Q = {s} s Q = { } Q = {,} s g f u aj s,,g w g 0 X X, wg 1 s,f w,s w, wg 1 s X f w g w 320 Graphs&GraphSarhs 16

17 for ah u G.V {s} u. = whit, u. =, u. = s. = gray, s. = 0 Q = ENQUEUE (Q,s) whil Q u= DEQUEUE (Q) for ah v G.Aj[u] if v.olor == whit v.olor = gray v. = u. + 1 v. = u ENQUEUE (Q,v) u.olor = lak Q = {s} s Q = { } Q = {,,g} s g f u aj s,,g w g 0 X X, wg 1 s,f w,s w, wg 1 s X f w g wg 1 s X 320 Graphs&GraphSarhs 17

18 Brath First Algo Rsults v aj ol s,,g w g 0 X, w g 1 X s X X X,f w g 2 XX X,s w X Xg X 2 X, w g 1 X s X X f w g X 3 X X g w g X 1 X s X X X X X X s g f s g f Complxity? Do you always hav to hk all nos? All gs? 320 Graphs&GraphSarhs 18

19 for ah u G.V {s} u. = whit, u. =, u. = s. = gray, s. = 0 Q = ENQUEUE (Q,s) whil Q u= DEQUEUE (Q) for ah v G.Aj[u] if v.olor == whit v.olor = gray v. = u. + 1 v. = u ENQUEUE (Q,v) u.olor = lak Brath First Algorithm 320 Graphs&GraphSarhs 19

20 Dpth First Sarh of a graph Works with graphs that hav isonnt parts Basis of othr algorithms (.g. topologial sort, omposing a irt graph into strongly onnt omponnts) 320 Graphs&GraphSarhs 23

21 Dpth First Sarh of a graph Sarhs all vrtis, uss olor gray whn starting a no, lak s aftr all aj nos pross. tims from gray (isovr tim) to lak (finish tim). Disovr tim olor tlls aout strutur. Visit all nos in a pth first way an uil a forst of pth first trs. 320 Graphs&GraphSarhs 24

22 Miro Survy Rsults 1 How to trmin omplxity for BFS, graph algos why not just stat th worst as of omplt intronntivity? Complxity has to o with how an algorithm prforms in th worst as, ut this is usually ovrkill if w think of th worst as graph with omplt intronntivity an only talk aout it in trms of th numr of nos. So y onvntion w talk aout how a graph prforms with rspt to th input sts of nos an gs. Thrfor whil w oul say that omplxity is O(n 2 ), it is atually mor pris to say it is O( V + E ). Not that talking aout it this way also shows that w hav a linar omplxity in ths trms. In fat th BFS algorithm rally is linar w pross all nos on to initializ it, an thn all th onnt gs on. 320 Graphs&GraphSarhs 25

23 Miro Survy Rsults 2 DFS why is th tim varial t twn 1 an 2 V? Dosn t th olor hang to whit an you only visit th no on? Ys, ut th tim varial is not how many tims you visit th no, it is how many nos you visit whil you ar working on th no. If you look at th DFS algo, tim gts inrmnt whn w isovr th no (mak it gray), an thn whn w r on with it (mak it lak). Thrfor t is inrmnt 2 tim for ah no, so its maximum valu is 2 V. Also rmmr w hk vry singl no in DFS. 320 Graphs&GraphSarhs 26

24 Miro Survy Rsults 3 How o you trmin omplxity with graph algorithms? First, think of input siz ing in trms of th sizs of th sts V an E, th no/vrtis an gs. Nxt, stuy th algorithm to s how th sizs of ths sts afft it. Dos DFS rturn th shortst path to a no? No. W ll s this in ation in th graph worksht nxt wk. 320 Graphs&GraphSarhs 27

25 DFS Algorithm tim = 0; for u V if u.olor == whit; fsvisit(u) fsvisit tim = tim + 1; u.isovr = tim ; u.olor gray for v u.aj if v.olor == whit v. = u; fsvisit(v) u.olor = lak; t = tim +1; u.finish = tim 320 Graphs&GraphSarhs 28

26 tim = 0; s for u V if u.olor == whit; fsvisit(u) fsvisit tim = tim + 1; u.isovr = tim ; u.olor gray for v u.aj if v.olor == whit v. = u; fsvisit(v) u.olor = lak; t = tim +1; u.finish = tim In your groups, figur out th rang of intgr tim valus for th graph. Now figur this out for any graph G = (V, E) 320 Graphs&GraphSarhs 29

27 tim = 0; s for u V if u.olor == whit; fsvisit(u) fsvisit tim = tim + 1; u.isovr = tim ; u.olor gray for v u.aj if v.olor == whit v. = u; fsvisit(v) u.olor = lak; t = tim +1; u.finish = tim What is th oun on th work that has to on y th algorithm? This tim you an us V an E to man th sizs of th sts. 320 Graphs&GraphSarhs 31

28 tim = 0; s for u V if u.olor == whit; fsvisit(u) fsvisit tim = tim + 1; u.isovr = tim ; u.olor gray for v u.aj if v.olor == whit v. = u; fsvisit(v) u.olor = lak; t = tim +1; u.finish = tim 320 Graphs&GraphSarhs 33

29 No Color at Disovr Tim s Bak Forwar Cross Tr Color of v whn w xplor (u,v): Whit tr g Gray ak g Blak forwar or ross g 320 Graphs&GraphSarhs 34

30 s Tr g: Bak g: Forwar g: Cross g: Rrawn with all tr, forwar gs going own, ak gs going up. 320 Graphs&GraphSarhs 35

31 Topologial Sort Usful for prolms suh as jo shuling, projt ritial path analysis, orr of ompilation tasks, whih orr to loa forign kys in ataass, ata srialization, Graph must irt, ayli (DAG) Linar orring of all vrtis suh that if an g (u,v) xists, thn vrtx u appars for vrtx v in th orring Shows prn among vrtis Uss a DFS to omput finish tims for ah vrtx Insrts ah vrtx into th front of a link list as it is finish 320 Graphs&GraphSarhs 36

32 A:gt atgoris B:sort into atgoris M:stalish gri C:photograph L:rat sription D:a to DB N:gt voluntrs, K:ig quipmnt E:rsarh J:ollt artifats F:intrprt I:stor H:lan G:sn for analysis P:ag O:masur, ror, map Q:akfill R:a provnin 320 Graphs&GraphSarhs 37

33 C F A D E B L I H J K P M O N Q G R 320 Graphs&GraphSarhs 38

34 C F A D E I H B L J K M N O P Q Topologial sort Call DFS to omput v.f for ah vrtx v As ah vrtx is finish insrt it into th front of a link list Rturn th link list G R 320 Graphs&GraphSarhs 39

35 In liu of ritations 320 Offi Hours Mon Tu W Thurs Fri 8 Col 9 Dr. Gorg Dr. Gorg 10 Dr. Gorg/ Jim 11 Ali Jim 12 Col Ali 1 Col/ Ali Shannon 2 Shannon 3 Dr. Gorg Dr. Gorg 4 Upoming Chk Progrss pag, Piazza postings for upats Graph worksht: Wnsay 320 Graphs&GraphSarhs 40 Topologial sort program u Ot 28

36 a l l f f k j g f m k j o o q j p p h h i p r n k C F A D E B L I H G J K M N O P Q R a l l f f g f m k k j j o o q j p p h h i p r n k ['n', 'm', 'g', 'k', 'j', 'p', 'r', 'h', 'i', 'o', 'q', '', '', 'a', '', 'l', '', 'f'] ['n', 'm', 'k', 'j', 'p', 'r', 'h', 'i', 'o', 'q', 'g', '', '', 'a', '', 'l', '', 'f'] 320 Graphs&GraphSarhs 41

37 BFS of all 16.8 M possil olors in th 24 it RGB olor spa. (Python o on wsit.) 320 Graphs&GraphSarhs 42

38 Strongly Connt Componnts Strongly Connt: a maximal st of vrtis whr all vrtx pairs in th omponnt ar somhow onnt Implis a yl must xist Uss DFS to ompos a irt graph Many algorithms ompos, thn work on omponnts sparatly an thn omin solutions aoring to strutur among omponnts 320 Graphs&GraphSarhs 43

39 Dtrmining SCCs Algorithm prforms DFS on a graph, thn DFS on its transpos. Th first DFS intifis groups of nos that w liv ar strongly onnt, an th son an thought of as vrifying that othr nos in th graph ar in not part of this sam omponnt. Aftr intifying all th strongly onnt omponnts in th graph, w an ollaps ah into a singl no an w n up with a DAG. 320 Graphs&GraphSarhs 44

40 Givn this graph: a f g 320 Graphs&GraphSarhs 45

41 Givn this graph: a f g In your groups, figur out whih nos ar strongly onnt. 320 Graphs&GraphSarhs 46

42 Givn this graph: a f g In your groups, figur out whih nos ar strongly onnt. Now ontrat all gs until only 1 no rmains in ah omponnt an raw th gs to otain a DAG. 320 Graphs&GraphSarhs 47

43 a f g Strongly onnt omponnts a f g Ayli omponnt graph G SCC 320 Graphs&GraphSarhs 48

44 SCC Algorithm Strongly Connt Componnts (G) 1. Call DFS(G) to omput th finish tims of ah vrtx u V, u.f 2. Comput G T 3. Call DFS(G T ), ut in th main loop, onsir th vrtis in rasing orr of u.f 4. Output th vrtis of ah tr in th pth first forst; ah tr is a sparat SCC 320 Graphs&GraphSarhs 51

45 SCC Algorithm Analysis 1 Assum w hav an ajany list for G. How muh work has to on to rat G T? a f g h Can you think of a way to o this linarly? g, g f, h f g h h h,, f, a, f a 320 Graphs&GraphSarhs 52

46 SCC Algorithm Analysis 2 Strongly Connt Componnts (G) Call DFS(G) to gt u.f for all u V v_or = all u V y rasing u.f Comput G T Call DFS(G T ) using v_or orring Output th vrtis of ah tr in th pthfirst forst; ah tr is a sparat SCC What is th total work for this algorithm? 320 Graphs&GraphSarhs 53

47 a f Strongly Connt Componnts (G) Call DFS(G) to gt u.f for all u V v_or = all u V y rasing u.f Comput G T Call DFS(G T ) using v_or orring g h g f h a g, f, h g h h,, f, a, f Output th vrtis of ah tr in th pth first forst; ah tr is a sparat SCC 320 Graphs&GraphSarhs 54

48 G 13/14 11/16 1/10 8/9 a f 12/15 3/4 2/7 5/6 v_or =,, a,,, g, h, f g h 320 Graphs&GraphSarhs 55

49 Conntions What hav w rntly n stuying that an hlp gnrat this orring? How os it iffr from what w r trying to o now? 320 Graphs&GraphSarhs 56

50 G T a f v_or =,, a,,, g, h, f SCC ALGORITHM ontinu. Call DFS(G T ) using v_or orring g h g f h a, f, g,, h, g, Output th vrtis of ah tr in th pth first forst; ah tr is a sparat SCC a 320 Graphs&GraphSarhs 57

51 G T 2/5 1/6 a f 3/4 12/13 7/10 8/9 g h 11/14 15/16 g f h a, f, g,, h, g, a 320 Graphs&GraphSarhs 58

52 G T 2/5 1/6 a f 3/4 12/13 7/10 8/9 g h 11/14 15/16 g f h a, f, g,, h, g, a 320 Graphs&GraphSarhs 59

53 G T 2/5 1/6 a f 3/4 12/13 7/10 8/9 g h 11/14 15/16 g f h a, f, g,, h, g, a 320 Graphs&GraphSarhs 60

54 Bak to G SCC a gf h Go ak to th original G an ontrat all th gs in ah strongly onnt omponnt until thr is just 1 vrtx. Rtain th gs onnting omponnts. 320 Graphs&GraphSarhs 61

55 Imag Crits lugolpia: funtional moluls Voronoi: olumn/far voronoi RGBolorSpa: hilrt urvs an ranom spanning trs/ 320 Graphs&GraphSarhs 62

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

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

V={A,B,C,D,E} E={ (A,D),(A,E),(B,D), (B,E),(C,D),(C,E)} s s of s Computr Sin & Enginring 423/823 Dsign n Anlysis of Ltur 03 (Chptr 22) Stphn Sott (Apt from Vinohnrn N. Vriym) s of s s r strt t typs tht r pplil to numrous prolms Cn ptur ntitis, rltionships twn

More information

CS 241 Analysis of Algorithms

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

More information

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

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

CS553 Lecture Register Allocation I 3

CS553 Lecture Register Allocation I 3 Low-Lvl Issus Last ltur Intrproural analysis Toay Start low-lvl issus Rgistr alloation Latr Mor rgistr alloation Instrution shuling CS553 Ltur Rgistr Alloation I 2 Rgistr Alloation Prolm Assign an unoun

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

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

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

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

Solutions to Homework 5

Solutions to Homework 5 Solutions to Homwork 5 Pro. Silvia Frnánz Disrt Mathmatis Math 53A, Fall 2008. [3.4 #] (a) Thr ar x olor hois or vrtx an x or ah o th othr thr vrtis. So th hromati polynomial is P (G, x) =x (x ) 3. ()

More information

Strongly Connected Components

Strongly Connected Components Strongly Connctd Componnts Lt G = (V, E) b a dirctd graph Writ if thr is a path from to in G Writ if and is an quivalnc rlation: implis and implis s quivalnc classs ar calld th strongly connctd componnts

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

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

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

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

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

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

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

Algorithmic and NP-Completeness Aspects of a Total Lict Domination Number of a Graph

Algorithmic and NP-Completeness Aspects of a Total Lict Domination Number of a Graph Intrntionl J.Mth. Comin. Vol.1(2014), 80-86 Algorithmi n NP-Compltnss Aspts of Totl Lit Domintion Numr of Grph Girish.V.R. (PES Institut of Thnology(South Cmpus), Bnglor, Krntk Stt, Ini) P.Ush (Dprtmnt

More information

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

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

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

More information

Math 61 : Discrete Structures Final Exam Instructor: Ciprian Manolescu. You have 180 minutes.

Math 61 : Discrete Structures Final Exam Instructor: Ciprian Manolescu. You have 180 minutes. Nm: UCA ID Numr: Stion lttr: th 61 : Disrt Struturs Finl Exm Instrutor: Ciprin nolsu You hv 180 minuts. No ooks, nots or lultors r llow. Do not us your own srth ppr. 1. (2 points h) Tru/Fls: Cirl th right

More information

CS200: Graphs. Graphs. Directed Graphs. Graphs/Networks Around Us. What can this represent? Sometimes we want to represent directionality:

CS200: Graphs. Graphs. Directed Graphs. Graphs/Networks Around Us. What can this represent? Sometimes we want to represent directionality: CS2: Grphs Prihr Ch. 4 Rosn Ch. Grphs A olltion of nos n gs Wht n this rprsnt? n A omputr ntwork n Astrtion of mp n Soil ntwork CS2 - Hsh Tls 2 Dirt Grphs Grphs/Ntworks Aroun Us A olltion of nos n irt

More information

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

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

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

Steinberg s Conjecture is false

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

More information

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

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

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

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

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

Weighted graphs -- reminder. Data Structures LECTURE 15. Shortest paths algorithms. Example: weighted graph. Two basic properties of shortest paths

Weighted graphs -- reminder. Data Structures LECTURE 15. Shortest paths algorithms. Example: weighted graph. Two basic properties of shortest paths Dt Strutur LECTURE Shortt pth lgorithm Proprti of hortt pth Bllmn-For lgorithm Dijktr lgorithm Chptr in th txtook (pp ). Wight grph -- rminr A wight grph i grph in whih g hv wight (ot) w(v i, v j ) >.

More information

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

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

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

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

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

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

Junction Tree Algorithm 1. David Barber

Junction Tree Algorithm 1. David Barber Juntion Tr Algorithm 1 David Barbr Univrsity Collg London 1 Ths slids aompany th book Baysian Rasoning and Mahin Larning. Th book and dmos an b downloadd from www.s.ul.a.uk/staff/d.barbr/brml. Fdbak and

More information

N1.1 Homework Answers

N1.1 Homework Answers Camrig Essntials Mathmatis Cor 8 N. Homwork Answrs N. Homwork Answrs a i 6 ii i 0 ii 3 2 Any pairs of numrs whih satisfy th alulation. For xampl a 4 = 3 3 6 3 = 3 4 6 2 2 8 2 3 3 2 8 5 5 20 30 4 a 5 a

More information

MA1506 Tutorial 2 Solutions. Question 1. (1a) 1 ) y x. e x. 1 exp (in general, Integrating factor is. ye dx. So ) (1b) e e. e c.

MA1506 Tutorial 2 Solutions. Question 1. (1a) 1 ) y x. e x. 1 exp (in general, Integrating factor is. ye dx. So ) (1b) e e. e c. MA56 utorial Solutions Qustion a Intgrating fator is ln p p in gnral, multipl b p So b ln p p sin his kin is all a Brnoulli quation -- st Sin w fin Y, Y Y, Y Y p Qustion Dfin v / hn our quation is v μ

More information

COMPLEXITY OF COUNTING PLANAR TILINGS BY TWO BARS

COMPLEXITY OF COUNTING PLANAR TILINGS BY TWO BARS OMPLXITY O OUNTING PLNR TILINGS Y TWO RS KYL MYR strt. W show tht th prolm o trmining th numr o wys o tiling plnr igur with horizontl n vrtil r is #P-omplt. W uil o o th rsults o uquir, Nivt, Rmil, n Roson

More information

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

AP Calculus BC Problem Drill 16: Indeterminate Forms, L Hopital s Rule, & Improper Intergals

AP Calculus BC Problem Drill 16: Indeterminate Forms, L Hopital s Rule, & Improper Intergals AP Calulus BC Problm Drill 6: Indtrminat Forms, L Hopital s Rul, & Impropr Intrgals Qustion No. of Instrutions: () Rad th problm and answr hois arfully () Work th problms on papr as ndd () Pik th answr

More information

Addition of angular momentum

Addition of angular momentum Addition of angular momntum April, 0 Oftn w nd to combin diffrnt sourcs of angular momntum to charactriz th total angular momntum of a systm, or to divid th total angular momntum into parts to valuat th

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

Kernels. ffl A kernel K is a function of two objects, for example, two sentence/tree pairs (x1; y1) and (x2; y2)

Kernels. ffl A kernel K is a function of two objects, for example, two sentence/tree pairs (x1; y1) and (x2; y2) Krnls krnl K is a function of two ojcts, for xampl, two sntnc/tr pairs (x1; y1) an (x2; y2) K((x1; y1); (x2; y2)) Intuition: K((x1; y1); (x2; y2)) is a masur of th similarity (x1; y1) twn (x2; y2) an ormally:

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

L I R M M O N T P E L L I E R

L I R M M O N T P E L L I E R L I R M M O N T P E L L I E R Laoratoir 'Informatiqu, Rootiqu t Miroltroniqu Montpllir Unit Mixt CNRS - Univrsit Montpllir II C 0998 ' Rapport Rhrh $ Maximal Inlusion Sarh: A nw algorithm for horal graphs

More information

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

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

More information

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

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

(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

Addition of angular momentum

Addition of angular momentum Addition of angular momntum April, 07 Oftn w nd to combin diffrnt sourcs of angular momntum to charactriz th total angular momntum of a systm, or to divid th total angular momntum into parts to valuat

More information

Final Exam Solutions

Final Exam Solutions CS 2 Advancd Data Structurs and Algorithms Final Exam Solutions Jonathan Turnr /8/20. (0 points) Suppos that r is a root of som tr in a Fionacci hap. Assum that just for a dltmin opration, r has no childrn

More information

3 2x. 3x 2. Prepared by Vince Zaccone For Campus Learning Assistance Services at UCSB

3 2x. 3x 2.   Prepared by Vince Zaccone For Campus Learning Assistance Services at UCSB Math B Intgration Rviw (Solutions) Do ths intgrals. Solutions ar postd at th wbsit blow. If you hav troubl with thm, sk hlp immdiatly! () 8 d () 5 d () d () sin d (5) d (6) cos d (7) d www.clas.ucsb.du/staff/vinc

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

Linked-List Implementation. Linked-lists for two sets. Multiple Operations. UNION Implementation. An Application of Disjoint-Set 1/9/2014

Linked-List Implementation. Linked-lists for two sets. Multiple Operations. UNION Implementation. An Application of Disjoint-Set 1/9/2014 Disjoint Sts Data Strutur (Chap. 21) A disjoint-st is a olltion ={S 1, S 2,, S k } o distint dynami sts. Eah st is idntiid by a mmbr o th st, alld rprsntativ. Disjoint st oprations: MAKE-SET(x): rat a

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

a 1and x is any real number.

a 1and x is any real number. Calcls Nots Eponnts an Logarithms Eponntial Fnction: Has th form y a, whr a 0, a an is any ral nmbr. Graph y, Graph y ln y y Th Natral Bas (Elr s nmbr): An irrational nmbr, symboliz by th lttr, appars

More information

Case Study Vancomycin Answers Provided by Jeffrey Stark, Graduate Student

Case Study Vancomycin Answers Provided by Jeffrey Stark, Graduate Student Cas Stuy Vancomycin Answrs Provi by Jffry Stark, Grauat Stunt h antibiotic Vancomycin is liminat almost ntirly by glomrular filtration. For a patint with normal rnal function, th half-lif is about 6 hours.

More information

The van der Waals interaction 1 D. E. Soper 2 University of Oregon 20 April 2012

The van der Waals interaction 1 D. E. Soper 2 University of Oregon 20 April 2012 Th van dr Waals intraction D. E. Sopr 2 Univrsity of Orgon 20 pril 202 Th van dr Waals intraction is discussd in Chaptr 5 of J. J. Sakurai, Modrn Quantum Mchanics. Hr I tak a look at it in a littl mor

More information

Homework #3. 1 x. dx. It therefore follows that a sum of the

Homework #3. 1 x. dx. It therefore follows that a sum of the Danil Cannon CS 62 / Luan March 5, 2009 Homwork # 1. Th natural logarithm is dfind by ln n = n 1 dx. It thrfor follows that a sum of th 1 x sam addnd ovr th sam intrval should b both asymptotically uppr-

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

Edge-Triggered D Flip-flop. Formal Analysis. Fundamental-Mode Sequential Circuits. D latch: How do flip-flops work?

Edge-Triggered D Flip-flop. Formal Analysis. Fundamental-Mode Sequential Circuits. D latch: How do flip-flops work? E-Trir D Flip-Flop Funamntal-Mo Squntial Ciruits PR A How o lip-lops work? How to analys aviour o lip-lops? R How to sin unamntal-mo iruits? Funamntal mo rstrition - only on input an an at a tim; iruit

More information

Additional Math (4047) Paper 2 (100 marks) y x. 2 d. d d

Additional Math (4047) Paper 2 (100 marks) y x. 2 d. d d Aitional Math (07) Prpar b Mr Ang, Nov 07 Fin th valu of th constant k for which is a solution of th quation k. [7] Givn that, Givn that k, Thrfor, k Topic : Papr (00 marks) Tim : hours 0 mins Nam : Aitional

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

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

Multiple Short Term Infusion Homework # 5 PHA 5127

Multiple Short Term Infusion Homework # 5 PHA 5127 Multipl Short rm Infusion Homwork # 5 PHA 527 A rug is aministr as a short trm infusion. h avrag pharmacokintic paramtrs for this rug ar: k 0.40 hr - V 28 L his rug follows a on-compartmnt boy mol. A 300

More information

LR(0) Analysis. LR(0) Analysis

LR(0) Analysis. LR(0) Analysis LR() Analysis LR() Conlicts: Introuction Whn constructing th LR() analysis tal scri in th prvious stps, it has not n possil to gt a trministic analysr, caus thr ar svral possil actions in th sam cll. I

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

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

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

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

( ) Differential Equations. Unit-7. Exact Differential Equations: M d x + N d y = 0. Verify the condition

( ) Differential Equations. Unit-7. Exact Differential Equations: M d x + N d y = 0. Verify the condition Diffrntial Equations Unit-7 Eat Diffrntial Equations: M d N d 0 Vrif th ondition M N Thn intgrat M d with rspt to as if wr onstants, thn intgrat th trms in N d whih do not ontain trms in and quat sum of

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

Y 0. Standing Wave Interference between the incident & reflected waves Standing wave. A string with one end fixed on a wall

Y 0. Standing Wave Interference between the incident & reflected waves Standing wave. A string with one end fixed on a wall Staning Wav Intrfrnc btwn th incint & rflct wavs Staning wav A string with on n fix on a wall Incint: y, t) Y cos( t ) 1( Y 1 ( ) Y (St th incint wav s phas to b, i.., Y + ral & positiv.) Rflct: y, t)

More information

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

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

More information

VTU NOTES QUESTION PAPERS NEWS RESULTS FORUMS

VTU NOTES QUESTION PAPERS NEWS RESULTS FORUMS Diffrntial Equations Unit-7 Eat Diffrntial Equations: M d N d 0 Vrif th ondition M N Thn intgrat M d with rspt to as if wr onstants, thn intgrat th trms in N d whih do not ontain trms in and quat sum of

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

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

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

More information

Outlines: Graphs Part-4. Applications of Depth-First Search. Directed Acyclic Graph (DAG) Generic scheduling problem.

Outlines: Graphs Part-4. Applications of Depth-First Search. Directed Acyclic Graph (DAG) Generic scheduling problem. Outlins: Graps Part-4 Applications o DFS Elmntary Grap Aloritms Topoloical Sort o Dirctd Acyclic Grap Stronly Connctd Componnts PART-4 1 2 Applications o Dpt-First Sarc Topoloical Sort: Usin dpt-irst sarc

More information

UNTYPED LAMBDA CALCULUS (II)

UNTYPED LAMBDA CALCULUS (II) 1 UNTYPED LAMBDA CALCULUS (II) RECALL: CALL-BY-VALUE O.S. Basic rul Sarch ruls: (\x.) v [v/x] 1 1 1 1 v v CALL-BY-VALUE EVALUATION EXAMPLE (\x. x x) (\y. y) x x [\y. y / x] = (\y. y) (\y. y) y [\y. y /

More information

CS 103 BFS Alorithm. Mark Redekopp

CS 103 BFS Alorithm. Mark Redekopp CS 3 BFS Aloritm Mrk Rkopp Brt-First Sr (BFS) HIGHLIGHTED ALGORITHM 3 Pt Plnnin W'v sn BFS in t ontxt o inin t sortst pt trou mz? S?? 4 Pt Plnnin W xplor t 4 niors s on irtion 3 3 3 S 3 3 3 3 3 F I you

More information

10/30/12. Today. CS/ENGRD 2110 Object- Oriented Programming and Data Structures Fall 2012 Doug James. DFS algorithm. Reachability Algorithms

10/30/12. Today. CS/ENGRD 2110 Object- Oriented Programming and Data Structures Fall 2012 Doug James. DFS algorithm. Reachability Algorithms 0/0/ CS/ENGRD 0 Ojt- Orint Prormmin n Dt Strutur Fll 0 Dou Jm Ltur 9: DFS, BFS & Shortt Pth Toy Rhility Dpth-Firt Srh Brth-Firt Srh Shortt Pth Unwiht rph Wiht rph Dijktr lorithm Rhility Alorithm Dpth Firt

More information

From Elimination to Belief Propagation

From Elimination to Belief Propagation School of omputr Scinc Th lif Propagation (Sum-Product lgorithm Probabilistic Graphical Modls (10-708 Lctur 5, Sp 31, 2007 Rcptor Kinas Rcptor Kinas Kinas X 5 ric Xing Gn G T X 6 X 7 Gn H X 8 Rading: J-hap

More information

Evans, Lipson, Wallace, Greenwood

Evans, Lipson, Wallace, Greenwood Camrig Snior Mathmatial Mthos AC/VCE Units 1& Chaptr Quaratis: Skillsht C 1 Solv ah o th ollowing or x: a (x )(x + 1) = 0 x(5x 1) = 0 x(1 x) = 0 x = 9x Solv ah o th ollowing or x: a x + x 10 = 0 x 8x +

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

Problem 22: Journey to the Center of the Earth

Problem 22: Journey to the Center of the Earth Problm : Journy to th Cntr of th Earth Imagin that on drilld a hol with smooth sids straight through th ntr of th arth If th air is rmod from this tub (and it dosn t fill up with watr, liquid rok, or iron

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

Unit 6: Solving Exponential Equations and More

Unit 6: Solving Exponential Equations and More Habrman MTH 111 Sction II: Eonntial and Logarithmic Functions Unit 6: Solving Eonntial Equations and Mor EXAMPLE: Solv th quation 10 100 for. Obtain an act solution. This quation is so asy to solv that

More information

Where k is either given or determined from the data and c is an arbitrary constant.

Where k is either given or determined from the data and c is an arbitrary constant. Exponntial growth and dcay applications W wish to solv an quation that has a drivativ. dy ky k > dx This quation says that th rat of chang of th function is proportional to th function. Th solution is

More information

Section 11.6: Directional Derivatives and the Gradient Vector

Section 11.6: Directional Derivatives and the Gradient Vector Sction.6: Dirctional Drivativs and th Gradint Vctor Practic HW rom Stwart Ttbook not to hand in p. 778 # -4 p. 799 # 4-5 7 9 9 35 37 odd Th Dirctional Drivativ Rcall that a b Slop o th tangnt lin to th

More information

Summer Reading Activities!

Summer Reading Activities! HOOT FLUSH SCAT CHOMP From Bstslling Author Summr Rading Activitis! Flush Word Find Can you find all 14 words in th puzzl blow? S W I M E N J L P H S P A R R D A Z A G A Z E I B H O T L V S C N U D H I

More information

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

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

More information

Topic review Topic 9: Undirected graphs and networks

Topic review Topic 9: Undirected graphs and networks Topi rviw Topi 9: Undirtd graphs and ntworks Multipl hoi Qustions 1 and 2 rfr to th ntwork shown. 1. Th sum of th dgrs of all th vrtis in th ntwork is: A 5 B 10 C 12 D 13 E 14 2. Th list of dgs an writtn

More information

NP-Completeness. CS3230 (Algorithm) Traveling Salesperson Problem. What s the Big Deal? Given a Problem. What s the Big Deal? What s the Big Deal?

NP-Completeness. CS3230 (Algorithm) Traveling Salesperson Problem. What s the Big Deal? Given a Problem. What s the Big Deal? What s the Big Deal? NP-Compltnss 1. Polynomil tim lgorithm 2. Polynomil tim rution 3.P vs NP 4.NP-ompltnss (som slis y P.T. Um Univrsity o Txs t Dlls r us) Trvling Slsprson Prolm Fin minimum lngth tour tht visits h ity on

More information

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