Searching Dynamic Point Sets in Spaces with Bounded Doubling Dimension

71
Searching Dynamic Searching Dynamic Point Sets in Spaces Point Sets in Spaces with Bounded Doubling with Bounded Doubling Dimension Dimension Lee-Ad Gottlieb Lee-Ad Gottlieb Joint work with Joint work with Richard Cole Richard Cole

description

Searching Dynamic Point Sets in Spaces with Bounded Doubling Dimension. Lee-Ad Gottlieb Joint work with Richard Cole. NNS. Nearest Neighbor Search (NNS) Given a set of points S in a metric space Preprocess S so that the following query can be answered efficiently: - PowerPoint PPT Presentation

Transcript of Searching Dynamic Point Sets in Spaces with Bounded Doubling Dimension

Searching Dynamic Point Sets Searching Dynamic Point Sets in Spaces with Bounded in Spaces with Bounded

Doubling DimensionDoubling Dimension

Lee-Ad GottliebLee-Ad Gottlieb

Joint work withJoint work withRichard ColeRichard Cole

NNSNNS

Nearest Neighbor SearchNearest Neighbor Search (NNS) (NNS)• Given a set of points Given a set of points SS in a metric in a metric

space space • Preprocess Preprocess SS so that the following so that the following

query can be answered efficiently:query can be answered efficiently: given query point q, what is the closest given query point q, what is the closest

point to point to qq in in SS??q

NNSNNS

A sublinear algorithm for NNS in A sublinear algorithm for NNS in general metrics?general metrics?• Bad news: not possible.Bad news: not possible.

q

~1~1

~1

~1

~1

NNSNNS

What if we only require only an What if we only require only an approximate NNS (ANN)? 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 theCan we parameterize the

hard case? hard case?

q

~1~1

~1

~1

~1

Doubling DimensionDoubling Dimension

The space within radius r of The space within radius r of center center cc is the is the rr--ballball of of cc..

Point set X has doubling Point set X has doubling dimension dimension if if • the points of X covered by the points of X covered by

ball B can be covered by 2ball B can be covered by 2 balls of half the radius.balls of half the radius.

1

2

3

4

6

5

7

8

NNS in Low Doubling DimensionNNS in Low Doubling Dimension

Data structure for (1+Data structure for (1+)-ANN query )-ANN query on on SS• Navigating Net of points aids search. Navigating Net of points aids search. • A Navigating Net is composed of levels A Navigating Net is composed of levels

of of -nets. -nets.

Navigating nets: Simple algorithms Navigating nets: Simple algorithms for proximity searchfor proximity search. R. . R. Krauthgamer, J.R. Lee. SODA ‘04Krauthgamer, J.R. Lee. SODA ‘04

Modified Modified -net-net

anan modified modified -net for a point set -net for a point set SS is is a set of balls of radius a set of balls of radius centered at centered at points of points of SS• Packing propertyPacking property

The centers are separated from each other The centers are separated from each other by some minimum distance by some minimum distance ’’

We use We use ’ = 4/5 ’ = 4/5

• The ballsThe balls Cover Cover all the points of the all the points of the SS..

Navigating Net VariantNavigating Net Variant1-net2-net4-net8-net

Navigating Net VariantNavigating Net Variant1-net2-net4-net8-net

Radius = 1

Covering: all points are covered

Packing

Navigating Net VariantNavigating Net Variant1-net2-net4-net8-net

Radius = 2

Navigating Net VariantNavigating Net Variant1-net2-net4-net8-net

Navigating Net VariantNavigating Net Variant1-net2-net4-net8-net

Navigating Net VariantNavigating Net Variant1-net2-net4-net8-net

Navigating Net VariantNavigating Net Variant1-net2-net4-net8-net

Navigating Net VariantNavigating Net Variant1-net2-net4-net8-net

Navigating Net VariantNavigating Net Variant1-net2-net4-net8-net

Navigating Net VariantNavigating Net Variant1-net2-net4-net8-net

Navigating Net VariantNavigating Net Variant1-net2-net4-net8-net

Search exampleSearch example1-net2-net4-net8-net

Search exampleSearch example1-net2-net4-net8-net

Search exampleSearch example1-net2-net4-net8-net

Search exampleSearch example1-net2-net4-net8-net

