Data Structures for Moving Objects Pankaj K. Agarwal Department of Computer Science Duke University Geometric Data Structures S: Set of geometric objects Points, segments, polygons Ask several queries on S Range searching Nearest-neighbor searching Quad Tree kd Tree BSP Data Structures for Moving Objects 1
Moving Objects: Applications Traffic management Location based services Emergency services Air traffic control Digital battlefields Molecular biology Deformable objects Adhoc networks Need data structures for storing, analyzing, querying moving objects. Data Structures for Moving Objects 2 Modeling Motion p(t) = (x(t), y(t)): Position of p at time t. x( ), y( ): Polynomials Degree of motion: max degree of x( ), y( ). Linear motion: Degree of motion is 1 p(t) = at + b, a,b R 2 Mostly assume motion to be linear Trajectory of points can change Trajectory can be piecewise linear Issues: p(t) Sampled motion Hierarchical motion Uncertainty Data Structures for Moving Objects 3
Range Searching S: Set of points Preprocess S into a data structure Report all points of S lying inside a query rectangle Data Structure Space Query Range tree n log n log n + k log log n kd-tree n n + k External memory data structures also available Example: R-tree Data Structures for Moving Objects 4 Kinetic Range Searching S: Set of points, each moving with fixed velocity in the plane Preprocess S into a data structure: Q1 Given a rectangle R and a time value t, report all points of S(t) R Q2 Given a rectangle R and time values t 1, t 2, report all points that pass through R during the time interval [t 1, t 2 ]. t t y y x x Data Structures for Moving Objects 5
Early Approaches One-dimensional data structures [Wolfson et al. 98-99, Tayeb et al. 98, Kollios et al. 99] Two-dimensional data structures Map trajectories to higher dimensional points [Kollios et al.] Build index on trajectories [Pfoser et al.] Parametric R-trees [Saltenis et al.] Assumes frequent updates on trajectories Data Structures for Moving Objects 6 Kinetic Range Searching (A., Arge, Erickson, 2001) Partition-tree based approach O(n) space, n + k query time log 2 n insertion/deletion/trajectory-change oblivious scheme Kinetic range trees n log n/ loglog n space, log n + k query Events: x- or y-coordinates of two points become equal Θ(n 2 ) events, each requiring log 2 n time Tradeoff between # events and query time Queries have to arrive in a chronological order Data Structures for Moving Objects 7
Partition Tree Based Approach t t xt* yt* t y x y x Trajectory of a point p i is a line l i in R 3 p i (t) R l i intersects (R, t) l x, l y : Projection of l onto the xt- & yt-planes l intersects (R, t) l x intersects (R x, t) & l y intersects (R y, t) Use duality and partition trees Data Structures for Moving Objects 8 R-Trees Bounding box hierarchy, B-tree Each node v is associated with a subset S v of points and the smallest rectangle R v containing S v Partition S v into B clusters, each associated with a child of v Several heuristics are proposed for partitioning S v into B clusters F G R1 R2 R1 B E H R5 R3 R4 R5 R6 A R3 C I R2 A B C D E F G H I R4 D Data Structures for Moving Objects 9
STAR-Tree Kinetic R-tree Maintain the smallest box enclosing the set of moving points Box is defined by four points The combinatorial structure can change Ω(n) times B(t) Maintain an approximation of the smallest enclosing box Maintaining the clustering kinetically Extend the known heuristics No theoretical nontrivial results known on kinetic clustering Data Structures for Moving Objects 10 Smallest Enclosing Box R(P(t)): Smallest box enclosing P at time t ε-core-set: C S ε-coreset if t (1 ε)r(s(t)) R(C(t)) Theorem: ε-core-set of size 1/ ε; Computation time: n + 1/ε A more general result on core sets in [A., Har-Peled, Varadarajan] Leads to approximatation algorithms for several problems Data Structures for Moving Objects 11
Smallest Enclosing Box 1 1 Quality 0.99 0.98 0.97 0.96 0.95 0.94 Kernel Size = 16 Kernel Size = 32 0.93 10 5 0 5 10 Quality 0.99 0.98 0.97 0.96 0.95 Kernel Size = 16 Kernel Size = 28 0.94 10 5 0 5 10 11000 10000 9000 Linear Motion, Input Size = 10,000 Quadratic Motion, Input Size = 10,000 18 16 14 Linear Motion, Kernel Size = 24 Quadratic Motion, Kernel Size = 27 8000 12 # Events 7000 6000 5000 4000 3000 2000 1000 10 5 0 5 10 # Events 10 8 6 4 2 0 10 5 0 5 10 Data Structures for Moving Objects 12 Smallest Enclosing Box STAR-tree: Maintain a box enclosing S v at each node v Compute C v S v for each node in a bottom-up manner Merge the core sets computed at the children of v Prune the merged set Maintain the smallest enclosing box R(C v ) Data Structures for Moving Objects 13
Re-Clustering Reorganize the children of a node if the rectangles of their children overlap a lot. u 2 u 3 u 3 w 2 u 1 v w 1 v Collect all the grandchildren of the node Reconstruct a 2-level R-tree on them Data Structures for Moving Objects 14 Experimental Results Synthetic Data 100,000 500,000 points inside 1000 1000 km 2 area with different distributions Points are inserted/deleted dynamically, at any time at least 80% points present Three range of speed: 45 km/h, 75km/h, 180 km/h Search I/O 50 45 40 35 30 25 20 15 10 5 0 S1 (approx.) S1 (exact) S2 (approx.) S2 (exact) S3 (approx.) S3 (exact) 100 150 200 250 300 Search I/O 200 180 160 140 120 100 80 60 40 20 0 100 150 200 250 300 350 400 450 500 Number of points (x 1000) Data Structures for Moving Objects 15
Experimental Results Realistic Data Extracted the roads map around Durham, NC, within 120 miles centered at Durham ( 250, 000 polygonal chains) Computed a planar map of the road network Chose source and destinations randomly with some distribution Computed a good path using Dijkstra s algorithm minimize the length + number of turns Used Douglas Peucker algorithm to simplify the paths Data Structures for Moving Objects 16 Experimental Results 20 18 16 14 Avg. Query I/O 12 10 8 6 4 2 0 50 100 150 200 250 300 Data Structures for Moving Objects 17
Tradeoffs in Performance Accuracy vs efficiency Maintain approximate structures Query vs events Combine KDS and time-oblivious approaches Responsive Approach: Near-future queries are more critical than far-future queries Fast query time for near-future queries Measure future by the number of events occurred # events:, query: /n + k Data Structures for Moving Objects 18 Concluding Remarks Incorporating more realistic motions Use dynamic systems, e.g., Kalman, particle filters, to model trajectories How does one perform geometric computation in this model? Geometric computation under uncertainty Hierarchical representation of motion Kinetic data structure for clustering, similarity searching Data Structures for Moving Objects 19