Figure1RoomanditsVdiagramfrom100representingdthexrespycoordinaterepresentsthedistancealongtheborderofPfromthedoorintheclockwiserespcounterclockwisedirectionThenwecanassociateanypointx ID: 98803
Download Pdf The PPT/PDF document "19thCanadianConferenceonComputationalGeo..." 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.
19thCanadianConferenceonComputationalGeometry,2007 Figure1:RoomanditsV-diagramfrom[1](0;0)representingd,thex(resp.y)coordinaterepre-sentsthedistancealongtheborderofPfromthedoorintheclockwise(resp.counterclockwise)direction.Thenwecanassociateanypoint(x;y)inthediagramwithpositionsofthetwoguardsontheborderofP.Torepresentthemutualvisibilityofpairsofpoints,anypoint(x;y)intheV-diagramisshadedithecorre-spondingpositionsarenotmutuallyvisibleinthepoly-gon.Figure1showsanexampleofthis,where0isthedoorpoint.Anypointonthediagonalcorrespondstoameetingpointofthetwoguards.ThenanypathintheV-diagramfromthetop-leftcorner(thedoor)tothediagonal(thegoal)thatdoesnotcrossanyshadedareas(obstacles)correspondstoavalidsearchschedulesofP;wesaythats=S().Wewillassumethateachguardcantravelindepen-dentlyatvaryingspeedsintherange[0,1]bothfor-wardsandbackwards(withoutcrossingthedoorpoint).Foranysearchschedules,letD(s)denotethedistancetravelledbytheguardsdurings,andletT(s)denotethetimerequiredfors.Itshouldbenotedthatminimiz-ingeachofthesemayresultindierentsearchsched-ules.Figure2showsanexampleofaroom,withadoorat0,wherethetwonotionsofoptimalschedulegivetwodierentsearchschedules.Theshortestdistanceisachievedifoneguardtravelsfrom0to2,whiletheotherguardwaitsat5,resultinginatotaldistancetrav-elledequalto24(theperimeterofthepolygon).Thisscheduletakesover19timeunits.Thequickestsearchscheduleinvolvesoneguardtravellingalong0,5,4,3,and2whiletheotherguardmustgofrom0tobandbacktoatomaintainmutualvisibility.Thisrequiresbacktrackingfrombtoa,whichresultsinatotaldis-tancetravelledthatisgreaterthan24,butittakeslessthan15timeunitstocompletetheentiresearch. Figure2:Optimalschedulesaredierent3CorrespondenceBetweenPathsintheV-diagramandSearchSchedulesTheV-diagramcanbeusedtoconstructoptimalsched-ulesforsearchingtheroom.Werstdescribearela-tionshipbetweenthelengthofapathintheV-diagramandthedistance/timeofthecorrespondingroomsearchschedule.Lemma1LetbeapathintheV-diagramforaroomands=S()bethecorrespondingsearchscheduleoftheroom.Thenjj1=D(s)andjj1=T(s).InordertoprovethislemmawemustdeneD(s)andT(s)moreprecisely.Letusrstrecallhowthelengthofacurveisdened.Adistancemetricd(a;b)denesthedistancebetweenapairofpointsaandb.Thisisthelengthofthelinesegmentfromatob.Thelengthofageneralcurve=(t);t2[0;T]isdenedtobesup(Pki=1d((ti);(ti1)))wherethesupistakenoverpartitionst0;:::;tkof[0;T].Weonlyconsiderrecti-ablecurves,whicharedenedascurveswherethesupexists.WedeneT(s)andD(s)inasimilarfashion,rstforstraightlinesegmentsandthenusingasup.Proof.[ProofofLemma1]BytheaboveclaricationofthedenitionofD(s)andT(s)itsucestoprovetheresultforapaththatisastraightlinesegment.IntheL1metricjj1=jabj1=j(ab)xj+j(ab)yj.Thisrepresentsthesumofthedistancestravelledbythetwoguards,so1=D(s).IntheL1metricjj1=jabj1=max(j(ab)xj;j(ab)yj).Sincebothguardshavethesamemax-imumspeedof1,assumethattheguardtravellingthegreatestdistancetravelsatspeed1tominimizethetimespent,whichisthenthatguard'sdistance.Wethenhavejj1=T(s).Corollary2Thesearchschedulerequiringtheshort-estamountofdistancetotravelalongtheroombound-arycorrespondstotheshortestpathintheL1metricfromthedoortothegoalintheV-diagram.Thequick-estsearchscheduleforaroom(P;d)correspondstotheshortestpathintheL1metricfromthedoortothegoalintheV-diagram. CCCG2007,Ottawa,Ontario,August20{22,2007 4V-diagramConstructionWenowdiscussthenatureoftheV-diagramandhowitiscreated.Theorem3TheborderofeachobstacleintheV-diagramispiecewisehyperbolic.Proof.Theproofisincludedasanappendix.ToconstructtheV-diagramweneedtoaccuratelydescribealloftheobstacles.Todothis,wemust,foreachofthere exvertices:1.Findthetwopointsatwhichtheprojectionsoftheadjacentedgesthroughthevertexrstintersectthepolygonagain.ThistakesO(n)time.2.Startingatoneofthesepointsandworkingalongthepolygontowardsthere exvertex,foreachedgeofthepolygonthatisencountered,ndthecurveoftheV-diagramrepresentingthepairsofpointsonthepolygonthathavealineofvisibilitythroughthere exvertex.ThistakesO(n)time.Therefore,withO(n)re exvertices,theexactvisibil-itydiagramcanbedescribedinO(n2)time.5FindingShortestPathsinV-diagramWehavenowreducedtheproblemofndingoptimalsearchscheduleswithrespecttodistanceandtimetotheproblemofndingshortestpathsintheL1andL1metricsamongcurvedobstaclesintheplanethatarepiecewisehyperbolic.WenotethefollowingtwopropertiesofL1andL1shortestpaths:1.BetweenanytwopointsthereisashortestL1paththatisrectilinear.Thisremainstrueinthepres-enceofcurvedobstacles,exceptinthesituation{thatdoesn'tariseforus{wheretheshortestpathtravelsbetweentwoabuttingcurvedobjects.2.TheL1andL1normsarerelatedbyalinearmap-ping;inparticularwecanndshortestL1pathsbyrotatingtheplaneanditsobstaclesby45andscaling,andthenndingshortestL1paths.Thisisjustiedin[9].ThusitsucestondshortestL1paths,eitheramongtheoriginalobstacles,oramongtheobstaclesrotatedby45.ThereisconsiderableworkonndingshortestL1pathsamongpolygonalobstaclesintheplane[2,12].Thereisalsoworkon\curvilinear"computationalge-ometry[4]whichhasledtoshortestpathalgorithmsamong\splinegons"[11].However,thereappearstobenosolutionintheliteraturetondingshortestL1pathsamongcurvedobstacles.Therearetwobasicap-proachestosolvingthisproblem.ThecontinuousDi-jkstraapproachisusedbyMitchell[12]forpolygonalobstacles.Alternatively,theproblemmaybemodelledasagraphshortestpathproblem[3].Theformerap-proachwilllikelyleadtoamoreecientsolution,butwewillsimplyclaimapolynomialtimealgorithmviamodellingtheproblemonagraph.Lemma4Betweenanytwopointsthereexistsashort-estpathamongobstaclesintheL1metricsuchthatthepathintersectsobstacleboundariesonlyatlocalxoryextremepointsoftheobstacles,andsuchthatthepor-tionofthepathbetweentwoconsecutivesuchpointsismonotoneinxandy.Proof.Theproofisincludedasanappendix.Thislemmajustiescreatingagraphwhoseverticesaretheextremepointsofobstaclesandwhoseedgescor-respondtomonotonepathsbetweenpairsofpoints.Wewillinfactuseasubsetoftheseedges,notbecauseitreducesthequadraticnumberofedges,butbecauseitsimpliesndingtheedges.Ifthereisamonotonepathbetweentwopointsthenthereisalowestmonotonepath,thelowerenvelopeofallmonotonepaths.Alow-estmonotonepathisminimalifitdoesnotgothroughanextremepointofanobstacleexceptatitsendpoints.Observethatanon-minimalpathisaconcatenationofminimalpaths.Thisjustiesrestrictingtheedgesofthegraphtomin-imallowestmonotonepathsbetweenpairsofpoints.TheweightofanedgeistheL1distancebetweentheendpoints.WeaddanadditionalvertexgtorepresentthegoallineintheV-diagram,andtheedgesandedgeweightsaredenedsimilarlywithrespecttoanypointonthegoalline.LetNbethenumberofvertices.SincethereareO(n)barrierseachwithO(n)extremepoints,thusNisO(n2).Inthecasewheretheobstaclesarenotrotatedby45(theoriginalL1case)weobtainatighterboundofN2O(n)(seetheappendix).ThegraphhasO(N2)edges.Wenowshowhowtoconstructthegraph.Findtheextremepointsoftheobstacles,andthepiecesofobsta-cleboundariesbetweenextremepoints.Notethatthesepiecesaremonotone.Foreachextremepointshootraysdownwardandtotheleftandtherightuntilwehittherstobstacleboundarypieceencountered.WeclaimthatthiscanallbedoneinO(NlogN)timeusingplanesweepsinthexandydirections.Considertwoextremepointsand ,withhigher.Suppose istotherightof. CCCG2007,Ottawa,Ontario,August20{22,2007 Figure3:Re exvertexAProofofTheorem3Webeginwithanintermediateresult.Lemma5Whenasinglere exvertexobstructsvisi-bilitybetweentwoedgesinthepolygon,thecurveonthecorrespondingregionofashadedportionoftheV-diagramishyperbolic.Proof.Withoutlossofgenerality,assumethatoneoftheendpointsofoneoftheedgesis(0;0),andthedirec-tionalongthatsideisrepresentedbythevector(0;1).ThenletR=(r1;r2)bethere exvertex,let(a1;a2)beoneendpointoftheotheredge,andlet(v1;v2)bethenormalizedvectorrepresentingthedirectionalongtheotheredge.LetC=(0;0)+s(0;1)beanypointalongtherstedgeandletD=(a1;a2)+t(v1;v2)beanypointalongthesecondedge.ThebarrieroftheshadedregionhasacurvecorrespondingtothepointsalongtheedgeswherethevisibilitylinealongtheedgesgoesthroughP(thatis,whenCRandDRareparallel).Thenbytreat-ingthepointsaspointsinthreedimensions,wecanusethevectorcrossproducttodecidethattwopointsalongtheedgesgiveapointonthiscurvewheneverCRDR=0()(((0;0)+s(0;1))(r1;r2))((a1;a2)+t(v1;v2)(r1;r2))=0()(r1;sr2)(a1+tv1r1;a2+tv2r2)=0()r1a2r1tv2+sa1+stv1sr1+r2a1+r2tv1=0()s(a2+tv2r2)=r1a2r1tv2+r2a1+r2tv1()s=r1a2+r1tv2r2a1r2tv1 a1+tv1r1Thustherelationshipbetweenthemovementalongoneedgeandthemovementoftheprojectionofthelineofsightalonganotheredgeofthepolygonisgivenbytheequationofahyperboliccurve. Figure4:IntersectionofpathandobstacleWenowproveTheorem3.Proof.EachobstacleintheV-diagramisaunionofbarriers,whereabarrierrepresentstheguardpositionsblockedbyonere exvertex.Abarrierhasahorizontalandverticalsidedeterminedbythetwoedgesadjacenttothere exvertex[15].Theremainderofthebarrierboundaryisdenedbythepairsofpointsonthepoly-gonthatareconnectedbyalinethatalsogoesthroughthere exvertex.Forexample,obstacleAinFigure1iscomposedoftwobarriers,associatedwithre exvertices9and10.Theboxinthegureshowstheportionofthebarrierwherevertex9wouldobstructtheviewbetweenguardsonedges(6,7)and(0,13).Fromtheabovelemma,weknowthatasinglere- exvertexobstructingvisibilitybetweentwoedgesofthepolygoncorrespondstoahyperbolicportionofabarrierintheV-diagram.Whentheendpointofoneedgeisreached,anewedgeisreached,soanewhyper-bolicportionofthebarrierisbegun.Soeachobstacleispiecewisehyperbolic.BProofofLemma4Bynote(1)atthebeginningofsection5,thereisashortestpaththatisrectilinear.Supposeisashort-estrectilinearpaththatcontainsobstacleintersectionpointsthatarenotlocalextremepoints.Letq=(t)betherstsuchpointon.Ifdoesnotchangedirectionatqthenqisalocalextremepoint.Otherwisemakesarightangleturnatq,andwecanalterthepathasshowninFigure4.Therevisedpathhasthesamelength,andifthedetourissmallenough,therevisedpathintersectsnoobstacles.Applyingthisinductivelyyieldsthedesiredpath.Nowsupposethatthepathisnotmonotonebetweentwoconsecutiveextremepoints.Then,assumingthepathdoesnotbacktrackonitself,somewhereonthepaththereare3consecutivesegmentssuchthattherst 19thCanadianConferenceonComputationalGeometry,2007 Figure5:ShortestL1subpathsbetweenextremepointsandthirdgoinoppositedirections(wwouldbethesec-ondofthesesegmentsinFigure5).Sincetherearenoextremepointsonthesecondsegment,itcanbetrans-latedsoastoshortenthelengthsoftherstandthirdsegmentswithoutintersectinganyobstacles(wcanbeshifteddownwithouthittinganyobstacles).Thusthepathcanbeshorteneduntilanobstacleishit,whichhappensatanextremepoint.SoanysubpathbetweenconsecutiveextremepointsthatisnotdirectintheL1sensecanbeshortened.Therefore,thelemmaisproven.CJusticationofN2O(n)fortheL1CaseWeshowthateachbarrierintheV-diagramofasim-plepolygoncontainsnomorethan3extremepoints.Withtwoadjacentstraightedgesontheborderofthebarrier,3extremepointsaredened.Theremainderofthebarrierborderisdenedbypairsofpointsonthepolygonboundarythatarecollinearwiththere exver-tex,wherethelinesegmentbetweenthepairofpointsdoesnotintersectthepolygonanywhereelse.Wewillshowthatnomoreextremepointsliealongthispartofthebarrier.Supposetherewasanextremepoint(i.e.,alocalmax-imumorminimum)onthispartoftheborder.Thiswouldimplythatforsomepointontheborderofthebarrier,thereismorethanonecorrespondingpointonthebarriersuchthatthepointsarecollinearwiththere- exvertexandthelinesegmentbetweenthetwopointsintersectsthebordernowhereelse.Clearlythisisnotpossible,sincetheexistenceofmorethanonesuchpointimpliesthatoneofthelinesegmentsintersectsthebor-dermorethanonce.Thusnoextremepointslieonthecurvedportionofthebarrier.Therefore,thereareatmost3extremepointsperbarrier.Sinceeachobsta-cleiscomposedofbarriers,andthereareatmostO(n)barriers,thereforethereareO(n)extremepoints. Figure6:RightturnrestrictionsondesiredpathDProofofClaim1Proof.(()Iftheraydownfrommeetstherayleftfrom ,thentheseraysdeneaminimallowestmono-tonepathbetweenthetwopoints.Ifthetworaysdonotmeeteachother,buttheymeetthesamepieceofobstacleboundary,thentheseraysandthepieceofobstacleboundary(withnoextremepointsonit)deneaminimallowestmonotonepathbetweenthepoints.())Supposethereisaminimallowestmonotonepathbetweenand butthatthetworaysmeetdierentpiecesofobstacleboundary(thetworaysdonotmeeteachother).Sinceisalowestmonotonepath,itismadeupofsegmentsthatgostraightdown,straightright,oralongtheborderofanobstacle.Nowsupposefurtherthatatsomepoint,containsadirectturntotherightthatdoesnotleaddirectlyto (thatis,thehorizontalsegmentfollowingtheturndoesnothave asanendpoint).Thenmustchangedi-rection(atleastslightlydownward)atsomelaterpoint;considerthesubpathofuptothispoint.Sinceisminimal,thissubpathdoesnotmeetanobstacleex-tremepoint.Butthentherightturncouldhavehap-penedlateronsincethehorizontalsegmentcouldbeshifteddown,asingure6.Thusisnotlowest.Sotheonlyrightturnthatmayhavemustleaddirectlyto .Thenallotherpartsofthepatharedownwardsegmentsandsegmentsthatfollowobstacleboundaries.Notethatthereisasegmentofstartingdirectlybelowthatfollowsanobstacleboundarysincetheraysfromand donotmeeteachother.Afterthissegment,mustturnrightandgodirectlyto orturndown.Ifturnsright(towards ),thenitmusthavemetanextremepoint(andthusisnotminimal)sincetheraysdonotmeetthesamepieceofobstacleboundary.Ifturnsdown,thenitmustdosoatanex-tremepointinorderforthepathtobemonotone,thusitisnotminimal.Thereforedoesnotexist,provingtheclaim.