0% found this document useful (0 votes)
28 views12 pages

DAA Assignment 2-1

Fhn hj

Uploaded by

21be02050
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
0% found this document useful (0 votes)
28 views12 pages

DAA Assignment 2-1

Fhn hj

Uploaded by

21be02050
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
You are on page 1/ 12
| ExPlain atcout Maryix chain multiptication with ar example 2 MALSiX Bhan mutiPtication : MALIX choiny multiptication 1s. a ciawic Problem in the design and Anarysis OF aigorithms PAXLICUIAYIY in the yeaim of Aynamic Pog rare tng. The Problem iS bo detesmine the MOSE eFFICienE rans to multiply O Chain of matsices together Let's Say You have a sequena of matyices . Ar,A2,A3,- Ani GMA You want tO Compute the pkoduct AixAgxAsX- An The oxdey OF multipication Matters because mate’x muttipli cation 5 not Commutative. A\\ the satutions of yhe vb Pychiems aye stosed in tabIe The table 15 Condideked 05 bottom APP¥Oach Manne’ fex Finding the Setukion - FOXmulG miy ye eis ON Leet MT EP EK Pye ® Phen if ted whese fee }-1 > Fok K vate. Exampie PXoblem .- considey the vawe5g = Pies : Pa 24 Pace jes ear Po zt and N=y4 Ee) Bea mee, 3-2 rots ae mou = a2 roo 23 748 m3322 0 3u784 SEO We tok shen ‘0. sepa if jai then mi 2 min S erent oJ HPI PHS Pin nA emia L Myr Mr Atk, ¥ Pa PR} = marin LOFOFSKUK E Y erin (1905 Pea (ma 120] latena oma oa Mg = onin Cnt Ma TE REM PML Prd | =n {mag t 33 7 Pg xPa Puy is | Emin LOO HUNEADY ies =ming 4h ae ) | roy = min Liz + Mk, Se Phe Pear Pott 9 5 main gm 33 4 rnyytar earls d = min {oot 6 xaxtd EMMOLSH y Fou 2B) | yma emin € migemest, 5 +P * Pen Pin Y =min Samy +9093 EP ix P2A PUY emin gor yerss x23 a ee 2KE Emin § Ug +uoy =2B Karn uy . | MQUE min € maiermeH 5 a pixPerr The aigesithm vin generate the ahortest Path Fora Mode 6 toa, the othey nodes in the gkaPh: ie Gx this Qwaph, we wih) assume that the weight OF the edges Kepkesents the distance betoeen 100 nodes. IPAS, We Can see We have the shoxtest Fath Fsory, Node 0 to tix Form node o te Node Q , From Node o to node 3, From | node © to Node ¥, From | node © 10 nede 6. y woe hove eet oF wesourtes given below: 7 Intra |» The pistarce From tre Souwe node to ikecif 19.0. I this cranny the source mode 150° node to a Wother node V9 wokreer The Distane From He sOUNCe ep we mark ari oF them aS infintty | Seo, APM, 29, U-DOe, SD 6>00- &r O30, 2 we MN aisp have an avvay oF unyratted elements that will track of uniwatted oF UNmaxked Nodes. 2 A\gasithm will Complete when al) the ‘ : nodes mma ioited Land the detane between them added to oa ‘ uowisited odes: 0194056 SLPS — stepl i Stave FIOM Check ber ienoge afsited ptepai~ Check for ad nose with painter Alston wode 1-0 roe ve » wase OF noes *0, and check tot OdIauent Hose tbldy vigited and odd up the Altoete now nose 0.008 crane Nose 05 WAS 9% You Cor ode {4 eas “ee yycent noses, now we howe relics anh Cnet ye In Wis Hep one ‘ ‘ 3 tt 06 visited ond aid UF We 1 15 gointeruen distance” step 2)- The! 4,,50 roared e WN) be: node > pode ® 249574. sbepy- pgpin ve pave WO Choices for OdipLENE Nekee 50 noe” soae witn coinimun aiokasr?e * In +nis HEP Node 4 6 winloum | sistance odlaten’ node 0 mowed (a5 waited ond add op the aiorarte: asieronnce :Acde OF NCCE | ereve Foc lOxd ONd ChecKe FOC oS Bees '- Papin, to wose 6,5 morved It 0 wigited and Odd UP gre distance wilt be - pidance + wide 07 pode! . georior™ A9- Bae edesee “pevarce: FF? She xv 175 optima, one’ sorite aeout eax FW min-cut sneotern? Mose flow rein cub Anco NIT computer science aNd eptinizatton +heos nck Areo¥ern States frat foo Plow metuork the maxi at ct Flow Fowing pom We ecuxce to tre 4etat weight of Seal mainimuca cut ie, the ereaiiest totar weight dest dh rvcmrenec ns, Aisworect the” “7 : ap «FF nde zone 4= UT HOAZ. jacen': sede viich She distance od 5 pede 3ohede-4 ances | | | wee vertex (619 tabich, | 1 , the ma. k-Fiow Sd £ 2 ry ne ‘ eo Tree : 8 ~ A Seswt Known as 4re Ww kegranty Q5 ali the demand aaya in & eninteoum & I ee y/ Fes t 2 Aeon States that a. OSt MEtWOKK Foul axe Yntegtss , then there isan optima soiutton 0 the iad Progam consisting OF onllf integers - : he MAL FIOW -mi cat Theorem scares Khat {hemp FIOM rom jhe Source node to Ene aNK Nede +nEaugh & Gragi etwooxe is |@quar tO are capacity oF {He rninimumr Cut that gs, Phak scurve meade om te sink Nock The marimun qumber of Paix watse eke dis moum size OF An edge CUL-T0 Provey Sesult , Le wryoduce amodttted graph G that 15 directed Qive G wre Sace Verbiees ad Hy DUE WE wePIace Each Edge a Gi by Are Hap aixert@d CA9e5 a>b ard b30- The maximum Flore {5 obtained by Adding Ue Flow we pushed torough the ELLOOK KE Antu CUES Cone Taenvited ProM) ANS diagram “THE mooi MUM CUE Lal\\ Onl! pass trough edges oF 22x0- Thexe ave moutttple erininuy Stedges equards +e mini curs in PIS NETLEOKK - voy 5 that! Because there's some kein of Lotti reek, i¢, a subset of pipes thar eranstex the Frutd at Hel rraxirnum capacity “YOu Can't push Moke Abxough This horrlereck win be prec'se\y he rointenum cut, ter, the wk edges frat block the flow . As a first applicarion,we considers: the mn OF maximizng the Number oF diafoint Raths bet tuo VextteeS 5) t Ina FaPh. eee, men ger's : “ eet Pon CQUALES Vre eraylmum number OF SUCH Paths | te NE PARAKEY) uMbers af @iges ov vertices Neate mugt Ibe 5 in Grin orders 4O Seperate S from t- 91) taf e—O) of cut “LEAL CRIDDY | N ExPlaty raxtenum pisfoint pars - | Finding +e maximum distin Paths in a nerwork 15 aciassicau| problem fo gxaph theo and has nurmevous appitcations "W various Fiads, Inciuding Here's Ame byiet Everviewd Of Hye problems | come anarys’s oF ALgorithms Commonly Used LO cowe Ite Pkoblem Statercent ~ a Given a diected ov undiwected gxaph = Cvré ) Whee wis the et OF vertices and © 19 the Serof edges, arong with o ae Sand Sink Vertex 4, he Obsective & to Find the eceacl ert) Cuerbes Ok Vexter Arsioiat ParhS FO tot Vertex -ateioine Pparhs are paths that do not share ony Cornmon vexiced , excep t For the source AT Stor Nex 'Ceh- Algorithms Fos coayimnun pisfotnt Paths + SeVEXAS agori ths Go ‘be emPoyed 40 seive AE maximum Aalsicl Mt FAtkhS pxoblewm*. 1s Gdennnds - kaep AIQOS\tHM — THe argoritnrn 15 an exterBion OF Ane ForhnaTAles sap methtd For commpurtng Ane MANNMUM FIOW 1 A MELWOXk - & Te feKaUVely FIASS QuaEMENLINY fOrehS FKOMN Ye Source td dhe ctor Using Baeadth- FrSt seaveh (BFS) aed augments te Flow along Anese Maths . n | a ia > €acy Pewation Fieds one A fats, S60 eP eating 4» Found “BVES Fhe may) My oC tery WjWialOr UNL NO mow aisiclnk Pawns Gao - Mumbeer of alsicink Paths , |a Dinic’s Aigosithrn} ; | > ain ill daa se agortthe isan J>sinnhay to Edmonds - kaYP piaiels agort ENS S thee, jaa FYOW OerWork 4, eyaph 6 and Tke Ave, more augmenting 1 Pay | x Finding Abe amimU) ow OTE urhizes a concert cared reve fonstsucts blocking FHet®> unit 0 Gn be Found: i > Dnte’s aigortthm tqr'cauly pergeams better than Bren. Kasp, esteciany on sparse axaphs S Ss mmeqgec's Theoxen + SF ee Dmengerts theorer States Arak Soe MagimuUm number of Aig in Pans bewocen hao vertices sam tna grarh CANAL tg I mourn nurnber of vertices vohose KeMOVEd dts coll mint | o fromt.- l>one Udy tO find Are maxi round clsioink Paths USING merger's | treosero We by using mEwosk Flew arge sitymd Zhe FOAFULKECS¢9 Edrocnd 5 -Karp - 7 | Ananysis os, FRE Liene complerity oF the EAronds ~KovP and Dinte’s AIgeevthMs is | oC V7, El). €) Oru} eXANY OCV?£) Ox gene QyaPhs anc O Cre ovettar Same WOtr fos owing te ANS, Heue gen CoPacity mEerwored e& menger's sheoresd provided @ Are Probie bur May Nok aise CHY tead *° ethricient aigor’ ves , te canbe used %© Psore optional ity OF serurtonS Found by Orne « TELS - a Tre ebitcieny OF Hare aigdsittmns depeccis on Ane Chawactat: Bere OF We gwar such as {tS strc, sparsity, and the seecthc Atstsi bution ot edaes- E meme ; | explain alocuk mex Hievaxchy ‘in detaty. cextainly ) Betor fsa layesed structure of afferent aypes ay StOKNgC devine rere y CS ee gre PrTOASY BOI fs LO Prove the Cpu vite peed data WY rrontmising gtenane mami Gnd role oro" POO TY Whereis je PQIStEXS: recated Within Whe cpy S = faster And Seaiest form oF rv CONES - uted to Store data Currently fgein) Cpu 2. cache meNOY _Locattd I C\0S5e to Yhe CPL. q Processed by + seg (steus = faster HHA MAIH Memory bUE Stower Loar DD ACKS ASA bwutfer iw the cou acd nmin Merety: ay 1ain memory, a |= Loxgex ad Stoucx shan cache merrocy | eteres dak and instructions actively being oed by the Cre w secondary ‘storage PTnaudes AeNCeS Ke hod dtonditves , S61/d State SeIVES ANG magnetic tapes: SloLee’s ANG lage’ LAD EOAin, memory « used fox ONG -tESTN Storage of data And Prearams. Dlagiarn of MEMOTYAKerarchy \— may memory Punt lary Memory - main memory (PS magnetic Tapes EbPlanotion Ob the dragrarni— TOP Layer i REQiBECTS ee located within the Cpuandarxe the test Prorn OF MEMOYY » They Stowe clata tat 15 Curvently DQ PmHceseed oy the CPU oF oye Thy yours ery ie nage HUF CLO than ¢,, < = Se aext Pnatructtons ackiway being im t % Rete ftayes errpnd ay Storage dewveess Sucty a4 woe by and aorta stare Aviv axe sowet 404 larger thang en ‘ peern stoxage Ff clata ard Pio, uced Fox Long - aren a hey ave 6 expiain ¥e 4exms np: hard and OP -Completene, og cuasseS Om MeLty IN corpurex scence, *here ENI5E SORE PRObI em, 5 wl found pare problems are sie agtutlonS aseok wet pie ‘ry classes: Im co ' rey Plexty | c1asses KNOWN as com Bieo sto +5 40. Q80UP Problems bated OD te, The? qQasxs heir scteokt> Lime and oface +d weauire to seve POblerns and vexity sowutions «rt te the bronco of tne theory oF Comping pee we Seoree® wauixed 40 Sole a PiObIen | The corsmon ssesouxtes axe KIMe ard va manning thew couch gimme +e aagonithm aces tO serve oP pind the coxesponaiing memerd usage: © The ere coropientty pk An argositaey %s Used to - He number of 5tePS wequixed 40 SOE a Pwblems but a can ayo be ust tO desexibe how long Ft takes to Verity 1 complerity C0 F problems with ~weiated a me eh the answer. : R tre oface complentty OF aD agouti describes how muh memory *¥equivéd FOX Are algorithm to operate. corplevity classes ave usetul fn -exganistag Sim arty OF P¥ObIems - a) ye HORE LION MEE LO Check wine gs 0° NP-hard PXOblem to, Diver then ¢ ‘ep psopiens © 3S to nupchord tf for ever gird A POI yoo MM"'al—Elone Keduetion Y Problem Ltn ap om Ltop, opine of Khe 2XAMPIES OF Problems in NP-hard axe’ , partied Psobler A quaittted Becleary Soxrouras 5, NO Horo(wolan cycie- » Teg np-complere Cia i— = paotnern 1 NUP-ComPIeEE IF TE tS Tooth Np and NP-hard ap-complete Problems ae Yhe Had pPsoblems toni. Fea yureS ~ >... . AIP ~ Compre te HENS On Sea | PRODINS awe Speci as any psobie™ (0 NP Cis con te banstamed BY WAUICA Wo NP- corapicte pobiens in Pow normia) time - © TF ome could SOIVe AN WiP-complete PrObIE™o (9 PON YNoreway AAere | Hremone could aiso ceive any mip pacbiers In porgoemia diene . € example Problems incude: © Rarattonian cycie 2) satohablity 7 i:

You might also like