Lazy Updates: An Efficient Technique to Continuously Monitoring Reverse kNN Presented By: Ying Zhang Joint work with Muhammad Aamir Cheema, Xuemin Lin, Wei Wang, Wenjie Zhang University of New South Wales, Australia 1 Reverse Nearest Neighbor • Nearest Neighbor Query (NN) – Find the object closest to q • Reverse Nearest Neighbor Query (RNN) – Korn et. al. Sigmod 2000 – Find objects s.t. q is their NN • Reverse k Nearest Neighbor Query (RkNN) – Find objects s.t. q is their kNN p2are is the of q p1 and p4 thenearest reverseneighbor nearest neighbors of q 2 Applications • Location based services, • Location based games, • Army strategic planning … Continuous Monitoring of RkNN 3 Related Work • Continuous RNN and RkNN – Benetis et. al (IDEAS 2002) : motion patterns (e.g., speed, direction) of objects and query are known – Xia et. al (ICDE 2006) : continuous RNN without motion patterns – Kang et. al (ICDE 2007) : improve the ICDE 2006 techniques – Wu et. al (MDM 2008) : extend to RkNN monitoring 4 Preliminaries • Half-space Pruning [VLDB04] – Objects in the half-space containing a can be pruned Static RNN query • Filtering Unpruned area – Repeat until no objects in unpruned area b c • Verification a – p is RNN iff no object p’ s.t. q dist(p,p’) < dist( p,q) d e 5 Preliminaries • Do filtering starting from the existing “candidates” if – Query moves, or – Candidate objects move, or – An object moves to the unpruned area • Do verification Continuous RNN query [ICDE07] Unpruned area b c a q d e 6 Proposed Framework • Assign rectangular safe regions to objects and queries • Prune objects using safe regions b c • Advantages a – Low Computation Cost q – Low Communication Cost d e 7 Challenges Based on : Shortest pair ? NO pair ? Longest Combination of them ? R ? Q 8 Half-Space Pruning – Any x on right side of LN : • mindist(x,MN) = dist(x,N) – Hp:N : the half-space containing p and defined by the bisector between p and N mindist(x,MN) > dist(x,p) LN LM x – Any x on left side of LM : • mindist(x,MN) = dist(x,M) p x x Hp:N – Any x between LM and LN : • a parabola with mindist(x, MN) = dist(x,p) M q Hp:M N 9 Challenges R ? Q 10 Half-Space Pruning: Normalization – Frontier point Fp – Moved to Fp, the intersection of the half-spaces correctly bounds the pruned area Hp:M – Hp:N passing Fp : normalized half-space H’p:N p Fp H’p:N Hp:N H’p:M M q N 11 Half-space Pruning: Pruning Rule 1 HM:B HP:A N R M Fp B A Q D E O P H’N:E H’M:B H’O:D H’P:A Pairs of antipodal corners are (B,M), (A,P), (E,N) and (D,O) 12 Dominance Pruning : pruning rule 2 O N R M P Fp H’N:C A B Q D C H’M:B H’O:D H’P:A 13 Trimming the rectangle R RF2 RF1 Q 14 Metric based pruning : pruning rule 3 R’ mindist(R’,Q) R maxdist(R,R’) Q 15 Order of pruning rules R3 R1 RF R2 Fp Q 16 Algorithm Overview • Initial Computation – – Filtering: Determine candidates Verification: Verify each candidate • Continuous Monitoring – Update candidate objects (filtering) if • Query or a candidate moves out of safe region, or • An object enters the unpruned area – Verify all candidates 17 Illustration of Filtering O7 O5 O6 O3 O2 Q O1 O4 18 Illustration of Verification O7 O6 O5 O 5 O6 ? O3 O3 O2 O2 Q Q O1 O1 O4 19 Data structure • Query table : id, safe region, candidate objects • Object table : id, safe region • Use grid data structure to support update • Each cell c of the grid : – Object list : objects whose safe regions overlap c – Influence list : queries whose unpruned area overlaps c 20 Theoretical Analysis Communication Cost : |Q| x (M1 + M2 + 1) + M3 M1: # candidate objects M2: #objects need exact location during the boolean range queries M3: #objects that leave the safe regions N: Total number of objects w : width of the safe region v: average speed of objects |Q| : The number of queries 21 Experiment settings • Generate Moving objects and queries using Brinkhoff Generator [1] on road map of Texas • Data space : 1000 Km X 1000 Km • Our algorithm (SAC) is compared with IGERN [2] for RNN queries and CRkNN [3] for RkNN queries [1] T. Brinkhoff. A framework for generating network-based moving objects. GeoInformatica, 2002. [2] J. M. Kang, M. F. Mokbel, S. Shekhar, T. Xia, and D. Zhang. Continuous evaluation of monochromatic and bichromatic reverse nearest neighbors. ICDE, 2007. [3] W. Wu, F. Yang, C. Y. Chan, and K.-L. Tan. Continuous reverse k-nearest-neighbor monitoring. MDM, 2008 22 Evaluation of pruning rules Avg. time for PR3 : 1.1 µs ( metric based pruning rule ) PR2 : 2.3 µs ( dominance pruning rule ) PR1 : 10.5 µs ( half space based pruning rule ) 23 Experiments: Size of safe region 24 Experiments: Number of objects IGERN : ICDE 2007 work for RNN SAC : Our algorithm 25 Experiments: Effect of data mobility • Data mobility is the percentage of objects/queries that change their location within one time unit 26 Experiments: RkNN queries CRkNN : MDM 2008 work for continuous monitoring RkNN SAC : Our algorithm 27 Conclusion Study the problem of continuously monitoring reverse kNN . Propose new framework based on safe region Outperform previous algorithms in terms of computation cost and communication cost 28 Thanks 29