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)
102 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)
102 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
Advanced Practical Physics For Students
PDF
No ratings yet
Advanced Practical Physics For Students
676 pages
Tin Goyenda 76 77 18 PDF
PDF
No ratings yet
Tin Goyenda 76 77 18 PDF
217 pages
C. Stanley Ogilvy, John T. Anderson-Excursions in Number Theory-Oxford UP (1966)
PDF
No ratings yet
C. Stanley Ogilvy, John T. Anderson-Excursions in Number Theory-Oxford UP (1966)
172 pages
Mathematics - Its Content, Methods, and Meaning PDF
PDF
100% (1)
Mathematics - Its Content, Methods, and Meaning PDF
60 pages
Selected Papers On Analysis of Algorithms (Donald E Knuth)
PDF
100% (2)
Selected Papers On Analysis of Algorithms (Donald E Knuth)
635 pages
Combinatory Logic in Programming
PDF
No ratings yet
Combinatory Logic in Programming
347 pages
Molecular Biotechnology: Principles and Applications of Recombinant DNA, 6th Edition - Wiley
PDF
0% (1)
Molecular Biotechnology: Principles and Applications of Recombinant DNA, 6th Edition - Wiley
3 pages
IDL Programming Techniques 2nd Edition
PDF
No ratings yet
IDL Programming Techniques 2nd Edition
465 pages
Linear Algebra
PDF
0% (1)
Linear Algebra
205 pages
Notes
PDF
No ratings yet
Notes
422 pages
The Singular Mind of Terry Tao - The New York Times
PDF
100% (1)
The Singular Mind of Terry Tao - The New York Times
13 pages
Acm/Icpc Cheatsheet: Puzzles
PDF
No ratings yet
Acm/Icpc Cheatsheet: Puzzles
26 pages
OpenStax Statistics CH02
PDF
No ratings yet
OpenStax Statistics CH02
36 pages
Built-In Functions - Python 2.7
PDF
100% (1)
Built-In Functions - Python 2.7
29 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
Hidalgo Why Information Grows
PDF
No ratings yet
Hidalgo Why Information Grows
7 pages
30-Second Energy - Brian Clegg
PDF
No ratings yet
30-Second Energy - Brian Clegg
219 pages
Foundations of Quantum Mechanics
PDF
No ratings yet
Foundations of Quantum Mechanics
35 pages
Euler Master Us All PDF
PDF
100% (1)
Euler Master Us All PDF
2 pages
Wigner D-Matrix
PDF
100% (1)
Wigner D-Matrix
8 pages
Algorithms For Minimization Without Derivatives
PDF
No ratings yet
Algorithms For Minimization Without Derivatives
104 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
Complex Variables PDF
PDF
100% (5)
Complex Variables PDF
15 pages
Data Visualization With Ma Thematic A
PDF
No ratings yet
Data Visualization With Ma Thematic A
46 pages
Laplace Transforms Heaviside 181
PDF
No ratings yet
Laplace Transforms Heaviside 181
176 pages
Vector Calculus Applications
PDF
No ratings yet
Vector Calculus Applications
4 pages
Introductory Mathematics-Part A
PDF
No ratings yet
Introductory Mathematics-Part A
77 pages
Math Models of Physics Problems
PDF
No ratings yet
Math Models of Physics Problems
29 pages
DSD 5th Unit
PDF
No ratings yet
DSD 5th Unit
41 pages
Physics Lab Manual PDF
PDF
No ratings yet
Physics Lab Manual PDF
57 pages
Daa Notes (Final)
PDF
No ratings yet
Daa Notes (Final)
41 pages
DS Unit IV Handwritten Notes
PDF
No ratings yet
DS Unit IV Handwritten Notes
90 pages
DSA
PDF
No ratings yet
DSA
28 pages
Unit 4 Notes
PDF
No ratings yet
Unit 4 Notes
32 pages
DS Mod4-Aswers
PDF
No ratings yet
DS Mod4-Aswers
18 pages
Rsa - TCR PDF
PDF
No ratings yet
Rsa - TCR PDF
89 pages
Computational Mathematics With SageMath PDF
PDF
No ratings yet
Computational Mathematics With SageMath PDF
41 pages
Aphs
PDF
No ratings yet
Aphs
40 pages
XDS - Modula 2.IDE - User.guide - en
PDF
No ratings yet
XDS - Modula 2.IDE - User.guide - en
61 pages
Daa Unit 3
PDF
No ratings yet
Daa Unit 3
16 pages
Dsa Unit 5th
PDF
No ratings yet
Dsa Unit 5th
10 pages
Unit 2 MFCS
PDF
No ratings yet
Unit 2 MFCS
26 pages
Gauge Theory Physics Economics PDF
PDF
No ratings yet
Gauge Theory Physics Economics PDF
37 pages
AIUB Assignment Cover Sheet
PDF
No ratings yet
AIUB Assignment Cover Sheet
1 page
Matlab Manual
PDF
No ratings yet
Matlab Manual
70 pages
DSA
PDF
No ratings yet
DSA
10 pages
Daa
PDF
No ratings yet
Daa
9 pages
M110-TMA-Spring 22-23
PDF
No ratings yet
M110-TMA-Spring 22-23
3 pages
Dsa Sppu Unit 3 Imp
PDF
No ratings yet
Dsa Sppu Unit 3 Imp
6 pages
Math For Intro Physics.a4
PDF
No ratings yet
Math For Intro Physics.a4
60 pages
18.781 - Theory of Numbers, Spring 2012: Introduction, Diophantine Equations, Divisibility, GCD
PDF
No ratings yet
18.781 - Theory of Numbers, Spring 2012: Introduction, Diophantine Equations, Divisibility, GCD
5 pages
RP 31082014
PDF
No ratings yet
RP 31082014
3 pages
Matroid
PDF
No ratings yet
Matroid
18 pages
Computer Science Made Simple - V Anton
PDF
No ratings yet
Computer Science Made Simple - V Anton
1 page
Mechanics
PDF
No ratings yet
Mechanics
10 pages
How To Learn Math and Physics: John Baez January 2, 2016
PDF
No ratings yet
How To Learn Math and Physics: John Baez January 2, 2016
12 pages
Mellin Transforms and Fourier-Ramanujan Expansions
PDF
100% (1)
Mellin Transforms and Fourier-Ramanujan Expansions
12 pages
Dave Pressler No 4th Dimension Commentary5-1
PDF
No ratings yet
Dave Pressler No 4th Dimension Commentary5-1
2 pages
Combinatorial Optimization: Alexander Schrijver
PDF
No ratings yet
Combinatorial Optimization: Alexander Schrijver
34 pages
Physics Cheat Sheet
PDF
No ratings yet
Physics Cheat Sheet
2 pages