/
Chapter Selecting the median DoritDor Uri Zwick Abstract Impro ving a long standing result Chapter Selecting the median DoritDor Uri Zwick Abstract Impro ving a long standing result

Chapter Selecting the median DoritDor Uri Zwick Abstract Impro ving a long standing result - PDF document

myesha-ticknor
myesha-ticknor . @myesha-ticknor
Follow
517 views
Uploaded On 2014-12-18

Chapter Selecting the median DoritDor Uri Zwick Abstract Impro ving a long standing result - PPT Presentation

In troduction The sele ction pr oblem is de ned as follo ws giv en set con taining distinct elemen ts dra wn from totally ordered domain and giv en a n um b er 1 nd the th or der statistic of ie the elemen t of larger than exactly 1 elemen ts of an ID: 25673

troduction The sele

Share:

Link:

Embed:

Download Presentation from below link

Download Pdf The PPT/PDF document "Chapter Selecting the median DoritDor Ur..." is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.


Presentation Transcript

DoritDorvingalongstandingresultofSconhage,PatersonandPippengereshoasettscanbefoundusingatmost2troductiontotallyordereddomain,andgivenanber1 ndthederstatistic,i.e.,theelementoflargerthanexactly1elementsofandsmallerthantheothertsofisthe-thorderstatisticofTheselectionproblemisoneofthemostfundamen-beenelystudied.Selectionisusedasabuildingblocinthesolutionofothertalproblemssucsortingand ndingconexhulls.Itissomewhatsurpris-ingthereforeonlyintheearly70'sitwasshosho+73],thattheselectionproblemcanbesolvedin)time.problem,theworkofBlumetal.completelysolvestheproblem.Ordoesit?AverynaturalsettingfortheselectionproblemisarisonmoAnalgorithminthismodelcantheinputtsonlybyperformingpairwisebethargedfortheseThecomparisonmodelmodelsbecomparisoncomplexityof ndingthemedian?thatexactly1comparisonsareneeded,inthewcase,to ndthemaximumorminimumofhreier[Sch32],Kislitsyn[Kis64e tofComputerScience,SchoolofSciences,RaymondandBeverlySacklerFyofExactSciences,elAvivUniv,TelAviv69978,ISRAEL.E-mailaddressescomparisonsareneededto ndboththemaximumandumofofoh72]).Exactly2n1comparisonsareneededtomergetosortedlistshoflength(StocerandYao[SY80)comparisonsareneededtosort(e.g.,FordandJohnson[FJ59Arelativelylargegap,consideringthefundamenbetwnloerandupperboundsontheexactcom-yof ndingthemedian.Afterpresentingabasicbee+73]trytooptimizetheiralgorithmandalgorithmthatper-boundcomparisonsarerequired,intheworstcase,to ndtheTheresultofBlumetal.issubsequenedbySconhage,PatersonandPippenger[SPP76whopresentabeautifulalgorithmfortheselectionofthemedian,oranyotherelement,usingatmost3Inthisworkweimproethelongstand-algorithmthatusesatmost2andJohn[BJ85](seealsoJohn[Joh88]),im-vingpreviousresultsofKirkpatrick[Kir81],MunroMunroandFusseneggerandGabooG78],obtaineda(1+)loerboundonberofcomparisonsneededtoselecttofasetofts,where)= )log isthebinaryenfunction(alllog-paperwnrecently[DZ95](usingsomewhatdi erentmeth-odsfromtheonesusedhere)thatthe-thelementcanbeselectedusingatmost(1+ loglog Thisforsmallvaluesofisalmostopti-boundinparticulara2)loerboundonthenberofcomparisonsneededto ndthemedian.Ourworkslightlynarrowsthegapbeteenthebestwnloerandupperboundsonthecomparisoncom-medianproblem.tisquitemodest,manynewideaswererequiredtoobtainit.Thesenewideasshedsomemorelightonthetricacyofthemedian ndingproblem. DorandAlgorithmsforselectingthe-thelementforsmallaluesofereobtainedbyHadianandSobel[HS69[HS69a76],Yap[Yap76],RamananandHya l[RH84],Aigner[Aig82]andEusterbrock[Eus93berofcomparisonsneededintheworstcc]showedthatthei-thelementcanbebercomparisons.CuntoandMunro[CM89]hadshownthattheboundofFloydandRivestistightralideausedyScetal.intheirforthemassproductioneintroducefactoriesandperformananalysisoftheirproductioncosts.eobtainimprogreenfactoriesusingwhichwecanimproethe3resultofSconhage,PatersonandPippenger.Theperformanceofagreenfactoryismainlycacterizedbytoparameters)comparisons.oselectthemedian,euseafactorywith;A95.Actually,thereisatradeo beteentheloeranduppercostsofafactoryorev2wychooseecanselectthet,forexample,usingatmost2yusingafactorywith4andInthispaper,weconcentrateonfactoriesformedianselection.Itiseasytoverifythatthealgorithmdescribedhere,asthemedian ndingalgorithmsofbothBlumetal.etal.,canbeimplementedinlineartimeintheRAMmodel.describeinmoredetailtheconceptoffactoryproductionandintroduceournotionpropertiesalgorithmwedescribeisageneralizationofthemedianmedian]andissimilartotheselectionalgorithmwedescribee].Inthesubsequentsectionswetrytodemonstratethemainideasusedintheconstructionofournewgreenfactories.Duetolackofspace,manyofthedetailsareomitted.actoryproductioncomposedtssmallerthanFig.1). }| { | {z Figure1:Thepartialorderorder]showthatproducingusuallyrequiresfewercomparisonsthantimestheberofcomparisonsrequiredtoproduceasingleThebestw,priortothiswork,ofproducingasingleaboutthemedianof2+1elementsusingthe3)mediancostperycanbecutbyalmostahalfifthe'saremassproducedusingfactories.Theinputstreamofasimplefactoryconsistsofsingle,anewdisjointcopyofisproduced.Afactoryiscythewingquanistheberofcomparisonsneededber;and nallytheductionr,whichisthemaximalnberfactorywhenlackofinputsstopsproduction.orev[SPP76]constructfactorieswiththefollowingcinitialck;etal.alsoshowthatifthereex-istfactories,for's,satisfying,forsomeA�0,and;Rmedianoftscanbefoundusingatmost)compar-Theaboetheoremimmediatelyimpliesthereforetheexistenceofa3)medianalgorithm.Thewyfactoriesareusedbyselectionalgorithmsisdescribedinthenextsection.ornowwejustmen-yaselectionalgorithmareevtuallybroken,withei-upperyhacomparedel-besamesideoftheIfsuchelementsareeverreturnedtothefactorytheknownrelationsamongthemmaysaethefactory SELECTINGTHEMEDIANsomeofthecomparisonsithastoperform.ocapturethatsupportwnrelations).ThisextensionisimplicitinthewofScetal.[SPP76].Makingthisnotionexplicitsimpli estheanalysisofmedianalgorithmofScetal.isinfactobtainedyreplacingthefactoryofTheorem2.1byasimplegreenfactoryAgreenfactoryfor'sismainlycharacterizedbthefollowingtoquanlowerelementcandtheerelementcUsingtheseproductionbecalculatedasfollows:TheamortizedproductioncostofwhoseuppertsareevtuallyreturnedproductiontuallyreturnedTheamortizedproductioncostofanhthatnoneofitselementsisreturnedtothefactoryisNotethatinthisaccountingschemeweattributealltheproductioncosttoelementsthatarenotreturnedtothe.Theinitialcostandtheproductionresidueofabefore.in[DZ95Thenewde nitionusesamortizedcostsperwhereasouroldde nitionusedamortizedcostsperdoesancewhethertheloerorupperpartofageneratedbeimplicitin[SPP76].eisagrenfactory;uandprductionr;u3heremeansthat;u3+(1)wherethe(1)iswithrespecttoupperethealgorithmoftoconstructsuchafactoryer,weareabletoreducetheupperandloythefactoryk;econstructedgreenfactoriesthatgeneratepartialordersthataremembersbeeasilyincorporateddescribedoobtainour2medianalgorithmweusegreenwiththefollowingc Figure2:Theorderedlistofeisagrenfactory;umainideasaredescribedinSection5.SelectionalgorithmsInthissectionwedescribeourselectionalgorithm.ThisalgorithmusesanThecomplexityoftheal-gorithmiscompletelydeterminedbythecofthefactoryused.ThisalgorithmisageneralizationofthemedianalgorithmofScetal.andavationoftheselectionalgorithmwedescribein[DZ95smallestusingatmost+(1amongtheinputelementsasthepercenalgorithmusestsaretothis,asproductionserted,usingbinaryinsertion,intoanorderedlist,asw,aseshallsoonshow,thatupper(i.e.,last)andtheelementsaboeittoolargetobepercent,orthatthetreoftheloer(i.e., rst)andtheelementsbeloitaretoosmalltobethepercentileelementoolargeortoosmalltobethepercentareupperuppertsofthetothefactoryforrecycling.beoftheandletbethenberofelementscurrentlyinthefactory.Theberofelementsthathaenotybeen=(betheofthepercentileelementamongthenon-eliminatedelemen Dorandberbeupperberbe=(asthecentresofallthe'sinthelistsatisfyboththesecriteria,thetsarecurrentlyinthefactorysatisfyneither,andalltheothernon-eliminatedtssatisfyexactlyoneofthesecriteria.nectedprocesses:tlymanyelementsarepartialorderproducedanditsisinsertedtotheusingbinaryinsertion.�ithecenoftheupperabotoobepercen�N+1,thecentreofthelopartialorderlistandbelowitareeliminated,astheyaretoosmalltobepercenupperarerecycled.Thevalueofisupdatedaccordinglyisdecrementedbythenberofelementsintheloerpartof(includingthecen+1.+1andisnotapplicablethenythede nitionwehaWhennooneof(i),(ii)and(iii)canbeappliedwegetthattthisstage),whichis),andtheylinearselectionalgorithm.enowanalyzethecomparisoncomplexityoftheperformed,upperpartialorderofthelistisbrokItscentreandupperarereturnedtothefactoryTheamortizedproductionpartialorderpereachelementaboethecener(iii)isperformed,theloestpartialorderupperreturnedtothefactoryTheamortizedproductioncostperhelementbelowthecentslargerthanthepercentileelementandatmosttssmallerthanthepercentotalproductioncostofallpartialordersareevtuallybrokenisthereforeatmost(+(1).Atmost)generatedpartialordersproductionproductiontotalnberofcomparisonsperformedbythefactoryistherefore(+(1bethe nallengthofthelist(whennoneof(i),(ii)and(iii)isapplicable).totalnberofpartialordersisatmost,asisremoedfromThetotalcostofthebinaryinsertionsintothelistisatmost)=)log)whichisThetotalnberofcomparisonsperformedbythealgorithmisthereforeatmost(+(1),asrequired.UsingtheofTheorem2.3,wobtainourmainresult:anbeseledusingatmostBasicprinciplesoffactorydesigndividedintothreesubsections.Inthe rstsubsectionwremindtheareandwhattheirdescribethenotionofInthethirdsubsectionwesktheconstructionofthefactoriesofScetal.al.Thesefactoriesaredescribedforasimplefactorydesign.describetingprincipleintroducedbyScetal.simplifytheyanalysis.informationwcaretorememberontheelementsthatpassthroughthefactorycanalwysbedescribedusingaHassediagram.hcomparisonmadebythealgorithmaddsanedgepossiblysomestageswemaydecideto`forget'theresultofsomecomparisonsandtheedgesthatcorrespondtothemarebermade,wecanttheberofedgesothisberremaininthefactorywhentheproductionstops.ber,inourfactories,isatmostaconstantimestheproductionresidueoftheanditcanbeattributedtotheinitialcost.Hyperpairsductionofapartialorderfromyproducingalargepartialorder,ahyp,thatcontainsapartialorder SELECTINGTHEMEDIAN Figure3:Somesmall's(Definition4.1.nhyp,wherisabi-narystring,isa nitepartialorderwithadistinguishesingleelement(estandsfortheemptystring).isobtainedinthesamewaybuttakingthelowerofthetwocesasthenewcdiagramsofsmallhyperpairspropertiesyperpairsaregiveninthefollowingLemma.etheceofahyp(i)ThecgetherwiththeelementsaterthanitformawithcTheelementsaterthanformadisjointsetofhypsmallerthanitformawithcTheelementssmallerthanformadisjointsetofhyp(ii)Thesmallerwith0,with1.betainsanNoedgesarecutduringtheyperpairs.beforeoutputtingantainedinayperpair,allthetheelementsofthiswithelementsnotcontainedinetobecut.Thisrathercostlyoperationisreferredtoasdpruningc)ofahyperpairberofedgestsofthatarebelowthecenwiththeothertsofdpruningc)ofahyperpairisde nedanalogously,especiallyifagraftingprocessabobeloyperpairmoreconttoconsidertheperelemenpruningcosts.bethenberof0'sand)=tobethebetsbeloatmost)+andthecostofpruningtsaboisatmost)+berWhenanedgeconnectediscut,ayperpairThishyperpaircanthenbeusedintheconstructionofthenextThefollowingLemmaiseasilypro)=0)=0)=)+1)= )= )=)+1producelargervaluesof,wehaetoconstructlargerandlargeryperpairs.Whenwedesignafamilyoffacto-ries,weusuallychooseanin nitebinarystringhmemberofthisfamilyweconstructahyperpairlongenoughbeuppertpruningcostsofanin nitesequencearede nedasthelimits)=lim)and)=limTheselimitsdoexistforthehosenin nitestrings.etal.basetheirfactoriesonthein nite=01(10)forwhich,ascanbeeasilyv)=)=1Inourfactories,wealsoneedyperpairswithcheaperloerelementpruningcostand,expensivupperwingTheorempresenatradeo beteentheupperandloerelementpruningcosts.proofisomittedduetolackofspace.oranya;bW2fforwhich)=)=positiondescribebutcompleteSelectastringyperpairisalongenoughpre xofaboeandtsbelowthecentreofthis+1elementsformacopyofByLemma4.1(ii),theremainingelemenformadisjointcollectionofpartialordersoftheform,whereisapre xofpartialordersareusedtoconstructanewthatwillbeusedtoconstructthenexteoutputan,wecutthe2edgesitconsomepartofangeneratedbythefactoryisrecycled,theelementsreturnedtothefactory(assingletons)areusedagainfortheconstructionofhyperpairs.Itiseasytockthattheloerandupperelementcostsofthis Dorandsimplefactoryareboth;u)+)+2.oranW2fegetthattheloeranduppertcostsare;uofthesimplefactoriesscribedaboecanbesigni cantlyimproedusingecancheaply ndelementsthataresmallerthanthecenorelementsthatarelargerthanthecen(butnotbothusually).Theprocessof ndingsuchele-tsiscalledPruningisthenusedtoobtaintsontheoppositeside.edemonstratethisnotionusingasimpleexample,thegraftingofsingletons.eanelemen,notcon-tainedinthehyperpair,andcompareittothecenofthehyperpair.ueisthisw,comparingnewtstothecentre,untileithertsaboethetre,ortsbelowthecentrearefound.process.tsareputintheoutputpartialorder.Theprun-ingprocesscompletethepartialordertoanAddingthisprocesstooursimplefactory,theupperandloerelementcostsarereduced;u;pr+2(notethatnoehaetopruneelementsfromatmostoneside).;u5ifwetak=01(10)=10(01)proofleastonesideofeachgeneratediscomposedofsin-gletons,andifthissideisrecycled,nocomparisonscanbereused.PippengerenowskhtheoperationofthegreengreenThesefactoriesimproveuponscribedabostartsbyproducinghyperpairscorrespond-bebeoflengthorbrevitywSomesmall'swereshowninFig.3.ByLemma4.1,,where+1)tainsanconstructingan,thefactoryinitiatesthefollopairgraftingprocess:xybeapairofelementsandletbeocouninitiallysettreofthehyperpair.&#x-149;—.1;pyone.Ontheotherhand,ifxcthencomparealso,ifxycthenincreaseyone.inthesimplefactorydescribedinthegraftingconuesuntsareabobeloprocessabobeloerorupperpartofanisreturnedtsreturnedareutilized.Theamortizedanalysisofthegreenfactoryencompassesatrade-o betupperofScetal.ycon'sand's,wherei&#x-119;—.4;1,theirfactoryisonlycapableofutilizingpairwisetrelationsamongtheelementsreturnedtoit(asthegraftingprocessusespairs).Ifaora,withi&#x-119;—.4;1,isreturnedtothefactory,itisimmediatelybrokto2'sorNotethatbothbe[SPP76],thattheupperandloerelementcostsofthis;uisSc'sbestancedprinciplesoffactorydesignourimproedfactoriesthatyieldthedianalgorithm.The rstoftheseprincipleswasalreadywingvariationsintheproducedpartialorders.Ourfactoriesconstructpartialordersfrom.Theproportionbetberofelemenbelowandaboetheofageneratedorderisnot xedinadvRecyclinglargerrelations.ThefactoriesofScetal.areonlycapableofrecyclingpairs(i.e.,'sand's).Ourfactoriesoctetsandotherstructureswhicharenothyperpairs.yperpairconstructsareobtainedbythemoresophisticatedgraftingprocessesused.Constructinghyper-products.ordersthatcouldnotbeusedfortheconstructionofyperpairs.partialordersyper-product,whereissomepartialorderwithtre,isahyperpairthateachofitselemenisalsothecentreofadisjoinHyperpairsareofcoursespecialcasesofhyper-productsas SELECTINGTHEMEDIANGraftinglargerrelationsandmass-grafting.process.graftingprocesses,ifonlypairsareoreachinputconstructwehaedi erentgraftingprocesses.Someofourgraftingprocesseshniqueofmassproduction.Usingsub-factories.yperpairs(corresponding=01(10)).Ourfactoriesgenerateseveraltypesyperpairsyper-products,aboe.Theconstructionofeachoneofthesehyper-productsiscarriedoutinaseparatesub-productionunitthatwerefertoasatsub-factoriesalsodi erinthe`raw-materials'thattheycanprocess.Usingcreditsintheamortizedcomplexityanalysis.Thelastprincipleisanaccountingprinciple.beprocessmaterialsfortheconstructionofpartialordersfromresultsinamhhigherproductioncost.oequalizethesesignedacredit(ordebitifnegativextendedabstractforafulldescriptionofourfactories.Inthedescribeafactorythatcanbegreatlysimpli edversionofourbestfactorythatyieldsthe2medianalgorithm.actoriesformedianselectionsatisfyingtheditionsofTheorem2.3isextremelyinokthissectionrelativelyshort,wedescribehereasimpli-wingresulthisonlyslightlywTheorem2.3:eisagrenfactory;uconsidered,theunitcostofthisfactoryis(1)andtheinitialcostandproductionresiduesarebetutilizesonlysingletons,pairsandquartetsdoesbalancedhyperpairs.isabletorecycleonlyafractionofatmost638oftheelementsinproportionquartetshaetobebrokenintopairs.ofthefactoryInthesecondandthethirdsubsectionsdescribeprocesses.,inthelastsubsectionwegiveafulldescriptionofthefactoryasinputs,singletons,pairs('sandimmediatelyjoinedintopairs.ysfourprocesses:yperpairgeneration,pairgrafting,quartetgrafting,andpruning.Thefactoryystosub-factoriesthatgenerateyperpairs.yperpairsyperpairs'sarepassedtothe rstsub-factory'scanbeusedfortheconstructionofhyperpairscorrespondpassedtothesecondfactory(as'scanbeusedyperpairscorrespond=10(01)Inputpairsarespreadbeteenthetsub-factoriesaccordingtodemand.describedtion4tosimplifytheyanalysis.operationberWhennoamyoccurs,welettheerc)ofanoperationbethecostoftheoperationwhentheupperpart(orloerpart)ofitsresultiseliminated.NotethatupperandloercostsarecalculatedforwholetheupperandloarecalculatedpereliminatedelemenThefactoryisnotcapableofrecyclingelemeni�2,hastobecutthereforeintoacollectionof's(Thepriceofthisoperationis1edgeperelemenbebesomeoftheberecycledyhaetobecut.Theexactproportionofquartetsthatwouldhaetobecutisnotknowninhpartialordershouldbecforthecuttingoftheseedges?Theonebeingrecycledortheonebeingconstructed?Theansweristhatthecostshouldbesplitbeteentheseto.Theoptimalcheme,inthecaseof,turnsouttobethefollo Dorandmostafraction638oftherecycledtsareinquartets.Ifmoretsareinquartetsthensomeofthequartetscutandthisischargedtothepartialorderbeingrecycled.Ifduringbeisctothepartialorderbeingconstructed.thentakespairsandturnsthemintoquartets.Nocostisassociatedwiththisoperationasnoedgesarecut.factorytheninatleastonethetosub-factories,alargeyperpairbearrivingatthefactoryaretheneitherusedforgraftinginthe rstsub-factoryorusedfortheconstructionofalargeenoughyperpairalsoineralargeenoughhyperpairisformed,aquartetprocessprocessisappliedonit.honeofthethesegraftingprocesseshasacollectionofpossibleoutcomes.Insomeoutcomeselementswithlowupperelementcostbuthighuppertcostareobtained.Someoftheseoutcomescanbeupperwthatiftherearenosuchoutcomes(whichcanbebinedwithprunedelements)wecanalwyscomfromtheupperupperupperprocesses,eliminationitself.eliminationcostdoesnotcontainundirectedcycles(undirectedcycles,ifobtained,arebroklastremarkregardsoptimizationscpoinuponberthataretobeaddedtotheoutputpartialorder.berbesumofoptimalnbers,beberthiscategory,intheoutputpartialorder).Thefactorytainsacounforeacandmakessurethatthenberofgraftedelementswillnotdi erfromthiscounterbymorethanaconstantvGraftingpairsdescribeprocess,processcess].OurprocessproductionschemetoconstructasequenceofprocessTheseparametersaresetbythefactorywheninitiatingthisprocess.Thegraftingrecursivelybuildshyperpairspartialorder.Adominatedhyperpairofdirectionandlevisahyperpairwithcenberelationbetisusuallynotdetermined.processcomposeddominatedhyperpairs(withcen,respectively)oflevyperpair+1.At rstahyperpairisconstructed,thatisthecentreofthenewhyperpairThetopossibleoutcomes,=1,are:cisadominatedhyperpairoflev+1.&#x-109;頀cisnotdominatedb&#x-109;頀c&#x-109;頀cLet(1)and(2)bethecorrespondingcasesfor=0,&#x-109;頀cc,respectivIf(2)or(2)occur,processstopped.purposesalsoforalsostopprocessdominatedhyperpairoflevel3isgenerated.yperpairsprocessreceivesitselementsaspairs.Itthereforestartswiththesecondcomparisonofthe0-thround.The\rowofthepairgraftingprocess,=1,iswninFig.4.Thefourpossibleoutcomesofthepairprocess,andThefourpossibleoutcomesofthisprocessupperandloercostsof,andDuetokofspace,omitthedetailedcosteliminationcosteliminatedelemenfourelemenu;v;w;z,whereuvuwz,isgraftedusingthefollowingsimplealgorithm: SELECTINGTHEMEDIAN el3 el2 cU20 cU21;1 el1 cU26 Figure4:wofpairgraftingwhen=1. Upperparteliminated erparteliminated Class Cost berof Cost berof elements elements U20 0 2 1 0 U21;1 4 2 3 2 U26 10 2 7 6 U04 6\r 0 4 4 able1:Costsofpairgraftingu;wthepair(u;v)totheinputqueue.wcthencomparewitheachofpossibleprocessinFig.5.fourthpartialorder specialprocesssymmetric.Thequartetgraftingprocessconuesunomitthecostsanalysis.Thecosts,for3,aresummerizedinTable2.factoryalgorithmAsmentionedbefore,composed rstusesthestring=01(10)whilethesecondoneusesthestring=10(01)edescribetheoperationofthe rstsub-factory(whoseinputsare's,pairsandsingletons).Theothersub-factoryworksinasymmetric.Theoperationofthe rstsub-factoryiscomposedofthefollowingsteps:Generateahyperpair,where=01(10),andletbeitscenThecenwillbethecentreofthegeneratedpartialorder.abobelointhe cwzQ20 vcQ13wu uwvczQ04 cvuzw Q13 Figure5:ossibleoutcomesof Upperparteliminated erparteliminated Class Cost berof Cost berof elements elements Q20 1 2 2 0 Q1;12 3 2 4 2 Q13 \r= 1 3 3 Q04 4\r 0 2 4 able2:Costsofoutputpartialorder.Applythegraftingprocesstilthreefromonetsfromcategoryareimme-diatelyplacedintheoutputpartialorderandthegraftingconprocess,orisobtained.tsfoundincategoryareimmediatelyplacedinthe nalpartialorder.Ifthreetuplesfromareaailable,applythepairgraftingprocesstileitherisobtained.tsfoundincategoryareimmediatelyplacedinthe nalpartialorder.obtainedusingpairgrafting,andtsfromtuplesobtainedusingquartetgraft-;Qg;L;LLfQ20gf;U;Uoreaconeofthesecaseswechooseanoptimalvalueof,pruneelementsfrominordertoacanoptimalsize(thisisrequiredonlyifereencountered)andoutputthisThesub-factorymaintainsthreecounhareinitiallysetto0.eraoracorrespondingWhenacertainpartofaora`consumed',instepcorrespondingtegral,amounThequartetgraftingprocess Dorandhesavalueofatleast3.oreacobtainedinstep(2a),andeacobtainedinsteps(2b)and(2c),anappropriatenberofelementsistobeprunedinstep(3).Twocountaintheberofelemenbebeloaborespectivoutputtingthepartialorder,tsabotsbeloarepruned.edepictthe\raourofthecostanalysisbyconsid-eringoneoftheworstcasesofthefactoryInthefolloing,we x637985whichistheoptimalvalue.Fobtainedin(2c),weprune1382elemenbelobeloThispruninggenerateshotsineithersingletonsorpairs(becausetheprun-ingprocessseparatessingletons,orr=2pairs,fromtheTheseelementscanbereturnedtothefactoryaspairsandsinceonepairisreturnedtothefactoryforevpairthatasutilized.thereisnoneedtobreakquartetsintopairs.Recyclingtheupperpartcutsoneedgeforeachpair\r=(becauseoftherecyclingrestrictions).us,thelo+1,eliminatedelemenandtheuppercostis()+1\r=oneeliminatedelement.RecallalsothattheeliminationcostisasingleedgepereliminatedelemenHence,theupperandloerelementcostsare:1+5+1\r= =1++1 Thecostanalysisofalltheothercasesisomitted.Concludingremarksremarks]andBlumetal.[BFP+73]andobtainedabetterAlthoughtheimprot,isquitemodest,manynewnewideasintroducedmayleadtofurtherimproedandaconsiderablee ortwasdevotedtotheirelytobebetupperboundsberremainsachallengingopenproblem.problem.M.Aigner.thetopthreeelemeneteAppliedMathematics,4:247{267,1982.1982.+73]M.Blum,R.W.Floyd,V.Pratt,R.L.Rivest,andboundsComputerandSystemScienc,7:448{461,1973.1973.S.W.BentandJ.W.John.Findingthemedianrequires2ncomparisons.InProceedingsofe,RdeIsland,pages213{216,1985.1985.W.CuntoandJ.I.Munro.eragecaseselection.JournaloftheA,36(2):270{279,1989.1989.D.DorandU.ZwicFindingpercendingsofthe3rdIsraelSymposiumonTheandComputingsystems,1995.1995.J.EusterbrocErratato"SelectingthetopthreeproofeteAppliedMathematics41:131{137,1993.1993.G78]F.FusseneggerandH.N.Gabohtoloerboundsforselectionproblems.oftheA,26(2):227{238,April1978.1978.L.R.FS.M.Johnson.AtournamentournamenR.W.FloydandR.L.RivExpectedtimeboundsforselection.ationoftheA,18:165{173,18:165{173,A.HadianandM.Sobel.-thlargestColloquiaMathe-aSocietatisJanosBolyai,4:585{599,1969.1969.a76]L.HyBoundsforselection.SIAMJournalon,5:109{114,1976.1976.J.W.John.Anewloerboundfortheset-partitionSIAMJournalonComputing,17(4):640{647,August1988.1988.D.G.Kirkpatrick.Auni edlowerboundsetpartitioningJournalofthe,28:150{165,1981.1981.S.S.Kislitsyn.Ontheselectionofthe-thelemenMat.Zh.,5:557{564,1964.1964.I.MunroandP.V.Poblete.AlowerboundReportReportCS-82-21,UnivyofWaterloo,1982.1982.oh72]I.Pohl.Asortingproblemanditscomplexity.CommunicationoftheA,15:462{464,1972.1972.P.V.RamananL.HyNewalgorithmsJournalofA,5:557{578,1984.1984.h32]J.Schreier.Ontournamenteliminationsystems.MathesisPolska,7:154{160,1932.(inPPA.Schonhage,M.Paterson,andN.Pippenger.Findingthemedian.JournalofComputerandSystem,13:184{199,1976.1976.P.StocerandF.F.YOntheoptimalitSIAMJournalonComputing,9:85{90,9:85{90,ap76]C.K.YNewupperboundsforselection.ber