Graphs and Trees
Graphs and Trees
| Prefte Muttgsiann : A wultqraph G =o SE ee ET LPN at seth Bs ee lore A graph Gwith on HeSte no 2 1 Verte Vv wult aurutaticaly have a = | ~——__|_#efie no 34 sages ond so aut 66 —— ie gf ia aes ee a aS —3 fo one verttx 2 no edad” } Hi > { Euipry /Nuu) Graph | THe empty raph Ua, J graph with no vertex sy no edge Tsolaxd vertex: a vertex \v' u uoladead cue doel Not belong ro any edge - y q ‘ | Adjoecancy 2 traiwentt ca & graph | | Suppose thot e= e0jv} U on edge 'o @. be-O2v ane end poinH oe. then te vertex UU said to be adjacent to Hu vertex V, 2 te edge 'e' Ub said tobe rncuident on VU 2 onv. a Pegwee Bf oO ae eeauhe deq ree 6f a vertey pba gre8ip OSL) Sega anon tee Hu nuwser EA edgek which aye ON AION | OO PENS words, He nu edget whick contain v ag an en | Notes The vertex 'v’ is casg accord’ nc Cv) U even oBr [RS ee aa ae serene rere ep Theosieuf > The ‘sum af ud _deqseel of tue vert cura a gioph U equal to tof we number of edge Z >) Broce dn a graph every edge will be counted twict _— t sinc each edge Uoingident to two vertiw: Thexfor, suum eA dequa e{ vert b= 2% Nd . 6 edged: v t Z Nott: Th thtorey hold for a wultiara ph: aa at) Consider tus graph G= GOvye) in Hu given Figuet : (a) Debesse G torurotty te) Frond tee deqree and parity each vertex - (e> Meady thot the suw deg wees of Hy verted ef cS qr aph u ae ee cs he pu 2. aa ae 2 b ee 3) vertut (a,b gideh=¥ tolgtl — (4 edged) € = Clojeds Carct, Ladt, AND Coal, {6,405 tere }] + a deqcad= 3 deg ce) =3 , deqCe)=4, degeg\ 22, deqCe) =m hanifp v7 OY 4 ‘ Thuk Gad» and @ one che eae 4 ag bax odd . vot ©) enema deqreed oe verti cl = seg Ca) 4 equ) 4+ seq CO + degca) + Seed) = 84 Begg ota = 14 Hey no. edgeb= => 2 Sum verted = 1% fp el edepel z Hence t¥ stat ent” |Sowastpliouy between vo auaph * A asia GH = & SRR +o be otworphic to a graph G, = oa 6) a ita celular (yan Givent ue al Glee Such that U usu,eMi7 then Hr .0um ber edged fo®aing Uy, dy in Gi same od — edged jorning #064) A#CYs) ia particula Wourosephil ut ee oe Sed uted ad acency > a 2 verhad : — : xp e a teala1, hee y 8) Eke fie)ats Show thot 44 Rouben graph Ga 4G, axe Uowrorpic- =. Mi salle),tage Ea bohe—l—arr—rrot throat —telse - we Can Also solve Glee s stow 1) tt function # uo bffection from VCGn) £0 VCG,) (itt PHEW | ods aden ory vertiud 2 their adfacency Watwied AE édenticdl - Vi a Vac Vax) 1014 tak week Lol Volos Oo t I 03510 vg [| LB Or OmesOF KO, Veag [+ O: MD" 510) 53 0 ew | Jal Vaipob x2 yovO wae Hom al Y Gill CE On Sa ce Uy Ua On Ue Us Ve v0, O54 Ignnd © alah l | Yi 04. Pb Ibbal wo LO Yo ite [rsld dior © an© Kio Ae G%, Ug] Ora4 Ono row | a Be eof et sy Oy 50g One’ val (| eon CeO Therefow thue 9 grapes one Uoworp Wc.——— } S®& ¥ Eulerian Graph: A connected quaph Gu Said, a E 99 U'rewt i,» be ewlevian i] twtr ex'sH Eulem Sat thi a CRE Aten Moly E ulevran path: An eutevian path Ga path tn which even edge th traveled only once? Eulenman’ civ cule). jan dulewan, luteeJll t (i kun) eUleVaO path wich U closed. RS The ne cessiay, L sufficient conaitions tor ap eulevian Gravt U thet ecereverex UU have even Tree a Hun U Wed One vertkx odd degree He Uruuit) connot Le Eutenan. 949 geoph U connected) 2 contarnt exacty 9 vertes ey odd degree | ten Hur U on Estevan RothGin Ge @o wash sud nie Oven! + The path begin’ With one vertex | odd degree L endhion Hu other ve res. © ef oad eg vee - , d ran fees 5 > Haut |tont an Graph 1 Agraphk U said +o be Hau | toatan if itebal 0 Haw toaion Grast init: | HawFltonian Par : A Haw tontan path in @ qraph J Oo path in wich each vertex ty wisited only onc . Houuilteniog Graeme: A Haultonian pirat Ua hou bho ajan aa whieh U closed cive) in'Hal Vertex U Sowe of Jinat verdex £ oily Aww werdex U visited twig » Saflicdient wodition a Ts He su 4 fe deqreel rey) 2 adjacent Wwertcel yy quieater eae ox etal ton wher Un= no- of Ver KOA Hn He graph uwt bt Houdltonian: ) GC) ov Tl Hu deque each VerHe Ul great than or 9 x equal te n/p when += © - NOH: Whwiteccsearching [yy vy fulevian pathy, a veriex woy be visit! YOu than oru. wile ceambing fer Housl tpaian pa th, verte. arped wil be visi td once only aos 4 # id Yi 2a) abinotlvesdSe aa: Nl se oe 4 paees uae) ot 4 ‘| WP aS 354 S84 4 Eulendan gv aph- fe ielescomea) 4 pete ded oe i wa Lingle h- f55.sariy q a4 « no + haus too tan raph . D 43 . * y eg) | Decide wuren Hs following graph ax Euleviay OX Houwltonion or both wrt down ad Eulesan efrew't Qo Howl lonten orastt A, When ever possible . Ss 1c2) a i 4c3ay 2 | 203) z i > | The deque G{ €Ach very UL odd vor Cullen | chyeuit of Poth. a NO: Sf) wertiod = 4 vad caidas Begrvee ef each vertix>=2one kobisiv bd 4 -- deque eo] each verter ADs Ofer =. he Ua |Home bomah (oaeeueN ar Ont hawiilteatran cikat U ts 8-39.94 raph U_ hawilteorag butnot Cuteboth \ Se Vv aes “Fianap Graph * A araph U called planar cl tt can be draton ot ; : in He plSne without any edges Crossing - fr a Non-= Plana finda gwaph tat Connot be draw? on O. plane without any elgef crssi dg - 5; i © y (WotR, ae ne I By + Non plana v ee Ve = a = ee ti E = ‘bkey Planan graph - (i) aT 4 — v Planar ayraph Note: P complete Qvaph #f five vertud & nah planav - 1 alae YQ aaa DiA u / é 7 Di eetcicie fe ele (et A be a set, 2 let T be a selation ona, We soy trot TU a tree uy tart Uo McevfexTAVo) MEAL nan: ro ee twre exist © unique path in T from Vy_ ie “every other Verte oy Agkut no Ul pac a {yo wu Vo to Vo. We Show Leous that the Wertx Vo, dedenised tia the definition of o tee , Uyrique-9t U SEES Caled Ey vot ee an treet AT a Hea Yelerred to Oo 20 ted Hee. WeltoMAcaCiiven) iin deno te ao Wotrol tree: To With roo fp Vo: tf (r Ye) Uroota tree on eleurent Vv A wit 6, vertex in T. Thu Ry ed's eu csign fur set A, ay Ho be ge red to oJ 90109 y Sim pitied 4 1425 hap eng that fies u “f 20 importante. rStoce it [| Mme. Gaderiying get A ae eat Prvolved in Tree: k _ (We) level o < level oy L-] ’ Sey tates Wy(ed| FA The lorgeyt tevel (| leavels TH, vertices (a) | level © = NO eagel enter Vo but, several way love. Therefore j Ve fl said to be at level 0 Vo O alten caved oh pawent en level verted wlSle tevel 4 Vertical caUed ah sl{spriag Vo. ot tree Ut Spates [tree - tree that hove wo. els pring (Oy area Honu postttve integer, woe soy that a tree Tu no. ane colled oa teaveh mn n-tree if evens Vertex hol +Hustiuwost n ol[open a a Exmil x ou vertreel a Other, thao Has lenved Lave exocty n-ottepsr ag) we say) thatot U_courplete J n-tree - Theonew 4 : (Wt CT, Vo) be avooted tree. thin - (a) There oe no cycles in 7: ® Vou the onty wot ou: Se Each vertex in T, Other than Voy lodiilin~ degree 4, £ Vo has 9 -deqree 0 - a) et A = CM) Va, vg, Vay VOy Ve VR, Mas Ya, Viney and (et T= (C0V)V2) , C4, Vi), CVA Vs), (V4 Ve) Wir Ve) CVesVale” (V4) Vy) , CV9,V9) ,CV>, Mod} Show thet TU SMooted tree £ Eceoreity tut Hoot - Sel S?nce no paths begin at verti Vi, V3, Ve, V4 £ Vr these cannot be the oH of ao tree: The are no pa frou vertiod Ve Vay 4 Voto vertex Ve) so we site eUusinatt thele Vertal ox possible roots - Thu, iL ste thy 0G S00 4a} = |a - Vquolt 2 a _ptree, "tH woot uut be wes tot gel 4 i | easy te. shoxos) citetocthenebilazad poi th Toes) _| Va to leven other wertex: | For exdmp ie pn pare Wave, Wea Seeds ju pow Va ito Vg gin CV gs Ve), avEe se {-siagraph of T, weginntty-witr/wertee Vay 2 woth eohg el ghown dow award. Fhe selucttsy. bWovoniviwy Figus hlauick taspee ton ep Hus -ereph Wag va ph shows that Poti drow verte xq. to even other vertex one unique, £ trek ati@no paths fou Va toy. Thut TU tee with root. r Spanntaq [ree * y defo PR graph which contains au Vertion with minimum! oo: 4 edagef: x27 } Def? 5 | Spanning Cubgraph ev23 VA Thee ay= Mico eau Thee Tetal/sus EY wetgutt ef edged uruit be wirtuurn . s Ao, =§ > VU TWA 2 Ue ini uuu spanning tree. ; eJ bp EN 4s! RIM'S AtqoritHm * Ctebind yeah uci op a a Nias aL GSR aeaGMEES GEA COE Scion ae 4 D Rewove oops £ piel edges > (starting 2 v Cleeep uP nf uid voetg us. end pt same) . : - 2 vf a 2) wuiie Aaddfng new edge = > y Select edge wrth menfuuus werg ut ote f pass edged |xow atready yiseted verdial Coo eycte atlowed) ; : 5) stop at (nJeag a 4 <3) ern —> 4 at ? ww ed _ 5 i sepa ed ver fat > a S+p1 > MU ove een ata). a oo s R reviove anaes ~ Visited = fataig a flee fk de be) ete veritas bok x fies 2 e Pern nd Eden ot, 98, 3 vera, a 2 es Se 67, ok ee AC BO ow be be ZB ase ag Sah sk* vo * ea 1 Spy : HU gom thu , a Step é 5 Reluiov loops £ /rlel edged CKeep utto wt) 2) Ust au edges And Sort theuy aoe! torw+e.. CAascending order) ] 8) Tare na edged jrou tue sorted Ut Cetetp eyele ee as ed qed) - oe ee A Step 4 Ascending _, ae) CF kee Mvolos LOM we ef = Bom ys b>honsb bb tt - 44 abi-2 ‘ = Dreads xo (p45 pore 3 dgere ea > | é if dt- 4 3 ; 5 bd-5 A gbYP dit-owove £= (pd ¥ vo ce-€ee eet iG coltouN Festouiag of graphiconsttedl 228 apy 3 vert et edged tue 9° * O Colouring ol tre vertreed a graph Pe So eer oe | Citas clot 04.9 25, tant no 2 adfacent verted have same colour - Ba : eq he Beotour bona > areph : 2eotou + qxaph a . Note> Always ty to colour with menfuruy colour. | a | e Lhrowatc Nuwben * qt Gh te walt numiberey colour used = colour tk graph. It U denoted by e 7 £0G) oy K ~chvoutosh’e . ie T¥8ph. Soa qWreaph. # (@)=3eR i Rica ‘ (ame Gen ne emape ACG) =2 | + 5 Note:- Evew giperttte Graph U 2-clourable graph - Le XCG)=2 - ae ‘graph. Ver tx CQnnoy forus edge with Mi ce ea - adjacent edge - v3 Va Ve CQ) =9.€ whot U tu chrowatic no- Bm ui at