Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
100 views
21 pages
Dsa Notes Unit 5
Dsa notes for aktu exams unit 5
Uploaded by
prasungupta251
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download
Save
Save Dsa_Notes_Unit_5 For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
0 ratings
0% found this document useful (0 votes)
100 views
21 pages
Dsa Notes Unit 5
Dsa notes for aktu exams unit 5
Uploaded by
prasungupta251
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Carousel Previous
Carousel Next
Download
Save
Save Dsa_Notes_Unit_5 For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
Download
Save Dsa_Notes_Unit_5 For Later
You are on page 1
/ 21
Search
Fullscreen
unite Graph trabhi= & Grabh Com be clefiged <4 Group of Vverhice awn eAgey thar ave wed to Connect tere VerHerp, A grabh Gnsist two diwinge QO: (CAS) A Sek V of €lement Celled mode ( point or Yerticey), meemmat} Asck & Of 44gq Auch Mu euch edgy in 6 i unique feiveel of verHieg FUr,v) aia | Adjacen}noder— Subhofe @= [U,9J then mole Youd v are Catlecl ene foiwt of e€, awe U ame y are dated fo be adjacent mode or neighbore. Degrees The degree of mele U writlen cles (u) 6 the number of edge Conta wive u, ui deg(UJ=0 then U 1% Called (dolate node. Pati A pal P of leqginn from a ‘neder u to nade v (4 defined ay a ,= Connected [bteconnectexl Grate A grabh i Connected if there ig a patin between amy “Ho of oder othereise grub ke disconnected, Complete graphy - L ny A grebh ix Gmpleke if every node Ws u eo lacea to avers other rede U in G. A Complete graph wil have DOAD edgep, labeled Graph - A grabh ig faid to be labelecl if it edge, BAe asngned dati in the lebeled grabh Some weit assigned fo tach dep, Math edger Heaps uf Eder |e lowel ve! eee ee end point eande! are parallc| edger. Shi- Ba edge @ id calted Joob if tt hag Leal end foinr je, ~e@=(u.uyWelgnter| 4 netbh: eel gw 5 Graph Rebre Hor fe ineplemeat naph Represeufetion The wel ote ia fed by esl scene a mnekax rebr 1 a 4, > C) Adjacenc Makar 5a eeu oor. ithe ise © pljaceneg List Cea aire SAC Oe ee “Od direchion of gai nen tb40H & £ i team Wwe Gon Coter! for A] Adjaceney seta eM wat v) boos > makay Gre: depend Oo grab: verica [nxn rn Iku a mahix alrt(nd there ig m0. of Vertiter {a= YYfon af. rele the +_Inthe od} acenty yep steel Ls} + Adja cover or on grep is ase by swale : { = T-e i PT ees 7S) | cy IHN Ww Beet O(m 42e) There ave ome drowbacky ™ peg ue tee”! Le TE may be defticutr to byert ame detehe node © hecuye the fire of medax A” mau need te, be Chevg-ee] ewel node yeed fo be Yeardlered. 4 thes numby of edgy 18 que to nO. of rede then the matix A wil be Shane (will Gran mane) Zeve)| hence Greste deat of Space wil) le User tec, ; Now the above Cande tewo adaceseg : Wore aufeh aNbecloVertex Graph Traversiv9 s— The process of Misting avel Zrblvig 9 ca. Srabh for processing ia Guléel re. (1) Debth Ficst feareh (Corey es slack CLT Fo) @) Bredth First fears (BPS) - es Mveur CErFo) he ese Gea e™ AS Debt First Search s- Tt is pebular fechnique ee Spmmebic. traversing. A depth fist Aearch fist we frevese Att” Vertex aval then ite adjacency vertex. Ef there are more thom one adgacencice then We brewere ae oue of The adjacency Vertex camel thea its adjacency Uertexee castef ea. Her ning 0.4 “deed node ? dratis, tothe end ofthe batt. se badttpeck on Patty unbil WE Can Gatinue alorgcineticr Pet vcwd foe. Duringy the Executjoy of both aly onthe Each node in Graph wsill ( one of the three Abaleg. Status <1 — peodly State (The wal State of the Neen) _ STATUS = 2 USaaitt eae mode iM iB oe pa or Seal, sintus = Processed SIE Tre nade Wi hey been frcescd. TMS algorttiven i4 —¢rmi i: — . S 8tie bimaey tree. _ i,Algorithm + % 1. Initialize all nade, 4o the ready State. (staTs=1) % Pushthe Starting mode A onto STACK aml change It Staley +o the Waitiveg Atate (STATUS=2) &- Rebeat Steb 4 andl 5 Unkt STACK IS Empty. Hy: fob the top node N Of Spack. Process N ane chaye (& Lhatuy to tre Ayocessec| State (statvs-3) | | aa Push onto stack all the Neighbours of N thet Gre SHU i'n Yeadly State Cspatys= 1) awd | Chante their statu +0 the Barhng Ate (status =2) 6. Exit. (D Subpose —Starhing node u A STaws4 = A,B, 6, DEF GH + STpIvs2 = Ld } Stas = A eA a ® status) = BEEGH Stamis2 = GC) TF Q Example i-ft) Pop E From the Ftack ancl chge its fates &to3 awl push ike Heighbouns usdseln are Im Statey 3 te 4 STACK omd chomge their Stetup 1 ed Per pases) A STATUS 2 = BRAG eal me svatvs 3 = A,C,E D A & ae € %G mee pop y= eae A STATUS 4 = OX STawsee B/D, eA on OS, 2 STAYS 3 = A, 6,E,G a vs e 4 : A MW) bobs ee 4 STATUS | = e STATUS 2= BDF STATS 3. = PISE OH Wi) Pob F 4 Se i eat : Sa? ame ll pa 7 D St 3 Ae ye a - pi) Pob } —* ¢ ST" > [aa ‘al Sue “4 a sta = AGE G MED © m he ol rs 2 Sia. = $i = Ors = rieBreadth Pivst Search (RES) ¢- Tra breadth first earch first we fraverse the Startivg Node ave then Its all the adjacency) Vertexes. The, teke omy one of there ome travers ity all ad) acenc J omel So on. | Algortthwo + Initialize alt node to reodly State Grats =1) 2 Put the Stavhg node A tn QUEUE auvel change its Statyy to waiting Stete Cstatus =2) & Repeat —
3) Add tothe Year o f Gveve att the Neiglters of MN that ave im the x cacy “lede Cstatus= Ome} aee ee sie) guphose A iS Startivg poiuf-(nedle), SATUS = Aid DER OH. enqueue A in dhe Queue evel Cleegep tts Staluy eae fal) Queue - SATUS 2 > A : g Pequeve A es the Clureue ane} Charge ibs Freby fon b, 40.3 evel Erqueue ity neighbours ufo Muewe uotnels are iw Sead anne chorge they hee A fom 1 fos fo i" é S73 = REF, GH : E e SIL = &¢ ; telel_] wir bequee F ames. st3 = A, eee A GD) pequeue B from =a iN Gi Spl =] erent ST, = AibGDEF ape = GIS ees ot Depew —e— SwZT = Re ae Gee ic eee eo s,, STi = FiG\H mt stp) = prenes(pleinel-e! Stz = PB? Sty = ABC? SFG Dequewe H Prom —a— : Ts Dequeue fen a A sr= Sti = GH fo Sts= Pi B, GER GH Sy = eae tee \ ST = AibeCb dequeue - € from —r Stotrees + number of tne trees drawn ph is called Shannw9 trees. If the Grabh is weighted geabh dren if we added tne weight of aul ils vertexes In the AS paorieg dite; Tne tree Which boy minimum fell of all Vertere, Se legal imp The Shinnivg tee fromthe 0 A meted) Subuprabh @ of gaabh GLVE) is ded te be org ifs () Gabqpaph Should Gate all Verticey of & @ Suygrabn Arould gate C(viet) edgy ee: Vs's oot 4 ° Aye = Ul = 7 . 24 Ke ¥ How 1 Sbonning Atree are conshete ig Given Gywhlete graph: fom a gral Complete graph -prstel Alger bn a is beyec| clivectly on the qereric. rinse) Apanni ee Algorithm ust gees ae gemove 2h am hea’ edge. “”d 8 dy a ) gore msT- KRUSKAL (og ae y Ah AS te . Q. for each vertex VE v@]J @ : do make -setCv) ; eS q D coypine Sige Pe aemymendecte9s 25 oreler by Uleiglt taken In Yondecresig coder eglt qe edb tH DOF 2 4 5. for each Gt) EF , «dda if Finb-ser(u) 4 FN b- Ser Cu) > ~ VE €legEr+e 1 then A AU SQUU)S i | = 0 (Elegze) 8 UNFONCU,¥) F ae 9. Return A» = lege +4e9t = ocelegv) MAKe=SETC2) Create 4 nei fel Wwhece only member Come teas reprefeutative) is 0. Svce tue 4b are olisgorut WE repwre that ye not alreadey be tn the —Some otner Set UNFON Orig) Ubsitey the dyramic Fels tat condany xe omg day Se and Sy. inte a men He that (8 the tmion of there tuo -tets. cis. cer Gx) sretarn & “Porter fo the Yeprecutative of tueExample: - B= £066), 4,0), iA) Coe), Cet) © © © © @ ® sdaiilkaal Sites aclce Z 4 ets | @ re ) arn s @ cheese @b) ee a @) — © werd at ® cheese (0,0) bit net union fecure it Close the ary © chase, a, J ® ces (ce) © cree (ep)Cgint's Algontt dreels the nevle % 9 divgle tree awef } ie BA adding “esd nocley to Apanninrd dree. ¥e loop avd baralte| edge: “fee p chose any arbitrary mode af Toot note. pir’Bee he. q A gorithm Msr- PREMS(6,W,r) 1. Poy each UE Vlo] a do pec | es Pluja_nid, 4 key [yJ<-o Ss. O«VfaJ 6. while Dad 7. do ue Extracken min(g) 8 fr tach We bj [4] qe {4.b.6 ay ca dof VER cre) was cl g u. % aul lee Te PlvJeu uf KY [ule w(uy——___—S—“‘tPaP Transitive apsure * ‘ For diveded gretph tne (.€). The amcitive chave of grabh Gig a goabh G”= (viet). Go fer vey vertex pur (vw) I” V there 1297 edge EX, if bind only if there ua valid pepe, fom tow In G a d pe ptide afse ale ' | tot : ¥ Eitan (re wo 4 (4) 4 |? 1 v gdh @,4), (ab) (ad) @d) (ae) ela \ | O88 (bid), € Hb) .0 Reachabisity Madnx. (db) Cd OC4ad) Cde) (ab) (e9 (edA fair Shortect path uen 2-1 = 9-1, 1-1 23S 9-1-3 i-< floyd Wars hal Algoxtwn Create clisharce matnx in ° 4 \ © 2\ co 3\4Floyd -Warshel A lgoritin The Ployd- werelwll gi) pair shorter path Algontin we a Aynawnc * programmivg metrodolegy to folve the Al. fair Bhor tat path treble. The algortin rane in Ov) -4,, awd negatively weighted] edge may be Breer, howevey Negatively utlputed Cycler Cure “froblews uttth the ag oth Ihe main yecurfve clefinition of the algerstinn i per by: Kl ; Aree BGs = min gee) i, AU asa Gj) if Ke FLOYD~ WARSHALL (Ww) N& yousCw) bow for Kx-1 to ‘do for fe1-ton © you do for Jeacton Colour * do dee ri (a? a Guae ans ay yi Ne Yelun of”sige $ ource Shorferh Fath: - pijkestea’'s Alg.o rtm of pifkesta’s Algoriten Solve the Sigle fource Aborter jal frorlen uslen olf eeey have -non- negative Weglts yin a greeely ANgortnm gue] —Semilay to Crten’s algontre. Algonthon Ateark of the Bereenictcx, 5 it grows 7 bree, T, Theor ubbinehely Abans all vertice reachable fom S. Verkie are addel 40 T in order of distance ie, first S shen the Vertex chheebs closest fo § then the nevt closest, ane So On. folrowieg implementation assumes that grabh 6) is teprestube) by ojacenc Hiss, Alewo Al genrtivm: = PITKSTRA (Gy, 9,5) 4, INETALIZe Srnaie- source CG,s) % gf ff 5S wit whimately Grbaing verticey Of inal Aherteet Poth weiglt from S. Tnhabize fron gueve @ hee, O— Vie] Wile priority dueye () 14 not ery do U— Exrencr_manC@) — | Pull oat new Vertex S— SE{UE If Fesform Telgxation for Gch Verken y adjacent for Gach Vertex yin Adj [W iy | Felax Cu, 9,19) © ' LT ravize SEN GLE SOURCE (G,S) in For Cac Vertex ye VC Hh de d(v)aeo © z eae hr wy 4 PCO )a— Nit. deeExample: - = (QuyxN] g [s, S Q- C4, vOy] S- | 8%,
You might also like
FFTContent PDF
PDF
No ratings yet
FFTContent PDF
8 pages
Database and Web Database Systems - Call Center Management System
PDF
100% (1)
Database and Web Database Systems - Call Center Management System
24 pages
CDS NW Synthesis and Characterization.12
PDF
100% (1)
CDS NW Synthesis and Characterization.12
22 pages
Graph Theory For Dummies
PDF
No ratings yet
Graph Theory For Dummies
24 pages
Algebra Can Be Fun (Yakov I. Perelman, G. Yankovsky) (Z-Library)
PDF
No ratings yet
Algebra Can Be Fun (Yakov I. Perelman, G. Yankovsky) (Z-Library)
234 pages
Numerical Methods - B. Ram
PDF
No ratings yet
Numerical Methods - B. Ram
236 pages
Questions and Answers in School Physics (Mir, 1973)
PDF
No ratings yet
Questions and Answers in School Physics (Mir, 1973)
240 pages
Dsa Sppu Unit 3 Imp
PDF
No ratings yet
Dsa Sppu Unit 3 Imp
6 pages
Tin Goyenda 76 77 18 PDF
PDF
No ratings yet
Tin Goyenda 76 77 18 PDF
217 pages
Advanced Physics For You 2nd Edition PDF
PDF
No ratings yet
Advanced Physics For You 2nd Edition PDF
31 pages
Dsa Unit 5th
PDF
No ratings yet
Dsa Unit 5th
10 pages
Convex Optimization - Boyd & Vandenberghe
PDF
No ratings yet
Convex Optimization - Boyd & Vandenberghe
8 pages
LAPACK Users Guide PDF
PDF
No ratings yet
LAPACK Users Guide PDF
425 pages
Daa Unit 3
PDF
No ratings yet
Daa Unit 3
16 pages
Mechanics
PDF
No ratings yet
Mechanics
10 pages
Karapetyants Drakin The Structure of Matter Mir 1978 PDF
PDF
No ratings yet
Karapetyants Drakin The Structure of Matter Mir 1978 PDF
343 pages
(XXXX) Bright, W. An Introduction To Scientific Research, Harvard University
PDF
No ratings yet
(XXXX) Bright, W. An Introduction To Scientific Research, Harvard University
6 pages
Common Prospectus English
PDF
No ratings yet
Common Prospectus English
427 pages
DSA
PDF
No ratings yet
DSA
10 pages
AIUB Assignment Cover Sheet
PDF
No ratings yet
AIUB Assignment Cover Sheet
1 page
(Introduction To) Schaums Outline Programming With C++
PDF
No ratings yet
(Introduction To) Schaums Outline Programming With C++
3 pages
MATH 115: Lecture IV Notes
PDF
No ratings yet
MATH 115: Lecture IV Notes
5 pages
Algorithms For Minimization Without Derivatives
PDF
No ratings yet
Algorithms For Minimization Without Derivatives
104 pages
Unit 4 Notes
PDF
No ratings yet
Unit 4 Notes
32 pages
A. G. Grozin - Using REDUCE in High Energy Physics (1997) (QED)
PDF
No ratings yet
A. G. Grozin - Using REDUCE in High Energy Physics (1997) (QED)
400 pages
DSD 5th Unit
PDF
No ratings yet
DSD 5th Unit
41 pages
30-Second Energy - Brian Clegg
PDF
No ratings yet
30-Second Energy - Brian Clegg
219 pages
Unit 2 MFCS
PDF
No ratings yet
Unit 2 MFCS
26 pages
(Image Processing Series) Luciano Da Fona Costa, Roberto Marcond Cesar Jr. - Shape Classification and Analysis - Theory and Practice-CRC Press (2009) PDF
PDF
No ratings yet
(Image Processing Series) Luciano Da Fona Costa, Roberto Marcond Cesar Jr. - Shape Classification and Analysis - Theory and Practice-CRC Press (2009) PDF
674 pages
Lecture Notes On Monte Carlo Methods: Andrew Larkoski November 7, 2016
PDF
No ratings yet
Lecture Notes On Monte Carlo Methods: Andrew Larkoski November 7, 2016
19 pages
Daa Notes (Final)
PDF
No ratings yet
Daa Notes (Final)
41 pages
Introduction To Robustness and Robust Statitics
PDF
No ratings yet
Introduction To Robustness and Robust Statitics
12 pages
Cognitive Complexity
PDF
No ratings yet
Cognitive Complexity
21 pages
SMT359 Errata
PDF
No ratings yet
SMT359 Errata
5 pages
Gödel's Incompleteness Theorems
PDF
No ratings yet
Gödel's Incompleteness Theorems
6 pages
Math EE IB
PDF
No ratings yet
Math EE IB
13 pages
IDL Programming Techniques 2nd Edition
PDF
No ratings yet
IDL Programming Techniques 2nd Edition
465 pages
DSA
PDF
No ratings yet
DSA
28 pages
The Julia Express: Bogumił Kami Nski September 27, 2016
PDF
No ratings yet
The Julia Express: Bogumił Kami Nski September 27, 2016
13 pages
Matroid
PDF
No ratings yet
Matroid
18 pages
Notes Mich14 PDF
PDF
No ratings yet
Notes Mich14 PDF
97 pages
CS 229, Autumn 2016 Problem Set #1: Supervised Learning: m −y θ x m θ (i) (i)
PDF
No ratings yet
CS 229, Autumn 2016 Problem Set #1: Supervised Learning: m −y θ x m θ (i) (i)
8 pages
Dimensionless Analysis PDF
PDF
No ratings yet
Dimensionless Analysis PDF
16 pages
Bounds6
PDF
No ratings yet
Bounds6
12 pages
Wigner D-Matrix
PDF
100% (1)
Wigner D-Matrix
8 pages
The Free High School Science Texts - A Textbook For Highschool Students Studying Physics (Team Nanban) (TPB) PDF
PDF
No ratings yet
The Free High School Science Texts - A Textbook For Highschool Students Studying Physics (Team Nanban) (TPB) PDF
397 pages
Cantor - Über Eine Elementare Frage Der Mannigfaltigkeitslehre
PDF
No ratings yet
Cantor - Über Eine Elementare Frage Der Mannigfaltigkeitslehre
8 pages
DS Mod4-Aswers
PDF
No ratings yet
DS Mod4-Aswers
18 pages
Physics Lab Manual PDF
PDF
No ratings yet
Physics Lab Manual PDF
57 pages
Introductory Mathematics-Part A
PDF
No ratings yet
Introductory Mathematics-Part A
77 pages
Pattern Recognition and Machine Learning Errata and Additional Comments
PDF
0% (1)
Pattern Recognition and Machine Learning Errata and Additional Comments
7 pages
Rsa - TCR PDF
PDF
No ratings yet
Rsa - TCR PDF
89 pages
Matlab Manual
PDF
No ratings yet
Matlab Manual
70 pages
DS Resume Template by Emma Ding
PDF
No ratings yet
DS Resume Template by Emma Ding
2 pages
Phys 143
PDF
100% (1)
Phys 143
63 pages
Shannon's Information Theory - Science4All
PDF
No ratings yet
Shannon's Information Theory - Science4All
13 pages
Click Here For Download: (PDF) Mercury's Perihelion From Le Verrier To Einstein (Oxford Science Publications)
PDF
No ratings yet
Click Here For Download: (PDF) Mercury's Perihelion From Le Verrier To Einstein (Oxford Science Publications)
2 pages
Wolfgang Demtröder Atoms, Molecules and Photons - An Introduction To Atomic-, Molecular - and Quantum-Physics
PDF
No ratings yet
Wolfgang Demtröder Atoms, Molecules and Photons - An Introduction To Atomic-, Molecular - and Quantum-Physics
10 pages
Combinatorial Optimization: Alexander Schrijver
PDF
No ratings yet
Combinatorial Optimization: Alexander Schrijver
34 pages
Basic Physics
PDF
100% (1)
Basic Physics
172 pages