已阅读5页,还剩64页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1 AlgorithmsinGeneralAsynchronousNetworks 沈卓炜zwshen 九龙湖校区计算机楼347房间Tel 52090919133909229522011年3月 2 Leaderelectioningeneralasynchronousnetworks Undirectedgraphs CangetasynchronousversionofsynchronousFloodMaxalgorithm Simulateroundswithcounters Needtoknowdiameterfortermination FloodMaxalgorithm Everyround SendmaxUIDseentoallneighbors Stopafterdiamrounds ElectselfiffownUIDismaxseen 3 Leaderelectioningeneralasynchronousnetworks We llseebetterasynchronousalgorithmslater Don tneedtoknowdiameter 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 Allowonlydistanceestimates D Messages O D E Time O diamD l d 37 AsynchBFS Termination Nooneknowswhenthisisdone socan tproduceparentoutputs 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 eachnodeatdistance kknowsitsparent andeachnodeatdistance k 1alsoknowsitschildren i0broadcastsnewphasemessagealongtreeedges todistancekprocesses Eachofthesesendssearchmessagetoallnbrsexceptitsparent Whenanynon i0processreceivesfirstsearchmessage setsparent senderandsendsapositiveack sendsnacksforsubsequentsearchmsgs Whendistancekprocessreceivesacks nacksforallitssearchmessages designatesnodesthatsentpostiveacksasitschildren Thendistancekprocessesconvergecastbacktoi0alongdepthktreetosaythatthey redone 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 Possibledistanceestimatesforikare2k 1 2k 2 0 Moreover ikcantakeonalltheseestimatesinsequence First messagestraverseupperlinks 2k 1 Thenlastlowermessagearrivesatik 2k 2 Thenlowermessageik 2 ik 1arrives reducesik 1 sestimateby2 messageik 1 ikarrivesonupperlinks 2k 3 Etc Countdowninbinary Ifthishappensquickly getpileupof2ksearchmessagesinCk k 1 47 ShortestPaths Moral Unrestrainedasynchronycancauseproblems Returntothisproblemafterwehavebettersynchronizationmethods Now anothergoodillustrationoftheproblemsintroducedbyasynchrony 48 Minimumspanningtree Assumptions G V E connected undirected Weightededges weightsknowntoendpointprocesses weightsdistinct UIDsProcessesdon tknown 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 notretestingsameedgeonceit srejected Q Howtorunthisalgorithmasynchronously 52 RunningtheAlgasynchronously Problemsarise Inaccurateinformationaboutoutgoingedges Insynchronousalgorithm whenanodetestsitsedges itknowsthatitsneighborsarealreadyuptothesamelevel andhaveup to dateinformationabouttheircomponent Inasynchronousversion neighborscouldlagbehind theymightbeinsamecomponentbutnotyetknowthis Less balanced combinationofcomponents Insynchronousalgorithm levelkcomponentshave 2knodes andlevelk 1componentsareconstructedfromatleasttwolevelkcomponents Inasynchronousversion componentsatdifferentlevelscouldbecombined Canleadtomoremessagesoverall 53 RunningtheAlgasynchronously Problemsarise Inaccurateinformationaboutoutgoingedges Less balanced combinationofcomponents Concurrentoverlappingsearches convergecasts Whennodesareoutofsynch concurrentsearchesforMWOEscouldinterferewitheachother we llseethis Timebound Theseproblemsresultfromnodesbeingout of synch atdifferentlevels Wecouldtrytosynchronizelevels butthismustbedonecarefully soasnottohurtthetimecomplexitytoomuch 54 GHSalgorithm Samebasicideasasbefore Formcomponents combinealongMWOEs Withinanycomponent processescooperatetofindcomponentMWOE Broadcastfromleader convergecast etc 55 GHSalgorithm Introducesynchronizationtopreventnodesfromgettingtoofaraheadoftheirneighbors Associatea level witheachcomponent asbefore Numberofnodesinalevelkcomponent 2k Now eachlevelk 1componentwillbe initially formedfromexactlytwolevelkcomponents Levelnumbersareusedforsynchronization andindeterminingwhoisinthesamecomponent Complexity Messages O E nlogn Time O nlogn d l 56 GHSalgorithm Combinepairsofcomponentsintwoways mergingandabsorbing Merging CandC havesamelevelk andhaveacommonMWOE ResultisanewmergedcomponentC withlevelk 1 57 GHSalgorithm Absorbing level C level C andC sMWOEleadstoC ResultistoabsorbCintoC Notcreatinganewcomponent justaddingCtoexistingC C catchesup withthemoreadvancedC Absorbingischeap local Mergingandabsorbingensurethatthenumberofnodesinanylevelkcomponent 2k MergingandabsorbingarebothallowableoperationsinfindingMST becausetheyareallowedbythegeneraltheoryforMSTs 58 Liveness Q Whyaremergingandabsorbingsufficienttoensurethattheconstructioniseventuallycompleted Lemma Afteranyallowablefinitesequenceofmergesandabsorbs eithertheforestconsistsofonetree sowe redone orsomemergeorabsorbisenabled 59 Liveness Proof Considerthecurrent componentdigraph Nodes componentsDirectededgescorrespondtoMWOEsThentheremustbesomepairC C whoseMWOEspointtoeachother Why TheseMWOEsmustbethesameedge Why Cancombine usingeithermergeorabsorb Ifsamelevel merge elseabsorb So mergingandabsorbingareenough Now howtoimplementthemwithadistributedalgorithm 60 Componentnamesandleaders Foreverycomponentwithlevel 1 definethecoreedgeofthecomponent stree Definedintermsofthemergeandabsorboperationsusedtoconstructthecomponent Aftermerge UsethecommonMWOE Afterabsorb Keeptheoldcoreedgeofthehigher levelcomponent Theedgealongwhichthemostrecentmergeoccurred Componentname core level Leader Endpointofcoreedgewithhigherid 61 Determiningifanedgeisoutgoing Supposeiwantstoknowiftheedge i j isoutgoingfromi scurrentcomponent Atthatpoint i scomponentnameinfoisup to date Componentisin searchmode ihasreceivedinitiatemessagefromtheleader whichcarriedcomponentname Soisendsjatestmessage Threecases 62 Determiningifanedgeisoutgoing Threecases Ifj scurrent core level isthesameasi s thenjknowsthatjisinthesamecomponentasi Ifj s core level isdifferentfromi sandj slevelis i s thenjknowsthatjisinadifferentcomponentfromi Componenthasonlyonecoreperlevel Nooneinthesamecomponentcurrentlyhasahigherlevelthanidoes sincethecomponentisstillsearchingforitsMWOE Ifj slevelis i s thenjdoesn tknowifitisinthesameoradifferentcomponent Soitdoesn tyetrespond waitstocatchuptoi slevel 63 Liveness again Q Cantheextradelaysimposedhereaffecttheprogressargument No Wecanredotheprogressargument thistimeconsideringonlythosecomponentswiththelowestcurrentlevelk AllprocessesinthesecomponentsmustsucceedindeterminingtheirMWOEs sothesecomponentssucceedindeterminingthecomponentMWOE Ifanyoftheselevelkcomponents MWOEsleadstoahigherlevel canabsorb Ifnotthenallleadtootherlevelkcomponents soasbefore wemusthavetwocomponentsthatpointtoeachother socanmerge 64 InterferenceamongconcurrentMWOEsearches SupposeCgetsabsorbedintoC viaanedgefromitoj whileC isworkingondeterminingitsMWOE Twocases jhasnotyetreporteditslocalmwoewhentheabsorboccurs Thenit snottoolatetoincludeCinthesearchfortheMWOEofC SojforwardstheinitiatemessageintoC jhasalreadyreporteditslocalmwoe Thenit stoolatetoincludeCinthesearch Butitdoesn tmatter theMWOEforthecombinedcomponentcan tbeoutgoingfromanodeinCanyhow 65 Afewdetails Specificmessages initiate BroadcastfromleadertofindMWOE piggybackscomponentname report ConvergecastMWOEresponsesbacktoleader test Askswhetheranedgeisoutgoingfromthecomponent accept reject Answers changeroot SentfromleadertoendpointofMWOE connect SentacrosstheMWOE toconnectcompon
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 小学三年级信息技术教学设计:数字载体寄深情-第十三课“飞鸿传书寄深情”单元实施
- 初中八年级物理《长度和时间的测量-运动的快慢》周测习题讲评教学设计
- 高二英语选修二Unit 4 Integrated skills与Extended reading教学设计
- 初中七年级科学 地球的转动与昼夜更替 教学设计
- 初中七年级英语教学设计:Unit 4 Developing Ideas 听说课深度教学实践
- 贵州招聘辅导员考试题目及答案
- 疫情防控员招聘面试题目及答案
- 梅毒、淋病和生殖器疱疹诊疗指南之梅毒2026
- 专题二 中国古代的法律教化、民族关系与对外交往
- 高中数学教资面试必练考题2026试卷及答案
- 2025年烟花爆竹经营单位主要负责人模拟考试题及答案
- 《高龄脊柱融合术加速康复外科关键措施管理指南(2024版)》解读
- 2023-2024学年四川省成都市金牛区九年级上学期期末考试英语试卷
- 心内科护理新进展
- IATF16949应急计划演练报告(全套)
- 大学生国家安全教育智慧树知到期末考试答案章节答案2024年
- 《弟子规》全文及解释(打印版)
- 2024年第五届全国版图知识竞赛真题模拟汇编
- 欢乐的那达慕混声合唱简谱
- 湖南宝山铅锌铜多金属矿成矿特征及找矿方向的中期报告
- DB42-T 2140.1-2023 人事考试考场设置规范 第1部分:笔试
评论
0/150
提交评论