Download presentation
Presentation is loading. Please wait.
Published byDylan Neal Modified over 9 years ago
1
CircularTrip: An Effective Algorithm for Continuous kNN Queries Muhammad Aamir Cheema Database Research Group, The School of Computer Science and Engineering, University of New South Wales (UNSW), Sydney Joined work with: Yidong Yuan (UNSW), Xuemin Lin (UNSW)
2
Problem Settings Given a query point q, continuously report k nearest objects of q according to Euclidean distance Objects and query points move in an unpredictable fashion Objects and query points can be indexed in main memory
3
Related Work Divide space into conceptual rectangles Initialize heap with first level rectangles and c q For top entry e in heap unless mindist(e,q) > dist k ; If e is rectangle, enheap all cells in e If e is cell; check objects in it Conceptual Partitioning: An efficient Method for Continuous nearest neighbor monitoring Kyriakos Mouratidis, Marios Hadjieleftheriou, Dimitris Papadias [SIGMOD 2005]
4
Motivations Data Point Updates If a NN moves away, the new answer cannot lie inside the circle All the shaded cells are visited Ideally, the update should start from the cells that intersect the circle
5
Motivations Rectangles do not approximate circles very well All the cells in any rectangle Rec are inserted in heap when r becomes greater than mindist(Rec,q) All cells in the four rectangles are enheaped. Ideally, only the cells that intersect the circle should be enheaped How to find all the cells that intersect a given circle? CircularTrip
6
CircularTrip Let n be the number of cells that intersect the circle, CircularTrip computes mindist of exactly n cells r
7
kNN Initial Computation r=0, dist k = ∞ (dist k = distance of kth NN) Repeat unless r ≥ dist k Call CircularTrip with radius Min(r=r+ δ, dist k ) (δ= cell width) Insert returned cells into heap according to ascending order of their mindist from q For each cell c in heap If mindist(c,q) ≥ dist k RETURN RESULTS Find points in c and update distk and q.kNN accordingly q p1p1 p2p2 r r = δ r = 2.δ r = dist(p 1,q) dist k = ∞ dist k = dist(p 1,q) dist k = dist(p 2,q) q.kNN = p 1 q.kNN = Φ q.kNN = p 2
8
Continuous Monitoring q p2p2 p1p1 Incoming objects: any non-result object p entering inside the circle Insert p into q.kNN Outgoing objects: any result object leaving the circle delete p from q.kNN Hanlde all the object updates as mentioned above Case 1: q.kNN contains k or more than k objects Keep k closest objects and discard other Case 2: q.kNN contains less than k objects Same as initial computation except the starting radius is dist k dist k
9
Experiments Objects/queries moving on the road map of German city Oldenburg (Brinkhoff Generator) Number of objects = 100,000 Number of queries = 5000 Object agility= 50% (number of objects reporting update at each timestamp) Query agility= 30% Grid size = 256 X 256 (i.e., δ = 1/256 ) Effect of δ
10
Experiments Effect of k
11
Experiments Effect of N and n N = number of objects n = number of queries
12
Experiments Effect of object agility and speed
13
Questions
14
Space Usage CPM stores visit list and heap for each query
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.