Presentation is loading. Please wait.

Presentation is loading. Please wait.

Nearest Neighbor and Reverse Nearest Neighbor Queries for Moving Objects Simonas Šaltenis with Rimantas Benetis, Christian S. Jensen, Gytis Karčiauskas.

Similar presentations


Presentation on theme: "Nearest Neighbor and Reverse Nearest Neighbor Queries for Moving Objects Simonas Šaltenis with Rimantas Benetis, Christian S. Jensen, Gytis Karčiauskas."— Presentation transcript:

1 Nearest Neighbor and Reverse Nearest Neighbor Queries for Moving Objects Simonas Šaltenis with Rimantas Benetis, Christian S. Jensen, Gytis Karčiauskas Nykredit Center for Database Research Department of Computer Science, Aalborg University

2 WIM workshop, Jyväskylä, August 4-7, 20022 Motivation Position-aware, online, moving objects are enabled by the following trends. Miniaturization of electronics Advances in positioning systems (e.g., GPS, cellular infrastrucutre based systems) Advances in wireless communications Examples of position-aware online moving objects 3G mobile-phones, as well as diverse types of personal digital assistants (online “cameras,” “wrist watches,” etc.) Vehicles, including cars, public transportation, recreational vehicles, sea vessels, etc. There is a need for a database support for storing and querying positions of large quantities of moving objects

3 WIM workshop, Jyväskylä, August 4-7, 20023 Motivation – Sample LBSs Location-aware advertising Consumers may receive sales information for locations close to them. Here, the positional data is used together with an accumulated user profile to provide a better service.  Query: ”Find 5 cars closest to this gas station (as possible receivers of advertising).” Location-aware, on-line games Gamers “shoot” each other with their personal mobile devices. Suppose gamers can shoot only their nearest neighbor.  Query: “Find all gamers that have me as their nearest neighbor (so that I can attempt to avoid their fire).” Ad-hoc mobile networks Objects, which provide routing services to each other, may need to know who are their nearest neighbors and who has them as their nearest neighbors.

4 WIM workshop, Jyväskylä, August 4-7, 20024 Outline Motivation Problem statement (data and queries) NN queries RNN queries Summary

5 WIM workshop, Jyväskylä, August 4-7, 20025 NN and RNN Queries Nearest neighbor (NN) query – find an object(s) that is closest to a query point. Reverse Nearest Neighbor (RNN) query – find objects that have a query point as their nearest neighbor. 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5

6 WIM workshop, Jyväskylä, August 4-7, 20026 Problem Statement I Data – a set of two-dimensional continuously moving points To address continuous change, we represent the positions of points as functions of time, yielding time-parameterized positions. We use linear functions to capture the present and future positions. Function parameters are updated whenever an object deviates substantially from its predicted trajectory. Given t 0, the current and anticiapted, future position of a two- dimensional point is described by four parameters.