Search exampleSearch example1-net2-net4-net8-net

Search exampleSearch example1-net2-net4-net8-net

Search exampleSearch example1-net2-net4-net8-net

Search exampleSearch example1-net2-net4-net8-net

Search exampleSearch example1-net2-net4-net8-net

Search exampleSearch example1-net2-net4-net8-net

Another PerspectiveAnother Perspective

DAG

Another PerspectiveAnother Perspective

DAG

Another PerspectiveAnother Perspective

DAG

Another PerspectiveAnother Perspective

DAG

AnalysisAnalysis

Time to find the lowest enclosing ballTime 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 Let the spread of the points be ddmaxmax/d/dminmin

There are O(log There are O(log ) levels) levels

• At every level, we consider At every level, we consider O(O() ) balls.balls.O(O() ) log log

If If = n = nO(1)O(1) we get a good search time we get a good search time• 22O(O() ) log nlog n

But what if But what if is asymptotically larger? is asymptotically larger?

Summary of Previous WorkSummary of Previous Work

(1+(1+)-NNS query)-NNS query Insertion/deletionInsertion/deletion sizesize

KL-04KL-04 22O(O() ) log log (1/(1/))O(O()) 22O(O()) log log 22O(O())nn

BKL-06BKL-06 22O(O() ) log log (1/(1/))O(O()) 22O(O()) log log O(n)O(n)

HM-06HM-06 22O(O() ) log n log n (1/(1/))O(O()) ** O(n)O(n)

This paperThis paper 22O(O() ) log n log n (1/(1/))O(O()) 22O(O()) log n log n O(n)O(n)

Spread of the points = dSpread of the points = dmaxmax/d/dminmin

Abstract dimensionAbstract dimension* * Static structure, Static structure, 22O(O())n log nn log n construction time construction time

ChallengeChallenge

How to dynamically maintain and How to dynamically maintain and search a deep DAG?search a deep DAG?

loglog levelsFor large

Special CaseSpecial Case

O(log n) search onan unbalanced treeis well known.

Special CaseSpecial Case

O(log n) search onan unbalanced treeis well known.

Special CaseSpecial Case

O(log n) search onan unbalanced treeis well known.

Special CaseSpecial Case

O(log n) search onan unbalanced treeis well known.

Special CaseSpecial Case

O(log n) search onan unbalanced treeis well known.

Can we do something similar for our DAGs?

Towards a TreeTowards a Tree

DAG

Towards a TreeTowards a Tree

Spanning tree representation

Towards a TreeTowards a Tree

Spanning tree representation

Towards a TreeTowards a Tree

Spanning tree representation

Balls & subtreesof interest

Towards a TreeTowards a Tree

Spanning tree representation

Balls & subtreesof interest

Towards a TreeTowards a Tree

Balls of interest

Spanning tree representation

PreliminariesPreliminaries

For a ball x at level i, its For a ball x at level i, its friendsfriends are are all balls of level i that intersect x.all balls of level i that intersect x.• In the navigating net, every ball knows In the navigating net, every ball knows

who its friends are. This information is who its friends are. This information is readily available from the DAGreadily available from the DAG

• If two balls of the same level both If two balls of the same level both contain contain qq, they must be friends., they must be friends.

Modified SearchModified Search

The search begins with the top ball as the single The search begins with the top ball as the single ball of interestball of interest..

In general, the search is specified by 2In general, the search is specified by 2O(O()) balls of balls of interest,interest, all at the same level. all at the same level.• each of these balls contain the query pointeach of these balls contain the query point• For illustration, let 2For illustration, let 2O(O()) = 3 = 3

Modified SearchModified Search

Start the search on the largest treeStart the search on the largest tree• Identify a subtree with a constant Identify a subtree with a constant

fraction of the total size of the large treefraction of the total size of the large tree

Modified SearchModified Search

If the query point is not in the If the query point is not in the subtree, eliminate the subtree from subtree, eliminate the subtree from consideration.consideration.

Modified SearchModified Search

If the query point is in the subtree, If the query point is in the subtree, take it as a new tree of interesttake it as a new tree of interest• Take its friends, too.Take its friends, too.

Modified SearchModified Search

Friends are descendants of previous nodes Friends are descendants of previous nodes of interest.of interest.• The new subtrees of interest are smaller than The new subtrees of interest are smaller than

