46
Disorder Inequality: A Combinatorial Approach to Nearest Neighbor Search Navin Goyal (Georgia Tech) Yury Lifshits (Caltech) Hinrich Schütze (Stuttgart University) Web Search and Data Mining 2008 Stanford, February 11, 2008 1 / 28

Disorder Inequality: A Combinatorial Approach to Nearest … · 2017-09-02 · Resume, job, BF/GF, car, apartment Co-occurrence similarity Suggesting new search terms 7/28. Nearest

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Disorder Inequality: A Combinatorial Approach to Nearest … · 2017-09-02 · Resume, job, BF/GF, car, apartment Co-occurrence similarity Suggesting new search terms 7/28. Nearest

Disorder Inequality:A Combinatorial Approach toNearest Neighbor Search

Navin Goyal (Georgia Tech)Yury Lifshits (Caltech)

Hinrich Schütze (Stuttgart University)

Web Search and Data Mining 2008Stanford, February 11, 2008

1 /28

Page 2: Disorder Inequality: A Combinatorial Approach to Nearest … · 2017-09-02 · Resume, job, BF/GF, car, apartment Co-occurrence similarity Suggesting new search terms 7/28. Nearest

Nearest Neighbors: an ExampleInput: Set of objects

Task: Preprocess it

Query: New object

Task: Find the most

similar one in the dataset

Most similar

2 /28

Page 3: Disorder Inequality: A Combinatorial Approach to Nearest … · 2017-09-02 · Resume, job, BF/GF, car, apartment Co-occurrence similarity Suggesting new search terms 7/28. Nearest

Nearest Neighbors: an ExampleInput: Set of objects

Task: Preprocess it

Query: New object

Task: Find the most

similar one in the dataset

Most similar

2 /28

Page 4: Disorder Inequality: A Combinatorial Approach to Nearest … · 2017-09-02 · Resume, job, BF/GF, car, apartment Co-occurrence similarity Suggesting new search terms 7/28. Nearest

Nearest Neighbors: an ExampleInput: Set of objects

Task: Preprocess it

Query: New object

Task: Find the most

similar one in the dataset

Most similar

2 /28

Page 5: Disorder Inequality: A Combinatorial Approach to Nearest … · 2017-09-02 · Resume, job, BF/GF, car, apartment Co-occurrence similarity Suggesting new search terms 7/28. Nearest

Nearest Neighbors

From computational perspective almost allalgorithmic problems in the Web representsome form of nearest neighbor problem:

Search space: object domain U, similarityfunction σ

Input: database S = {p1, . . . ,pn} ⊆ UQuery: q ∈ UTask: find argmax σ(pi,q)

3 /28

Page 6: Disorder Inequality: A Combinatorial Approach to Nearest … · 2017-09-02 · Resume, job, BF/GF, car, apartment Co-occurrence similarity Suggesting new search terms 7/28. Nearest

Contribution

Combinatorial framework: new approachto data mining problems that does notrequire triangle inequality

New algorithms for nearest neighborsearch

Experiments

Tutorial, website

4 /28

Page 7: Disorder Inequality: A Combinatorial Approach to Nearest … · 2017-09-02 · Resume, job, BF/GF, car, apartment Co-occurrence similarity Suggesting new search terms 7/28. Nearest

Outline

1 Motivation

2 Combinatorial Framework

3 New Algorithms

4 Directions for Further Research

5 /28

Page 8: Disorder Inequality: A Combinatorial Approach to Nearest … · 2017-09-02 · Resume, job, BF/GF, car, apartment Co-occurrence similarity Suggesting new search terms 7/28. Nearest

2Motivation

6 /28

Page 9: Disorder Inequality: A Combinatorial Approach to Nearest … · 2017-09-02 · Resume, job, BF/GF, car, apartment Co-occurrence similarity Suggesting new search terms 7/28. Nearest

Similarity Search for the Web

Recommendations

Personalized news aggregation

Ad targeting

“Best match” searchResume, job, BF/GF, car, apartment

Co-occurrence similaritySuggesting new search terms

7 /28

Page 10: Disorder Inequality: A Combinatorial Approach to Nearest … · 2017-09-02 · Resume, job, BF/GF, car, apartment Co-occurrence similarity Suggesting new search terms 7/28. Nearest

Nearest Neighbors: Prior WorkSphere Rectangle Tree Orchard’s Algorithm k-d-B tree

Geometric near-neighbor access tree Excludedmiddle vantage point forest mvp-tree Fixed-height

fixed-queries tree AESA Vantage-pointtree LAESA R∗-tree Burkhard-Keller tree BBD tree

