efficient method for maximizing bichromatic reverse nearest neighbor

80
1 Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor Raymond Chi-Wing Wong (Hong Kong University of Science and Technology) M. Tamer Ozsu (University of Waterloo) Philip S. Yu (University of Illinois at Chicago) Ada Wai-Chee Fu (Chinese University of Hong Kong) Lian Liu (Hong Kong University of Science and Technology) Presented by Raymond Chi-Wing Wong Presented by Raymond Chi-Wing Wong

Upload: semah

Post on 12-Jan-2016

32 views

Category:

Documents


0 download

DESCRIPTION

Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor. Raymond Chi-Wing Wong (Hong Kong University of Science and Technology) M. Tamer Ozsu (University of Waterloo) Philip S. Yu (University of Illinois at Chicago) Ada Wai-Chee Fu (Chinese University of Hong Kong) - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor

1

Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor

Raymond Chi-Wing Wong (Hong Kong University of Science and Technology)

M. Tamer Ozsu (University of Waterloo)Philip S. Yu (University of Illinois at Chicago)

Ada Wai-Chee Fu (Chinese University of Hong Kong)Lian Liu (Hong Kong University of Science and Technology)

Presented by Raymond Chi-Wing WongPresented by Raymond Chi-Wing Wong

Page 2: Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor

2

Outline

1. Introduction Related work – Bichromatic Reverse

Nearest Neighbor

2. Problem - MaxBRNN3. Algorithm - MaxOverlap 4. Empirical Study5. Conclusion

Page 3: Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor

3

1. Introduction

Bichromatic Reverse Nearest Neighbor (BRNN or RNN) Given

P and O are two sets of points in the same data space

Problem Given a point pP, a BRNN query finds all the

points oO whose nearest neighbor (NN) in P are p.

Page 4: Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor

4

1. Introduction NN: Nearest neighborRNN: Reverse nearest neighbor

NN in P = p1

P = {p1, p2}

O = {o1, o2, o3 , o4, o5}

Convenience stores

Customers

p1

p2

o1

o2

o3

o4

o5

NN in P = p1

NN in P = p2

NN in P = p2

NN in P = p2

RNN = {o1, o2}

RNN = {o3, o4 , o5}

Page 5: Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor

5

1. Introduction NN: Nearest neighborRNN: Reverse nearest neighbor

P = {p1, p2}

O = {o1, o2, o3 , o4, o5}

Convenience stores

Customers

p1

p2

o1

o2

o3

o4

o5

Suppose that we want to set upa new convenience store p

Where should we set up?

p

RNN = {o1, o2}

Placement 1

Placement 1 RNN = {o1, o2}

Influence value = 2

2

Page 6: Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor

6

1. Introduction NN: Nearest neighborRNN: Reverse nearest neighbor

P = {p1, p2}

O = {o1, o2, o3 , o4, o5}

Convenience stores

Customers

p1

p2

o1

o2

o3

o4

o5

Suppose that we want to set upa new convenience store p

Where should we set up?

p

RNN = {o1, o2 , o3, o4 , o5}

Different placements of p may havedifferent RNN sets

Placement 2

Placement 1 RNN = {o1, o2}

Placement 2 RNN = {o1, o2 , o3, o4 , o5}

Which placement is better?

Placement 2

2

5

Influence value = 5

Page 7: Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor

7

1. Introduction NN: Nearest neighborRNN: Reverse nearest neighbor

P = {p1, p2}

O = {o1, o2, o3 , o4, o5}

Convenience stores

Customers

p1

p2

o1

o2

o3

o4

o5

Suppose that we want to set upa new convenience store p

Where should we set up?

p

RNN = {o1, o2 , o3, o4 , o5}

Different placements of p may havethe same RNN set

Placement 3

Placement 1 RNN = {o1, o2}

Placement 2 RNN = {o1, o2 , o3, o4 , o5}

Placement 3 RNN = {o1, o2 , o3, o4 , o5}

2