the old ones.the old ones.• The previously largest tree has been reduced The previously largest tree has been reduced

by a constant fractionby a constant fraction

Friends

Modified SearchModified Search

Friends are descendants of previous nodes Friends are descendants of previous nodes of interest.of interest.• The new subtrees of interest are smaller than The new subtrees of interest are smaller than

the old ones.the old ones.• The largest subtree has been reduced by a The largest subtree has been reduced by a

constant fractionconstant fraction• This implies an O(log n) searchThis implies an O(log n) search

Navigating NetNavigating Net

Conclusion: Conclusion: • Spanning tree of the DAG can be Spanning tree of the DAG can be

searched in time 2searched in time 2O(O() ) log nlog n

We now discuss maintaining the We now discuss maintaining the navigating net under insertionsnavigating net under insertions• Recall that Recall that can be large. can be large.• We cannot afford log We cannot afford log time to update time to update

the DAGthe DAG

Navigating NetNavigating Net First problem:First problem:

• InsertionsInsertions

1-net2-net4-net

Navigating NetNavigating Net1-net2-net4-net

First problem:First problem:• InsertionsInsertions

Navigating NetNavigating Net1-net2-net4-net

First problem:First problem:• InsertionsInsertions• Solution: close-Solution: close-

containmentcontainment

Navigating NetNavigating Net1-net2-net4-net

First problem:First problem:• InsertionsInsertions• Solution: close-Solution: close-

containmentcontainment

Navigating NetNavigating Net

Solution:Solution:• dropoff =5dropoff =5• Close-containmentClose-containment

1-net5-net25-net

Navigating NetNavigating Net

Solution:Solution:• dropoff =5dropoff =5• Close-containmentClose-containment

1-net5-net25-net

Navigating NetNavigating Net

Solution:Solution:• dropoff =5dropoff =5• Close-containmentClose-containment

1-net5-net25-net

Navigating NetNavigating Net

Solution:Solution:• dropoff =5dropoff =5• Close-containmentClose-containment

1-net5-net25-net

Navigating NetNavigating Net

Solution:Solution:• dropoff =5dropoff =5• Close-containmentClose-containment

1-net5-net25-net

Navigating NetNavigating Net

Solution:Solution:• dropoff =5dropoff =5• Close-containmentClose-containment

1-net5-net25-net

Navigating NetNavigating Net

Solution:Solution:• dropoff =5dropoff =5• Close-containmentClose-containment

1-net5-net25-net

Navigating NetNavigating Net

Solution:Solution:• dropoff =5dropoff =5• Close-containmentClose-containment

1-net5-net25-net

Navigating NetNavigating Net

Solution:Solution:• dropoff =5dropoff =5• Close-containmentClose-containment

1-net5-net25-net

Navigating NetNavigating Net

Solution:Solution:• dropoff =5dropoff =5• Close-containmentClose-containment

1-net5-net25-net

Navigating NetNavigating Net

Second ProblemSecond Problem• Net sizeNet size

It costs too much to store all the friendsIt costs too much to store all the friends 22O(O()) friends for each of O(n) balls gives 2 friends for each of O(n) balls gives 2O(O())n n

spacespace

• SolutionSolution Storing friends for only n/2Storing friends for only n/2O(O()) balls, uses balls, uses

O(n) space.O(n) space. Implicit: no need to know the value of Implicit: no need to know the value of

Navigating NetNavigating Net Third ProblemThird Problem

• DeletionsDeletions A deleted point may have been the center of A deleted point may have been the center of (log (log ) )

balls of the net.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 Leave the balls there, but mark the 1-level ball as

deleted.deleted.• After After (n) deletions, start rebuilding structure in the (n) deletions, start rebuilding structure in the

backgroundbackground During the search, identify which subtrees of the During the search, identify which subtrees of the

spanning tree have unmarked nodesspanning 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.

ConclusionConclusion

We give a dynamic ANN method that We give a dynamic ANN method that is spread independentis spread independent• (1+(1+)-ANN search: 2)-ANN search: 2O(O() ) log n log n (1/(1/))O(O())

• Insertions/deletions: 2Insertions/deletions: 2O(O() ) log n log n • Data structure size: O(n)Data structure size: O(n)