Download presentation
Presentation is loading. Please wait.
1
Searching Dynamic Point Sets in Spaces with Bounded Doubling Dimension Lee-Ad Gottlieb Joint work with Richard Cole
2
NNS Nearest Neighbor Search (NNS) Nearest Neighbor Search (NNS) Given a set of points S in a metric spaceGiven a set of points S in a metric space Preprocess S so that the following query can be answered efficiently:Preprocess S so that the following query can be answered efficiently: given query point q, what is the closest point to q in S? given query point q, what is the closest point to q in S? q
3
NNS A sublinear algorithm for NNS in general metrics? A sublinear algorithm for NNS in general metrics? Bad news: not possible. Bad news: not possible. q ~1
4
NNS What if we only require only an approximate NNS (ANN)? What if we only require only an approximate NNS (ANN)? More bad news: Still takes linear time!More bad news: Still takes linear time! This talk deals with ANN. This talk deals with ANN. Can we parameterize the Can we parameterize the hard case? q ~1
5
Doubling Dimension The space within radius r of center c is the r-ball of c. The space within radius r of center c is the r-ball of c. Point set X has doubling dimension if Point set X has doubling dimension if the points of X covered by ball B can be covered by 2 balls of half the radius.the points of X covered by ball B can be covered by 2 balls of half the radius. 1 2 3 4 6 5 7 8
6
NNS in Low Doubling Dimension Data structure for (1+)-ANN query on S Data structure for (1+)-ANN query on S Navigating Net of points aids search.Navigating Net of points aids search. A Navigating Net is composed of levels of -nets.A Navigating Net is composed of levels of -nets. Navigating nets: Simple algorithms for proximity search. R. Krauthgamer, J.R. Lee. SODA ‘04 Navigating nets: Simple algorithms for proximity search. R. Krauthgamer, J.R. Lee. SODA ‘04
7
Modified -net an modified -net for a point set S is a set of balls of radius centered at points of S an modified -net for a point set S is a set of balls of radius centered at points of S Packing propertyPacking property The centers are separated from each other by some minimum distance ’ The centers are separated from each other by some minimum distance ’ We use ’ = 4/5 We use ’ = 4/5 The balls Cover all the points of the S.The balls Cover all the points of the S.
8
Navigating Net Variant 1-net 2-net 4-net 8-net
9
Navigating Net Variant 1-net 2-net 4-net 8-net Radius = 1 Covering: all points are covered Packing
10
Navigating Net Variant 1-net 2-net 4-net 8-net Radius = 2
11
Navigating Net Variant 1-net 2-net 4-net 8-net
12
Navigating Net Variant 1-net 2-net 4-net 8-net
13
Navigating Net Variant 1-net 2-net 4-net 8-net
14
Navigating Net Variant 1-net 2-net 4-net 8-net
15
Navigating Net Variant 1-net 2-net 4-net 8-net
16
Navigating Net Variant 1-net 2-net 4-net 8-net
17
Navigating Net Variant 1-net 2-net 4-net 8-net
18
Navigating Net Variant 1-net 2-net 4-net 8-net
19
Search example 1-net 2-net 4-net 8-net
20
Search example 1-net 2-net 4-net 8-net
21
Search example 1-net 2-net 4-net 8-net
22
Search example 1-net 2-net 4-net 8-net
23
Search example 1-net 2-net 4-net 8-net
24
Search example 1-net 2-net 4-net 8-net
25
Search example 1-net 2-net 4-net 8-net
26
Search example 1-net 2-net 4-net 8-net
27
Search example 1-net 2-net 4-net 8-net
28
Search example 1-net 2-net 4-net 8-net
29
Another Perspective DAG
30
Another Perspective DAG
31
Another Perspective DAG
32
Another Perspective DAG
33
Analysis Time to find the lowest enclosing ball Time to find the lowest enclosing ball How many levels of nets are there?How many levels of nets are there? Let the spread of the points be d max /d min Let the spread of the points be d max /d min There are O(log ) levels There are O(log ) levels At every level, we consider O() balls.At every level, we consider O() balls. O() log If = n O(1) we get a good search time If = n O(1) we get a good search time 2 O() log n2 O() log n But what if is asymptotically larger? But what if is asymptotically larger?
34
Summary of Previous Work (1+)-NNS query Insertion/deletionsize KL-04 2 O() log (1/) O() 2 O() log 2 O() n BKL-06 2 O() log (1/) O() 2 O() log O(n) HM-06 2 O() log n (1/) O() *O(n) This paper 2 O() log n (1/) O() 2 O() log n O(n) Spread of the points = d max /d min Abstract dimension * Static structure, 2 O() n log n construction time
35
Challenge How to dynamically maintain and search a deep DAG? How to dynamically maintain and search a deep DAG? log log levels For large
36
Special Case O(log n) search on an unbalanced tree is well known.
37
Special Case O(log n) search on an unbalanced tree is well known.
38
Special Case O(log n) search on an unbalanced tree is well known.
39
Special Case O(log n) search on an unbalanced tree is well known.
40
Special Case O(log n) search on an unbalanced tree is well known. Can we do something similar for our DAGs?
41
Towards a Tree DAG
42
Towards a Tree Spanning tree representation
43
Towards a Tree Spanning tree representation
44
Towards a Tree Spanning tree representation Balls & subtrees of interest
45
Towards a Tree Spanning tree representation Balls & subtrees of interest
46
Towards a Tree Balls of interest Spanning tree representation
47
Towards a tree Spanning tree Spanning tree log 2 levelslog 2 levels If = n O(1)If = n O(1) log 2 = O(log n) levels log 2 = O(log n) levels The tree is balanced. The tree is balanced. If = n (1)If = n (1) log 2 = (log n) levels log 2 = (log n) levels The tree is unbalanced. The tree is unbalanced.
48
Spread Independent Search Suppose for the moment that all balls were non-intersecting. Suppose for the moment that all balls were non-intersecting. At each level, there wouldAt each level, there would be a single ball of interest. The tree search need onlyThe tree search need only descend a single path. Thus, we need only carry out aThus, we need only carry out a simple search on an unbalanced tree.
49
Spread Independent Search Can we remove the assumption on the spread? Can we remove the assumption on the spread? can take on any value f(n). can take on any value f(n). Two Issues Two Issues Spanning tree may have (log n) levels.Spanning tree may have (log n) levels. It’s not balanced. It’s not balanced. For a dynamic solution, navigating net must be maintained.For a dynamic solution, navigating net must be maintained. We’ll get back to this later. We’ll get back to this later.
50
Centroid Path Decomposition Centroid paths always follow the heaviest child. Centroid paths always follow the heaviest child. Any path from root to leaf traverses at most log n centroid paths.Any path from root to leaf traverses at most log n centroid paths. The nodes of an i-centroid path each have weight between 2 i-1 and 2 i. The nodes of an i-centroid path each have weight between 2 i-1 and 2 i. Given the centroid path decomposition of an unbalanced tree, we show how to search in O(log n) time. Given the centroid path decomposition of an unbalanced tree, we show how to search in O(log n) time.
51
Tree Search Starting at the root centroid path: Starting at the root centroid path: Search for a ball containing q. Search for a ball containing q. a b c d e f g
52
Tree Search Starting at the root centroid path: Starting at the root centroid path: Search for a ball containing q. Search for a ball containing q. Does the top ball contain q?Does the top ball contain q? a b c d e f g
53
Tree Search Starting at the root centroid path: Starting at the root centroid path: Search for a ball containing q. Search for a ball containing q. Does the top ball contain q?Does the top ball contain q? Does the bottom ball contain q?Does the bottom ball contain q? a b c d e f g
54
Tree Search Starting at the root centroid path: Starting at the root centroid path: Search for a ball containing q. Search for a ball containing q. Does the top ball contain q?Does the top ball contain q? Does the bottom ball contain q?Does the bottom ball contain q? Otherwise, search for the lowest ball in the centroid path containing q.Otherwise, search for the lowest ball in the centroid path containing q. a b c d e f g
55
Tree search a b c d e f g bc ad ef Find the lowest ball containing q. Find the lowest ball containing q. Weighted search on the parents of the off-path subtrees.Weighted search on the parents of the off-path subtrees.
56
Tree search a b c d e f g bc ad ef Find the lowest ball containing q. Find the lowest ball containing q. Weighted search on the parents of the off-path subtrees.Weighted search on the parents of the off-path subtrees. Balanced Search tree
57
Tree search Find the lowest ball containing q. Find the lowest ball containing q. Weighted search on the parents of the off-path subtrees.Weighted search on the parents of the off-path subtrees. a b c d e f g bc ad ef Balanced Search tree Time: Log(W-w(d))
58
Search Analysis If the bottom node of the centroid path contains q. If the bottom node of the centroid path contains q. Don’t need to check this path – rather we descend to the next lower level path.Don’t need to check this path – rather we descend to the next lower level path. Have eliminated half the remaining balls in a single step.Have eliminated half the remaining balls in a single step. Otherwise we search for the lowest ball r that contains q. Otherwise we search for the lowest ball r that contains q. Let w be the weight of r’s off-path subtree.Let w be the weight of r’s off-path subtree. Let W be the combined weight ofLet W be the combined weight of the balls of the centroid path. the balls of the centroid path. these balls’ off-path subtrees. these balls’ off-path subtrees. The weighted search uses O(log W/w) steps to eliminate W-w balls.The weighted search uses O(log W/w) steps to eliminate W-w balls. Conclusion: Search take O(log n) time Conclusion: Search take O(log n) time
59
Spread Independent Search If all balls were non-intersecting If all balls were non-intersecting The aforementioned algorithm would give a O(log n) search of the spanning treeThe aforementioned algorithm would give a O(log n) search of the spanning tree Problem: balls may Problem: balls mayintersect. Can we modify the previous Can we modify the previous algorithm to work in this case?
60
Preliminaries For a ball x at level i, its friends are all balls of level i that intersect x. For a ball x at level i, its friends are all balls of level i that intersect x. In the navigating net, every ball knows who its friends are. This information is readily available from the DAGIn the navigating net, every ball knows who its friends are. This information is readily available from the DAG If two balls of the same level both contain q, they must be friends.If two balls of the same level both contain q, they must be friends.
61
Modified Search The search begins with the top ball as the single ball of interest. The search begins with the top ball as the single ball of interest. In general, the search is specified by 2 O() balls of interest, all at the same level. In general, the search is specified by 2 O() balls of interest, all at the same level. each of these balls contain the query pointeach of these balls contain the query point For illustration, let 2 O() = 3For illustration, let 2 O() = 3
62
Modified Search Start the search on the largest tree Start the search on the largest tree Identify a subtree with a constant fraction of the total size of the large treeIdentify a subtree with a constant fraction of the total size of the large tree
63
Modified Search If the query point is not in the subtree, eliminate the subtree from consideration. If the query point is not in the subtree, eliminate the subtree from consideration.
64
Modified Search If the query point is in the subtree, take it as a new tree of interest If the query point is in the subtree, take it as a new tree of interest Take its friends, too.Take its friends, too.
65
Modified Search Friends are descendants of previous nodes of interest. Friends are descendants of previous nodes of interest. The new subtrees of interest are smaller than the old ones.The new subtrees of interest are smaller than the old ones. The previously largest tree has been reduced by a constant fractionThe previously largest tree has been reduced by a constant fraction Friends
66
Modified Search Friends are descendants of previous nodes of interest. Friends are descendants of previous nodes of interest. The new subtrees of interest are smaller than the old ones.The new subtrees of interest are smaller than the old ones. The largest subtree has been reduced by a constant fractionThe largest subtree has been reduced by a constant fraction This implies an O(log n) searchThis implies an O(log n) search
67
Search A search is defined by the current balls of interest, as in the DAG search of KL-04. A search is defined by the current balls of interest, as in the DAG search of KL-04. For each ball, we record which centroid path it’s in.For each ball, we record which centroid path it’s in. For these centroid pathsFor these centroid paths search for the lowest containing ball in the path search for the lowest containing ball in the path record the unsearched portion of the path and its weight. record the unsearched portion of the path and its weight. For the (current) heaviest centroid path For the (current) heaviest centroid path Allow the search to continue a single step.Allow the search to continue a single step. If the lowest containing ball is not found, update the weight.If the lowest containing ball is not found, update the weight. If the lowest containing ball is found, take it and its friends as the new balls of interest.If the lowest containing ball is found, take it and its friends as the new balls of interest.
68
Search Analysis Each iteration starts with a constant number of balls of interest. Each iteration starts with a constant number of balls of interest. The search on the heaviest path for its lowest containing ball x is allowed to proceed one step. The search on the heaviest path for its lowest containing ball x is allowed to proceed one step. If x is not foundIf x is not found the weight of the path is reduced by a constant fraction in a single step. the weight of the path is reduced by a constant fraction in a single step. If x is foundIf x is found we descend to the next centroid path. This can be done at most O(log n) times. we descend to the next centroid path. This can be done at most O(log n) times. The new balls of interest are the friends of x. They are necessarily descendants of the old balls of interest. The new balls of interest are the friends of x. They are necessarily descendants of the old balls of interest. The search takes O(log n) time The search takes O(log n) time
69
Navigating Net Conclusion: Conclusion: Spanning tree of the DAG can be searched in time 2 O() log nSpanning tree of the DAG can be searched in time 2 O() log n We now discuss maintaining the navigating net under insertions We now discuss maintaining the navigating net under insertions Recall that can be large.Recall that can be large. We cannot afford log time to update the DAGWe cannot afford log time to update the DAG
70
Navigating Net First problem: First problem: InsertionsInsertions 1-net 2-net 4-net
71
Navigating Net 1-net 2-net 4-net First problem: First problem: InsertionsInsertions
72
Navigating Net 1-net 2-net 4-net First problem: First problem: InsertionsInsertions Solution: close-Solution: close-containment
73
Navigating Net 1-net 2-net 4-net First problem: First problem: InsertionsInsertions Solution: close-Solution: close-containment
74
Navigating Net Solution: Solution: dropoff =5dropoff =5 Close-containmentClose-containment 1-net 5-net 25-net
75
Navigating Net Solution: Solution: dropoff =5dropoff =5 Close-containmentClose-containment 1-net 5-net 25-net
76
Navigating Net Solution: Solution: dropoff =5dropoff =5 Close-containmentClose-containment 1-net 5-net 25-net
77
Navigating Net Solution: Solution: dropoff =5dropoff =5 Close-containmentClose-containment 1-net 5-net 25-net
78
Navigating Net Solution: Solution: dropoff =5dropoff =5 Close-containmentClose-containment 1-net 5-net 25-net
79
Navigating Net Solution: Solution: dropoff =5dropoff =5 Close-containmentClose-containment 1-net 5-net 25-net
80
Navigating Net Solution: Solution: dropoff =5dropoff =5 Close-containmentClose-containment 1-net 5-net 25-net
81
Navigating Net Solution: Solution: dropoff =5dropoff =5 Close-containmentClose-containment 1-net 5-net 25-net
82
Navigating Net Solution: Solution: dropoff =5dropoff =5 Close-containmentClose-containment 1-net 5-net 25-net
83
Navigating Net Solution: Solution: dropoff =5dropoff =5 Close-containmentClose-containment 1-net 5-net 25-net
84
Navigating Net Second Problem Second Problem Net sizeNet size It costs too much to store all the friends It costs too much to store all the friends 2 O() friends for each of O(n) balls gives 2 O() n space 2 O() friends for each of O(n) balls gives 2 O() n space SolutionSolution Storing friends for only n/2 O() balls, uses O(n) space. Storing friends for only n/2 O() balls, uses O(n) space. Implicit: no need to know the value of Implicit: no need to know the value of
85
Navigating Net Third Problem Third Problem DeletionsDeletions A deleted point may have been the center of (log ) balls of the net. A deleted point may have been the center of (log ) balls of the net. We cannot remove all these balls. We cannot remove all these balls. SolutionSolution Leave the balls there, but mark the 1-level ball as deleted. Leave the balls there, but mark the 1-level ball as deleted. After (n) deletions, start rebuilding structure in the backgroundAfter (n) deletions, start rebuilding structure in the background During the search, identify which subtrees of the spanning tree have unmarked nodes During the search, identify which subtrees of the spanning tree have unmarked nodes Only these subtrees should be searchedOnly these subtrees should be searched Cost: O(1) for each query.Cost: O(1) for each query.
86
Conclusion We give a dynamic ANN method that is spread independent We give a dynamic ANN method that is spread independent (1+)-ANN search: 2 O() log n (1/) O()(1+)-ANN search: 2 O() log n (1/) O() Insertions/deletions: 2 O() log nInsertions/deletions: 2 O() log n Data structure size: O(n)Data structure size: O(n)
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.