5

5

Influence value = 5

Page 8: Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor

8

1. Introduction NN: Nearest neighborRNN: Reverse nearest neighbor

P = {p1, p2}

O = {o1, o2, o3 , o4, o5}

Convenience stores

Customers

p1

p2

o1

o2

o3

o4

o5

Suppose that we want to set upa new convenience store p

Where should we set up?

Problem: We want to find a region R(or area) such that when p is placedin R, the influence value of p is maximized.

Placement 1 RNN = {o1, o2}

Placement 2 RNN = {o1, o2 , o3, o4 , o5}

Placement 3 RNN = {o1, o2 , o3, o4 , o5}

2

5

5

Page 9: Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor

9

1. Introduction Related Work

Arrangement Running Time = O(|O| log |P| + |O|2 +2(|O|))

where (|O|) is a function on |O| and is (|O|)

Our Proposed Algorithm MaxOverlap Running Time = O(|O| log |P| + k2 |O| +k |O| log |O|)

where k << |O| Significant improvement

on Running Time Problem: We want to find a region R(or area) such that when p is placedin R, the influence value of p is maximized.

Page 10: Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor

10

2. ProblemNN: Nearest neighborRNN: Reverse nearest neighbor

P = {p1, p2}

O = {o1, o2, o3 , o4, o5}

Convenience stores

Customers

p1

p2

o1

o2

o3

o4

o5

Problem: We want to find a region R(or area) such that when p is placedin R, the influence value of p is maximized.

p

RNN = {o1, o2 , o3, o4 , o5}

Page 11: Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor

11

2. ProblemNN: Nearest neighborRNN: Reverse nearest neighbor

P = {p1, p2}

O = {o1, o2, o3 , o4, o5}

Convenience stores

Customers

p1

p2

o1

o2

o3

o4

o5

Problem: We want to find a region R(or area) such that when p is placedin R, the influence value of p is maximized.

Consistent region

For any two possible placements in this region, their RNN sets are the same

Influence value = 5

RNN = {o1, o2 , o3, o4 , o5}

p

Page 12: Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor

12

2. ProblemNN: Nearest neighborRNN: Reverse nearest neighbor

P = {p1, p2}

O = {o1, o2, o3 , o4, o5}

Convenience stores

Customers

p1

p2

o1

o2

o3

o4

o5

Problem: We want to find a region R(or area) such that when p is placedin R, the influence value of p is maximized.

Page 13: Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor

13

2. ProblemNN: Nearest neighborRNN: Reverse nearest neighbor

P = {p1, p2}

O = {o1, o2, o3 , o4, o5}

Convenience stores

Customers

p1

p2

o1

o2

o3

o4

o5

Problem: We want to find a region R(or area) such that when p is placedin R, the influence value of p is maximized.

p

RNN = {o1, o2}

Page 14: Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor

14

2. ProblemNN: Nearest neighborRNN: Reverse nearest neighbor

P = {p1, p2}

O = {o1, o2, o3 , o4, o5}

Convenience stores

Customers

p1

p2

o1

o2

o3

o4

o5

Problem: We want to find a region R(or area) such that when p is placedin R, the influence value of p is maximized.

Non-Consistent region

RNN = {o1, o2 , o3, o4 , o5}

p

Page 15: Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor

15

2. ProblemNN: Nearest neighborRNN: Reverse nearest neighbor

P = {p1, p2}

O = {o1, o2, o3 , o4, o5}

Convenience stores

Customers

p1

p2

o1

o2

o3

o4

o5

Problem: We want to find a region R(or area) such that when p is placedin R, the influence value of p is maximized.

Consistent region

Page 16: Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor

16

2. ProblemNN: Nearest neighborRNN: Reverse nearest neighbor

P = {p1, p2}

O = {o1, o2, o3 , o4, o5}

Convenience stores

Customers

p1

p2

o1

o2

o3

o4

o5

Problem: We want to find a region R(or area) such that when p is placedin R, the influence value of p is maximized.