7 WIM workshop, Jyväskylä, August 4-7, 20027 Problem Statement II Query – a moving point q and a time interval [t s ;t e ], where t e t s current time. Result – a subdivision of [t s ;t e ] into non-intersecting intervals T j. Each T j is associated with a set of points that are nearest neighbors (reverse nearest neighbors) to q during T j. For example: RNN query: (1, [0;5]) Query result: (  {2, 5}, [0;3) ,  {2, 4}, [3;5]  1 2 3 4 5 1 2 3 4 5

8 WIM workshop, Jyväskylä, August 4-7, 20028 Outline Motivation Problem statement (data and queries) NN queries RNN queries Summary

9 WIM workshop, Jyväskylä, August 4-7, 20029 p12 p8 NNs for Stationary Points I Roussopoulos (1995) algorithm for R-trees, simplified by Cheung and Fu (1998) R1R2 R3R4R5 p6p7 p5 p1p2 Pointers to data tuples p8 p3p4 p9p10 p11 p12p13 R6R7 p1 p7 p6 p2 p3 p4 p5 p9 p10 p11 p13 Query point Candidate NN point:  Candidate NN point: p8 R3 R4 R5 R6 R7 R1 R2 p12 p8 Result: p12

10 WIM workshop, Jyväskylä, August 4-7, 200210 NNs for Stationary Points II The Rousopoulos algorithm performs a depth first search of the tree. Candidate NNs (CNNs) are maintained. Whenever a node is visited Pruning is performed: entries with bounding rectangles (R) with dist(R, q) larger than dist(CNN, q) are pruned. Ordering is used when visiting the remaining entries of the node: entries with bounding rectangles with smaller dist(R, q) are visited first.

11 WIM workshop, Jyväskylä, August 4-7, 200211 Time-Parameterized R-Tree The TPR-tree (Šaltenis et al., 2000) is based on the R-tree. Moving points are bounded with time-parameterized rectangles (TPBRs). Min and max velocity coordinates are stored with each TPBR. TPBRs are bounding from now on. At any t > t c we can get a valid R-tree: TPR-tree(t) = R-tree Objects are grouped according to integrated R*-tree heuristics where A(t) is, e.g., the area of an MBR

12 WIM workshop, Jyväskylä, August 4-7, 200212 NN Algorithm for the TPR-tree I We “time-parameterize” the NN algorithm for R-trees, by observing how distance is time-parameterized: Because the movements of points are described by linear functions, for any time interval [t s ;t e ], the (square of) distance between these two points is a quadratic function dist (q,p) (t)= at 2 +bt+c, t  [t s ;t e ]. Similarly, any time interval [t s ;t e ] can be subdivided into a finite (at most five) number of non-intersecting intervals so that, during each of the intervals, the (square of) distance between a point and a time-parameterized rectangle is a quadratic function. Thus, finding out which point or TPBR is closer to the query point and during which time intervals (i.e., comparing two time-parameterized distances) involves solving one or several quadratic inequalities. dist=0 dist

13 WIM workshop, Jyväskylä, August 4-7, 200213 NN Algorithm for the TPR-tree II The time-parameterized NN algorithm has the same structure as the algorithm for the R-tree, but has modified pruning and ordering strategies. Ordering: Entries of a node with the smallest metric are visited first (consider the average distance to the query point during the whole query time interval). Pruning: The result list is initialized so that the distance from query point q to a candidate NN point (CNN) during the whole query time interval is infinite. Then,  Entries (both non-leaf and data) are pruned if the distance from them to q is greater than the distance from q to a CNN during the whole time interval. This involves checking each time-interval in the current result list.  If a data entry is not pruned, the time interval when it is closest to q is added to the result list. E.g., if the result list is (  {2}, [0;3) ,  {4}, [3;5]  ) and, during [2;4), point 3 is closer to q than both 2 and 4, the result list is transformed to (  {2}, [0;2) ,  {3}, [2;4)   {4}, [4;5]  ). tsts tete  (dist =  ) tsts tete cnn 1 cnn 2 cnn n

14 WIM workshop, Jyväskylä, August 4-7, 200214 Outline Motivation Problem statement (data and queries) NN queries RNN queries Summary

15 WIM workshop, Jyväskylä, August 4-7, 200215 RNNs for Stationary Points An algorithm for stationary points was proposed by Stanoi et al. (2000). Idea: Let p be an NN of q among points in one of the six sectors S i. We call p an RNN candidate. Then, either q is the NN of p (and, thus, p is the RNN of q), or q has no RNNs in S i. There can be at most six RNNs – one for each S i. S1S1 S2S2 S3S3 S4S4 S5S5 S6S6 q 60  p x Sketch of the algorithm: Run a restricted NN algorithm in each S i, resulting in at most six RNN candidates. To verify candidates, run the NN algorithm with each candidate as the query point. a b

16 WIM workshop, Jyväskylä, August 4-7, 200216 RNN Algorithm for the TPR-tree Sketch of the algorithm 1. For each of the sectors S i, run the NN algorithm to find a result list B i. 2. For each B i and for each element  {b k }, T k  in B i, call the NN algorithm to check whether (and when) q is the NN of b k during T k.  Note that, in the NN algorithm, we can start a more aggressive pruning right away by setting q as a candidate NN of b k (instead of initially having an undefined candidate with an infinite distance).  Also, time interval T  T k is excluded from consideration as soon as some point p is found that, during T, is closer to b k than q. (Thus, we are sure that during T b k is not an RNN of q). The algorithm can be implemented so that only two top- down traversals of a tree are performed (steps 1 and 2).

17 WIM workshop, Jyväskylä, August 4-7, 200217  2, [1;1.5]  from B 3  2, [1.5;2]  from B 2 RNN Example 2 3 4 5 6 7 t =0 t =1t =2 Perform NN in S 2 : B 2 =( , [0;2]  ) S2S2 S3S3 S1S1 q RNN query: (q, [0;2]): B 2 =(  4, [0;2]  ) B 2 =(  4, [0;1.5]  2, [1.5;2]  ) Perform NN in S 3 : B 3 =(  2, [0;1.5]  3, [1.5;2]  ) Perform NN in S 1 : B 1 =(  5, [0;2]  ) Check candidates in B 1, B 2 and B 3 : Final answer: (  2, [1;2]  )

18 WIM workshop, Jyväskylä, August 4-7, 200218 Summary and Other Results We provide the first algorithms for nearest neighbor and reverse nearest neighbor queries for continuously moving (data and query) points in a time interval. NN algorithm by Roussopoulos et al. is adapted. RNN algorithm by Stanoi et al. is adapted. Persistent queries are supported – algorithms are provided that efficiently update the above-described result sets whenever a deletion or an insertion occurs before t e. Current-time continuous queries are supported by periodically computing and then maintaining the results of persistent queries. Balance is achieved between: Maintaining too large query result (with a long future time interval) on each update operation Performing too frequent queries (with short future time intervals)

19 WIM workshop, Jyväskylä, August 4-7, 200219 Related Work A lot of work has been done in NN query processing for stationary points in GIS and high-dimensional datasets (Roussopoulos et al., 1995, Hjaltason and Samet, 1999). Kolios et al (1999) propose a solution for NN queries on one- dimensional moving points based on duality transformation. The formulation of the problem is different (asks for one point that gets closest to the query point during the query time interval) Song and Roussopoulos (2001) consider an NN problem where a query point is moving but data points are stationary. Albers et al. (1998) consider how to maintain Voronoi diagrams of moving points. Special index structures were proposed (Korn and Muthukrishnan, 2000, Yang and Lin, 2001) for the processing of RNN queries.


Download ppt "Nearest Neighbor and Reverse Nearest Neighbor Queries for Moving Objects Simonas Šaltenis with Rimantas Benetis, Christian S. Jensen, Gytis Karčiauskas."

Similar presentations


Ads by Google