Title: Monitoring k-NN Queries over Moving Objects
1Monitoring k-NN Queries over Moving Objects
- Xiaohui Yu
- University of Toronto
- xhyu_at_cs.toronto.edu
- Joint work with Ken Pu and Nick Koudas
2k-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
3Problem
- A set of moving objects P on a 2D plane
- Monitoring the nearest neighbors of query points
(Q) in a specified region over time
2
1
3
4
7
6
5
8
t1
4Applications
- Location-based advertising
- E-flyers distribution identifying the customers
closest to the store
- Location-based mixed reality games
5Outline
- Related work
- Object-Indexing
- Overhaul algorithm
- Incremental index update/query answering
- Query-Indexing
- Hierarchical Object-Indexing
- Experiments
- Conclusions
6Previous 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
7Previous Work
- The assumption is often violated in real
applications where the objects movements are
non-predictable.
8Our approach
- No assumptions on the motion of objects
arbitrary speeds/directions
receive buffer
updates
9Grid-based index structures
- Residing in main memory
- Partition the space into NN grids
- Easy to maintain, supporting fast query
processing
10Outline
- Related work
- Object-Indexing
- Overhaul algorithm
- Incremental index update/query answering
- Query-Indexing
- Hierarchical Object-Indexing
- Experiments
- Conclusions
11Object Indexing
12Example Finding 3-NN
5
2
3
4
q
1
6
13The algorithm
- Initial computation
- Progressively enlarge the search region
- Until k neighbors are found
- Calculate the critical region Rcrit (guaranteed
to contain the querys k-NNs) - Search in the region for the k-NNs.
The overhaul algorithm
14Overhaul algorithm Analysis
- Notation
- NP - number of objects
- NQ - number of queries
- Running time breakdown
- Tindex a0NP
- Tquery a1 NQ ( of cells in Rcrit) a2 NQ
( of objects in Rcrit) - Optimal cell size to minimize Tquery (assuming
uniformity) - Proportional to
15Analysis non-uniform data
Measure of non-uniformity
- Reasonably skewed distributions Tquery
- Highly skewed Tquery
16Outline
- Related work
- Object-Indexing
- Overhaul algorithm
- Incremental index update/query answering
- Query-Indexing
- Hierarchical Object-Indexing
- Experiments
- Conclusions
17From 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
18Which 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(NP )
19Outline
- Related work
- Object-Indexing
- Overhaul algorithm
- Incremental index update/query answering
- Query-Indexing
- Hierarchical Object-Indexing
- Experiments
- Conclusions
20Query-Indexing
- Cost of Object-Indexing dominated by indexing
time when NQ is small - Indexing queries instead of objects
21Query-Index
22Constructing a Query Index
23Query answering
24Query-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.
25Analysis
- indexing time query answering time
- Theoretically,
- QI suffers from less localized access to objects
- QI is preferable when NQ is small
26Outline
- Related work
- Object-Indexing
- Overhaul algorithm
- Incremental index update/query answering
- Query-Indexing
- Hierarchical Object-Indexing
- Experiments
- Conclusions
27Problem with one-level object indexing
28Hierarchical Object-Indexing
- Split the overly crowded cells into smaller cells
-
29q
30Outline
- Related work
- Object-Indexing
- Overhaul algorithm
- Incremental index update/query answering
- Query-Indexing
- Hierarchical Object-Indexing
- Experiments
- Conclusions
31Experiments
- Verify the analytical results
- NP, NQ, k, velocity, cell-size
- Compare the performance of the proposed
structures with that of R-tree-based methods - NP, NQ, k, velocity, skew
32Highlights
- Tindex and Tquery of Object-Indexing
- Optimal cell size
- Overhaul v.s. incremental computation as
velocities of objects vary - Object-Indexing v.s. Query-Indexing
- Comparison of grid-based algorithms with
R-tree-based algorithms
33Performance of overhaul w.r.t. NP
34Effect of cell-size on performance
35Overhaul v.s. incremental index maintenance
36Object-Indexing v.s. Query Indexing
37Comparison with R-trees datasets
uniform
hi-skewed
skewed
Simulation using Illinois road network
(600km600km)
38Comparison with R-trees
NP 100,000, NQ 5,000, k 10
39Conclusions
- We proposed two solutions to monitor k-NN
- Object-Indexing
- Query-Indexing
- Extensions to handle skewed data
- Outperform R-tree-based solutions