Consistent region

Many consistent regions!

Influence value = 5

Page 17: Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor

17

2. ProblemNN: Nearest neighborRNN: Reverse nearest neighbor

P = {p1, p2}

O = {o1, o2, o3 , o4, o5}

Convenience stores

Customers

p1

p2

o1

o2

o3

o4

o5

Problem: We want to find a region R(or area) such that when p is placedin R, the influence value of p is maximized.

Maximal consistent regionThere does not exist another consistent region R’ where (1) R’ covers R and (2) the RNN sets of R and R’ are equal

Influence value = 5

Page 18: Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor

18

2. ProblemNN: Nearest neighborRNN: Reverse nearest neighbor

P = {p1, p2}

O = {o1, o2, o3 , o4, o5}

Convenience stores

Customers

p1

p2

o1

o2

o3

o4

o5

Problem: We want to find a region R(or area) such that when p is placedin R, the influence value of p is maximized.

Maximal consistent regionThere does not exist another consistent region R’ where (1) R’ covers R and (2) the RNN sets of R and R’ are equal

Maximal consistent region

Influence value = 5

Page 19: Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor

19

p1

p2

o1

o2

o3

o4

o5

Problem: We want to find a region R(or area) such that when p is placedin R, the influence value of p is maximized.

Maximal consistent region

2. Problem

Problem: We want to find a maximalconsistent region R such that when the influence value of R is maximized.

We call this problemMaximizing Bichromatic Reverse Nearest Neighbor(MaxBRNN)

Page 20: Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor

20

p1

p2

o1

o2

o3

o4

o5

2. Problem

Problem: We want to find a maximalconsistent region R such that when the influence value of R is maximized.

We call this problemMaximizing Bichromatic Reverse Nearest Neighbor(MaxBRNN)

Two challenges:

Challenge 1: It is difficult to find a maximal consistent region

Challenge 2: We need to return the maximal consistent region with the greatest influence value

Page 21: Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor

21

2. Problem

Problem: We want to find a maximalconsistent region R such that when the influence value of R is maximized.

We call this problemMaximizing Bichromatic Reverse Nearest Neighbor(MaxBRNN)

Two challenges:

Challenge 1: It is difficult to find a maximal consistent region

Challenge 2: We need to return the maximal consistent region with the greatest influence value

Nearest location circle (NLC)

P = {p1, p2}

O = {o1, o2}

Convenience stores

Customers

p1

p2

o1

o2

NN in P = p1Construct a circle centered at o1

with radius |p1, o1|

NN in P = p2

Construct a circle centered at o2

with radius |p2, o2|

Page 22: Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor

22

2. Problem

Problem: We want to find a maximalconsistent region R such that when the influence value of R is maximized.

We call this problemMaximizing Bichromatic Reverse Nearest Neighbor(MaxBRNN)

Two challenges:

Challenge 1: It is difficult to find a maximal consistent region

Challenge 2: We need to return the maximal consistent region with the greatest influence value

Nearest location circle (NLC)

P = {p1, p2}

O = {o1, o2}

Convenience stores

Customers

p1

p2

o1

o2

A

Page 23: Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor

23

2. Problem

Problem: We want to find a maximalconsistent region R such that when the influence value of R is maximized.

We call this problemMaximizing Bichromatic Reverse Nearest Neighbor(MaxBRNN)

Two challenges:

Challenge 1: It is difficult to find a maximal consistent region

Challenge 2: We need to return the maximal consistent region with the greatest influence value

Nearest location circle (NLC)

P = {p1, p2}

O = {o1, o2}

Convenience stores

Customers

p1

p2

o1

o2

AB

Page 24: Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor

24

2. Problem

Problem: We want to find a maximalconsistent region R such that when the influence value of R is maximized.

We call this problemMaximizing Bichromatic Reverse Nearest Neighbor(MaxBRNN)

Two challenges:

Challenge 1: It is difficult to find a maximal consistent region