Navigating Nets Voronoi tree Balanced aspect ratio

tree Metric tree vps-tree M-treeLocality-Sensitive Hashing SS-tree

R-tree Spatial approximation treeMulti-vantage point tree Bisector tree mb-tree Cover

tree Hybrid tree Generalized hyperplane tree Slim tree

Spill Tree Fixed queries tree X-tree k-d tree Balltree

Quadtree Octree Post-office tree8 /28

Page 11: Disorder Inequality: A Combinatorial Approach to Nearest … · 2017-09-02 · Resume, job, BF/GF, car, apartment Co-occurrence similarity Suggesting new search terms 7/28. Nearest

Challenge: Separation Effect

In theory:Triangle inequalityDoubling dimension is o(logn)

Typical web dataset has separation effect

For almost all i, j : 1/2 ≤ d(pi,pj) ≤ 1

Classic methods fail:In general metric space exact problem is intractableBranch and bound algorithms visit every objectDoubling dimension is at least logn/2

9 /28

Page 12: Disorder Inequality: A Combinatorial Approach to Nearest … · 2017-09-02 · Resume, job, BF/GF, car, apartment Co-occurrence similarity Suggesting new search terms 7/28. Nearest

Challenge: Separation Effect

In theory:Triangle inequalityDoubling dimension is o(logn)

Typical web dataset has separation effect

For almost all i, j : 1/2 ≤ d(pi,pj) ≤ 1

Classic methods fail:In general metric space exact problem is intractableBranch and bound algorithms visit every objectDoubling dimension is at least logn/2

9 /28

Page 13: Disorder Inequality: A Combinatorial Approach to Nearest … · 2017-09-02 · Resume, job, BF/GF, car, apartment Co-occurrence similarity Suggesting new search terms 7/28. Nearest

Challenge: Separation Effect

In theory:Triangle inequalityDoubling dimension is o(logn)

Typical web dataset has separation effect

For almost all i, j : 1/2 ≤ d(pi,pj) ≤ 1

Classic methods fail:In general metric space exact problem is intractableBranch and bound algorithms visit every objectDoubling dimension is at least logn/2

9 /28

Page 14: Disorder Inequality: A Combinatorial Approach to Nearest … · 2017-09-02 · Resume, job, BF/GF, car, apartment Co-occurrence similarity Suggesting new search terms 7/28. Nearest

2Combinatorial Framework

10 /28

Page 15: Disorder Inequality: A Combinatorial Approach to Nearest … · 2017-09-02 · Resume, job, BF/GF, car, apartment Co-occurrence similarity Suggesting new search terms 7/28. Nearest

Comparison Oracle

Dataset p1, . . . ,pn

Objects and distance (or similarity)function are NOT given

Instead, there is a comparison oracleanswering queries of the form:

Who is closer to A: B or C?

11 /28

Page 16: Disorder Inequality: A Combinatorial Approach to Nearest … · 2017-09-02 · Resume, job, BF/GF, car, apartment Co-occurrence similarity Suggesting new search terms 7/28. Nearest

Disorder Inequality

Sort all objects by their similarity to p:

p r s

rankp(r)

rankp(s)

Then by similarity to r:

r s

rankr(s)

Dataset has disorder D if∀p, r, s : rankr(s) ≤ D(rankp(r) + rankp(s))

12 /28

Page 17: Disorder Inequality: A Combinatorial Approach to Nearest … · 2017-09-02 · Resume, job, BF/GF, car, apartment Co-occurrence similarity Suggesting new search terms 7/28. Nearest

Disorder Inequality

Sort all objects by their similarity to p:

p r s

rankp(r)

rankp(s)

Then by similarity to r:

r s

rankr(s)

Dataset has disorder D if∀p, r, s : rankr(s) ≤ D(rankp(r) + rankp(s))

12 /28

Page 18: Disorder Inequality: A Combinatorial Approach to Nearest … · 2017-09-02 · Resume, job, BF/GF, car, apartment Co-occurrence similarity Suggesting new search terms 7/28. Nearest

Disorder Inequality

Sort all objects by their similarity to p:

p r s

rankp(r)

rankp(s)

Then by similarity to r:

r s

rankr(s)

Dataset has disorder D if∀p, r, s : rankr(s) ≤ D(rankp(r) + rankp(s))

12 /28

Page 19: Disorder Inequality: A Combinatorial Approach to Nearest … · 2017-09-02 · Resume, job, BF/GF, car, apartment Co-occurrence similarity Suggesting new search terms 7/28. Nearest

Combinatorial Framework

=

Comparison oracleWho is closer to A: B or C?

