23d1e78d6d84152ff43d67136e3c9df8.ppt
- Количество слайдов: 38
Continuous Nearest Neighbor Monitoring in Road Networks K. Mouratidis 1 Joint work with: M. L. Yiu 2, D. Papadias 3, N. Mamoulis 2 1 School of Information Systems, Singapore Management University 2 Dept. of Computer Science, University of Hong Kong 3 Dept. of Computer Science, Hong Kong Uni. of Science & Technology 1
Introduction The k-NN problem: Given a query point q and a set of objects P, find the k objects in P that are closest to q. 2
Introduction Continuous NN monitoring: Long-running queries demand constant update of their results. Existing methods are designed for Euclidean spaces. Consider a road network (where edge weights correspond to their length, or travel time). Queries and objects move in the network. Network distance: the length (i. e. , sum of weights) of the shortest path connecting them. (Example: taxi – pedestrians) 3
Introduction Continuous NN monitoring in a Road Network: • Queries and objects move in an unpredictable manner in the network, issuing an update whenever they move • Network edges issue weight updates • Central server processes the stream of updates, and continuously reports the k NNs of each query according to network distance Aim: to minimize the query processing time 4
Related Work Snapshot NN in road networks: e. g. , Papadias et al. VLDB’ 03, Kolahdouzan and Shahabi VLDB’ 04 - Static data objects, One-time results Path NN in road networks: Cho and Chung VLDB’ 05, Kolahdouzan and Shahabi STDBM’ 04 - Static data objects, Known query trajectory Euclidean NN monitoring: Yu et al. ICDE’ 05, Xiong et al. ICDE’ 05, Mouratidis et al. SIGMOD’ 05 - Grid index: cannot capture network-imposed constraints - Circles/rectangles: no mapping to network distance space 5 - Do not deal with edge updates
Incremental Monitoring (IMA) and Group Monitoring (GMA) Algorithms Two methods (IMA, GMA) for: monitoring NNs according to network distance, with low CPU cost. Edges: indexed with a quadtree. We store with each edge (i) the objects in it, and (ii) an influence list. Queries: For each query we store its current NNs, and its expansion tree. 6
IMA: Initial NN computation Initial result (k=3): expansion tree, infl. intervals, and marks Only updates affecting the expansion tree can alter the 7 result!
IMA: Object updates (Case 1) Outgoing no more than incoming NNs: update result + shrink expansion tree 8
IMA: Object updates (Case 1) New (shrunk) expansion tree 9
IMA: Object updates (Case 2) More outgoing than incoming: re-compute from marks + expand tree 10
IMA: Object updates (Case 2) New (grown) expansion tree 11
IMA: Query updates Re-compute starting from valid tree marks 12
IMA: Edge updates - Weight increase 13
IMA: Edge updates - Weight decrease 14
IMA: Multiple concurrent updates Order of updates: 1. 2. 3. 4. 5. 6. Decreasing edge weights Increasing edge weights Query movement Object updates For each affected query q NN set = k best among remaining NNs and incomers 7. Expand from marks in valid expansion tree 15
GMA: Main idea Sequence: path between consecutive intersection or terminal nodes The k-NN set of any query in sequence s is in the union of (i) the objects in s, (ii) the k-NNs of its intersection nodes (endpoints). 16
GMA: Main idea (example) Objects on sequence between n 1 and n 5 = {p 4, p 5} 2 -NNs of intersection n 1 = {p 1, p 5} 2 -NNs of intersection n 5 = {p 3, p 2} 2 -NNs of q 1 or q 2 {p 4, p 5} {p 1, p 5} {p 3, p 2} 17
GMA: Active nodes active node: intersection node of nonempty sequence GMA monitors the k-NNs of active nodes (using IMA), and uses them to compute the NNs of the actual user queries GMA reduces CPU time by (i) shared execution among queries in the same sequence (ii) reduction from NN monitoring of moving queries to NN monitoring of static active nodes. 18
GMA: Update processing Initial Result: utilizing active node NNs NN Maintenance: In every processing cycle do: 1. Update NNs of active nodes with IMA. 2. If NNs of active node n change, re-compute affected queries in sequences adjacent to n 3. If object/edge updates occur in sequence s, re-compute affected queries within sequence s 4. Re-compute moving queries 19
Sample experimental results N=100 K, k=50, fobj=fqry=10%, fedg=4% Competitor: no previous work. OVH: re-computes from scratch. 20
Sample experimental results n=5 K, N=100 K, k=50, fobj=10%, fedg=4% 21
Sample experimental results n=5 K, N=100 K, k=50, fobj=fqry=10% 22
Sample experimental results n=5 K, N=100 K, fobj=fqry=10%, fedg=4% 23
Summary First work on NN monitoring in road networks. - No assumption about query/object moving patterns - Edge weights fluctuate We propose two methods: IMA: incremental NN maintenance GMA: query grouping - shared execution GMA is faster and requires less space. 24
Thank you! 25
4. Road-CNN (IMA) Incremental Monitoring Algorithm (Uobj, Uqry, Uedg) 1. For each query q in Uqry that moves outside q. tree 2. Delete q from the influence lists of affecting edges ; Discard q. tree and q. best_NN 3. For each edge e in Uedg with decreasing weight 4. For each query q in e. IL 5. Delete invalid part of q. tree ; Remove q from invalid inf. lists ; Remove invalid NNs 6. Update distances of nodes in valid part of q. tree ; Update the distances of NNs in valid q. tree 7. For each edge e in Uedg with increasing weight 8. For each query q in e. IL (same as lines 5, 6) 9. For each query q in Uqry that moves inside q. tree (same as lines 5, 6) 10. For each object p in Uobj 11. Delete p from its old edge ; Insert p into its new edge 12. For each query affected by p 13. Treat p as outgoing, incoming, or moving NN 14. For each query q affected in lines 1, 4, 8, 9, 12 15. q. best_NN = k best objects among remaining NNs and incomers 16. Insert into min-heap H the marks of the valid q. tree 17. If head of H has key < distance of the kth object in q. best_NN 18. Consider all nodes in the valid q. tree as verified ; Perform NN search initializing heap to H 26 19. If necessary, shrink q. tree ; Update influence lists accordingly
4. Road-CNN (GMA) Four events may alter NNs of a query q in s: (i) movement of q, (ii) changes in the NN sets of active nodes of s, (iii) object updates in s, and (iv) edge updates in s. Group Monitoring Algorithm (Uobj, Uedg, Qins, Qdel) 1. For each query q in Qins (Qdel) 2. Insert (delete) q in the corresponding edge ; Update n. k for active nodes of containing sequence 3. Invoke IMA for active nodes, taking into account changes in n. k 4. For each node n whose result changed in line 3 5. Mark as affected each query in n. Q influenced by n 6. For each update <p. id, pold, pnew> in Uobj 7. For each query q in old (new) sequence that is affected by pold (pnew) 8. Mark q as affected 9. For each edge e in Uedg //Let s be the sequence containing e 10. Mark as affected each query in s that is affected by e 27 11. For each query q marked as affected or in Qins
Road-CNN experimental settings 28
Experimental results 29
Experimental results 30
Experimental results 31
Experimental results 32
Experimental results 33
Experimental results 34
Experimental results 35
Experimental results (Space) 36
Experimental results (with Brinkhoff data) 37
Experimental results (with Brinkhoff data) 38
23d1e78d6d84152ff43d67136e3c9df8.ppt