Challenge 2: We need to return the maximal consistent region with the greatest influence value

Nearest location circle (NLC)

P = {p1, p2}

O = {o1, o2}

Convenience stores

Customers

p1

p2

o1

o2

AB

C

Page 25: Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor

25

2. Problem

Problem: We want to find a maximalconsistent region R such that when the influence value of R is maximized.

We call this problemMaximizing Bichromatic Reverse Nearest Neighbor(MaxBRNN)

Two challenges:

Challenge 1: It is difficult to find a maximal consistent region

Challenge 2: We need to return the maximal consistent region with the greatest influence value

Nearest location circle (NLC)

P = {p1, p2}

O = {o1, o2}

Convenience stores

Customers

p1

p2

o1

o2

AB

C

D

Page 26: Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor

26

2. Problem

Problem: We want to find a maximalconsistent region R such that when the influence value of R is maximized.

We call this problemMaximizing Bichromatic Reverse Nearest Neighbor(MaxBRNN)

Two challenges:

Challenge 1: It is difficult to find a maximal consistent region

Challenge 2: We need to return the maximal consistent region with the greatest influence value

Nearest location circle (NLC)

P = {p1, p2}

O = {o1, o2}

Convenience stores

Customers

p1

p2

o1

o2

AB

C

D

RNN set = {o1, o2}

RNN set = {o1}

RNN set = {o2}

RNN set = {}

Four maximal consistent regions

Solution: Region A

21 1

0

Intersection between two NLCs

Page 27: Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor

27

2. Problem

Problem: We want to find a maximalconsistent region R such that when the influence value of R is maximized.

We call this problemMaximizing Bichromatic Reverse Nearest Neighbor(MaxBRNN)

Two challenges:

Challenge 1: It is difficult to find a maximal consistent region

Challenge 2: We need to return the maximal consistent region with the greatest influence value

Nearest location circle (NLC)

p1

p2

o1

o2

AB

C

D

Four maximal consistent regions

Solution: Region A

Lemma: The solution of MaxBRNN can berepresented by an intersection ofmultiple nearest location circles.

Intersection between two NLCs

Page 28: Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor

28

2. Problem

Problem: We want to find a maximalconsistent region R such that when the influence value of R is maximized.

We call this problemMaximizing Bichromatic Reverse Nearest Neighbor(MaxBRNN)

Two challenges:

Challenge 1: It is difficult to find a maximal consistent region

Challenge 2: We need to return the maximal consistent region with the greatest influence value

We propose an algorithm called MaxOverlap

Page 29: Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor

29

3. Algorithm

Make use of the principle of region-to-point transformation

Optimal Region Search Problem

Optimal Point Search Problem

1. Search a limited number of points

2. Find the optimal point

This optimal point can be mapped to

the optimal region in Optimal Region

Search Problem

Page 30: Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor

30

3. Algorithm

o1

o2

o3

o4

o5

o6p

5

p4

p3

p2

p1

P = {p1, p2 , p3 , p4 , p5}

O = {o1, o2, o3 , o4, o5 , o6}

Convenience stores

Customers

Page 31: Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor

31

3. Algorithm

o1

o2

o3

o4

o5

o6p

5

p4

p3

p2

p1

Page 32: Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor

32

3. Algorithm

o1

o2

o3

o4

o5

o6

The maixmal consistent region which maximizes the RNN set

NLC c1

NLC c2

NLC c3

Intersection of c1, c2 and c3

Intersection of c1, c2 and c3Solution

Page 33: Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor

33

3. Algorithm

Algorithm MaxOverlap Three-Step Algorithm

Page 34: Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor

34

3. Algorithm

o1

o2

o3

o4

o5

o6

Step 1 (Finding Intersection Point)

Page 35: Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor

35

3. Algorithm

o1

o2

o3

o4

o5

o6

q8 q

9

q7

q6

q2

q3

q1

q5

q4

Step 1 (Finding Intersection Point)

Page 36: Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor

36

3. Algorithm

o1

o2

o3

o4

o5

o6

q8 q

9

q7

q6

q2

q3

q1

q5

q4

Step 2 (Point Query)

Point query for q4

Page 37: Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor

37

3. Algorithm

o1

o2

o3

o4

o5

o6

q8 q

9

q7

q6

q2

q3

q1

q5

q4

Step 2 (Point Query)

Point query for q4

Result for q4 = { }c1

Page 38: Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor

38

3. Algorithm

o1

o2

o3

o4

o5

o6

q8 q

9

q7

q6

q2

q3

q1

q5

q4

Step 2 (Point Query)

Point query for q4

Result for q4 = { }c1 , c3

Page 39: Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor

39

3. Algorithm

o1

o2

o3

o4

o5

o6

q8 q

9

q7

q6

q2

q3

q1

q5

q4

Step 2 (Point Query)

Point query for q3

Result for q4 = { }c1 , c3

Page 40: Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor

40

3. Algorithm

o1

o2

o3

o4

o5

o6

q8 q

9

q7

q6

q2

q3

q1

q5

q4

Step 2 (Point Query)

Point query for q3

Result for q4 = { }c1 , c3

Result for q3 = { }c1

Page 41: Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor

41

3. Algorithm

o1

o2

o3

o4

o5

o6

q8 q

9

q7

q6

q2

q3

q1

q5

q4

Step 2 (Point Query)

Point query for q3

Result for q4 = { }c1 , c3

Result for q3 = { }c1, c2

Page 42: Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor

42

3. Algorithm

o1

o2

o3

o4

o5

o6

q8 q

9

q7

q6

q2

q3

q1

q5

q4

Step 2 (Point Query)

Point query for q3

Result for q4 = { }c1 , c3

Result for q3 = { }c1, c2, c3

Page 43: Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor

43

3. Algorithm

o1

o2

o3

o4

o5

o6

q8 q

9

q7

q6

q2

q3

q1

q5

q4

Step 2 (Point Query)

Point query for q1

Result for q4 = { }c1 , c3

Result for q1 = { }c1, c2, c3

Result for q3 = { }c1, c2, c3

Page 44: Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor

44

3. Algorithm

o1

o2

o3

o4

o5

o6

q8 q

9

q7

q6

q2

q3

q1

q5

q4

Step 2 (Point Query)

Result for q4 = { }c1 , c3

Result for q1 = { }c1, c2, c3

Result for q5 = { }c1, c2, c3

Point query for q5

Result for q3 = { }c1, c2, c3

Page 45: Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor

45

Result for q3 = { }c1, c2, c3

3. Algorithm

o1

o2

o3

o4

o5

o6

q8 q

9

q7

q6

q2

q3

q1

q5

q4

Step 3 (Finding Maximum Size)

Result for q4 = { }c1 , c3

Result for q1 = { }c1, c2, c3

Result for q5 = { }c1, c2, c3

The intersection of c1, c2 and c3 corresponds to the solution.

Optimal Region Search Problem

Optimal Point Search Problem

Page 46: Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor

46

3. Algorithm Theorem: The running time of

algorithm MaxOverlap is

O(|O| log |P| + k2|O| + k |O| log |O|)

where k is typically much smaller than |O|

Page 47: Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor

47

3. Algorithm

Enhancement 1: We process the intersection points q in a pre-defined order

Enhancement 2: Step 2 and Step 3 can be combined We introduce a pruning technique

such that some intersection points will not be processed.

Page 48: Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor

48

4. Empirical Study Synthetic Dataset

P: Gaussian distribution O: Zipfian distribution

Real Dataset Rtree Portal

http://www.rtreeportal.org/spatial.html CA (62,556) LB (53,145) GR (23,268) GM (36,334)

P: one of the above datasets O: one of the above datasets

Page 49: Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor

49

4. Empirical Study Measurements

Execution Time Storage

Our proposed algorithms MaxOverlap-P