+

Disorder inequalityrankr(s) ≤ D(rankp(r) + rankp(s))

13 /28

Page 20: Disorder Inequality: A Combinatorial Approach to Nearest … · 2017-09-02 · Resume, job, BF/GF, car, apartment Co-occurrence similarity Suggesting new search terms 7/28. Nearest

Combinatorial Framework: FAQ

Disorder of a metric space? Disorder ofRk?

In what cases disorder is relatively small?

Experimental values of D for somepractical datasets?

Disorder constant vs. other concepts ofintrinsic dimension?

14 /28

Page 21: Disorder Inequality: A Combinatorial Approach to Nearest … · 2017-09-02 · Resume, job, BF/GF, car, apartment Co-occurrence similarity Suggesting new search terms 7/28. Nearest

Combinatorial Framework: Pro & Contra

Advantages:

Does not require triangle inequality for distances

Applicable to any data model and any similarityfunction

Require only comparative training information

Sensitive to “local density” of a dataset

Limitation: worst-case form of disorder inequality

15 /28

Page 22: Disorder Inequality: A Combinatorial Approach to Nearest … · 2017-09-02 · Resume, job, BF/GF, car, apartment Co-occurrence similarity Suggesting new search terms 7/28. Nearest

Combinatorial Framework: Pro & Contra

Advantages:

Does not require triangle inequality for distances

Applicable to any data model and any similarityfunction

Require only comparative training information

Sensitive to “local density” of a dataset

Limitation: worst-case form of disorder inequality

15 /28

Page 23: Disorder Inequality: A Combinatorial Approach to Nearest … · 2017-09-02 · Resume, job, BF/GF, car, apartment Co-occurrence similarity Suggesting new search terms 7/28. Nearest

Disorder vs. Others

If expansion rate is c, disorder constant isat most c2

Doubling dimension and disorderdimension are incomparable

Disorder inequality implies combinatorialform of “doubling effect”

16 /28

Page 24: Disorder Inequality: A Combinatorial Approach to Nearest … · 2017-09-02 · Resume, job, BF/GF, car, apartment Co-occurrence similarity Suggesting new search terms 7/28. Nearest

3New Algorithms

17 /28

Page 25: Disorder Inequality: A Combinatorial Approach to Nearest … · 2017-09-02 · Resume, job, BF/GF, car, apartment Co-occurrence similarity Suggesting new search terms 7/28. Nearest

Ranwalk Informally (1/2)

qp1

p2

p3

p4

18 /28

Page 26: Disorder Inequality: A Combinatorial Approach to Nearest … · 2017-09-02 · Resume, job, BF/GF, car, apartment Co-occurrence similarity Suggesting new search terms 7/28. Nearest

Ranwalk Informally (1/2)

qp1

p2

p3

p4

18 /28

Page 27: Disorder Inequality: A Combinatorial Approach to Nearest … · 2017-09-02 · Resume, job, BF/GF, car, apartment Co-occurrence similarity Suggesting new search terms 7/28. Nearest

Ranwalk Informally (1/2)

qp1

p2

p3

p4

18 /28

Page 28: Disorder Inequality: A Combinatorial Approach to Nearest … · 2017-09-02 · Resume, job, BF/GF, car, apartment Co-occurrence similarity Suggesting new search terms 7/28. Nearest

Ranwalk Informally (1/2)

qp1

p2

p3

p4

18 /28

Page 29: Disorder Inequality: A Combinatorial Approach to Nearest … · 2017-09-02 · Resume, job, BF/GF, car, apartment Co-occurrence similarity Suggesting new search terms 7/28. Nearest

Ranwalk Informally (1/2)

qp1

p2

p3

p4

18 /28

Page 30: Disorder Inequality: A Combinatorial Approach to Nearest … · 2017-09-02 · Resume, job, BF/GF, car, apartment Co-occurrence similarity Suggesting new search terms 7/28. Nearest

Ranwalk Informally (1/2)

qp1

p2

p3

p4

18 /28

Page 31: Disorder Inequality: A Combinatorial Approach to Nearest … · 2017-09-02 · Resume, job, BF/GF, car, apartment Co-occurrence similarity Suggesting new search terms 7/28. Nearest

Ranwalk Informally (2/2)Hierarchical greedy navigation:

1 Start at random city p1

2 Among all airlines choose the one going mostclosely to q, move there (say, to p2)

3 Among all railway routes from p2 choose the onegoing most closely to q, move there (p3)

4 Among all bus routes from p3 choose the one goingmost closely to q, move there (p4)

5 Repeat this logn times and return the final city

Transport system: for level k choose crandom arcs to n

