Birn et al.: Nearest Neighbors
1
Simple and Fast Nearest Neighbor Search Marcel Birn, Manuel - - PowerPoint PPT Presentation
Birn et al.: Nearest Neighbors 1 Simple and Fast Nearest Neighbor Search Marcel Birn, Manuel Holtgrewe, Peter Sanders , Johannes Singler Birn et al.: Nearest Neighbors 2 2D Nearest Neighbor Search Preprocess S = { ( x 1 , y 1 ) , . . . , ( x
Birn et al.: Nearest Neighbors
1
Birn et al.: Nearest Neighbors
2
Preprocess S = {(x1, y1), . . . , (xn, yn)}. Query: q = (x, y) −
Birn et al.: Nearest Neighbors
3
Geographic Information Systems, e.g., Route Planning
Birn et al.: Nearest Neighbors
4
Preprocessing: Delaunay Triangulation (not Yao graph etc. !) Query: Start at any point in S. Follow any edge towards q. Iterate until no improvement possible. still linear time. . .
Birn et al.: Nearest Neighbors
5
Start with a sample of points from S. Closest point in sample → starting point in next level.
Birn et al.: Nearest Neighbors
6
Randomly number points in S. Function nlevelNN(q)
for i := 1 to n do
return u Sounds like quadratic space and at least linear time???
Birn et al.: Nearest Neighbors
7
n
where Gk = (1..k, Ek):= Delaunay triangulation of points 1..k.
e.g., [Guibas et al. 92].
Birn et al.: Nearest Neighbors
8
Procedure nn(q, {s1, . . . , sn})
repeat foreach neighbor v of u in G with u > v in increasing order do invariant u is nearest neighbor of q wrt 1..v − 1 if ||q − sv||2 < ||q − su||2 then
break for loop until no improvement found return u
Birn et al.: Nearest Neighbors
9
Theorem: Expected number of nodes visited ≤ ln n + 1 Proof Idea: si is visited
This event has probability 1/i.
Birn et al.: Nearest Neighbors
10
# of inspected edges might be Ω (n)
Birn et al.: Nearest Neighbors
11
Store coordinates redundantly in edge array.
1 2 3 4 5 6 7 8
4(6,0) 4(6,0) 7(8,0) 6(5,0) 8(3,0) 6(5,0) 3(2,0) 8(3,0) 2(7,0) 5(1,0)
2 3 4 1 q=(2.8, 0)
Birn et al.: Nearest Neighbors
12
Birn et al.: Nearest Neighbors
13
[Devillers02]
5% 95% in square
mixed
Birn et al.: Nearest Neighbors
14
0.1 1 10 128 512 211 213 215 217 219 221 223 time per query [µs] number of points (n) CGAL Delaunay hierarchy FDH exact ANN kd-tree CGAL kd-tree FDH array, inexact
Birn et al.: Nearest Neighbors
15
0.1 1 10 100 1000 104 128 512 211 213 215 217 219 221 223 time per query [µs] number of points (n) ANN kd-tree CGAL Delaunay hierarchy CGAL kd-tree FDH, exact FDH, inexact
Birn et al.: Nearest Neighbors
16
0.1 1 10 100 1000 128 512 211 213 215 217 219 221 223 time per query [µs] number of points (n) ANN kd-tree CGAL Delaunay hierarchy CGAL kd-tree FDH, exact FDH, inexact
Birn et al.: Nearest Neighbors
17
(triangles. . . ) and for point location. [BoissonatTeillaud86], [Guibas et al. 92],. . .
[Geisberger et al. 2008]
Birn et al.: Nearest Neighbors
18
Full Delaunay Hierarchies
Birn et al.: Nearest Neighbors
19
e.g., replace high degree nodes? move high degree nodes in hierarchy?