MaxOverlap with Pruning MaxOverlap-NP

MaxOverlap without pruning Comparison with adapted algorithms

Arrangement Buffer-Adapt

Page 50: Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor

50

4. Empirical Study Small dataset

Page 51: Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor

51

4. Empirical Study Large dataset

Page 52: Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor

52

5. Conclusion

Problem MaxBRNN Maximizing Bichromatic Reverse

Nearest Neighbor Algorithm MaxOverlap

Theoretical Analysis of Running Time Significant Improvement on Running

Time Experiments

Page 53: Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor

53

Q&A

Page 54: Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor

54

1. Introduction Arrangement

Idea: search regions in the space There are an exponential number of

regions Our algorithm MaxOverlap

Idea: make use of the principle of region-to-point transformation

Optimal Region Search Problem

Optimal Point Search Problem

1. Search a limited number of points

2. Find the optimal point

This optimal point can be mapped to

the optimal region in Optimal Region

Search Problem

Page 55: Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor

55

1. Introduction Related Work

We are studying problem MaxBRNN over the L2-norm (i.e., Euclidean distance)

Buffer Studies problem MaxBRNN over the L1-norm (i.e., Manhattan

distance) Buffer-Adapt

Heuristic algorithm over the L2-norm Our algorithm MaxOverlap runs faster than Buffer-

Adapt

Page 56: Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor

56

1. Introduction Related Work

Buffer-Adapt Running Time = O(|O| log |P| + L2k |O| + L2 |O| log |O|)

where L > k

Our Proposed Algorithm MaxOverlap Running Time = O(|O| log |P| + k2 |O| +k |O| log |

O|)where k << |O|

Significant improvementon Running Time

Problem: We want to find a region R(or area) such that when p is placedin R, the influence value of p is maximized.

Page 57: Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor

57

1. Introduction Applications

Traditional applications which exist in BRNN also applied to MaxBRNN

Service Location Planning Convenience store, supermarket, coffee shop, ATM,

wireless routers, … Profile-based Marketing Natural disaster (e.g., earthquake in China)

Place supply/service centers for rescue or relief jobs Big event (e.g., US presidential campaign)

Place police force for security Military

Place some temporary depots for gasoline and food

Page 58: Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor

58

1. Introduction NN: Nearest neighborRNN: Reverse nearest neighbor

P = {p1, p2}

O = {o1, o2, o3 , o4, o5}

Convenience stores

Customers

p1

p2

o1

o2

o3

o4

o5

Suppose that we want to set upa new convenience store p

Where should we set up?

Problem: We want to find a region R(or area) such that when p is placedin R, the influence value of p is maximized.

Placement 1 RNN = {o1, o2}

Placement 2 RNN = {o1, o2 , o3, o4 , o5}

Placement 3 RNN = {o1, o2 , o3, o4 , o5}

2

5

5

There are many arbitrary regions!

Consistent region

Many consistent regions!

Page 59: Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor

59

3. Algorithm

If the solution is the region with the influence value = 1, any one of NLCs is the solution

o2

o1p

1

p2o

3

p3

Page 60: Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor

60

3. Algorithm

If the solution is the region with the influence value = 1, any one of NLCs is the solution

If the solution is the region with the influence value > 1, finding this solution is more

complicated

Page 61: Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor

61

3. Algorithm

o1

o2

o3

o4

o5

o6

Intersection of c1, c2 and c3Solution

Page 62: Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor

62

3. Algorithm

Step 1 (Finding Intersection Point) We find a set Q of all intersection points between the

boundaries of any two overlapping NLCs Step 2 (Point Query)

For each point q in Q, we perform a point query for q to find a set S of NLCs covering q

Step 3 (Finding Maximum Size) We choose set S with the largest size obtained in the above step

Page 63: Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor

63

3. Algorithm

o1

o2

o3

o4

o5

o6

q8 q

9

q7

q6

q2

q3

q1

q5

q4

This region contains at least one intersection point (e.g., q1, q3 and q5)

