/
Computational Geometry Lectures  Closest air Problem S Computational Geometry Lectures  Closest air Problem S

Computational Geometry Lectures Closest air Problem S - PDF document

faustina-dinatale
faustina-dinatale . @faustina-dinatale
Follow
396 views
Uploaded On 2015-05-16

Computational Geometry Lectures Closest air Problem S - PPT Presentation

Here are represen ting this as 2D problem but in general it can an dimensional problem oin ts are represen ted their co ordinates or this problem co ordinates eing in tegral on mak uc of di57355erence though will assume that ha real co ordinates 11 ID: 67872

Here are represen ting

Share:

Link:

Embed:

Download Presentation from below link

Download Pdf The PPT/PDF document "Computational Geometry Lectures Closest..." 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

ComputationalGeometry,Lectures3,4ClosestPairProblemScribeVarunNayyar1ClosestPairProblemGivenasetofnpointsdeterminepointsa,bsuchthattheinterpointdistance(Euclidean)istheminimumamongallpossiblepairofpoints.Herewearerepresentingthisasa2-Dproblembutingeneralitcanbeanndimensionalproblem.Pointsarerepresentedbytheircoordinates.Forthisproblemcoordinatesbeingintegralwontmakemuchofadi erence,thoughwewillassumethatwehaverealcoordinates.1.1InterPointDistanceInterpointdistancebetweentwopointsPi(xi;yi)andPj(xj;yj)isgivenasfollows:q(xixj)2+(yiyj)2.Thiscaneasilybeextendedtoanndimensionalcase.1.2TrivialMethodForanydimensiond,wecansolvethisbycomputingtheminimumofn2pairs.Thisgivesarunningtimeof(n2).Asweincreasethedimensionthecomputationformindistance1 scalesup,hencetherunningtimeof(n2d).1.3ProbleminOneDimensionInonedimensionallthepointsareinalineafterwesortthemin(nlogn).Aftersortingwecangothroughthemto ndtheconsecutivepointswithleastseparation.Thustheprobleminonedimensionissolvedin(nlogn)timewhichismainlydominatedbysortingtime.2DivideAndConquerConsiderthe2-Dproblem.Wecan ndthemedianline(x-coordinate)in(n)time.Nowlet1betheminimuminterpointdistanceinthelefthalf.Similarlylet2betheminimuminterpointdistanceintherighthalf.Wehave=min(1;2).Thepairswherethelefthalfisontheleftsideandtherighthalfontherightsideformaseparatecase.Weneednotworryaboutallsuchpoints,onlypointslyingwiththe2stripareofconcerntous.Allotherswillhavehaveinterpointdistancegreaterthenandcanbeeliminatedfromconsideration.Thekindofrecurrencewearelookingwillbeofthefollowingtype:T(n)=2T(n2)+(n)+MiddleCasewhere(n)timefor ndingthemedianandtheMiddleCasereferstothenumberofcom-parisonsneededtobedonewithinthe2Strip.2 2.1NumberofComparisonswithintheDeltaStripSparsityCondition:Wecannothavetwomanypointswithinonesideofthe2StripasitwillmaketheinterpointdistanceonthathalflessthanStripitself,whichisacontradictionaccordingtothede nitionofStrip.Whatisthemaximumnumberofpointsinthe2StripXsquarewheretheinterpointDistanceis?2.2SolvingTechniquefor2DProjectallpointontheverticalline.ForeveryprojectedpointPweneedto ndouthowmanyotherpointsontheverticallinewemustcompareitwithasshownintheillustrationbelow.ThegreenpointsaretheProjectionofthepointsontherighthalfoftheStripwhiletheredpointsareForthelefthalf.Foreverypointweneedtogoupanddownandcomparepointslyingwithinthatintervalonly.ThusforeverypointwehavetodoaconstantCnumberofcomparisons.WecansortthemonthebasisofycoordinatebeforedoingtheDivideandConquerprocedure.Thustheoveralltimewillbe(nlogn)+T(n)...whereT(n)=2T(n=2)+0(n)+Cd(n).ThisconstantCdscalesupwithdimension'd'.3 2.33andHigherDimensionsForthesameproblemin3-Dwecanprojectpointsonbothhalfwithindeltadistanceonaplane.Thusweseebyprojectingwearereducingtheproblembyonedimension.AgainbecauseofsparsityconditiontherearenomorethanaconstantnumberofpointssayCd(dependenton'd')ina2X2Square.2.4Lemma:Inthed-dimensionitispossibleto ndapartitioningplaneHwiththefollowingproperties:Thesizeofthesmallersetn2dandlargestset(112d)nIfthemininterpointdistanceisthenthe2slicedoesnotcontainmorethanCdn(11d)points.(Noteisunknown).Wecanapplyasecondrecursiontotheinnerplacethussolvingthesameproblemin2-Dnow.Therecursiveequationwouldlooksomethinglikethisinthatcase:T(n)2T(n=2)+M(k)+O(n)whereM(k)isthetimetomergekpointsinthe2Slab.Here,M(k)equalsO(klogk)Ifweusetheabovelemmachoosethespeciallinetopartitionk=O(n23).SoM(n23)isO(n).2.5AlternateMethodThismethodisforthe2Dsub-problemreducedfromprojecting3Dproblemontoaplane.Theproceduremaintainaseparatedgridasshownbelow:ForeverypointwehavetolookattheEightAdjacentcellsonly.Sparcityconditionguaranteesnottoomanypointswithinacell.Soforeachpointweneedaconstanttimetosearchpointswithineightadjacentcells.Hencefornpointswewouldneed(n).4 5