算法高级教程3.10.2OnlineBipartiteMatching.pptx
- 文档编号:1097753
- 上传时间:2022-10-16
- 格式:PPTX
- 页数:75
- 大小:390.95KB
算法高级教程3.10.2OnlineBipartiteMatching.pptx
《算法高级教程3.10.2OnlineBipartiteMatching.pptx》由会员分享,可在线阅读,更多相关《算法高级教程3.10.2OnlineBipartiteMatching.pptx(75页珍藏版)》请在冰豆网上搜索。
,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:
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 算法 高级 教程 3.10 OnlineBipartiteMatching