2kneighborhood

19 /28

Page 32: Disorder Inequality: A Combinatorial Approach to Nearest … · 2017-09-02 · Resume, job, BF/GF, car, apartment Co-occurrence similarity Suggesting new search terms 7/28. Nearest

Ranwalk Informally (2/2)Hierarchical greedy navigation:

1 Start at random city p1

2 Among all airlines choose the one going mostclosely to q, move there (say, to p2)

3 Among all railway routes from p2 choose the onegoing most closely to q, move there (p3)

4 Among all bus routes from p3 choose the one goingmost closely to q, move there (p4)

5 Repeat this logn times and return the final city

Transport system: for level k choose crandom arcs to n

2kneighborhood

19 /28

Page 33: Disorder Inequality: A Combinatorial Approach to Nearest … · 2017-09-02 · Resume, job, BF/GF, car, apartment Co-occurrence similarity Suggesting new search terms 7/28. Nearest

Ranwalk Informally (2/2)Hierarchical greedy navigation:

1 Start at random city p1

2 Among all airlines choose the one going mostclosely to q, move there (say, to p2)

3 Among all railway routes from p2 choose the onegoing most closely to q, move there (p3)

4 Among all bus routes from p3 choose the one goingmost closely to q, move there (p4)

5 Repeat this logn times and return the final city

Transport system: for level k choose crandom arcs to n

2kneighborhood

19 /28

Page 34: Disorder Inequality: A Combinatorial Approach to Nearest … · 2017-09-02 · Resume, job, BF/GF, car, apartment Co-occurrence similarity Suggesting new search terms 7/28. Nearest

Ranwalk Informally (2/2)Hierarchical greedy navigation:

1 Start at random city p1

2 Among all airlines choose the one going mostclosely to q, move there (say, to p2)

3 Among all railway routes from p2 choose the onegoing most closely to q, move there (p3)

4 Among all bus routes from p3 choose the one goingmost closely to q, move there (p4)

5 Repeat this logn times and return the final city

Transport system: for level k choose crandom arcs to n

2kneighborhood

19 /28

Page 35: Disorder Inequality: A Combinatorial Approach to Nearest … · 2017-09-02 · Resume, job, BF/GF, car, apartment Co-occurrence similarity Suggesting new search terms 7/28. Nearest

Ranwalk Informally (2/2)Hierarchical greedy navigation:

1 Start at random city p1

2 Among all airlines choose the one going mostclosely to q, move there (say, to p2)

3 Among all railway routes from p2 choose the onegoing most closely to q, move there (p3)

4 Among all bus routes from p3 choose the one goingmost closely to q, move there (p4)

5 Repeat this logn times and return the final city

Transport system: for level k choose crandom arcs to n

2kneighborhood

19 /28

Page 36: Disorder Inequality: A Combinatorial Approach to Nearest … · 2017-09-02 · Resume, job, BF/GF, car, apartment Co-occurrence similarity Suggesting new search terms 7/28. Nearest

Ranwalk Informally (2/2)Hierarchical greedy navigation:

1 Start at random city p1

2 Among all airlines choose the one going mostclosely to q, move there (say, to p2)

3 Among all railway routes from p2 choose the onegoing most closely to q, move there (p3)

4 Among all bus routes from p3 choose the one goingmost closely to q, move there (p4)

5 Repeat this logn times and return the final city

Transport system: for level k choose crandom arcs to n

2kneighborhood

19 /28

Page 37: Disorder Inequality: A Combinatorial Approach to Nearest … · 2017-09-02 · Resume, job, BF/GF, car, apartment Co-occurrence similarity Suggesting new search terms 7/28. Nearest

Ranwalk AlgorithmPreprocessing:

For every point p in database we sort all otherpoints by their similarity to pData structure: n lists of n− 1 points each.

Query processing:1 Step 0: choose a random point p0 in the database.2 From k = 1 to k = logn do Step k: Choose

D′ := 3D(log logn+ 1) random points frommin(n, 3Dn

2k)-neighborhood of pk−1. Compute

similarities of these points w.r.t. q and set pk to bethe most similar one.

3 If rankplogn(q) > D go to step 0, otherwise searchthe whole D2-neighborhood of plogn and return thepoint most similar to q as the final answer.

20 /28

Page 38: Disorder Inequality: A Combinatorial Approach to Nearest … · 2017-09-02 · Resume, job, BF/GF, car, apartment Co-occurrence similarity Suggesting new search terms 7/28. Nearest

Analysis of RanwalkAssume that database points together withquery point S ∪ {q} satisfy disorder inequalitywith constant D:

rankx(y) ≤ D(rankz(x) + rankz(y)).

Then Ranwalk algorithm always answersnearest neighbor queries correctlyResources:

Preprocessing space: O(n2)

Preprocessing time: O(n2 logn)

Expected query time: O(D logn log logn+D2)

21 /28

Page 39: Disorder Inequality: A Combinatorial Approach to Nearest … · 2017-09-02 · Resume, job, BF/GF, car, apartment Co-occurrence similarity Suggesting new search terms 7/28. Nearest

Variation: ArwalkArwalk: moving all random choices topreprocessing

Assume that database points together withquery point S ∪ {q} satisfy disorder inequalitywith constant D

Then for any probability of error δ Arwalkalgorithm answers nearest neighbor querywithin the following constraints:

Preprocessing space: O(nD logn(log logn+ log1/δ))Preprocessing time: O(n2 logn)

Query time: O(D logn(log logn+ log1/δ))

22 /28

Page 40: Disorder Inequality: A Combinatorial Approach to Nearest … · 2017-09-02 · Resume, job, BF/GF, car, apartment Co-occurrence similarity Suggesting new search terms 7/28. Nearest

ExperimentReuters-RCV1 corpus:

1 Fix range R

2 Choose randoma,b ∈ [1..R]

3 Choose random p ∈ S4 Take r s.t. rankp(r) = a

5 Take s s.t. rankr(s) = b

6 Let c = rankp(s)

7 Return ca+b

23 /28

Page 41: Disorder Inequality: A Combinatorial Approach to Nearest … · 2017-09-02 · Resume, job, BF/GF, car, apartment Co-occurrence similarity Suggesting new search terms 7/28. Nearest

3Directions for Further Research

24 /28

Page 42: Disorder Inequality: A Combinatorial Approach to Nearest … · 2017-09-02 · Resume, job, BF/GF, car, apartment Co-occurrence similarity Suggesting new search terms 7/28. Nearest

Recent ResultsYury Lifshits and Shengyu Zhang

Similarity Search via Combinatorial Nets

Better nearest neighbors:

Deterministic

Preprocessing poly(D)n log2n time

Price: search time increases to D4 logn

Combinatorial algorithms for otherproblems:

Near duplicates

Navigation in a small world

Clustering

25 /28

Page 43: Disorder Inequality: A Combinatorial Approach to Nearest … · 2017-09-02 · Resume, job, BF/GF, car, apartment Co-occurrence similarity Suggesting new search terms 7/28. Nearest

Future of Combinatorial Framework

Other problems in combinatorial framework:

Low-distortion embeddingsClosest pairsCommunity discoveryLinear arrangementDistance labellingDimensionality reduction

What if disorder inequality has exceptions,but holds in average?

Insertions, deletions, changing metric

Metric regularizations

Experiments & implementation26 /28

Page 44: Disorder Inequality: A Combinatorial Approach to Nearest … · 2017-09-02 · Resume, job, BF/GF, car, apartment Co-occurrence similarity Suggesting new search terms 7/28. Nearest

Sponsored Linkshttp://yury.name

http://simsearch.yury.nameTutorial, bibliography, people, links, open problems

Yury Lifshits and Shengyu Zhang

Similarity Search via Combinatorial Nets

http://yury.name/papers/lifshits2008similarity.pdf

Navin Goyal, Yury Lifshits, Hinrich Schütze

Disorder Inequality: A Combinatorial Approach to Nearest Neighbor Search

http://yury.name/papers/goyal2008disorder.pdf

Benjamin Hoffmann, Yury Lifshits, Dirk Novotka

Maximal Intersection Queries in Randomized Graph Models

http://yury.name/papers/hoffmann2007maximal.pdf

27 /28

Page 45: Disorder Inequality: A Combinatorial Approach to Nearest … · 2017-09-02 · Resume, job, BF/GF, car, apartment Co-occurrence similarity Suggesting new search terms 7/28. Nearest

Summary

Combinatorial framework:comparison oracle + disorder inequality

New algorithms:Random walk with nearly D logn steps

Further work:Implementing combinatorial algorithmsDisorder in average

Thanks for your attention!Questions?

28 /28

Page 46: Disorder Inequality: A Combinatorial Approach to Nearest … · 2017-09-02 · Resume, job, BF/GF, car, apartment Co-occurrence similarity Suggesting new search terms 7/28. Nearest

Summary

Combinatorial framework:comparison oracle + disorder inequality

New algorithms:Random walk with nearly D logn steps

Further work:Implementing combinatorial algorithmsDisorder in average

Thanks for your attention!Questions?

28 /28