Intersection point betweenthe boundaries of two NLCs

Observation 1

Intersection of c1, c2 and c3Solution

Page 64: Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor

64

3. Algorithm

o1

o2

o3

o4

o5

o6

q8 q

9

q7

q6

q2

q3

q1

q5

q4

This region contains at least one intersection point (e.g., q1, q3 and q5)

Observation 1

Intersection of c1, c2 and c3Solution

Suppose we perform a point query for q1 to find all NLCs covering q1

Result = { }c1

Page 65: Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor

65

3. Algorithm

o1

o2

o3

o4

o5

o6

q8 q

9

q7

q6

q2

q3

q1

q5

q4

This region contains at least one intersection point (e.g., q1, q3 and q5)

Observation 1

Intersection of c1, c2 and c3Solution

Suppose we perform a point query for q1 to find all NLCs covering q1

Result = { }c1, c2

Page 66: Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor

66

3. Algorithm

o1

o2

o3

o4

o5

o6

q8 q

9

q7

q6

q2

q3

q1

q5

q4

This region contains at least one intersection point (e.g., q1, q3 and q5)

Observation 1

Intersection of c1, c2 and c3Solution

Suppose we perform a point query for q1 to find all NLCs covering q1

Result = { }c1, c2, c3

Same set of NLCs

Page 67: Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor

67

3. Algorithm

o1

o2

o3

o4

o5

o6

q8 q

9

q7

q6

q2

q3

q1

q5

q4

This region contains at least one intersection point (e.g., q1, q3 and q5)

Observation 1

Intersection of c1, c2 and c3Solution

Suppose we perform a point query for q3 to find all NLCs covering q3

Result = { }c1

Page 68: Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor

68

3. Algorithm

o1

o2

o3

o4

o5

o6

q8 q

9

q7

q6

q2

q3

q1

q5

q4

This region contains at least one intersection point (e.g., q1, q3 and q5)

Observation 1

Intersection of c1, c2 and c3Solution

Suppose we perform a point query for q3 to find all NLCs covering q3

Result = { }c1, c2

Page 69: Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor

69

3. Algorithm

o1

o2

o3

o4

o5

o6

q8 q

9

q7

q6

q2

q3

q1

q5

q4

This region contains at least one intersection point (e.g., q1, q3 and q5)

Observation 1

Intersection of c1, c2 and c3Solution

Suppose we perform a point query for q3 to find all NLCs covering q3

Result = { }c1, c2, c3

Same set of NLCs

Page 70: Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor

70

3. Algorithm

o1

o2

o3

o4

o5

o6

q8 q

9

q7

q6

q2

q3

q1

q5

q4

This region contains at least one intersection point (e.g., q1, q3 and q5)

Observation 1

Intersection of c1, c2 and c3Solution

Suppose we perform a point query for q5 to find all NLCs covering q5

Result = { }c1

Page 71: Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor

71

3. Algorithm

o1

o2

o3

o4

o5

o6

q8 q

9

q7

q6

q2

q3

q1

q5

q4

This region contains at least one intersection point (e.g., q1, q3 and q5)

Observation 1

Intersection of c1, c2 and c3Solution

Suppose we perform a point query for q5 to find all NLCs covering q5

Result = { }c1, c2

Page 72: Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor

72

3. Algorithm

o1

o2

o3

o4

o5

o6

q8 q

9

q7

q6

q2

q3

q1

q5

q4

This region contains at least one intersection point (e.g., q1, q3 and q5)

Observation 1

Intersection of c1, c2 and c3Solution

Suppose we perform a point query for q5 to find all NLCs covering q5

Result = { }c1, c2, c3

Same set of NLCs

Observation 2

The result of the point query foreach of these intersection pointscan be used to denote thefinal solution

Page 73: Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor

73

3. Algorithm

o1

o2

o3

o4

o5

o6

q8 q

9

q7

q6

q2

q3

q1

q5

q4

This region contains at least one intersection point (e.g., q1, q3 and q5)

