ebook img

Label Placement in Road Maps PDF

0.64 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Label Placement in Road Maps

Label Placement in Road Maps AndreasGemsa,BenjaminNiedermann,andMartinNöllenburg InstituteofTheoreticalInformatics,KarlsruheInstituteofTechnology,Germany 5 Abstract. Aroadmapcanbeinterpretedasagraphembeddedintheplane,in 1 whicheachvertexcorrespondstoaroadjunctionandeachedgetoaparticular 0 roadsection.Weconsiderthecartographicproblemtoplacenon-overlappingroad 2 labelsalongtheedgessothatasmanyroadsectionsaspossibleareidentifiedby n theirname,i.e.,coveredbyalabel.WeshowthatthisisNP-hardingeneral,but a theproblemcanbesolvedinpolynomialtimeiftheroadmapisanembeddedtree. J 8 2 1 Introduction ] G Map labeling is a well-known cartographic problem in computational geometry [11, C Chapter 58.3.1], [13]. Depending on the type of map features, one can distinguish . labelingofpoints,lines,andareas.Commoncartographicqualitycriteriaarethatlabels s c must be disjoint and clearly identify their respective map features [7]. Most of the [ previousworkconcernspointlabeling,whilelabelinglineandareafeaturesreceived 1 considerablylessattention.Inthispaperweaddresslabelinglinearfeatures,namely v roadsinaroadmap. 8 Geometrically,aroadmapistherepresentationofaroadgraphGasanarrangement 8 offatcurvesintheplaneR2.EachroadisaconnectedsubgraphofG(typicallyasimple 1 path) and each edge belongs to exactly one road. Roads may intersect each other in 7 0 junctions,theverticesofG,andwedenoteanedgeconnectingtwojunctionsasaroad . section.Inroadlabelingthetaskistoplacetheroadnamesinsidethefatcurvessothat 1 theroadsectionsareidentifiedunambiguously,seeFig.1. 0 5 Chirié[1]presentedasetofrulesandqualitycriteriaforlabelplacementinroad 1 mapsbasedoninterviewswithcartographers.Thisincludesthat(C1)labelsareplaced v: insideandparalleltotheroadshapes,(C2)everyroadsectionbetweentwojunctions i should be clearly identified, and (C3) no two road labels may intersect. Further, he X gaveamathematicaldescriptionforlabelingasingleroadandintroducedaheuristic r forsequentiallylabelingallroadsinthemap.Imhof’sfoundationalcartographicwork a onlabelpositioninginmapslistsverysimilarqualitycriteria[3].Edmondsonetal.[2] took an algorithmic perspective on labeling a single linear feature (such as a river). While Edmondson et al. considered non-bent labels, Wolff et al. [12] introduced an algorithmforsinglelinearfeaturethatplaceslabelsfollowingthecurvatureofthelinear feature.Strijk[9]consideredstaticroadlabelingwithembeddedlabelsandpresenteda heuristicforselectingnon-overlappinglabelsoutofasetoflabelcandidates.Seibertand Unger[8]consideredgrid-shapedroadnetworks.Theyshowedthatinthosenetworksit isNP-completeandAPX-hardtodecidewhetherforeveryroadatleastonelabelcan beplaced.Yet,NeyerandWagner[6]introducedapracticallyefficientalgorithmthat 2 AndreasGemsa,BenjaminNiedermann,andMartinNöllenburg HammingSt. HammingSt. junction edge H am DijkstraSt. m junction in roadsection vertex (aK)nuthTuSritng.St. gSt.HammingSt. (bK)nuthSt.TuringSt. HammingSt. (c) label rveegrtuelxar Fig.1. a–b): Two ways to label the same road network. Each road section has its own color. Junctionsaremarkedgray.Fig.b)identifiesallroadsections.c)Illustrationoftheroadgraphand relevantterms. findssuchagridlabelingifpossible.MaassandDöllner[5]presentedaheuristicfor labelingtheroadsofaninteractive3Dmapwithobjects(suchasbuildings).Apartfrom label-labeloverlaps,theyalsoresolvelabel-objectocclusions.Vaaraniemetal.[10]used aforce-basedlabelingalgorithmfor2Dand3Dscenesincludingroadlabelplacement. Contribution. While in grid-shaped road networks it is sufficient to place a single labelperroadtoclearlyidentifyallitsroadsections,thisisnotthecaseingeneralroad networks.ConsidertheexampleinFig.1.InFig.1a),itisnotobviouswhethertheorange roadsectioninthecenterbelongstoKnuthSt.ortoTuringSt.Simplymaximizingthe numberofplacedlabels,asoftendoneforlabelingpointfeatures,cancauseundesired effectslikeunnamedroadsorclumsylabelplacements(e.g.,aroundDijkstraSt.and HammingSt.inFig.1a)).Therefore,incontrasttoSeibertandUnger[8],weaimfor maximizingthenumberofidentifiedroadsections,i.e.,roadsectionsthatcanbeclearly assignedtolabels;seeFig.1b). Basedoncriteria(C1)–(C3)weintroduceanewandversatilemodelforroadlabeling in Section 2. In Section 3 we show that the problem of maximizing the number of identifiedroadsectionsisNP-hardforgeneralroadgraphs,evenifeachroadisapath. Forthespecialcasethattheroadgraphisatree,wepresentapolynomial-timealgorithm inSection4.Thisspecialcaseisnotonlyoftheoreticalinterest,butouralgorithminfact providesaveryusefulsubroutineinexactorheuristicalgorithmsforlabelinggeneral roadgraphs.Ourinitialexperiments,sketchedinSection5,showthatreal-worldroad networksdecomposeintosmallsubgraphs,alargefractionofwhich(morethan85.1%) areactuallytrees,andthuscanbelabeledoptimallybyouralgorithm. 2 Preliminaries Asarguedabove,aroadmapisacollectionoffatcurvesintheplane,eachrepresenting aparticularpieceofanamedroad.Iftwo(ormore)suchcurvesintersect,theyform junctions.Aroadlabelisagainafatcurve(theboundingshapeoftheroadname)thatis containedinandparalleltothefatcurverepresentingitsroad.Weobservethatlabelsof differentroadscanintersectonlywithinjunctionsandthattheactualwidthofthecurves LabelPlacementinRoadMaps 3 isirrelevant,exceptfordefiningtheshapeandsizeofthejunctions.Theseobservations allowustodefinethefollowingmoreabstractbutequivalentroadmapmodel. Aroadmap isaplanarroadgraphG=(V,E)togetherwithaplanarembedding M E(G),whichcanbethoughtofasthegeometricrepresentationoftheroadaxesasthin curves;seeFig1c).WedenotethenumberofverticesofGbyn,andthenumberof edgesbym.ObservethatsinceGisplanarm=O(n).Eachedgee Eiseitheraroad ∈ section,whichisnotpartofajunction,orajunctionedge,whichispartofajunction. Eachvertexv V iseitherajunctionvertexincidentonlytojunctionedges,oraregular ∈ vertexincidenttooneroadsectionandatmostonejunctionedge,whichimpliesthat eachregularvertexhasdegreeatmosttwo.Ajunctionvertexvanditsincidentedges are denoted as a junction. The edge set E decomposes into a set of edge-disjoint R roads,whereeachroadR inducesaconnectedsubgraphofG.Withoutlossof ∈ R generalityweassumenotworoadsectionsGareincidenttothesamevertex.Thus,a roaddecomposesintoroadsections,separatedbyjunctionverticesandtheirincident junctionedges.Inrealisticroadnetworksthenumberofroadsconnectedpassingthrough ajunctionissmallanddoesnotdependonthesizeoftheroadnetwork.Wetherefore assumethateachvertexinGhasconstantdegree.WeassumethateachroadR has ∈R anamewhoselengthwedenotebyλ(R). Forsimplicity,weidentifytheembeddingE(G)withthepointsintheplanecovered byE(G),i.e.E(G) R2.WealsouseE(v),E(e),andE(R)todenotetheembeddings ⊆ ofavertexv,anedgee,andaroadR. Wemodelalabelasasimpleopencurve(cid:96): [0,1] E(G)inE(G).Unlessmen- → tioned otherwise, we consider a curve (cid:96) always to be simple and open, i.e., (cid:96) has no self-intersectionsanditsendpointsdonotcoincide.Inordertoeasethedescription,we identifyacurve(cid:96)inE(G)withitsimage,i.e.,(cid:96)denotestheset (cid:96)(t) E(G) t [0,1] . { ∈ | ∈ } Thestartpointof(cid:96)isdenotedasthehead h((cid:96))andtheendpointasthetailt((cid:96)).The lengthof(cid:96)isdenotedbylen((cid:96)).Thecurve(cid:96)identifiesaroadsectionrif(cid:96) E(r)= . ∩ (cid:54) ∅ Foraset ofcurvesω( )isthenumberofroadsectionsthatareidentifiedbythecurves L L in .Forasinglecurve(cid:96)weuseω((cid:96))insteadofω( (cid:96) ).Fortwocurves(cid:96) and(cid:96) itis 1 2 L { } notnecessarilytruethatω( (cid:96) ,(cid:96) ) = ω((cid:96) )+ω((cid:96) ),becausetheymayidentifythe 1 2 1 2 { } sameroadsectiontwice. Alabel(cid:96)foraroadRisacurve(cid:96) E(R)oflengthλ(R)whoseendpointsmustlie ⊆ onroadsectionsandnotonjunctionedgesorjunctionvertices.Requiringthatlabelsend onroadsectionsavoidsambiguousplacementoflabelsinjunctionswhereitisunclear howtheroadpassesthroughit.Alabeling foraroadmapwithroadset isasetof L R mutuallynon-overlappinglabels,wherewesaythattwolabels(cid:96)and(cid:96) overlapifthey (cid:48) intersectinapointthatisnottheirrespectiveheadortail. Followingthecartographicqualitycriteria(C1)–(C3),ourgoalistofindalabeling L thatmaximizesthenumberofidentifiedroadsections,i.e.,foranylabeling wehave (cid:48) L ω( (cid:48)) ω( ).WecallthisproblemMAXIDENTIFIEDROADS. L ≤ L Note that assuming the road graph G to be planar is not a restriction in practice. Considerforexamplearoadsectionrthatoverpassesanotherroadsectionr ,i.e.,risa (cid:48) bridgeoverr ,orr isatunnelunderneathr.Inordertoavoidoverlapsbetweenlabels (cid:48) (cid:48) placedonrandr ,weeithercanmodeltheintersectionofrandr asaregularcrossing (cid:48) (cid:48) oftworoadsorwesplitr insmallerroadsectionsthatdonotcrossr.Inbothcases (cid:48) 4 AndreasGemsa,BenjaminNiedermann,andMartinNöllenburg truefalse x2∨x4∨x3 x4∨x1∨x5 true x2 x3 F F x4 x5 x1 false false (c)Chain F x¯2∨x¯1∨x¯3 x¯3∨x¯5∨x¯4 false (d)Fork (a)SketchofMϕ (b)Clause Fig.2.IllustrationofNP-hardnessproof.(a)3-Satformulaϕ=(x x x ) (x x 4 1 5 2 4 ∨ ∨ ∧ ∨ ∨ x ) (x¯ x¯ x¯ ) (x¯ x¯ x¯ )representedasroadgraph .Truthassignmentis 3 2 1 3 3 5 4 ϕ ∧ ∨ ∨ ∧ ∨ ∨ M x =true,x =true,x =false,x =falseandx =false.(b)Clausegadgetintwostates. 1 2 3 4 5 (c)Thechainisthebasicbuildingblockfortheproof.(d)Schematizedforkgadget. thecorrespondingroadgraphbecomesplanar.Inthelattercasewemayobtainmore independentroadscreatedbychoppingr intosmallerpieces. (cid:48) 3 ComputationalComplexity WefirststudythecomputationalcomplexityofroadlabelingandproveNP-hardnessof MAXIDENTIFIEDROADSinthefollowingsense. Theorem1. Foragivenroadmap andanintegerK itisNP-hardtodecideifin M totalatleastK roadsectionscanbeidentified. Proof. We perform a reduction from the NP-complete PLANAR MONOTONE 3-SAT problem[4].AninstanceofPLANARMONOTONE3-SATisaBooleanformulaϕwithn variablesandmclauses(disjunctionsofatmostthreeliterals)thatsatisfiesthefollowing additionalrequirements:(i)ϕismonotone,i.e.,everyclausecontainseitheronlypositive literalsoronlynegativeliteralsand(ii)theinducedvariable-clausegraphH ofϕis ϕ planarandcanbeembeddedintheplanewithallvariableverticesonahorizontalline, allpositiveclauseverticesononesideoftheline,allnegativeclausesontheotherside oftheline,andtheedgesdrawnasrectilinearcurvesconnectingclausesandcontained variablesontheirrespectivesideoftheline.Weconstructaroadmap thatmimics ϕ M theshapeoftheaboveembeddingofH bydefiningvariableandclausegadgets,which ϕ simulatetheassignmentoftruthvaluestovariablesandtheevaluationoftheclauses. WerefertoFig.2forasketchoftheconstruction. ChainGadget.Thebasicbuildingblockisthechaingadget,whichconsistsofan alternatingsequenceofequallylonghorizontalandverticalroadswithidenticallabel lengthsthatintersecttheirrespectiveneighborsinthesequenceandformjunctionswith LabelPlacementinRoadMaps 5 r r 1 2 g g 1 2 r r4 false false true true 5 r 6 r 3 g false true 3 (a) (b) (c) Fig.3.Illustrationoftheforkgadget.(a)Structureoftheforkgadget.(c)Configurationtransmitting thevaluefalse.(b)Configurationtransmittingthevaluetrue. them as indicated in Fig. 2c). Assume that the chain consists of k 3 roads. Then ≥ eachroadexceptthefirstandlastonedecomposesintothreeroadsectionssplitbytwo junctions, a longer central section and two short end sections; the first and last road consistofonlytworoadsections,ashortoneandalongone,separatedbyonejunction. (Thesetworoadswilllaterbeconnectedtoothergadgets;indicatedbydottedsquaresin Fig.2c).)Thelabellengthanddistancebetweenjunctionsischosensothatforeachroad eitherthecentralandoneendsectionisidentified,ornosectionatallisidentified.For thefirstandlastroad,bothsectionsareidentifiedifthejunctioniscoveredandotherwise onlythelongsectioncanbeidentified.Wehavekroadsandk 1junctions.Eachlabel − mustblockajunction,ifitidentifiestwosections.Sothebestpossibleconfiguration blocksalljunctionsandidentifies2(k 1)+1=2k 1roadsections. − − Thechaingadgethasexactlytwostates,inwhich2k 1roadsectionsareidentified. − Eitherthelabelofthefirstroaddoesnotblockajunctionandidentifiesasinglesection andallsubsequentroadshavetheirlabelcoverthejunctionwiththeprecedingroadin thesequence,orthelabelofthelastroaddoesnotblockajunctionandallotherroads havetheirlabelcoverthejunctionwiththesuccessiveroadinthesequence.Inanyother configurationthereisatleastoneroadwithoutanyidentifiedsectionandthusatmost 2k 2sectionsareidentified.Weusethetwooptimalstatesofthegadgettorepresent − andtransmitthevaluestrueandfalsefromoneendtotheother. ForkGadget.Theforkgadgetallowstosplitthevaluerepresentedinonechaininto twochains,whichisneededtotransmitthetruthvalueofavariableintomultipleclauses. Tothatenditconnectstoanendroadofthreechaingadgetsbysharingjunctions. The core of the fork consists of six roads r ,...,r , whereas r , r , and r are 1 6 1 2 3 verticallinesegmentsandr ,r andr arehorizontallinesegments;seeFig.3.We 4 5 6 arrangethoseroadssuchthatr andr haveeachonejunctionwithr andonejunction 1 2 4 withr .Further,r hasonejunctionwithr ,onewithr andonewithr .Thelabel 5 3 4 5 6 length of those roads is chosen so that it is exactly the length of the roads. Hence, a placedlabelidenfiesallroadsectionsoftheroads. Further,therearethreeroadsg ,g ,g suchthatg hasonejunctionwithr ,g has 1 2 3 1 1 2 onejunctionwithr andg hasonejunctionwithr .Inallthreecasesweplacethe 2 3 6 junctionsothatitsplitstheroadinashortroadsectionthatisshorterthantheroad’s labellengthandalongroadsectionthathasexactlytheroad’slabellength.Wecallg , 1 6 AndreasGemsa,BenjaminNiedermann,andMartinNöllenburg g andg gates,becauselatertheseroadswillbeconnectedtotheendroadsofchains 2 3 byjunctions.Tothatendthoseconnectingjunctionswillbeplacedonthelongroad sectionsofthegates;seevioletdottedareasinFig.3. Theforkgadgethasexactlytwostates,inwhich16roadsectionsareidentified.In thefirststatethelabelsofr ,r andr areplaced;seeFig3(b).Hence,thelabelsofg 1 2 3 1 andg identifyonlythelongroadsectionsofg andg ,butnottheshortones.Thelabel 2 1 2 ofg idenfiesboththelongandshortroadsectionofg .Inthesecondstatethelabelsof 3 3 r ,r ,r areplaced;seeFig3(c).Hence,thelabelsofg andg identifythelongand 4 5 6 1 2 shortroadsectionsofg andg ,whileonlythelongroadsectionofg isidentifiedbya 1 2 3 label.Inanyotherconfigurationfewerroadsectionsareidentifiedbylabels.Weusethe twooptimalstatesofthegadgettorepresentandtransmitthevaluestrueandfalsefrom onegatetotheothertwogates.Morespecificallythegatesg andg areconnectedwith 1 2 chainsthatleadtothesameliteral,whileg isconnectedwithachainthatleadstothe 3 complementaryliteral. VariableGadget.Wedefinethevariablegadgetssimplybyconnectingchainandfork gadgetsintoaconnectedcomponentofintersectingroads.Thisconstructionalreadyhas thefunctionalityofavariablegadget:itrepresents(inalabelingidentifyingthemaximum numberofroadsections)thesametruthvalueinallofitsbranches,synchronizedbythe forkgadgets,seethebluechainsandyellowforksinFig.2a).Moreprecisely,weplacea sequenceofchainslinkedbyforkgadgetsalongthehorizontallineonwhichthevariable verticesareplacedinthedrawingH .Eachforkcreatesabranchofthevariablegadget ϕ eitheraboveorbelowtheline.Wecreateasmanybranchesabove(below)thelineas thevariablehasoccurrencesinpositive(negative)clausesinϕ.Thefirstandlastchain onthelinealsoserveasbranches.Thesynchronizationofthedifferentbranchesviathe forksissuchthateitheralltopbrancheshavetheirroadlabelspushedawayfromthe lineandallbottombranchespulledtowardsthelineorviceversa.Inthefirstcase,we saythatthevariableisinthestatefalseandinthelattercasethatitisinthestatetrue. TheexampleinFig.2hastwovariablessettotrueandthreevariablessettofalse. Clause Gadget. Finally, we need to create the clause gadget, which links three branches of different variables. The core of the gadget is a single road that consists ofthreesub-pathsmeetinginonejunction.Eachsub-pathofthatroadsharesanother junctionwithoneofthethreeincomingvariablebranches.Beyondeachofthesethree junctionsthefinalroadsectionsarejustlongenoughsothatalabelcanbeplacedon thesection.However,thesectionbetweenthecentraljunctionoftheclauseroadandthe junctionswiththeliteralroadsisshorterthanthelabellength.Theroadoftheclause gadgethassixsectionsintotalandwearguethatthesixsectionscanonlybeidentified ifatleastoneincomingliteralevaluatestotrue.Otherwiseatmostfivesectionscanbe identified.Byconstruction,eachroadinthechainofafalseliteralhasitslabelpushed towardstheclause,i.e.,itblocksthejunctionwiththeclauseroad.Aslongasatleast oneofthesethreejunctionsisnotblocked,allsectionscanbeidentified;seeFig.2b). Butifallthreejunctionsareblocked,thenonlytwoofthethreeinnersectionsofthe clauseroadcanbeidentifiedandthethirdoneremainsunlabeled;seeFig.2b). Reduction.Obviously,thesizeoftheinstance ispolynomialinnandm.Ifwe ϕ M haveasatisfyingvariableassignmentforϕ,wecanconstructthecorrespondingroad labelingandthenumberofidentifiedroadsectionsissixperclauseandafixedconstant LabelPlacementinRoadMaps 7 numberK ofsectionsinthevariablegadgets,i.e.,atleastK =K +6m.Ontheother (cid:48) (cid:48) hand,ifwehavearoadlabelingwithatleastK identifiedsections,eachvariablegadget isinoneofitstwomaximumconfigurationsandeachclauseroadhasatleastonelabel thatcoversajunctionwithaliteralroad,meaningthatthecorrespondingtruthvalue assignmentofthevariablesisindeedasatisfyingone.Thisconcludesthereduction. SinceMAXIDENTIFIEDROADSisanoptimizationproblem,weonlypresenttheNP- hardness proof. Still, one can argue that the corresponding decision problem is NP- completebyguessingwhichjunctionsarecoveredbywhichlabelandthenusinglinear programmingforcomputingthelabelpositions.Weomitthetechnicaldetails.Further, mostroadsinthereductionarepaths,exceptforthecentralroadineachclausegadget, whichisadegree-3star.Infact,wecanstrengthenTheorem1byusingamorecomplex clausegadgetinsteadthatusesonlypaths;seeAppendixA.1. 4 AnEfficientAlgorithmforTree-ShapedRoadMaps In this section we assume that the underlying road graph of the road map is a tree T =(V,E).InSection4.1wepresentapolynomial-timealgorithmtooptimallysolve MAXIDENTIFIEDROADSfortrees;Section4.2shows howtoimproveitsrunningtimeandspaceconsump- tion. Our approach uses the basic idea that remov- ing the vertices, whose embeddings lie in a curve horizontal c E(T),splitsthetreeintoindependentparts.In curve ‘ = pa⊆rticularthisistrueforlabels.WeassumethatT is child of ‘ ρ rooted at an arbitrary leaf ρ and that its edges are directed away from ρ; see Fig. 4. For two points p,q E(T) we define d(p,q) as the length of the ∈ head of ‘ shortestcurveinE(T)thatconnectspandq.Fortwo verticesuandv ofT wealsowrited(u,v)instead vertical of d(E(u),E(v)). For a point p E(T) we abbre- curve ‘ ∈ viatethedistanced(p,ρ)totherootρbyd .Fora tail of ‘ ρ p curve(cid:96)inE(T),wecallp (cid:96)thelowestpointof(cid:96) ∈ ifd d ,foranyq (cid:96).AsT isatree,pisunique. Fig.4.Basicdefinitions. p ≤ q ∈ WedistinguishtwotypesofcurvesinE(T).Acurve(cid:96) isverticalifh((cid:96))ort((cid:96))isthelowestpointof(cid:96);otherwisewecall(cid:96)horizontal(see Fig. 4). Without loss of generality we assume that the lowest point of each vertical curve(cid:96)isitstailt((cid:96)).Sincelabelsaremodeledascurves,theyarealsoeitherverticalor horizontal.Foravertexu V letT denotethesubtreerootedatu. u ∈ 4.1 BasicApproach Wefirstdetermineafinitesetofcandidatepositionsfortheheadsandtailsoflabels, andtransformT intoatreeT =(V ,E )bysubdividingsomeofT’sedgessothatit (cid:48) (cid:48) (cid:48) containsavertexforeverycandidateposition.Tothatendweconstructforeachregular vertex v V a chain of tightly packed vertical labels that starts at E(v), is directed ∈ 8 AndreasGemsa,BenjaminNiedermann,andMartinNöllenburg towardsρ,andendswheneithertheroadends,oraddingthenextlabeldoesnotincrease thenumberofidentifiedroadsections.Morespecifically,weplaceafirstverticallabel(cid:96) 1 suchthath((cid:96) ) = E(v).Fori = 2,3,... weaddanewverticallabel(cid:96) withh((cid:96) )= 1 i i t((cid:96) ),aslongash((cid:96) )andt((cid:96) )donotlieonthesameroadsectionandnoneof(cid:96) ’s i 1 i i i end−pointslieonajunctionedge.Weusethetailsofallthoselabelstosubdividethe treeT.DoingthisforallregularverticesofT weobtainthetreeT ,whichwecallthe (cid:48) subdivisiontreeofT.TheverticesinV V areneitherjunctionverticesnorregular (cid:48) \ vertices.SinceeachchainconsistsofO(n)labelsthecardinalityofV isO(n2).We (cid:48) call an optimal labeling of T an canonical labeling if for each label (cid:96) there (cid:48) L ∈ L existsavertexvin T withE(v)=h((cid:96))orE(v)=t((cid:96)).Thenextlemmaprovesthatis (cid:48) sufficienttoconsidercanonicallabelings. Lemma1. ForanyroadgraphT thatisatree,thereexistsacanonicallabeling . L Proof. Let beanoptimallabelingofT.Wepushthelabelsof asfaraspossible L L towardstheleavesofT withoutchangingtheidentifiedroadsections;seeFig.5.More specifically,startingwiththelabelsclosesttotheleaves,wemoveeachlabelawayfrom therootasfaraspossiblewhileitsheadandtailmustremainontheirrespectiveroad sections.Foraverticallabelthisdirectionisunique,whileforhorizontallabelswecan chooseanyofthetwo.Then,foreachlabelitsheadortaileithercoincideswithaleafof T,withsomeinternalregularvertex,orwiththeheadofanotherlabel.Consequently, eachverticallabelbelongstoachainoftightlypackedverticallabelsstartingataregular vertexv V.Further,theheadortailofeachhorizontallabelcoincideswiththeend ∈ ofachainoftightlypackedverticallabelsoraregularvertexofT,whichprovesthe claim. (cid:116)(cid:117) We now explain how to construct such a canonical labeling. To that end we first introducesomenotations.Foravertexu V let (u)denotealabelingthatidentifies (cid:48) ∈ L amaximumnumberofroadsectionsinT onlyusingvalidlabels (a) inE(T ),whereT denotesthesubtreeofT rootedatu.Note u(cid:48) u(cid:48) (cid:48) thatthoselabelsalsomayidentifytheincomingroadsectionof u,e.g.,label(cid:96)inFig.5b)identifiestheedgee. (cid:48) Further,thechildrenofavertexu V aredenotedbythe (cid:48) ∈ set N(u); we explicitly exclude the parent of u from N(u). Further, consider an arbitrary curve (cid:96) in E(T) and let (cid:96) = (cid:48) (cid:96) t((cid:96)),h((cid:96)) . We observe that removing all vertices of T (cid:48) \ { } containedin(cid:96) togetherwiththeirincidentoutgoingedgescreates (cid:48) (b) severalindependentsubtrees.Wecalltherootsofthesesubtrees (excepttheonecontainingρ)childrenof(cid:96)(seeFig.4).Ifnovertex T chain u0 ofT liesin(cid:96),thecurveiscontainedinasingleedge(u,v) E . (cid:48) (cid:48) (cid:48) ‘ ∈ In that case v is the only child of (cid:96). We denote the set of all e u e0 childrenof(cid:96)asN((cid:96)). added ForeachvertexuinT(cid:48)weintroduceasetC(u)ofcandidates, vertex which model potential labels with lowest point E(u). If u is a regular vertex of T or u V V, the set C(u) contains all (cid:48) ∈ \ verticallabels(cid:96)withlowestpointE(u).Ifuisajunctionvertex, Fig.5. Canonical la- beling. C(u)containsallhorizontallabelsthatstartorendatavertexof LabelPlacementinRoadMaps 9 T andwhoselowestpointisE(u).InbothcasesweassumethatC(u)alsocontainsthe (cid:48) degeneratedcurve =E(u),whichisthedummylabelofu.WesetN( )=N(u) u u ⊥ ⊥ andω( )=0. u ⊥ (cid:83) For a curve (cid:96) we define ((cid:96)) = (v) (cid:96) . Thus, ((cid:96)) is a labeling L v N((cid:96))L ∪ { } L ∈ comprising(cid:96)andthelabelsofitschildren’soptimallabelings.Wecallalabel(cid:96) C(u) ∈ with(cid:96)=argmax ω( ((cid:96))) (cid:96) C(u) anoptimalcandidateofu.Next,weprovethat { L | ∈ } itissufficienttoconsideroptimalcandidatestoconstructacanonicallabeling. Lemma2. GivenavertexuofT andanoptimallabeling (u)andlet(cid:96)beanoptimal (cid:48) L candidateofu,thenitistruethatω( (u))=ω( ((cid:96))). L L Proof. Firstnotethatω( (u)) ω( ((cid:96)))becausebothlabelings (u)and ((cid:96))only L ≥ L L L containlabelsthatareembeddedinE(T ).ByLemma1wecanassumewithoutlossof u(cid:48) generalitythat (u)isacanonicallabeling.Let(cid:96)bethelabelof (u)withE(u)asthe L L lowestpointof(cid:96)(ifitexists). If(cid:96)exists,thentheverticesinN((cid:96))arerootsofindependentsubtrees,whichdirectly yieldsω( (u))=ω( ((cid:96))).ByconstructionofC(u)wefurtherknowthat(cid:96)iscontained L L inC(u).Hence,(cid:96)isanoptimalcandidateofu,whichimpliesω((cid:96))=ω((cid:96)). If (cid:96)doesnotexist,thenwehave (cid:91) (1) (cid:91) ω( (u))=ω( (v)) = ω( (v) )=ω( ( )). u u L L L ∪{⊥ } L ⊥ v∈N(u) v∈N(⊥u) Equality(1)followsfromN( )=N(u)andthedefinitionthat doesnotidentify u u ⊥ ⊥ anyroadsection.Since iscontainedinC(u),thedummylabel istheoptimal u u ⊥ ⊥ candidate(cid:96). (cid:116)(cid:117) Algorithm 1 first constructs the subdivision tree T = (V ,E ) from T. Then (cid:48) (cid:48) (cid:48) starting with the leaves of T and going to the root ρ of T , it computes an optimal (cid:48) (cid:48) candidate(cid:96)=OptCandidate(u)foreachvertexu V inabottom-upfashion.By (cid:48) ∈ Lemma2thelabeling ((cid:96))isanoptimallabelingofT .Inparticular (ρ)istheoptimal L u(cid:48) L labelingofT. DuetothesizeofthesubdivisiontreeT weconsiderO(n2)vertices.Implement- (cid:48) ingOptCandidate(u),whichcomputesanoptimalcandidate(cid:96)foru,naively,cre- atesC(u)explicitly.Weobservethatifuisajunctionvertex,C(u)maycontainO(n2) labels; O(n2) pairs of road sections of different subtrees of u can be connected by Algorithm1:ComputinganoptimallabelingofT. Input:RoadgraphT,whereT isatreewithrootρ. Output:Optimallabeling (ρ)ofT. L 1 T(cid:48) computesubdivisiontreeofT ← 2 foreachleafvofT(cid:48)do (v) foreachvertexuofT(cid:48)consideredinabottom-up L ←∅ traversalofT(cid:48)do 3 (u) (OptCandidate(u)) L ←L 4 return (ρ) L 10 AndreasGemsa,BenjaminNiedermann,andMartinNöllenburg horizontallabels.EachlabelcanbeconstructedinO(n)timeusingabreadth-firstsearch. Thus,foreachvertexutheprocedureOptCandidateneedsinanaiveimplementation O(n3)time,whichyieldsO(n5)runningtimeintotal.Further,weneedO(n2)storage to store T . Note that we do not need to store (u) for each vertex u of T , but by (cid:48) (cid:48) L Lemma2wecanreconstructitusing ((cid:96)),where(cid:96)istheoptimalcandidateofu.Tothat L endwestoreforeachvertexofT itsoptimalcandidate(cid:96)andw( ((cid:96))). (cid:48) L Theorem2. Foraroadmapwithatreeasunderlyingroadgraph,MAXIDENTIFIED- ROADScanbesolvedinO(n5)timeusingO(n2)space. Incasethatallroadsarepaths,Algorithm1runsinO(n4)time,becauseforeach u V the set C(u) contains O(n) labels. Further, besides the primary objective (cid:48) ∈ to identify a maximum number of road sections, Chirié [1] also suggested several additionalsecondaryobjectives,e.g.,labelsshouldoverlapasfewjunctionsaspossible. Our approach allows us to easily incorporate secondary objectives by changing the weightfunctionωappropriately. 4.2 ImprovementsonRunningTime InthispartwedescribehowtherunningtimeofAlgorithm1canbeimprovedtoO(n3) timebyspeedingupOptCandidate(u)toO(n)time. Foranedgee=(u,v) E E wecallaverticalcurve(cid:96) E(T)ane-rootedcurve, (cid:48) ∈ ∪ ⊆ ift((cid:96))=E(u),h((cid:96))liesonaroadsection,andlen(E(e) (cid:96))=min len((cid:96)),len(E(e)) , ∩ { } i.e., (cid:96) emanates from E(u) passing through e; for example the red label in Fig. 5b) is an e-rooted curve. An e-rooted curve (cid:96) is maximal if there is no other e-rooted curve (cid:96) with len((cid:96)) = len((cid:96)) and ω( ((cid:96))) > ω( ((cid:96))). We observe that in any (cid:48) (cid:48) (cid:48) L L canonicallabelingeachverticallabel(cid:96)isa(u,v)-rootedcurvewith(u,v) E ,and (cid:48) ∈ each horizontal label (cid:96) can be composed of a (u,v )-rooted curve (cid:96) and a (u,v )- 1 1 2 rootedcurve(cid:96) with(u,v ),(u,v ) E andE(u)isthelowestpointof(cid:96);seeFig.7 2 1 2 (cid:48) ∈ and Fig. 8, respectively. Further, for a vertical curve c in E(T) its distance interval I(c) is [d ,d ]. Since T is a tree, for every point p of c we have d I(c). t(c) h(c) p ∈ Two vertical curves c and c superpose 9 ethaacthNeoentxhcteo,rdwiefseIf(ioncrt)ro∩edaIcu(hcce(cid:48)e)da(cid:54)=gde∅a(cid:48)t(;ause,sevtr)Fuicogtfu6rT.e 765c5436cc147c83 74655c26 7 I(c1) I(cI2()c5)I(c4) allmaximal(u,v)-rootedcurvesasO(n) 23 I(c3) superposition-freecurvesinE(T ).Inpar- 1 0 5 10 u ρ ticular,eachofthosecurvesliesonasin- gleroadsectionsuchthatall(u,v)-rooted Fig.6.Superposingcurves,e.g.,c andc super- 1 2 curvesendingonthatcurvearemaximal poseeachother,whilec andc donot.Thetree 1 5 andidentifythesamenumberofroadsec- isannotatedwithdistancemarks. tions.Wedefinethisdatastructureasfollows. Definition1 (Linearization).Lete=(u,v)beanedgeofT.Atuple(L,ω)iscalled alinearizationofe,ifLisasetofsuperposition-freecurvesandω: L Rsuchthat → (1) foreachcurvec Lthereisaroadsectione inT withc E(e), (cid:48) u (cid:48) ∈ ⊆

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.