ebook img

Central Trajectories PDF

0.44 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 Central Trajectories

Central Trajectories Marc van Kreveld Maarten Lo¨ffler Frank Staals ∗ ∗ ∗ Abstract Animportanttaskintrajectoryanalysisisclustering. Theresultsofaclusteringareoftensummarizedbyasingle representativetrajectoryandanassociatedsizeofeachcluster. Westudytheproblemofcomputingasuitable representative of a set of similar trajectories. To this end we define a central trajectory C, which consists of piecesoftheinputtrajectories,switchesfromoneentitytoanotheronlyiftheyarewithinasmalldistanceofeach 5 other,andsuchthatatanytimet,thepointC(t)isascentralaspossible. Wemeasurecentralityintermsofthe 1 radiusofthesmallestdiskcenteredatC(t)enclosingallentitiesattimet,anddiscusshowthetechniquescanbe 0 adaptedtoothermeasuresofcentrality. WefirststudytheprobleminR1,whereweshowthatanoptimalcentral 2 trajectoryC representingntrajectories,eachconsistingofτ edges,hascomplexityΘ(τn2)andcanbecomputed n inO(τn2logn)time. WethenconsidertrajectoriesinRdwithd 2,andshowthatthecomplexityofC isatmost a O(τn5/2)andcanbecomputedinO(τn3)time. ≥ J 8 ] G C . s c [ 1 v 2 2 8 1 0 . 1 0 5 1 : v i X r a ∗Department of Information and Computing Sciences, Universiteit Utrecht, The Netherlands, {m.j.vankreveld|m.loffler|f.staals}@uu.nl (a) (b) Fig.1: (a)Everytrajectoryhasapeculiaritythatisnotrepresentativefortheset. (b)Taking,forexample,the pointwiseaverageofasetoftrajectoriesmayresultinonethatignorescontext. 1 Introduction Atrajectoryisasequenceoftime-stampedlocationsintheplane,ormoregenerallyinRd. Trajectory dataisobtainedbytrackingthemovementsofe.g. animals[6,10,16],hurricanes[24],traffic[21],or othermovingentities[12]overtime. Largeamountsofsuchdatahaverecentlybeencollectedinavariety ofresearchfields. Asaresult,thereisagreatdemandfortoolsandtechniquestoanalyzetrajectorydata. Oneimportanttaskintrajectoryanalysisisclustering: subdividingalargecollectionoftrajectories intogroupsof“similar”ones. Thisproblemhasbeenstudiedextensively,andmanydifferenttechniques areavailable[7,14,15,20,25]. Onceasuitableclusteringhasbeendetermined,theresultneedstobe stored or prepared for further processing. Storing the whole collection of trajectories in each cluster is often not feasible, because follow-up analysis tasks may be computation-intensive. Instead, we wishtorepresenteachclusterbyasignature: thenumberoftrajectoriesinthecluster,togetherwitha representativetrajectorywhichshouldcapturethedefiningfeaturesofalltrajectoriesinthecluster. Representativetrajectoriesarealsousefulforvisualizationpurposes. Displayinglargeamountsof trajectoriesoftenleadstovisualclutter. Instead,ifweshowonlyanumberofrepresentativetrajectories, thisreducesthevisualclutter,andallowsformoreeffectivedataexploration. Theoriginaltrajectories canstillbeshownifdesired,usingthedetails-on-demandprincipleininformationvisualization[23]. Representativetrajectories. Whenchoosingarepresentativetrajectoryforagroupofsimilartrajecto- ries,thefirstobviouschoicewouldbetopickoneofthetrajectoriesinthegroup. However,onecanargue thatnosingleelementinagroupmaybeagoodrepresentative,e.g. becauseeachindividualtrajectory hassomeprominentfeaturethatisnotsharedbytherest(seeFig.1(a)),ornotrajectoryissufficiently inthemiddleallthetime. Ontheotherhand, itisdesirabletooutputatrajectorythatdoesconsistof piecesofinputtrajectories,becauseotherwisetherepresentativetrajectorymaydisplaybehaviourthatis notpresentintheinput,e.g. becauseofcontextualinformationthatisnotavailabletothealgorithm(see Fig.1(b)). Todeterminewhatagoodrepresentativetrajectoryofagroupofsimilartrajectoriesis,weidentify twomaincategories: time-dependent andtime-independent representatives. Trajectoriesaretypically collectedasadiscretesequenceoftime-stampedlocations. Bylinearlyinterpolatingthelocationswe obtainacontinuouspiecewise-linearcurveastheimageofthefunction. Dependingontheapplication, wemaybeinterestedinthecurvewithattachedtimestamps(say,whenstudyingaflockofanimalsthat movedtogether)orinjustthecurve(say,whenconsideringhikersthattookthesameroute,butpossibly atdifferenttimesandspeeds). Whentimeisnotimportant,onecanselectarepresentativebaseddirectlyonthegeometryortopology of the set of curves [8, 18]. When time is important, we would like to have the property that at each time t our representative point c(t) is a good representative of the set of points P(t). To this end, we maychooseanystaticrepresentativepointofapointset, forwhichmanyexamplesareavailable: the Fermat-Weberpoint(whichminimizesthesumofdistancestothepointsinP),thecenterofmass(which minimizesthesumofsquareddistances),orthecenterofthesmallestenclosingcircle(whichminimizes thedistancetothefarthestpointinP). 1 ε (a) (b) Fig.2: (a) Two views of five moving entities and their trajectories. (b) On the top the pairwise distances betweentheentitiesasafunctionovertime. OnthebottomthefunctionsD ,andinyellowthearea σ representing (C). D Centraltrajectories. Inthiswork,wefocusontime-dependentmeasuresbasedonstaticconceptsof centrality. Wechoosethedistancetothefarthestpoint,butdiscussinSection4howourresultscanbe adaptedtoothermeasures. Ideally,wewouldoutputatrajectoryC suchthatatanytimet,C(t)isthepoint(entity)thatisclosest toitsfarthestentity. Unfortunately,whentheentitiesmoveinRdford > 1,thismaycausediscontinuities. Suchdiscontinuitiesareunavoidable: ifweinsistthattheoutputtrajectoryconsistsofpiecesofinput trajectoriesandiscontinuous,theningeneral,therewillbenoopportunitiestoswitchfromonetrajectory toanother,andweareeffectivelychoosingoneoftheinputtrajectoriesagain. Atthesametime,wedo not want to output a trajectory with arbitrarily large discontinuities. An acceptable compromise is to allowdiscontinuities,orjumps,butonlyoversmalldistances,controlledbyaparameterε. Wenotethat thisproblemofdiscontinuitiesshowsupfortime-independentrepresentativesforentitiesmovinginRd, withd 3,aswell,becausethetraversedcurvesgenerallydonotintersect. ≥ Related work. Buchin et al. [8] consider the problem of computing a median trajectory for a set of trajectories without time information. Their method produces a trajectory that consists of pieces of theinput. Agarwaletal.[1]considertrajectorieswithtimeinformationandcomputearepresentative trajectorythatfollowsthemedian(inR1)orapointofhighdepth(inR2)oftheinputentities. Theresulting trajectory does not necessarily stay close to the input trajectories. They give exact and approximate algorithms. Durocher and Kirkpatrick [13] observe that a trajectory minimizing the sum of distances totheotherentitiesisunstable,inthesensethatarbitrarilysmallmovementoftheentitiesmaycause an arbitrarily large movement in the location of the representative entity. They proceed to consider alternative measures of centrality, and define the projection median, which they prove is more stable. Basuetal.[4]extendthisconcepttohigherdimensions. Problem description. We are given a set of n entities, each moving along a piecewise linear X trajectoryinRdconsistingofτ edges. Weassumethatalltrajectorieshavetheirverticesatthesametimes, i.e.timest ,..,t . Fig.2(a)showsanexample. Foranentityσ,letσ(t)denotethepositionofσattimet. 0 τ Withslightabuseofnotationwewillwriteσ forbothentityσ anditstrajectory. Atagiventimet,we denotethedistancefromσtotheentityfarthestawayfromσbyD (t) = D(σ,t) = max σ(t)ψ(t) , σ ψ∈X (cid:107) (cid:107) where pq denotestheEuclideandistancebetweenpointspandqinRd. Fig.2(b)illustratesthepairwise (cid:107) (cid:107) distancesandresultingD functionsforfiveexampletrajectories. Foreaseofexposition,weassumethat thetrajectoriesareingeneralposition: thatis,nothreetrajectoriesintersectinthesamepoint,andnotwo pairsofentitiesareatdistanceεfromeachotheratthesametime. 2 Atrajectoid isafunctionthatmapstimetothesetofentities ,withtherestrictionthatatdisconti- X nuitiesthedistancebetweentheentitiesinvolvedisatmostε. Intuitively,atrajectoidcorrespondstoa concatenationofpiecesoftheinputtrajectoriesinsuchawaythattwoconsecutivepiecesmatchupin time,andtheendpointoftheformerpieceiswithindistanceεfromthestartpointofthelatterpiece. In Fig.2(b),atrajectoidmayswitchbetweenapairofentitieswhentheirpairwisedistancefunctionliesin thebottomstripofheightε. Moreformally,foratrajectoidT wehavethat atanytimet,T(t) = σ forsomeσ ,and • ∈ X ateverytimetwhereT hasadiscontinuity,thatis,T jumpsfromentityσ toentityψ,wehavethat • σ(t)ψ(t) ε. (cid:107) (cid:107) ≤ Note that this definition still allows for a series of jumps within an arbitrarily short time interval [t,t+δ],essentiallysimulatingajumpoverdistanceslargerthanε. Tomaketheformulationcleaner,we slightlyweakenthesecondcondition,andallowatrajectoidtohavediscontinuitieswithadistancelarger thanε,providedthatsuchalargejumpcanberealizedbyasequenceofsmalljumps,eachofdistanceat mostε. Whenitisclearfromthecontext,wewillwriteT(t)insteadofT(t)(t)tomeanthelocationof entityT(t)attimet. WenowwishtocomputeatrajectoidC thatminimizesthefunction (cid:90) tτ (T) = D(T,t)dt. D t0 So,atanytimet,allentitieslieinadiskofradiusD(C,t)centeredatC(t). Outline and results. We first study the situation where entities move in R1. In Section 2 we show that the worst case complexity of a central trajectory in R1 is Θ(τn2), and that we can compute one in O(τn2logn) time. We then extend our approach to entities moving in Rd, for any constant d, in Section 3. For this case, we prove that the maximal complexity of a central trajectory C is O(τn5/2). ComputingC takesO(τn3)timeandrequiresO(τn2logn)workingspace. Webrieflydiscussvarious extensionstoourapproachinSection4. OmittedproofscanbefoundinAppendix??. Eventhoughwedonotexpectthistohappeninpractice,theworstcasecomplexityofourcentral trajectories can be significantly higher than the input size. If this occurs, we can use traditional line simplificationalgorithmslikeImaiandIri[19]tosimplifytheresultingcentraltrajectory. Thisgivesusa representativethatstillisalwaysclose—forinstancewithindistance2ε—tooneoftheinputtrajectories. Alternatively, we can use dynamic-programming combined with our methods to enforce the output trajectorytohaveatmostk vertices,foranyk,andalwaysbeontheinputtrajectories. Computingsucha centraltrajectoryismoreexpensivethanourcurrentalgorithms,however. Furthermore,enforcingalow outputcomplexitymaynotbenecessary. Forexample,inapplicationslikevisualization,thenumberof trajectoriesshownoftenhasalargerimpactvisualclutterthanthelengthorcomplexityoftheindividual trajectories. It may be easier to follow a single trajectory that has many vertices than to follow many trajectoriesthathavefewerverticeseach. 2 Entities moving in R1 Let bethesetofentitiesmovinginR1. ThetrajectoriesoftheseentitiescanbeseenaspolylinesinR2: X weassociatetimewiththehorizontalaxis,andR1 withtheverticalaxis(seeFig.3(a)). Weobservethat thedistancebetweentwopointspandq inR1 issimplytheirabsolutedifference,thatis, pq = p q . (cid:107) (cid:107) | − | LetI betheidealtrajectory,thatis,thetrajectorythatminimizes butisnotrestrictedtolieonthe D inputtrajectories. Itfollowsthatatanytimet,I(t)issimplytheaverageofthehighestentityU(t)and thelowestentityL(t). WefurthersubdivideeachtimeintervalJi = [ti,ti+1]intoelementaryintervals, suchthatI isasinglelinesegmentinsideeachelementaryinterval. Lemma1. Thetotalnumberofelementaryintervalsisτ(n+2). Proof. The ideal trajectory I changes direction when U(t) or L(t) changes. During a single interval [ti,ti+1]allentitiesmovealonglines,soU andL aretheupperandlowerenvelopeofasetofnlines. So 3 (a) (b) Fig.3: (a)AsetoftrajectoriesandtheidealtrajectoryI. Thebreakpointsintheidealtrajectorypartitiontime intoO(nτ)intervals. (b)ThetrajectoriesaftertransformingI toahorizontalline. bystandardpoint-lineduality,U andL correspondtotheupperandlowerhullofnpoints. Thesummed complexityoftheupperandlowerhullisatmostn+2. WeassumewithoutlossofgeneralitythatwithineachelementaryintervalI coincideswiththex-axis. Tosimplifythedescriptionoftheproofsandalgorithms, wealsoassumethattheentitiesnevermove paralleltotheidealtrajectory,thatis,therearenohorizontaledges. Lemma2. C isacentraltrajectoryinR1 ifandonlyifitminimizesthefunction (cid:90) tτ (cid:48)(T) = T(t) dt. D | | t0 Proof. AcentraltrajectoryC isatrajectoidthatminimizesthefunction (cid:90) tτ (cid:90) tτ (cid:90) tτ (T) = D(T,t)dt = max T(t)ψ(t) dt = max T(t) ψ(t) dt D t0 t0 ψ∈X (cid:107) (cid:107) t0 ψ∈X | − | (cid:90) tτ = max T(t) U(t) , T(t) L(t) dt. {| − | | − |} t0 Since(U(t)+L(t))/2 = 0,wehavethat T(t) U(t) > T(t) L(t) ifandonlyifT(t) < 0. So, | − | | − | wesplittheintegral,dependingonT(t),givingus (cid:90) (cid:90) (T) = T(t) L(t)dt+ U(t) T(t)dt D − − t0≤t≤tτ∧T(t)≥0 t0≤t≤tτ∧T(t)<0 (cid:90) (cid:90) = T(t)dt L(t)dt+ − t0≤t≤tτ∧T(t)≥0 t0≤t≤tτ∧T(t)≥0 (cid:90) (cid:90) U(t)dt T(t)dt. − t0≤t≤tτ∧T(t)<0 t0≤t≤tτ∧T(t)<0 (cid:82) (cid:82) (cid:82) (cid:82) We now use that T(t) = T(t) , and that L(t) = U(t) (since (U(t) + − T(t)<0 T(t)<0| | − L(t))/2 = 0). Afterrearrangingthetermswethenobtain (cid:90) (cid:90) (T) = T(t)dt+ T(t) dt+ D | | t0≤t≤tτ∧T(t)≥0 t0≤t≤tτ∧T(t)<0 (cid:90) (cid:90) U(t)dt+ U(t)dt t0≤t≤tτ∧T(t)≥0 t0≤t≤tτ∧T(t)<0 (cid:90) (cid:90) = T(t) dt + U(t)dt. | | t0≤t≤tτ t0≤t≤tτ 4 Fig.4: Lowerboundconstructionthatshowsthat (red)mayhavequadraticcomplexity. Theidealtrajectory C I isshowningreen. The last term is independent of T, so we have (T) = (cid:48)(T)+c, for some c R. The lemma D D ∈ follows. ByLemma2acentraltrajectoryC isatrajectoidthatminimizesthearea (cid:48)(T)betweenT andthe D idealtrajectoryI. Hence,wecanfocusonfindingatrajectoidthatminimizes (cid:48). D 2.1 Complexity Lemma3. ForasetofntrajectoriesinR1,eachwithverticesattimest0,..,tτ,acentraltrajectoryC mayhaveworstcasecomplexityΩ(τn2). Proof. WedescribeaconstructionfortheentitiesthatshowsthatwithinasingletimeintervalJ = [t ,t ] i i+1 thecomplexityofC maybeΩ(n2). Repeatingthisconstructionτ timesgivesusΩ(τn2)asdesired. WithinJ theentitiesmovelinearly. Soweconstructanarrangement oflinesthatdescribesthe A motionofallentities. Weplacem = n/3linessuchthattheupperenvelopeof haslinearcomplexity. A Wedothesameforthelowerenvelope. WepositiontheselinessuchthattheidealtrajectoryI—whichis theaverageoftheupperandlowerenvelope—makesavertical“zigzagging”pattern(seeFig.4). The remainingsetH ofmlinesarehorizontal. Twoconsecutivelinesareplacedat(vertical)distanceatmost ε. WeplacealllinessuchthattheyallintersectI. ItfollowsthatC jumpsO(n2)timesbetweenthelines inH. Thelemmafollows. Twoentitiesσ andψ areε-connected attimetifthereisasequenceσ = σ ,..,σ = ψ ofentities 0 k suchthatforalli,σ andσ arewithindistanceεofeachotherattimet. Asubset (cid:48) ofentities i i+1 X ⊆ X isε-connectedattimetifallentitiesin (cid:48) arepairwiseε-connectedattimet. Theset (cid:48) isε-connected X X duringanintervalI,iftheyareε-connectedatanytimet I. Wenowobserve: ∈ Observation4. C canjumpfromentityσ toψ attimetifandonlyifσ andψ areε-connectedattimet. Atanytimet,wecanpartition intomaximalsetsofε-connectedentities. Thecentraltrajectory X C mustbeinoneofsuchmaximalsets (cid:48): itusesthetrajectoryofanentityσ (cid:48) (attimet),ifand X ∈ X onlyifσ istheentityfrom (cid:48) closesttoI. Moreformally,letfσ(t) = σ(t) ,andletL( ) = minf∈F f X | | F denotethelowerenvelopeofasetoffunctions . F Observation5. Let (cid:48) σ beasetofentitiesthatisε-connectedduringintervalJ,andassumethat X (cid:51) C (cid:48) duringJ. Foranytimet J,wehavethatC(t) = σ(t)ifandonlyiffσ isonthelowerenvelope ∈ X ∈ oftheset (cid:48) = fψ ψ (cid:48) attimet,thatis,fσ(t) = L( )(t). F { | ∈ X } F Let ,.., , denote a collection of maximal sets of entities that are ε-connected during time 1 m X X intervalsJ1,..,Jm,respectively. Let i = fσ σ i ,andletLi bethelowerenvelopeL( i)of i F { | ∈ X } F F 5 restrictedtointervalJi. AlowerenvelopeLi hasabreakpointattimetiffσ(t) = fψ(t),forσ,ψ i. ∈ X There are two types of break points: (i) σ(t) = ψ(t), or (ii) σ(t) = ψ(t). At events of type (i) the − modifiedtrajectoriesofσandψintersect. Ateventsofthetype(ii),σandψareequallyfarfromI,buton differentsidesofI. LetB = (t,σ,ψ) Li(t) = fσ(t) = fψ(t) i 1,..,m denotethecollection { | ∧ ∈ { }} ofbreakpointsfromalllowerenvelopesL1,..,Lm. Lemma6. Consideratriplet(t,σ,ψ) B. ThereisatmostonelowerenvelopeLi suchthattisabreak ∈ pointinLi. Proof. AssumebycontradictionthattisabreakpointinbothLi andLj. Atanytimet,anentitycanbe inatmostonemaximalset . Soif and shareeitherentityσ orψ,thentheintervalsJ andJ (cid:96) i j i j X X X aredisjoint. Itfollowstcannotlieinbothintervals,andthuscannotbeabreakpointinbothLi andLj. Contradiction. Lemma 7. Let be an arrangement of n lines, describing the movement of n entities during an A elementaryintervalJ. Ifthereisabreakpoint(t,σ,ψ) B,witht J,oftype(ii),thenσ(t)andψ(t) ∈ ∈ lieontheboundary∂ ofthezone ofI in . Z Z A Proof. Let bethemaximalε-connectedsetcontainingσ andψ,andassumewithoutlossofgenerality j X thatf (t) = σ(t) = ψ(t) = f (t). Now,assumebycontradictionthatσ isnoton∂ attimet(the σ ψ − Z casethatψ(t)isnoton∂ issymmetric). Thismeansthatthereisanentityρwith0 ρ(t) < σ(t). If Z ≤ ρ ,thiscontradictsthatf (t)wasonthelowerenvelopeof attimet. Soρisnotε-connectedto j σ j ∈ X X σ attimet. Hence,theirdistanceisatleastε. Wethenhaveσ(t) > ρ(t)+ε > ε. Itnowfollowsthat σ andψ cannotbeε-connectedattimet: thedistancebetweenσ andψ isbiggerthanεsotheyarenot directlyconnected,andfσ andfψ areonLj,sotherearealsonootherentitiesin j throughwhichthey X canbeε-connected. Contradiction. Lemma 8. Let be an arrangement of n lines, describing the movement of n entities during an A elementaryintervalJ. Thetotalnumberofbreakpoints(t,σ,φ) B,witht J,oftype(ii)isatmost ∈ ∈ 6.5n. Proof. ByLemma6allbreakpointscanbechargedtoexactly e one set . From Lemma 7 it follows that break points of j X type(ii)involveonlyentitieswhoselinesin participatein thezoneofI. A I tg te t Let E be the set of edges of ∂ . We have that E Z | | ≤ 5.5n [5, 22]. We now split every edge that intersects I, at theintersectionpoint. SinceeverylineintersectsI atmost g once,thismeansthenumberofedgesinE increasesto6.5n. Fig.5: The jumps of L (dashed arrows) Foreverypairofedges(e,g),thatlieonoppositesidesofI, involvingedgeseandg. thereisatmostonetimetwherealowerenvelopeL = Lj, forsomej,hasabreakpointoftype(ii). Considerabreakpointoftype(ii),thatis,atimetsuchthatL switches(jumps)fromanentityσ to anentityψ,withσ andψ onoppositesidesofI. Lete E andg E betheedgescontainingσ(t)and ∈ ∈ ψ(t),respectively. Ifthearrivingedgeghasnotbeenchargedbefore,wechargethejumptog. Otherwise, wechargeittoe. WecontinuetoshowthateveryedgeinE ischargedatmostonce. SinceE hasatmost 6.5nedges,thenumberofbreakpointsoftype(ii)isalsoatmost6.5n. Wenowshowthateithereorg hasnotbeenchargedbefore. Assume,bycontradiction,thatbothe andg havebeenchargedbeforetimet,attimest andt ,respectively. Considerthecasethatt < t e g g e (seeFig.5). Attimete, thelowerenvelopeL jumpsfromanedgehontoeorviceversa. Sincethere isajumpinvolvingedgeg attimet andoneattimetitfollowsthatattimet ,g istheclosestedgein g e E oppositetoe. Hence,h = g. Thismeanswejumptwicebetweeneandg. Contradiction. Thecase t < t issymmetricalandthecaset = t cannotoccur. Itfollowsthateorg wasnotchargedbefore e g e g timet,andthusalledgesinE arechargedatmostonce. 6 Lemma9. ThetotalcomplexityofalllowerenvelopesL1,..,Lm on[ti,ti+1]isO(n2). Proof. Thebreakpointsinthelowerenvelopesareeitheroftype(i)oroftype(ii). Wenowshowthat thereareatmostO(n2)breakpointsofeithertype. Thebreakpointsoftype(i)correspondtointersectionsbetweenthetrajectoriesoftwoentities. Within interval [t ,t ] the entities move along lines, hence there are at most O(n2) such intersections. By i i+1 Lemma6allbreakpointscanbechargedtoexactlyoneset . Itfollowsthatthetotalnumberofbreak i X pointsoftype(i)isO(n2). ToshowthatthenumberofeventsofthesecondtypeisatmostO(n2)aswellwedivide[t ,t ] i i+1 inO(n)elementaryintervalssuchthatI coincideswiththex-axis. ByLemma8eachsuchelementary intervalcontainsatmostO(n)breakpointsoftype(ii). Theorem10. GivenasetofntrajectoriesinR1,eachwithverticesattimest ,..,t ,acentraltrajectory 0 τ C hasworstcasecomplexityO(τn2). Proof. AcentraltrajectoryC isapiecewisefunction. FromObservations4and5itnowfollowsthatC hasabreakpointattimetonlyif(a)twosubsetsofentitiesbecomeε-connectedorε-disconnected,or (b)thelowerenvelopeofasetofε-connectedentitieshasabreakpointattimet. Withinasingletime intervalJ = [t ,t ]thereareatmostO(n2)timeswhentwoentitiesareatdistanceexactlyε. Hence, i i i+1 thenumberofeventsoftype(a)duringintervalJ isalsoO(n2). ByLemma9thetotalcomplexityofall i lowerenvelopesofε-connectedsetsduringJ isalsoO(n2). Hence,thenumberofbreakpointsoftype i (b)withinintervalJ isalsoO(n2). Thetheoremfollows. i 2.2 Algorithm We now present an algorithm to compute a trajectoid C minimizing (cid:48). By Lemma 2 such a trajectoid is D a central trajectory. The basic idea is to construct a weighted(directedacyclic)graphthatrepresentsaset oftrajectoidscontaininganoptimaltrajectoid. Wecan then find C by computing a minimum weight path in thisgraph. The graph that we use is a weighted version of theReebgraphthatBuchinetal.[9]usetomodelthe trajectorygroupingstructure. Wereviewtheirdefinition here. The Reeb graph is a directed acyclic graph. Fig.6: TheReebgraphforthemovingentities R Each edge e = (u,v) of corresponds to a maximal from Fig. 3(a). The dashed lines indi- R subset of entities C that is ε-connected during e catethattwoentitiesareatdistanceε. ⊆ X the time interval [t ,t ]. The vertices represent times u v atwhichthesetsofε-connectedentitieschange,thatis,thetimesatwhichtwoentitiesσ andψ areat distanceεfromeachotherandthesetcontainingσ mergeswithorsplitsfromthesetcontainingψ. See Fig.6foranillustration. ByObservation4acentraltrajectoryC canjumpfromσ toψ ifandonlyifσ andψ areε-connected, that is, if σ and ψ are in the same component C of edge e. From Observation 5 it follows that on e eachedgee,C usesonlythetrajectoriesofentitiesσ forwhichfσ occursonthelowerenvelopeofthe functions e = fσ σ Ce . Hence,wecanthenexpressthecostforC usingedgeeby F { | ∈ } (cid:90) tv ωe = L( e)(t)dt. F tu ItnowfollowsthatC followsapathintheReebgraph ,thatis,thesetoftrajectoidsrepresentedby R containsatrajectoidminimizing (cid:48). Sowecancomputeacentraltrajectorybyfindingaminimum R D weightpathin fromasourcetoasink. R 7 Analysis. FirstwecomputetheReebgraphasdefinedbyBuchinetal.[9]. ThistakesO(τn2logn) time. Second we compute the weight ω for each edge e. The Reeb graph is a DAG, so once e R we have the edge weights, we can use dynamic programming to compute a minimum weight path in O( ) = O(τn2)time. Soallthatremainsistocomputetheedgeweightsω . Forthis, weneedthe e |R| lowerenvelopeLe ofeachset e ontheintervalJe. Tocomputethelowerenvelopes,weneedtheideal F trajectoryI,whichwecancomputeI inO(τnlogn)timebycomputingthelowerandupperenvelopeof thetrajectoriesineachtimeinterval[t ,t ]. i i+1 Lemma9impliesthatthetotalcomplexityofalllowerenvelopesisO(τn2). Tocomputethemwe havetwooptions. Wecansimplycomputethelowerenvelopefromscratchforeveryedgeof . This R takesO(τn2 nlogn) = O(τn3logn)time. Instead,foreachtimeintervalJ = [t ,t ],wecompute i i i+1 · thearrangement representingthemodifiedtrajectoriesontheintervalJi,anduseittotraceLe in for A A everyedgeeof . R An arrangement of m line segments can be built in O(mlogm+A) time, where A is the output complexity[2]. Intotal consistsofO(n2)linesegments: n+2perentity. Sinceeachpairoftrajectories A intersectsatmostonceduringJ ,wehavethatA = O(n2). Thus,wecanbuild inO(n2logn)time. i A Thearrangement representsallbreakpointsoftype(i),ofallfunctionsf . Wenowcomputeallpairs σ A ofpointsin correspondingtobreakpointsoftype(ii). WedothisinO(n2)timebytraversingthezone A ofI in . A Wenowtracethelowerenvelopesthrough : foreachedgee = (u,v)intheReebgraphwithJ J , e i A ⊆ westartatthepointσ(tu),σ Ce,thatisclosesttoI,andthenfollowtheedgesin correspondingto ∈ A Le,takingcaretojumpwhenweencounterbreakpointsoftype(ii). Ourlowerenvelopesarealldisjoint (exceptatendpoints),sowetraverseeachedgein atmostonce. Thesameholdsforthejumps. Wecan A avoidcostsforsearchingforthestartingpointofeachlowerenvelopebytracingthelowerenvelopesin therightorder: whenwearedonetracingLe,withe = (u,v),wecontinuewiththelowerenvelopeofan outgoingedgeofvertexv. Ifv isasplitvertexwhereσ andψ areatdistanceε,thenthestartingpointof thelowerenvelopeoftheotheredgeiseitherσ(t )orψ(t ),dependingonwhichofthetwoisfarthest v v fromI. Itfollowsthatwhenwehave andthelistofbreakpointsoftype(ii),wecancomputealllower A envelopesinO(n2)time. Weconclude: Theorem11. GivenasetofntrajectoriesinR1,eachwithverticesattimest ,..,t ,wecancomputea 0 τ centraltrajectoryC inO(τn2logn)timeusingO(τn2)space. A central trajectory without jumps. When our entities move in R1, it is not yet necessary to have discontinuitiesinC,i.e.wecansetε = 0. Inthiscasewecangiveamorepreciseboundonthecomplexity ofC,andwecanuseaslightlyeasieralgorithm. ThedetailscanbefoundinAppendixA. 3 Entities moving in Rd Intheprevioussection,weusedtheidealtrajectoryI,whichminimizesthedistancetothefarthestentity, ignoringtherequirementtostayonaninputtrajectory. Theproblemwasthenequivalenttofindinga trajectoidthatminimizesthedistancetotheidealtrajectory. InRd,withd > 1,however,thisapproach fails,asthefollowingexampleshows. Observation12. LetP beasetofpointsinR2. ThepointinP thatminimizesthedistancetotheideal point(i.e.,thecenterofthesmallestenclosingdiskofP)isnotnecessarilythesameasthepointinP thatminimizesthedistancetothefarthestpointinP. Proof. SeeFig.7. Considerthreepointsa,bandcatthecornersofanequilateraltriangle,andtwopoints pandq closetothecentermofthecirclethrougha,bandc. Nowpisclosertomthanq,yetq iscloser tobthanp(andq isasfarfromaasfromb). 8 c p q a m b Fig.7: Pointpisclosesttotheidealpointm,howeverthesmallestenclosingdiskcenteredatq issmaller thanthatofp. 3.1 Complexity ItfollowsfromLemma3thatthecomplexityofacentraltrajectoryforentitiesmovinginRd isatleast Ω(τn2). In this section, we prove that the complexity of C within a single time interval [ti,ti+1] is at mostO(n5/2). Thus,thecomplexityoverallτ timeintervalsisO(τn5/2). Let denotethecollectionoffunctionsD ,forσ . WepartitiontimeintointervalsJ(cid:48),..,J(cid:48) F σ ∈ X 1 k(cid:48) suchthatineachintervalJ(cid:48) allfunctionsD restrictedtoJ(cid:48) aresimple,thatis,theyconsistofjustone i σ i piece. We now show that each function D consists of at most τ(2n 1) pieces, and thus the total σ − numberofintervalsisatmostO(τn2). SeeFig.2(b)foranillustration. Lemma13. EachfunctionD ispiecewisehyperbolicandconsistsofatmostτ(2n 1)pieces. σ − Proof. Consider a time interval J = [t ,t ]. For any entity ψ and any time t J , the function i i i+1 i ∈ σ(t)ψ(t) = √at2+bt+c, with a,b,c R, is hyperbolic in t. Each pair of such functions can (cid:107) (cid:107) ∈ intersectatmosttwice. DuringJ ,D istheupperenvelopeofthesefunctions,soitconsistsofλ (n) i σ 2 pieces,whereλ denotesthemaximumcomplexityofaDavenport-Schinzelsequenceoforders[3]. We s haveλ (n) = 2n 1,sothelemmafollows. 2 − Lemma14. Thetotalnumberofintersectionsofallfunctionsin isatmostO(τn3). F Proof. Fixapairofentitiesσ,ψ. ByLemma13thereareatmostτ(2n 1)timeintervalsJ,suchthat − D restrictedtoJ issimple. ThesameholdsforD . So,thereareatmostτ(4n 2)intervalsinwhich σ ψ − bothD andD aresimple(andhyperbolic). IneachintervalD andD intersectatmosttwice. σ ψ σ ψ WeagainobservethatC canonlyjumpfromoneentitytoanotheriftheyareε-connected. Hence, Observation 4 holds entities moving in Rd as well. As before, this means that at any time t, we can partition intomaximalsetsofε-connectedentities. Let (cid:48) σ beamaximalsubsetofε-connected X X (cid:51) entitiesattimet. Thistime,acentraltrajectoryC usesthetrajectoryofentityσ attimet,ifandonlyifσ istheentityfrom (cid:48) whosefunction isminimal. Hence,ifwedefinef = D Observation5holds σ σ σ X D againaswell. Consider all m(cid:48) = O(n2) intervals J(cid:48),..,J(cid:48) that together form [t ,t ]. We subdivide these 1 m(cid:48) j j+1 intervalsatpointswherethedistancebetweentwoentitiesisexactlyε. LetJ ,..,J denotethesetof 1 m resultingintervals. SincethereareO(n2)timesatwhichtwoentitiesareatdistanceexactlyε,westill haveO(n2)intervals. NotethatforallintervalsJ andallentitiesσ,f issimpleandtotallydefinedon i σ J . i IneachintervalJi,acentraltrajectoryC usesthetrajectoriesofonlyonemaximalsetofε-connected entities. LetXi(cid:48) bethisset,letFi(cid:48) = {fσ | σ ∈ Xi(cid:48)}bethesetofcorrespondingfunctions,andletLi be thelowerenvelopeof (cid:48),restrictedtointervalJ . Wenowshowthatthetotalcomplexityofallthese Fi i lowerenvelopesisO(n5/2). ItfollowsthatthemaximalcomplexityofC inJi isatmostO(n5/2)aswell. Lemma15. LetJ beaninterval,let beasetofhyperbolicfunctionsthataresimpleandtotallydefined F onJ,andletk denotethecomplexityofthelowerenvelopeL of restrictedtoJ. ThenthereareΩ(k2) F intersectionsoffunctionsin thatdonotlieonL. F 9

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.