Presentation is loading. Please wait.

Presentation is loading. Please wait.

Monitoring k-NN Queries over Moving Objects Xiaohui Yu University of Toronto Joint work with Ken Pu and Nick Koudas.

Similar presentations


Presentation on theme: "Monitoring k-NN Queries over Moving Objects Xiaohui Yu University of Toronto Joint work with Ken Pu and Nick Koudas."— Presentation transcript:

1 Monitoring k-NN Queries over Moving Objects Xiaohui Yu University of Toronto xhyu@cs.toronto.edu Joint work with Ken Pu and Nick Koudas

2 k-Nearest Neighbors k-NN search: Given a set of points, find the k points that are closest to the query point. We focus on k-NN for spatio-temporal data

3 Problem A set of moving objects P on a 2D plane Monitoring the nearest neighbors of query points (Q) in a specified region over time t1t1 q 1 3 2 4 5 6 7 8 t2t2 q 1 3 2 4 5 6 7 8

4 Applications Location-based advertising –E-flyers distribution – identifying the customers closest to the store Location-based mixed reality games

5 Outline Related work Object-Indexing –Overhaul algorithm –Incremental index update/query answering Query-Indexing Hierarchical Object-Indexing Experiments Conclusions

6 Previous Work Most work has focused on predictive queries –“Who will be my NNs five minutes from now? ” Assumption: the trajectories of the objects are fully predictable –linear/non-linear/autoregressive functions –very frequent updates/re-evaluations when the assumption does not hold [Sun et al. 2004]

7 Previous Work The assumption is often violated in real applications where the objects’ movements are non-predictable.

8 No assumptions on the motion of objects: arbitrary speeds/directions receive buffer updates …… snapshot buffer t … result Our approach

9 Grid-based index structures Residing in main memory Partition the space into N×N grids Easy to maintain, supporting fast query processing

10 Outline Related work Object-Indexing –Overhaul algorithm –Incremental index update/query answering Query-Indexing Hierarchical Object-Indexing Experiments Conclusions

11 Object Indexing object-id list (x,y) snapshot buffer kNN list …

12 1 2 4 3 q Example: Finding 3-NN 5 6 d Current result: 3 Current result: 3,2 Current result: 3,2,1 Final result: 3,2,4

13 The algorithm 1.Initial computation –Progressively enlarge the search region –Until k neighbors are found 2.Calculate the critical region R crit (guaranteed to contain the query’s k-NNs) 3.Search in the region for the k-NNs. The overhaul algorithm

14 Overhaul algorithm: Analysis Notation – N P - number of objects –N Q - number of queries Running time breakdown –T index : a 0 ×N P –T query : a 1 × N Q ×(# of cells in R crit ) + a 2 × N Q ×(# of objects in R crit ) Optimal cell size to minimize T query (assuming uniformity) : –Proportional to

15 Analysis – non-uniform data Reasonably skewed distributions: T query Highly skewed: T query Measure of non-uniformity

16 Outline Related work Object-Indexing –Overhaul algorithm –Incremental index update/query answering Query-Indexing Hierarchical Object-Indexing Experiments Conclusions

17 From overhaul to incremental… Incremental update of the object-index –Check if the new position falls in the same cell as in the previous cycle Yes – do nothing No – remove it from old cell, insert it into the new cell Incremental query answering –Compute the critical region based its previous k-NN –Search the critical region for the current k-NN

18 Which one is better? Mobility is the key Index maintenance –The probability of exiting the current cell is crucial Incremental query answering –When mobility is low, the cost of query answering is –Worst case: O(N P )

19 Outline Related work Object-Indexing –Overhaul algorithm –Incremental index update/query answering Query-Indexing Hierarchical Object-Indexing Experiments Conclusions

20 Query-Indexing Cost of Object-Indexing dominated by indexing time when N Q is small Indexing queries instead of objects

21 R crit (q 1 ) R crit (q 2 ) Query-Index q1q1 q2q2 Query List q1q1 k-NN q2q2 (x,y) snapshot buffer

22 Constructing a Query Index R crit (q) Query List cell 1 …… cell 2 cell 3 cell 4 q

23 Query answering R crit (q 1 ) R crit (q 2 ) q1q1 q2q2 Query List q1q1 k-NN q2q2 (x,y) snapshot buffer

24 Query-Indexing: algorithm Index-building –Compute the critical region –Insert a query into cells contained in its critical region Query-answering –For each object Determine the cell it belongs to For each query registered with the cell, update its k- NN if necessary.

25 Analysis indexing time + query answering time Theoretically, –QI suffers from less localized access to objects Rcrit(q 1 ) Rcrit(q 2 ) q1q1 q2q2 Query List q1q1 k-NN q2q2 (x,y) snapshot buffer QI is preferable when N Q is small

26 Outline Related work Object-Indexing –Overhaul algorithm –Incremental index update/query answering Query-Indexing Hierarchical Object-Indexing Experiments Conclusions

27 Problem with one-level object indexing

28 Hierarchical Object-Indexing Split the overly crowded cells into smaller cells

29 Refined approximation q

30 Outline Related work Object-Indexing –Overhaul algorithm –Incremental index update/query answering Query-Indexing Hierarchical Object-Indexing Experiments Conclusions

31 Experiments Verify the analytical results –N P, N Q, k, velocity, cell-size Compare the performance of the proposed structures with that of R-tree-based methods –N P, N Q, k, velocity, skew

32 Highlights 1. T index and T query of Object-Indexing 2.Optimal cell size 3.Overhaul v.s. incremental computation as velocities of objects vary 4.Object-Indexing v.s. Query-Indexing 5.Comparison of grid-based algorithms with R-tree-based algorithms

33 Performance of overhaul w.r.t. N P

34 Effect of cell-size on performance

35 Overhaul v.s. incremental index maintenance

36 Object-Indexing v.s. Query Indexing

37 Comparison with R-trees – datasets Simulation using Illinois road network (600km×600km) uniform skewed hi-skewed

38 Comparison with R-trees N P = 100,000, N Q = 5,000, k = 10

39 Conclusions We proposed two solutions to monitor k-NN –Object-Indexing –Query-Indexing Extensions to handle skewed data Outperform R-tree-based solutions


Download ppt "Monitoring k-NN Queries over Moving Objects Xiaohui Yu University of Toronto Joint work with Ken Pu and Nick Koudas."

Similar presentations


Ads by Google