On Efficient Spatial Matching Raymond Chi-Wing Wong (the Chinese - - PowerPoint PPT Presentation

on efficient spatial matching
SMART_READER_LITE
LIVE PREVIEW

On Efficient Spatial Matching Raymond Chi-Wing Wong (the Chinese - - PowerPoint PPT Presentation

On Efficient Spatial Matching Raymond Chi-Wing Wong (the Chinese University of Hong Kong) Yufei Tao (the Chinese University of Hong Kong) Ada Wai-Chee Fu (the Chinese University of Hong Kong) Xiaokui Xiao (the Chinese University of Hong Kong)


slide-1
SLIDE 1

On Efficient Spatial Matching

Raymond Chi-Wing Wong (the Chinese University of Hong Kong) Yufei Tao (the Chinese University of Hong Kong) Ada Wai-Chee Fu (the Chinese University of Hong Kong) Xiaokui Xiao (the Chinese University of Hong Kong)

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

slide-2
SLIDE 2

Outline

1. Introduction

  • Related work – Bichromatic Reverse Nearest Neighbor

2. Problem

  • Spatial Matching Problem (SPM)
  • Unweighted SPM
  • Weighted SPM

3. Algorithm

  • Chain (for unweighed SPM)
  • Weighted Chain (for weighted SPM)

4. Empirical Study 5. Conclusion

slide-3
SLIDE 3
  • 1. Introduction

Bichromatic Reverse Nearest Neighbor

(BRNN)

Given

P and O are two sets of objects in the same data

space

Problem

Given an object p∈P, a BRNN query finds all the

  • bjects o∈O whose nearest neighbor (NN) in P are p.
slide-4
SLIDE 4
  • 1. Introduction

NN in P = p1 NN: Nearest neighbor RNN: Reverse nearest neighbor p3 p2 p1

  • 1
  • 2
  • 3

NN in P = p1 NN in P = p1 RNN = { o1, o2, o3} RNN = { } RNN = { } P = { p1, p2, p3} O = { o1, o2, o3} Polling places Residential estates

slide-5
SLIDE 5
  • 1. Introduction

NN: Nearest neighbor RNN: Reverse nearest neighbor p3 p2 p1

  • 1
  • 2
  • 3

RNN = { o1, o2, o3} P = { p1, p2, p3} O = { o1, o2, o3} Polling places Residential estates However, this assignment is not suitable because each polling place has a

“serving capacity”.

slide-6
SLIDE 6
  • 1. Introduction

NN: Nearest neighbor RNN: Reverse nearest neighbor p3 p2 p1

  • 1
  • 2
  • 3

RNN = { o1, o2, o3} P = { p1, p2, p3} O = { o1, o2, o3} Polling places Residential estates 7k 3k 4k 10k 10k 10k The total population from o1, o2 and o3 is equal to 14k, which is greater than the capacity of p1 Thus, bichromatic RNN cannot handle this assignment problem.

Problem: to find an assignment

between P and O with the consideration of the population

  • f pi∈P and the capacity of oj∈O.

Spatial matching (SPM)

I dea: SPM aims at allocating each estate o ∈ O

to the polling-place p ∈ P that (i) is as near to o as possible, and (ii) its servicing capacity has not been exhausted in serving

  • ther closer estates.
slide-7
SLIDE 7
  • 2. Problem
  • 1. Unweighted SPM
  • Population of pi∈P (denoted by pi.w) = 1
  • Capacity of oj∈O (denoted by oj.w) = 1
  • 2. Weighted SPM
  • Population of pi∈P (denoted by pi.w) ≥ 1
  • Capacity of oj∈O (denoted by oj.w) ≥ 1
slide-8
SLIDE 8
  • 2. Problem

Theorem: The problem of computing

the BRNN set of each object p∈P is an instance of weighted SPM, where

p.w = |O| for every p∈P and

  • .w= 1 for every o∈O.

Weighted SPM BRNN

slide-9
SLIDE 9
  • 2. Problem

Related Work

Closest Pair

Running time = O(|P| x |O| 2)

Stable Marriage

A classical problem in Computer Science Running time = O(|P| x |O|)

Our Proposed Algorithm Chain

Running time = O( |O| x logO(1) |P| ) Significant improvement on running time

slide-10
SLIDE 10
  • 2. Problem

p3 p2 p1

  • 1
  • 2
  • 3

P = { p1, p2, p3} O = { o1, o2, o3} Polling places Residential estates 1 1 1 1 1 1

Problem: to find an assignment

between P and O with the consideration of the population

  • f pi∈P and the capacity of oj∈O.

Spatial matching (SPM) Unweighted SPM How can we perform an assignment between P and O?

slide-11
SLIDE 11
  • 2. Problem

p3 p2 p1

  • 1
  • 2
  • 3

P = { p1, p2, p3} O = { o1, o2, o3} Polling places Residential estates 1 1 1 1 1 1

Problem: to find an assignment

between P and O with the consideration of the population

  • f pi∈P and the capacity of oj∈O.

Spatial matching (SPM) Unweighted SPM How can we perform an assignment between P and O? First, we consider an assignment A.

slide-12
SLIDE 12
  • 2. Problem

p3 p2 p1

  • 1
  • 2
  • 3

P = { p1, p2, p3} O = { o1, o2, o3} Polling places Residential estates 1 1 1 1 1 1

Problem: to find an assignment

between P and O with the consideration of the population

  • f pi∈P and the capacity of oj∈O.

Spatial matching (SPM) Unweighted SPM How can we perform an assignment between P and O? (p2, o3) is a dangling pair. |p2, o3| < |p2, o2| First, we consider an assignment A. (p, o) is a dangling pair if

  • 1. |p, o| < the distance between o

and its partner in A

  • 2. |p, o| < the distance between p

and its partner in A

slide-13
SLIDE 13
  • 2. Problem

p3 p2 p1

  • 1
  • 2
  • 3

P = { p1, p2, p3} O = { o1, o2, o3} Polling places Residential estates 1 1 1 1 1 1

Problem: to find an assignment

between P and O with the consideration of the population

  • f pi∈P and the capacity of oj∈O.

Spatial matching (SPM) Unweighted SPM How can we perform an assignment between P and O? (p2, o3) is a dangling pair. |p2, o3| < |p2, o2| |p2, o3| < |p3, o3| First, we consider an assignment A. (p, o) is a dangling pair if

  • 1. |p, o| < the distance between o

and its partner in A

  • 2. |p, o| < the distance between p

and its partner in A If the assignment A does NOT contain any dangling pair, then the assignment is fair. This assignment is NOT fair because we find a dangling pair.

slide-14
SLIDE 14
  • 2. Problem

p3 p2 p1

  • 1
  • 2
  • 3

P = { p1, p2, p3} O = { o1, o2, o3} Polling places Residential estates 1 1 1 1 1 1

Problem: to find an assignment

between P and O with the consideration of the population

  • f pi∈P and the capacity of oj∈O.

Spatial matching (SPM) Unweighted SPM (p, o) is a dangling pair if

  • 1. |p, o| < the distance between o

and its partner in A

  • 2. |p, o| < the distance between p

and its partner in A If the assignment A does NOT contain any dangling pair, then the assignment is fair. This assignment is fair because we cannot find a dangling pair.

slide-15
SLIDE 15
  • 2. Problem

Unweighted SPM

Dangling pair

Weighted SPM

Dangling pair

slide-16
SLIDE 16
  • 3. Algorithm

Un-weighted SPM problem

Algorithm (Un-weighted) Chain

Weighted SPM problem

Algorithm Weighted Chain

slide-17
SLIDE 17

3.1 Algorithm

Algorithm Chain makes use of

bichromatic mutual NN to find the

fair assignment.

An object p ∈ P and an object o ∈ O

are bichromatic mutual NN if

p is the NN of o in P and

  • is the NN of p in O
slide-18
SLIDE 18

3.1 Algorithm

p3 p2 p1 p4

  • 1
  • 2
  • 3
  • 4

Unweighted SPM

slide-19
SLIDE 19

3.1 Algorithm

p3 p2 p1 p4

  • 1
  • 2
  • 3
  • 4

(p3, o3) is a pair of mutual NN. (p3, o3) corresponds to a match. We can remove it. Assignment = { } (p3, o3) Unweighted SPM

slide-20
SLIDE 20

3.1 Algorithm

p2 p1 p4

  • 1
  • 2
  • 4

(p2, o2) is a pair of mutual NN. (p2, o2) corresponds to a match. We can remove it. Assignment = { } (p3, o3) , (p2, o2) Unweighted SPM

slide-21
SLIDE 21

3.1 Algorithm

p1 p4

  • 1
  • 4

(p4, o4) is a pair of mutual NN. (p4, o4) corresponds to a match. We can remove it. Assignment = { } (p3, o3) , (p2, o2) (p4, o4) , Unweighted SPM

slide-22
SLIDE 22

3.1 Algorithm

p1

  • 1

(p1, o1) is a pair of mutual NN. (p1, o1) corresponds to a match. We can remove it. Assignment = { } (p3, o3) , (p2, o2) (p4, o4) , , (p1, o1) Unweighted SPM

slide-23
SLIDE 23

3.1 Algorithm

p1

  • 1

Assignment = { } (p3, o3) , (p2, o2) (p4, o4) , , (p1, o1) p4

  • 4

p2

  • 2

p3

  • 3

We prove that this assignment is fair. We can find a fair assignment by repeatedly removing pairs of mutual NN. But, how can we find a pair

  • f mutual NN efficiently?

We propose Algorithm Chain to perform mutual NN search efficiently. Unweighted SPM

slide-24
SLIDE 24

3.1 Algorithm

Find the first mutual NN (nearest

neighbor) and remove it

Find the second mutual NN and remove

it

… Find the n-th mutual NN and remove it

slide-25
SLIDE 25

3.1 Algorithm Chain

p1

  • 1

p4

  • 4

p2

  • 2

p3

  • 3

From o1, find NN in P (i.e., p1) Unweighted SPM Randomly find a data point o

slide-26
SLIDE 26

3.1 Algorithm Chain

p1

  • 1

p4

  • 4

p2

  • 2

p3

  • 3

From p1, find NN in O (i.e., o2) Since o2 is NOT equal to o1, (p1, o1) is not a pair of mutual NN. We need to continue the process. Unweighted SPM

slide-27
SLIDE 27

3.1 Algorithm Chain

p1

  • 1

p4

  • 4

p2

  • 2

p3

  • 3

From o2, find NN in P (i.e., p2) Since p2 is NOT equal to p1, (p1, o2) is not a pair of mutual NN. We need to continue the process. Unweighted SPM Note that we are expanding a chain from data point o1.

slide-28
SLIDE 28

3.1 Algorithm Chain

p1

  • 1

p4

  • 4

p2

  • 2

p3

  • 3

From p2, find NN in O (i.e., o2) Now, we find a pair of mutual NN (p2, o2). We can remove it. Assignment = { } (p2, o2) Unweighted SPM

slide-29
SLIDE 29

3.1 Algorithm Chain

p1

  • 1

p4

  • 4

p3

  • 3

Assignment = { } (p2, o2) Unweighted SPM We find the FIRST mutual NN. Should we perform similar steps to find the SECOND mutual NN? That is, should we randomly select a data point again and re-start the chain?

  • Yes. We can do in this way.

But, it is NOT efficient. Instead, we can re-use the existing chain to find the SECOND mutual NN.

slide-30
SLIDE 30

3.1 Algorithm Chain

p1

  • 1

p4

  • 4

p3

  • 3

From p1, find NN in O (i.e., o4) Since o4 is NOT equal to o1, (p1, o1) is not a pair of mutual NN. We need to continue the process. Assignment = { } (p2, o2) Unweighted SPM

slide-31
SLIDE 31

3.1 Algorithm Chain

p1

  • 1

p4

  • 4

p3

  • 3

From o4, find NN in P (i.e., p4) Since p4 is NOT equal to p1, (p1, o4) is not a pair of mutual NN. We need to continue the process. Assignment = { } (p2, o2) Unweighted SPM

slide-32
SLIDE 32

3.1 Algorithm Chain

p1

  • 1

p4

  • 4

p3

  • 3

From p4, find NN in O (i.e., o4) Now, we find a pair of mutual NN (p4, o4). We can remove it. Assignment = { } (p2, o2) , (p4, o4) Unweighted SPM

slide-33
SLIDE 33

3.1 Algorithm Chain

p1

  • 1

p3

  • 3

From p1, find NN in O (i.e., o1) Now, we find a pair of mutual NN (p1, o1). We can remove it. Assignment = { } (p2, o2) , (p4, o4) (p1, o1) , Unweighted SPM

slide-34
SLIDE 34

3.1 Algorithm Chain

p3

  • 3

From o3, find NN in P (i.e., p3) Assignment = { } (p2, o2) , (p4, o4) (p1, o1) , Unweighted SPM Randomly find a data point o

slide-35
SLIDE 35

3.1 Algorithm Chain

p3

  • 3

From p3, find NN in O (i.e., o3) Now, we find a pair of mutual NN (p3, o3). We can remove it. Assignment = { } (p2, o2) , (p4, o4) (p1, o1) , , (p3, o3) Unweighted SPM

slide-36
SLIDE 36

3.1 Algorithm Chain

Theorem: (Un-weighted) Chain performs at most

3|O| NN queries and exactly 2|O| object deletions.

Theorem: The running time of (Un-weighted)

Chain is O( |O| x ( α(|P|)+ β(|P|) ) )

α(n): worst case complexity of an NN query on dataset of size n β(n): worst case complexity of an object deletion on dataset of size n

α(n) and β(n) can be accomplished in O(logO(1)(n)).

Thus, the running time is O( |O| x logO(1) |P| ) Unweighted SPM

T.M. Chan, A Dynamic Data Structure for 3-d Convex Hulls and 2-d Nearest Neighbor Queries, SODA 2006

slide-37
SLIDE 37

3.2 Algorithm Weighted Chain

Similar to (Unweighted) Chain Consider the population and the

capacity of each point

slide-38
SLIDE 38

3.2 Algorithm Weighted Chain

p3 p2 p1

  • 1
  • 2
  • 3

10 10 10 15 20 10 Weighted SPM

slide-39
SLIDE 39

3.2 Algorithm Weighted Chain

p3 p2 p1

  • 1
  • 2
  • 3

10 10 10 15 20 10 From o1, find NN in P (i.e., p1) Weighted SPM

slide-40
SLIDE 40

3.2 Algorithm Weighted Chain

p3 p2 p1

  • 1
  • 2
  • 3

10 10 10 15 20 10 From p1, find NN in O (i.e., o2) Since o2 is NOT equal to o1, (p1, o1) is not a pair of mutual NN. We need to continue the process. Weighted SPM

slide-41
SLIDE 41

3.2 Algorithm Weighted Chain

p3 p2 p1

  • 1
  • 2
  • 3

10 10 10 15 20 10 From o2, find NN in P (i.e., p1) Now, we find a pair of mutual NN (p1, o2). We can remove (p1, o2, 10). Assignment = { } (p1, o2, 10) Weighted SPM

slide-42
SLIDE 42

3.2 Algorithm Weighted Chain

p3 p2 p1

  • 1
  • 3

10 10 15 10 10 From p1, find NN in O (i.e., o3) Assignment = { } (p1, o2, 10) Since o3 is NOT equal to o1, (p1, o1) is not a pair of mutual NN. We need to continue the process. Weighted SPM Similar steps are performed.

slide-43
SLIDE 43

3.2 Algorithm Weighted Chain

Theorem: Weighted Chain performs at most 3(|P|

+ |O|) NN queries and at most |P| + |O| object deletions

Theorem: The running time of Weighted Chain is

O( (|P| + |O|) x ( α(|P|)+ β(|P|)+ α(|O|)+ β(|O|)) )

α(n): worst case complexity of an NN query on dataset of size n β(n): worst case complexity of an object deletion on dataset of size n

α(n) and β(n) can be accomplished in O(logO(1)(n)).

Thus, the running time is O( (|P| + |O|) x (logO(1) |P| + logO(1) |O|) ) Weighted SPM

slide-44
SLIDE 44
  • 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

slide-45
SLIDE 45
  • 4. Empirical Study

NN query in Chain

Build R* -tree on P Build R* -tree on O

slide-46
SLIDE 46
  • 4. Empirical Study

Measurements

Execution Time Memory Usage Total no. of NN queries/|O| Total no. of NN queries/(|P| + |O|)

Comparison with adapted algorithms

Gale-Shapley Closest Pair

slide-47
SLIDE 47
  • 4. Empirical Study

Un-weighted SPM

slide-48
SLIDE 48
  • 4. Empirical Study

Weighted SPM

slide-49
SLIDE 49
  • 4. Empirical Study

Real Data Set

slide-50
SLIDE 50
  • 5. Conclusion

Un-weighted and Weighted Spatial

Matching Problem

A general model of BRNN

Algorithm Chain

Theoretical Analysis of Running Time Significant Improvement on Running Time

Experiments

slide-51
SLIDE 51

FAQ

slide-52
SLIDE 52

Stable Marriage

Two sets O (for woman) and P (for man) For each woman o ∈ O,

there is a preference list which sorts the men in descending

  • rder of how much o loves them.

For each man p ∈ P,

there is a preference list which sorts the women in

descending order of how much p loves them.

Stable Marriage

the absence of a man p and a woman o, such that

p loves o more than his current partner, and

  • loves p more than her current partner.
slide-53
SLIDE 53

Stable Marriage

Reduction to Stable Marriage

For each o ∈ O

We create a preference list in ascending order of

|o, p| for all p ∈ P

For each p ∈ P

We create a preference list in ascending order of

|o, p| for all o ∈ O

slide-54
SLIDE 54
  • 2. Problem

p3 p2 p1

  • 1
  • 2
  • 3

P = { p1, p2, p3} O = { o1, o2, o3} Polling places Residential estates 7k 3k 4k 10k 10k 10k

Problem: to find an assignment

between P and O with the consideration of the population

  • f pi∈P and the capacity of oj∈O.

Spatial matching (SPM) Weighted SPM How can we perform an assignment between P and O? First, we consider an assignment A.

slide-55
SLIDE 55
  • 2. Problem

p3 p2 p1

  • 1
  • 2
  • 3

P = { p1, p2, p3} O = { o1, o2, o3} Polling places Residential estates 7k 3k 4k 10k 10k 10k

Problem: to find an assignment

between P and O with the consideration of the population

  • f pi∈P and the capacity of oj∈O.

Spatial matching (SPM) Weighted SPM How can we perform an assignment between P and O? First, we consider an assignment A. 3k 4k 3k 4k

slide-56
SLIDE 56
  • 2. Problem

p3 p2 p1

  • 1
  • 2
  • 3

P = { p1, p2, p3} O = { o1, o2, o3} Polling places Residential estates 7k 3k 4k 10k 10k 10k

Problem: to find an assignment

between P and O with the consideration of the population

  • f pi∈P and the capacity of oj∈O.

Spatial matching (SPM) Weighted SPM How can we perform an assignment between P and O? |p1, o1| < |p2, o1| First, we consider an assignment A. 4k 3k 4k (p1, o1) is a dangling pair. 3k (p, o) is a dangling pair if

  • 1. |p, o| < the distance between o

and some of its partners in A

  • 2. |p, o| < the distance between p

and some of its partners in A

slide-57
SLIDE 57
  • 2. Problem

p3 p2 p1

  • 1
  • 2
  • 3

P = { p1, p2, p3} O = { o1, o2, o3} Polling places Residential estates 7k 3k 4k 10k 10k 10k

Problem: to find an assignment

between P and O with the consideration of the population

  • f pi∈P and the capacity of oj∈O.

Spatial matching (SPM) Weighted SPM How can we perform an assignment between P and O? |p1, o1| < |p1, o2| First, we consider an assignment A. (p, o) is a dangling pair if

  • 1. |p, o| < the distance between o

and some of its partners in A

  • 2. |p, o| < the distance between p

and some of its partners in A If the assignment A does NOT contain any dangling pair, then the assignment is fair. 4k 3k 4k (p1, o1) is a dangling pair. 3k |p1, o1| < |p2, o1| This assignment is NOT fair because we find a dangling pair.

slide-58
SLIDE 58
  • 2. Problem

p3 p2 p1

  • 1
  • 2
  • 3

P = { p1, p2, p3} O = { o1, o2, o3} Polling places Residential estates 7k 3k 4k 10k 10k 10k

Problem: to find an assignment

between P and O with the consideration of the population

  • f pi∈P and the capacity of oj∈O.

Spatial matching (SPM) Weighted SPM (p, o) is a dangling pair if

  • 1. |p, o| < the distance between o

and some of its partners in A

  • 2. |p, o| < the distance between p

and some of its partners in A If the assignment A does NOT contain any dangling pair, then the assignment is fair. This assignment is fair because we cannot find a dangling pair. 4k 3k 7k

slide-59
SLIDE 59

3.2 Algorithm Weighted Chain

p3 p2 p1

  • 1
  • 2
  • 3

10 10 10 15 20 10 Weighted SPM

slide-60
SLIDE 60

3.2 Algorithm Weighted Chain

p3 p2 p1

  • 1
  • 2
  • 3

10 10 10 15 20 10 From o1, find NN in P (i.e., p1) Weighted SPM

slide-61
SLIDE 61

3.2 Algorithm Weighted Chain

p3 p2 p1

  • 1
  • 2
  • 3

10 10 10 15 20 10 From p1, find NN in O (i.e., o2) Since o2 is NOT equal to o1, (p1, o1) is not a pair of mutual NN. We need to continue the process. Weighted SPM

slide-62
SLIDE 62

3.2 Algorithm Weighted Chain

p3 p2 p1

  • 1
  • 2
  • 3

10 10 10 15 20 10 From o2, find NN in P (i.e., p1) Now, we find a pair of mutual NN (p1, o2). We can remove (p1, o2, 10). Assignment = { } (p1, o2, 10) Weighted SPM

slide-63
SLIDE 63

3.2 Algorithm Weighted Chain

p3 p2 p1

  • 1
  • 3

10 10 15 10 10 From p1, find NN in O (i.e., o3) Assignment = { } (p1, o2, 10) Since o3 is NOT equal to o1, (p1, o1) is not a pair of mutual NN. We need to continue the process. Weighted SPM

slide-64
SLIDE 64

3.2 Algorithm Weighted Chain

p3 p2 p1

  • 1
  • 3

10 10 15 10 10 From o3, find NN in P (i.e., p1) Assignment = { } (p1, o2, 10) Now, we find a pair of mutual NN (p1, o3). We can remove (p1, o3, 10). , (p1, o3, 10) Weighted SPM

slide-65
SLIDE 65

3.2 Algorithm Weighted Chain

p3 p2

  • 1
  • 3

10 10 5 10 From o1, find NN in P (i.e., p2) Assignment = { } (p1, o2, 10), (p1, o3, 10) Weighted SPM

slide-66
SLIDE 66

3.2 Algorithm Weighted Chain

p3 p2

  • 1
  • 3

10 10 5 10 From p2, find NN in O (i.e., o1) Assignment = { } (p1, o2, 10), (p1, o3, 10) Now, we find a pair of mutual NN (p2, o1). We can remove (p2, o1, 10). (p2, o1, 10) , Weighted SPM

slide-67
SLIDE 67

3.2 Algorithm Weighted Chain

p3

  • 3 5

10 From o3, find NN in P (i.e., p3) Assignment = { } (p1, o2, 10), (p1, o3, 10) (p2, o1, 10) , Weighted SPM

slide-68
SLIDE 68

3.2 Algorithm Weighted Chain

p3

  • 3 5

10 From p3, find NN in O (i.e., o3) Assignment = { } (p1, o2, 10), (p1, o3, 10) (p2, o1, 10) , Now, we find a pair of mutual NN (p3, o3). We can remove (p3, o3, 5). , (p3, o3, 5) Weighted SPM