This preview shows pages 1–10. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: CSCI585 CSCI585 Nearest Neighbor Queries Instructor: Cyrus Shahabi CSCI585 CSCI585 2 Nearest Neighbor Search Retrieve the nearest neighbor of query point Q Simple Strategy: convert the nearest neighbor search to range search. Guess a range around Q that contains at least one object say O if the current guess does not include any answers, increase range size until an object found. Compute distance d between Q and O reexecute the range query with the distance d around Q. Compute distance of Q from each retrieved object. The object at minimum distance is the nearest neighbor!!! CSCI585 CSCI585 Nave Approach A B C E F G H Query Point Q Issues: how to guess range? The retrieval may be suboptimal if incorrect range guessed. Would be a problem in high dimensional spaces. B C E F G H A: B: C: 4 5 6 1 2 3 10 11 12 7 8 9 E F G H 6 7 2 3 1 4 5 8 9 10 11 12 CSCI585 CSCI585 4 Given a query location q , find the nearest object. Depth First and BestFirst Search using Rtrees Goal: avoid visiting nodes that cannot contain results q a CSCI585 CSCI585 5 Basic Pruning Metric: MINDIST Minimum distance between q and an MBR. mindist ( E 1 , q ) is a lower bound of d ( o , q ) for every object o in E 1 . If we have found a candidate NN p , we can prune every MBR whose mindist > d ( p , q ). E 1 p q mindist ( E 1 , q ) CSCI585 CSCI585 MINDIST Property MINDIST is a lower bound of any kNN distance (s1, s2) (t1, t2) (p1, p2) (p1, p2) (p1, p2) (p1, p2) (p1, p2) 6 CSCI585 CSCI585 7 DepthFirst (DF) NN Algorithm Roussoulos et al., SIGMOD, 1995 2 4 6 8 10 2 4 6 8 10 x axis y axis b c a E 3 d e f g h i j k l m query E 4 E 5 E 1 E 2 E 6 E 7 1 2 5 9 5 2 13 a b c d e E 1 E 2 E 3 E 4 E 5 Root E 1 E 2 E 3 E 4 f g h E 5 l m E 7 i j k E 6 E 6 E 7 2 10 13 Note : distances not actually stored inside nodes. Only for illustration 5 Main idea Starting from the root visit nodes according to their mindist in depthfirst manner CSCI585 CSCI585 8 DF Search Visit E 1 2 4 6 8 10 2 4 6 8 10 x axis y axis b c a E 3 d e f g h i j k l m query E 4 E 5 E 1 E 2 E 6 E 7 1 2 5 9 5 2 13 a b c d e E 1 E 2 E 3 E 4 E 5 Root E 1 E 2 E 3 E 4 f g h E 5 l m E 7 i j k E 6 E 6 E 7 2 5 CSCI585 CSCI585 9 DF Search Find Candidate NN a First Candidate NN: a with distance 1 2 5 9 5 2 13 a b c d e E 1 E 2 E 3 E 4 E 5 Root E 1 E 2 E 3 E 4...
View
Full
Document
This document was uploaded on 05/17/2010.
 Spring '09

Click to edit the document details