算法高级教程3.10.2OnlineBipartiteMatching优质PPT.pptx

上传人:b****1 文档编号:14017646 上传时间:2022-10-16 格式:PPTX 页数:75 大小:390.95KB
下载 相关 举报
算法高级教程3.10.2OnlineBipartiteMatching优质PPT.pptx_第1页
第1页 / 共75页
算法高级教程3.10.2OnlineBipartiteMatching优质PPT.pptx_第2页
第2页 / 共75页
算法高级教程3.10.2OnlineBipartiteMatching优质PPT.pptx_第3页
第3页 / 共75页
算法高级教程3.10.2OnlineBipartiteMatching优质PPT.pptx_第4页
第4页 / 共75页
算法高级教程3.10.2OnlineBipartiteMatching优质PPT.pptx_第5页
第5页 / 共75页
点击查看更多>>
下载资源
资源描述

算法高级教程3.10.2OnlineBipartiteMatching优质PPT.pptx

《算法高级教程3.10.2OnlineBipartiteMatching优质PPT.pptx》由会员分享,可在线阅读,更多相关《算法高级教程3.10.2OnlineBipartiteMatching优质PPT.pptx(75页珍藏版)》请在冰豆网上搜索。

算法高级教程3.10.2OnlineBipartiteMatching优质PPT.pptx

,OnlineBipartiteMatching,Amatchmakerandnboysaregatheredinaroom.ngirlsappear,oneatatime.Eachgirlhasalistofboyswhoareacceptabletoher,whichsherevealstothematchmakerassheappears.Thematchmakerimmediatelymatchesthenewgirltooneoftheboysonherlist,ifanyofthemareavailable.Thegoalistomaximizethenumberofmatches.,2,ImportanceofMatching,ResourceAllocationSchedulingMemoryManagementRoutingRobotMotionPlanningExploringanunknownterrainFindingadestinationComputationalFinance,Subroutineinmanyotheralgorithms.,GivenasinputabipartitegraphG=(U,V,E)inwhicheachvertexuU(girls)arrivesinonlinefashion,deviseanalgorithmthatmatchesu(girl)toone(boy)ofitspreviouslyunmatchedneighboursinV.Thematchinghastobeimmediateandisirrevocable,oncemade.Theobjectiveistomaximizethesizeoftheresultingmatching.AssumethattheinputgraphGhasaperfectmatchingi.e.amatchingofsizen.Wedenoteaperfectmatchingbyafunctionm:

@#@UV.Hence,ac-competitivealgorithmmustreturnamatchingofsizeatleastcn.,4,DeterministicAlgorithm,whenuarrivesassignittoasomeunmatchedneighbour.Lemma3.10.1.Theabovealgorithmhasacompetitiveratioof1/2.Proof.Ifavertexu1isnotpresentintheresultingmatchingM,thenitdoesnothaveanunmatchedneighbour,ifnot,wewouldhavematchedu1tothatneighbour.Hence,theresultingmatchingmustbemaximal.Foreveryedgeu,m(u),eithervertexuorm(u)ispresentinM.So,atleastn/2verticesarematchedandhencethealgorithmhasacompetitiveratioof1/2.,5,Onlinebipartitematching,V(boys),U(girls),Onlinebipartitematching,V(boys),U(girls),Onlinebipartitematching,V(boys),U(girls),Onlinebipartitematching,V(boys),U(girls),Onlinebipartitematching,V(boys),U(girls),Onlinebipartitematching,V(boys),U(girls),Onlinebipartitematching,V(boys),U(girls),Wecanprovethatanydeterministicalgorithmcannotdobetterthantheobviousalgorithm.Anadversarycanlimitthesizeofmatchington/2inthefollowingway:

@#@Letthefirstn/2verticesthatarrivehaveedgestoalltheverticesinV.Clearly,theadversarycandeterminetheverticesinVthatwillbematched.Letthenextn/2verticesthatarrivecontainedgesonlytothoseverticesinVwhicharealreadymatched.Theinputgraphhasaperfectmatchingbutthesecondhalfoftheverticesarenotmatched;@#@henceouranalysisistightforthedeterministiccase.,13,Onlinebipartitematching,n/2,:

@#@n/2:

@#@,V(boys),U(girls),Onlinebipartitematching,n/2,:

@#@n/2:

@#@,V(boys),U(girls),Onlinebipartitematching,:

@#@,:

@#@,n/2,V(boys),U(girls),RandomizedAlgorithm,Foreachpossibleinput,calculatetheexpectationoftheanswerandtaketheworstexpectedvalueamongalltheinputs.Inourcase,aninputinstancewouldbespecifiedbyagraphGalongwithanarrivalorder.Sotheinputspacewouldcontainallpossible(G,)pairs.Themostnaturalwaytointroducerandomnesswouldbetomatchutooneoftheunmatchedneighbourspickedrandomly.Thisalgorithmperformsbetterthanthedeterministicalgorithm;@#@howevertheimprovementisnotsubstantial.,17,Lemma3.10.2.Arandomizedalgorithmthatpicksanunmatchedneighbouruniformlyandrandomlyhasacompetitiveratioofatmost1/2+O(logn)/n.Proof.Toseewhythisisthecase,considerthefollowinginput.Letu1,.,unUandv1,.,vnV.Thereisanedgebetweenuiandviforalli.EveryvertexinthefirsthalfofU=u1,.,un/2isconnectedtoeveryvertexinthesecondhalfofV=vn/2,.,vnasshownbelow:

@#@,18,Onlinebipartitematching,:

@#@,:

@#@,n/2,n/2,VU,u1,un/2un/2+1,:

@#@,:

@#@,v(boys)(girls),1,vn/2vn/2+1,vnun,Tightinstanceforthenaverandomizedalgorithm,Theverticesarriveintheorderoftheirindices.Intuitively,thealgorithmfailstoperformwellonthisinputsinceitmatchestoomanyusfromthefirsthalftothevsofthesecondhalf.Thefirstn/2verticesfromUaredefinitelyinthematchingsinceallofthemgetatleastoneunmatchedneighbourwhentheyarrive.EachuifromthesecondhalfofUcanbematchedtovi,ifviisnotalreadymatched.Whatistheprobabilitythatthishappens?

@#@,20,LetusfindtheexpectednumberofverticesthatarematchedinthefirsthalfofV.Whenu1arrives,itcanpickeitherv1orvn/2,.,vn.Sotheprobabilityofv1gettingmatchedis1/(n/2+1).Similarly,whenu2arrives,theprobabilitythatv2getsmatchedis:

@#@,21,Similarly,probabilityofv3gettingmatchedislessthan1/(n/21)andingeneralavertexviinthefirsthalfofVhaslessthan1/(n/2i+2)probabilityofbeinginthematching.LetEvbetheexpectednumberofverticesfromv1,.,vn/2inthematching.,Hence,lessthanO(logn)unmatchedneighboursareexpectedtobeavailabletothesecondhalfofU,whichprovesourclaim.22,Rankingalgorithm,Aslightlydifferentrandomizedalgorithm,namedRankingKarp,performsmuchbetter.Thealgorithmisasfollows:

@#@Ranking()Initialization:

@#@Pickarandompermutation(ranking)oftheverticesinVForeachuUthatarrives:

@#@

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 成人教育 > 成考

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1