Observation 1

Observation 2

The result of the point query foreach of these intersection pointscan be used to denote thefinal solution

Optimal Region Search Problem

Optimal Point Search Problem

Page 74: Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor

74

3. Algorithm

o1

o2

o3

o4

o5

o6

q8 q

9

q7

q6

q2

q3

q1

q5

q4

Intersection of c1, c2 and c3Solution

Page 75: Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor

75

3. Algorithm

o1

o2

o3

o4

o5

o6

Intersection of c1, c2 and c3SolutionNLC L(c)

c1 c2, c3

c2 c1, c3

c3 c1, c2, c4

c4 c3

c5 c6

c6 c5

Overlap table2

2

3

1

1

1

c3 overlaps with more NLCs

We process c3 first becauseit is more likely that the solution involves c3

q3

q4

Point query for q4

Result for q4 = { }c1 , c3

Temp. Solution {c1, c3}

Page 76: Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor

76

3. Algorithm

o1

o2

o3

o4

o5

o6

Intersection of c1, c2 and c3SolutionNLC L(c)

c1 c2, c3

c2 c1, c3

c3 c1, c2, c4

c4 c3

c5 c6

c6 c5

Overlap table2

2

3

1

1

1

c3 overlaps with more NLCs

We process c3 first becauseit is more likely that the solution involves c3

q3

q4

Result for q4 = { }c1 , c3

Temp. Solution {c1, c3}

Point query for q3

Result for q3 = { }c1, c2, c3

{c1, c2 , c3}

Page 77: Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor

77

3. Algorithm

o1

o2

o3

o4

o5

o6

Intersection of c1, c2 and c3SolutionNLC L(c)

c1 c2, c3

c2 c1, c3

c3 c1, c2, c4

c4 c3

c5 c6

c6 c5

Overlap table2

2

3

1

1

1

c3 overlaps with more NLCs

We process c3 first becauseit is more likely that the solution involves c3

q3

q4

Result for q4 = { }c1 , c3

Temp. Solution {c1, c3}

Result for q3 = { }c1, c2, c3

{c1, c2 , c3}

q2

q1

Point query for q1

Result for q1 = { }c1, c2, c3

Page 78: Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor

78

3. Algorithm

o1

o2

o3

o4

o5

o6

Intersection of c1, c2 and c3SolutionNLC L(c)

c1 c2, c3

c2 c1, c3

c3 c1, c2, c4

c4 c3

c5 c6

c6 c5

Overlap table2

2

3

1

1

1

q3

q4

Result for q4 = { }c1 , c3

Temp. Solution {c1, c3}

Result for q3 = { }c1, c2, c3

{c1, c2 , c3}

q2

q1

Result for q1 = { }c1, c2, c3

Suppose we have processed c1 and c2

Page 79: Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor

79

3. Algorithm

o1

o2

o3

o4

o5

o6

Intersection of c1, c2 and c3SolutionNLC L(c)

c1 c2, c3

c2 c1, c3

c3 c1, c2, c4

c4 c3

c5 c6

c6 c5

Overlap table2

2

3

1

1

1

q3

q4

Result for q4 = { }c1 , c3

Temp. Solution {c1, c3}

Result for q3 = { }c1, c2, c3

{c1, c2 , c3}

q2

q1

Result for q1 = { }c1, c2, c3

Suppose we want to process c5

3

c5 overlaps at most 1 NLC

Any intersection points from c5 havethe influence value at most 2

Pruning: Since 2 < 3, we do NOT need to process c5.

Lemma: Let I be the influence value found so far.Consider an NLC c.If |L(c)|+1 < I, we do not need to process c.

Page 80: Efficient Method for Maximizing Bichromatic Reverse Nearest Neighbor

80

4. Empirical Study

Nearest Location Circle (NLC) Construction Involve NN queries over P Build R*-tree on P

Step 2 Involve Point Queries over NLC Build R*-tree on all NLCs