已閱讀5頁,還剩64頁未讀, 繼續(xù)免費(fèi)閱讀
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
.,1,AlgorithmsinGeneralAsynchronousNetworks,沈卓煒zwshen九龍湖校區(qū)計(jì)算機(jī)樓347房間Tel:52090919133909229522011年3月,.,2,Leaderelectioningeneralasynchronousnetworks,Undirectedgraphs.CangetasynchronousversionofsynchronousFloodMaxalgorithm:Simulateroundswithcounters.Needtoknowdiameterfortermination.FloodMaxalgorithm:Everyround:SendmaxUIDseentoallneighbors.Stopafterdiamrounds.ElectselfiffownUIDismaxseen.,.,3,Leaderelectioningeneralasynchronousnetworks,Wellseebetterasynchronousalgorithmslater:Dontneedtoknowdiameter.Lowermessagecomplexity.Dependontechniquessuchas:Breadth-firstsearchConvergecastusingaspanningtreeSynchronizerstosimulatesynchronousalgorithmsConsistentglobalsnapshotstodetecttermination,.,4,Spanningtreeandsearching,Spanningtreesareusedforcommunication,e.g.,broadcast/convergecastStartwiththesimpletaskofsettingupsome(arbitrary)spanningtreewitha(given)rooti0.Assume:Undirected,connectedgraph(i.e.,bidirectionalcommunication).Rooti0Sizeanddiameterunknown.UIDs,withcomparisons.Canidentifyin-andout-edgestosameneighbor.,.,5,Spanningtreeandsearching,Require:Eachprocessshouldoutputitsparentintree,withaparentoutputaction.Startingpoint:SynchBFSalgorithm:i0floodssearchmessage;parentofanodeisthefirstnodefromwhichitreceivesasearchmessage.Tryrunningthesamealgorithminasynchronousnetwork.Stillyieldsspanningtree,butnotnecessarilybreadth-firsttree.,.,6,AsynchSpanningtree,Processi,.,7,Asynchronousspanningtree,.,8,Asynchronousspanningtree,S,.,9,Asynchronousspanningtree,S,.,10,Asynchronousspanningtree,S,.,11,Asynchronousspanningtree,S,S,.,12,Asynchronousspanningtree,S,.,13,Asynchronousspanningtree,S,S,S,.,14,Asynchronousspanningtree,.,15,AsynchSpanningtree,ComplexityMessages:O(|E|)Time:diam(l+d)+lAnomaly:Pathsmaybelongerthandiameter!Messagesmaytravelfasteralonglongerpaths,inasynchronousnetworks.,.,16,ApplicationofAsynchSpanningtree,SimilartosynchronousBFSMessagebroadcast:Piggybackonsearchmessage.Childpointers:Addresponsestosearchmessages,easybecauseofbidirectionalcommunication.Useprecomputedtreeforbcast/convergecastNowthetiminganomalyarisesO(h(l+d)timecomplexity.O(|E|)messagecomplexity.,h=heightoftree;mayben,.,17,ApplicationsofBFS,Globalcomputation:Sum,max,oranykindofdataaggregation:ConvergecastonBFStree.Complexity:TimeO(diameter);MessagesO(n)Leaderelection(withoutknowingdiameter):EveryonestartsBFS,determinesmaxUID.Complexity:TimeO(diam);MessagesO(n|E|)(actually,O(diam|E|).Computediameter:AlldoBFS.ConvergecasttofindheightofeachBFStree.Convergecastagaintofindmaxofallheights.,.,18,Moreapplications,Asynchronousbroadcast/convergecast:Canalsoconstructspanningtreewhileusingittobroadcastmessageandalsotocollectresponses.E.g.,totelltherootwhenthebcastisdone,ortocollectaggregateddata.Complexity:O(|E|)messagecomplexity.O(n(l+d)timecomplexity,timinganomaly.Electleaderwhennodeshavenoinfoaboutthenetwork(noknowledgeofn,diam,etc.;noroot,nospanningtree),.,19,Breadth-firstspanningtree,Assume(sameasabove):Undirected,connectedgraph(i.e.,bidirectionalcommunication).Rooti0.Sizeanddiameterunknown.UIDs,withcomparisons.Require:Eachprocessshouldoutputitsparentinabreadth-firstspanningtree.,.,20,Breadth-firstspanningtree,Inasynchronousnetworks,modifiedSynchBFSdoesnotguaranteethatthespanningtreeconstructedisbreadth-first.Longpathsmaybetraversedfasterthanshortones.Canmodifyeachprocesstokeeptrackofdistance,changeparentwhenithearsofshorterpath.Relaxationalgorithm(likeBellman-Ford).Mustinformneighborsofchanges.Eventually,treestabilizestoabreadth-firstspanningtree.,.,21,AsynchBFS,.,22,AsynchBFS,0,.,23,AsynchBFS,0,0,.,24,AsynchBFS,0,0,0,.,25,AsynchBFS,1,0,0,.,26,AsynchBFS,1,0,1,1,.,27,AsynchBFS,1,0,1,3,2,1,1,.,28,AsynchBFS,1,0,4,1,3,2,1,1,.,29,AsynchBFS,1,0,4,1,3,2,1,1,4,4,.,30,AsynchBFS,1,0,2,1,3,2,1,4,4,.,31,AsynchBFS,1,0,2,5,1,3,2,1,4,2,.,32,AsynchBFS,6,1,0,2,3,1,3,2,1,1,.,33,AsynchBFS,6,1,0,2,2,1,3,2,1,1,.,34,AsynchBFS,2,1,0,2,2,1,3,2,1,0,.,35,AsynchBFS,1,1,0,2,2,1,3,2,1,.,36,AsynchBFS,Complexity:Messages:O(n|E|)MaysendO(n)messagesoneachlink(oneforeachdistanceestimate).Time:O(diamn(l+d)(takingpileupsintoaccount).CanreducecomplexityifknowboundDondiameter:AllowonlydistanceestimatesD.Messages:O(D|E|);Time:O(diamD(l+d),.,37,AsynchBFS,Termination:Nooneknowswhenthisisdone,socantproduceparentoutputs.Canaugmentwithacksforsearchmessages,convergecastbacktoi0.i0learnswhenthetreehasstabilized,tellseveryoneelse.Abittricky:Treegrowsandshrinks.Someprocessesmayparticipatemanytimes,astheylearnimprovements.Bookkeepingneeded.Complexity?,.,38,LayeredBFS,Asynchronyleadstomanycorrections,whichleadtolotsofcommunication.Idea:Slowdowncommunication,growthetreeinsynchronizedphases.Inphasek,incorporateallnodesatdistancekfromi0.i0synchronizesbetweenincorporatingnodesatdistancekandk+1.Phase1:i0sendssearchmessagestoneighbors.Neighborssetdist:=1,sendackstoi0.,.,39,LayeredBFS,Phasek+1:Assumephases1,karecompleted:eachnodeatdistancekknowsitsparent,andeachnodeatdistancek-1alsoknowsitschildren.i0broadcastsnewphasemessagealongtreeedges,todistancekprocesses.Eachofthesesendssearchmessagetoallnbrsexceptitsparent.Whenanynon-i0processreceivesfirstsearchmessage,setsparent:=senderandsendsapositiveack;sendsnacksforsubsequentsearchmsgs.Whendistancekprocessreceivesacks/nacksforallitssearchmessages,designatesnodesthatsentpostiveacksasitschildren.Thendistancekprocessesconvergecastbacktoi0alongdepthktreetosaythattheyredone;includeabitsayingwhethernewnodeswerefound.,.,40,LayeredBFS,Terminates:Wheni0learns,insomephase,thatnonewnodeswerefound.ObviouslyproducesBFStree.Complexity:Messages:O(|E|+ndiam)Time:Usesimplifiedanalysis:NeglectinglocalcomputationtimelAssumingthateverymessageinachannelisdeliveredintimed(ignoringcongestiondelays).O(diam2d),Eachedgeexploredatmostonceineachdirectionbysearch/ack.,Eachtreeedgetraversedatmostonceineachphasebynewphase/convergecast.,.,41,LayeredBFSvsAsynchBFS,Messagecomplexity:AsynchBFS:O(diam|E|),assumingdiamisknown,O(n|E|)ifnotLayeredBFS:O(|E|+ndiam)Timecomplexity:AsynchBFS:O(diamd)LayeredBFS:O(diam2d)Canalsodefine“hybrid”algorithmAddmlayersineachphase.Withineachphase,layersconstructedasynchronously.Intermediateperformance.,.,42,ShortestPaths,Assumptions:SameasforBFS,plusedgeweights.weight(i,j),nonnegativereal,sameinbothdirections.Require:Outputshortestdistanceandparentinshortest-pathstree.UseBellman-FordasynchronouslyUsedtoestablishroutesinARPANET1969-1980.CanaugmentwithconvergecastasforBFS,fortermination.Butworst-casecomplexityisverybad,.,43,AsynchBellmanFord,.,44,AsynchBellmanFord,Termination:Useconvergecast(asforAsynchBFS).Complexity:O(n!)simplepathsfromi0toanyothernode,whichisO(nn).SothenumberofmessagessentonanychannelisO(nn).Somessagecomplexity=O(nn|E|),timecomplexity=O(nnn(l+d).,.,45,AsynchBellmanFord,Complexity:Q:Arethemessageandtimecomplexityreallyexponentialinn?A:Yes:Insomeexecutionofnetworkbelow,iksends2kmessagestoik+1,somessagecomplexityis(2n/2)andtimecomplexityis(2n/2d).,.,46,Exponentialtime/messagecomplexity,Possibledistanceestimatesforikare2k1,2k2,0.Moreover,ikcantakeonalltheseestimatesinsequence:First,messagestraverseupperlinks,2k1.Thenlastlowermessagearrivesatik,2k2.Thenlowermessageik-2ik-1arrives,reducesik-1sestimateby2,messageik-1ikarrivesonupperlinks,2k3.Etc.Countdowninbinary.Ifthishappensquickly,getpileupof2ksearchmessagesinCk,k+1.,.,47,ShortestPaths,Moral:Unrestrainedasynchronycancauseproblems.Returntothisproblemafterwehavebettersynchronizationmethods.Now,anothergoodillustrationoftheproblemsintroducedbyasynchrony:,.,48,Minimumspanningtree,Assumptions:G=(V,E)connected,undirected.Weightededges,weightsknowntoendpointprocesses,weightsdistinct.UIDsProcessesdontknown,diam.Canidentifyin-andout-edgestosameneighbor.Input:wakeupactions,occurringatanytimeatoneormorenodes.Processwakesupwhenitfirstreceiveseitherawakeupinputoraprotocolmessage.,.,49,Minimumspanningtree,Assumptions:Requires:ProduceMST,whereeachprocessknowswhichofitsincidentedgesbelongtothetree.Guaranteedtobeunique,becauseofuniqueweights.Gallager-Humblet-Spiraalgorithm,.,50,Recallsynchronousalgorithm,Proceedsinphases(levels).Aftereachphase,wehaveaspanningforest,inwhicheachcomponenttreehasaleader.Ineachphase,eachcomponentfindsminweightoutgoingedge(MWOE),thencomponentsmergeusingallMWOEstogetcomponentsfornextphase.,.,51,Synchronousalgorithm,Complexityisgood:Messages:O(nlogn+|E|)Time(rounds):O(nlogn)Lowmessagecomplexitydependsonthewaynodestesttheirincidentedges,inorderofweight,notretestingsameedgeonceitsrejected.Q:Howtorunthisalgorithmasynchronously?,.,52,RunningtheAlgasynchronously,Problemsarise:Inaccurateinformationaboutoutgoingedges:Insynchronousalgorithm,whenanodetestsitsedges,itknowsthatitsneighborsarealreadyuptothesamelevel,andhaveup-to-dateinformationabouttheircomponent.Inasynchronousversion,neighborscouldlagbehind;theymightbeinsamecomponentbutnotyetknowthis.Less“balanced”combinationofcomponents:Insynchronousalgorithm,levelkcomponentshave2knodes,andlevelk+1componentsareconstructedfromatleasttwolevelkcomponents.Inasynchronousversion,componentsatdifferentlevelscouldbecombined.Canleadtomoremessagesoverall.,.,53,RunningtheAlgasynchronously,Problemsarise:Inaccurateinformationaboutoutgoingedges:Less“balanced”combinationofcomponents:Concurrentoverlappingsearches/convergecasts:Whennodesareoutofsynch,concurrentsearchesforMWOEscouldinterferewitheachother(wellseethis).Timebound:Theseproblemsresultfromnodesbeingout-of-synch,atdifferentlevels.Wecouldtrytosynchronizelevels,butthismustbedonecarefully,soasnottohurtthetimecomplexitytoomuch.,.,54,GHSalgorithm,Samebasicideasasbefore:Formcomponents,combinealongMWOEs.Withinanycomponent,processescooperatetofindcomponentMWOE.Broadcastfromleader,convergecast,etc.,.,55,GHSalgorithm,Introducesynchronizationtopreventnodesfromgettingtoofaraheadoftheirneighbors.Associatea“l(fā)evel”witheachcomponent,asbefore.Numberofnodesinalevelkcomponent2k.Now,eachlevelk+1componentwillbe(initially)formedfromexactlytwolevelkcomponents.Levelnumbersareusedforsynchronization,andindeterminingwhoisinthesamecomponent.Complexity:Messages:O(|E|+nlogn)Time:O(nlogn(d+l),.,56,GHSalgorithm,Combinepairsofcomponentsintwoways,mergingandabsorbing.Merging:CandChavesamelevelk,andhaveacommonMWOE.ResultisanewmergedcomponentC,withlevelk+1.,.,57,GHSalgorithm,Absorbing:level(C)level(C),andCsMWOEleadstoC.ResultistoabsorbCintoC.Notcreatinganewcomponent,justaddingCtoexistingC.C“catchesup”withthemoreadvancedC.Absorbingischeap,local.Mergingandabsorbingensurethatthenumberofnodesinanylevelkcomponent2k.MergingandabsorbingarebothallowableoperationsinfindingMST,becausetheyareallowedbythegeneraltheoryforMSTs.,.,58,Liveness,Q:Whyaremergingandabsorbingsufficienttoensurethattheconstructioniseventuallycompleted?Lemma:Afteranyallowablefinitesequenceofmergesandabsorbs,eithertheforestconsistsofonetree(soweredone),orsomemergeorabsorbisenabled.,.,59,Liveness,Proof:Considerthecurrent“componentdigraph”:Nodes=componentsDirectededgescorrespondtoMWOEsThentheremustbesomepairC,CwhoseMWOEspointtoeachother.(Why?)TheseMWOEsmustbethesameedge.(Why?)Cancombine,usingeithermergeorabsorb:Ifsamelevel,merge,elseabsorb.So,mergingandabsorbingareenough.Now,howtoimplementthemwithadistributedalgorithm?,.,60,Componentnamesandleaders,Foreverycomponentwithlevel1,definethecoreedgeofthecomponentstree.Definedintermsofthemergeandabsorboperationsusedtoconstructthecomponent:Aftermerge:UsethecommonMWOE.Afterabsorb:Keeptheoldcoreedgeofthehigher-levelcomponent.“Theedgealongwhichthemostrecentmergeoccurred.”Componentname:(core,level)Leader:Endpointofcoreedgewithhigherid.,.,61,Determiningifanedgeisoutgoing,Supposeiwantstoknowiftheedge(i,j)isoutgoingfromiscurrentcomponent.Atthatpoint,iscomponentnameinfoisup-to-date:Componentisin“searchmode”.ihasreceivedinitiatemessagefromtheleader,whichcarriedcomponentname.Soisendsjatestmessage.Threecases:,.,62,Determiningifanedgeisoutgoing,Threecases:Ifjscurrent(core,level)isthesameasis,thenjknowsthatjisinthesamecomponentasi.Ifjs(core,level)isdifferentfromisandjslevelisis,thenjknowsthatjisinadifferentcomponentfromi.Componenthasonlyonecoreperlevel.Nooneinthesamecomponentcurrentlyhasahigherlevelthanidoes,sincethecomponentisstillsearchingforitsMWOE.Ifjslevelisis,thenjdoesntknowifitisinthesameoradifferentcomponent.Soitdoesntyetrespond-waitstocatchuptoislevel.,.,63,Liveness,again,Q:Cantheextradelaysimposedhereaffecttheprogressargument?No:Wecanredotheprogressargument,thistimeconsideringonlythosecomponentswiththelowestcurrentlevelk.AllprocessesinthesecomponentsmustsucceedindeterminingtheirMWOEs,sothesecomponentssucceedindeterminingthecomponentMWOE.IfanyoftheselevelkcomponentsMWOEsleadstoahigherlevel,canabsorb.Ifnotthenallleadtootherlevelkcomponents,soasbefore,wemusthavetwocomponentsthatpointtoeachother;socanmerge.,.,64,InterferenceamongconcurrentMWOEsearches,SupposeCgetsabsorbedintoCviaanedgefromitoj,whileCisworkingondeterminingitsMWOE.Twocases:jhasnotyetreporteditslocalmwoewhentheabsorboccurs.ThenitsnottoolatetoincludeCinthesearchfortheMWOEofC.SojforwardstheinitiatemessageintoC.jhasalreadyreporteditslocalmwoe.ThenitstoolatetoincludeCinthesearch.Butitdoesntmatter:theMWOEforthecombinedcomponentcantbeoutgoingfromanodeinCanyhow!,.,65,Afewdetails,Specificmessages:initiate:BroadcastfromleadertofindMWOE;piggybackscomponentname.report:ConvergecastMWOEresponsesbacktoleader.test:Askswhetheranedgeisoutgoingfromthecomponent.accept/reject:Answers.changeroot:SentfromleadertoendpointofMWOE.connect:SentacrosstheMWOE,toconnectcomponents.Wes
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 廣東外語外貿(mào)大學(xué)《大數(shù)據(jù)運(yùn)維實(shí)驗(yàn)》2023-2024學(xué)年第一學(xué)期期末試卷
- 廣東食品藥品職業(yè)學(xué)院《藝術(shù)作品朗誦》2023-2024學(xué)年第一學(xué)期期末試卷
- 廣東石油化工學(xué)院《傳統(tǒng)建筑與園林營造》2023-2024學(xué)年第一學(xué)期期末試卷
- 廣東汕頭幼兒師范高等??茖W(xué)?!豆P(guān)理論與實(shí)務(wù)》2023-2024學(xué)年第一學(xué)期期末試卷
- 廣東培正學(xué)院《會(huì)計(jì)信息系統(tǒng)》2023-2024學(xué)年第一學(xué)期期末試卷
- 七年級(jí)上冊(cè)《6.1.1 立體圖形與平面圖形》課件與作業(yè)
- 七年級(jí)上冊(cè)《2.2.1 第2課時(shí) 有理數(shù)乘法的運(yùn)算律》課件與作業(yè)
- 廣東南方職業(yè)學(xué)院《教育研究概論》2023-2024學(xué)年第一學(xué)期期末試卷
- 廣東茂名農(nóng)林科技職業(yè)學(xué)院《播音主持》2023-2024學(xué)年第一學(xué)期期末試卷
- 廣東理工職業(yè)學(xué)院《實(shí)驗(yàn)核醫(yī)學(xué)》2023-2024學(xué)年第一學(xué)期期末試卷
- 大型活動(dòng)車輛調(diào)度管理方案
- 醫(yī)生幫扶計(jì)劃和幫扶措施
- 房屋永久居住權(quán)合同范本
- 浙江省寧波市慈溪市2023-2024學(xué)年高二上學(xué)期期末考試 歷史 含解析
- 《新聞傳播倫理與法規(guī)》習(xí)題與答案
- 上海市市轄區(qū)(2024年-2025年小學(xué)五年級(jí)語文)人教版期末考試(下學(xué)期)試卷及答案
- 電信業(yè)務(wù)運(yùn)營與服務(wù)規(guī)范
- 信息安全技術(shù)測(cè)試題與答案
- 安保工作考核表
- 收費(fèi)站突發(fā)事件應(yīng)急預(yù)案(10篇)
- 2024年-2025年公路養(yǎng)護(hù)工理論知識(shí)考試題及答案
評(píng)論
0/150
提交評(píng)論