The Well-Separated Pair Decomposition The Well-Separated M. Farshi - - PowerPoint PPT Presentation

the well separated pair decomposition
SMART_READER_LITE
LIVE PREVIEW

The Well-Separated Pair Decomposition The Well-Separated M. Farshi - - PowerPoint PPT Presentation

The Well-Separated Pair Decomposition The Well-Separated M. Farshi Pair Decomposition Lab. of Combinatorial and Geometric Algorithms, M. Farshi Department of Computer Science, Definition of Yazd University WSPD Compute WSPD The Split


slide-1
SLIDE 1

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

The Well-Separated Pair Decomposition

  • M. Farshi
  • Lab. of Combinatorial and Geometric Algorithms,

Department of Computer Science, Yazd University

February 2015 7th Winter School on Computational Geometry

1 / 28

slide-2
SLIDE 2

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

Outline

1

Introduction

2

Definition of the Well-Separated Pair Decomposition

3

Computing the Well-Separated Pair Decomposition

4

The split tree

5

Extension to Other Metrics

2 / 28

slide-3
SLIDE 3

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

Outline

1

Introduction

2

Definition of the Well-Separated Pair Decomposition

3

Computing the Well-Separated Pair Decomposition

4

The split tree

5

Extension to Other Metrics

2 / 28

slide-4
SLIDE 4

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

Outline

1

Introduction

2

Definition of the Well-Separated Pair Decomposition

3

Computing the Well-Separated Pair Decomposition

4

The split tree

5

Extension to Other Metrics

2 / 28

slide-5
SLIDE 5

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

Outline

1

Introduction

2

Definition of the Well-Separated Pair Decomposition

3

Computing the Well-Separated Pair Decomposition

4

The split tree

5

Extension to Other Metrics

2 / 28

slide-6
SLIDE 6

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

Outline

1

Introduction

2

Definition of the Well-Separated Pair Decomposition

3

Computing the Well-Separated Pair Decomposition

4

The split tree

5

Extension to Other Metrics

2 / 28

slide-7
SLIDE 7

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

Introduction

Motivation

P = set of n points in Rd. D = {|pq| |p, q ∈ P}. |D| =? Decomposition of P × P = {Ai}i s.t. P × P = ∪iAi, Ai = pairs with same distance. |{Ai}i| = |D| ∈ Θ(n2). What if Ai = pairs with almost same distance? Is there a decomposition with size o(n2)? Answer:

3 / 28

slide-8
SLIDE 8

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

Introduction

Motivation

P = set of n points in Rd. D = {|pq| |p, q ∈ P}. |D| =? Decomposition of P × P = {Ai}i s.t. P × P = ∪iAi, Ai = pairs with same distance. |{Ai}i| = |D| ∈ Θ(n2). What if Ai = pairs with almost same distance? Is there a decomposition with size o(n2)? Answer:

3 / 28

slide-9
SLIDE 9

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

Introduction

Motivation

P = set of n points in Rd. D = {|pq| |p, q ∈ P}. |D| =? Decomposition of P × P = {Ai}i s.t. P × P = ∪iAi, Ai = pairs with same distance. |{Ai}i| = |D| ∈ Θ(n2). What if Ai = pairs with almost same distance? Is there a decomposition with size o(n2)? Answer:

3 / 28

slide-10
SLIDE 10

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

Introduction

Motivation

P = set of n points in Rd. D = {|pq| |p, q ∈ P}. |D| =? Θ(n2) Decomposition of P × P = {Ai}i s.t. P × P = ∪iAi, Ai = pairs with same distance. |{Ai}i| = |D| ∈ Θ(n2). What if Ai = pairs with almost same distance? Is there a decomposition with size o(n2)? Answer:

3 / 28

slide-11
SLIDE 11

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

Introduction

Motivation

P = set of n points in Rd. D = {|pq| |p, q ∈ P}. |D| =? Θ(n2) Decomposition of P × P = {Ai}i s.t. P × P = ∪iAi, Ai = pairs with same distance. |{Ai}i| = |D| ∈ Θ(n2). What if Ai = pairs with almost same distance? Is there a decomposition with size o(n2)? Answer:

3 / 28

slide-12
SLIDE 12

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

Introduction

Motivation

P = set of n points in Rd. D = {|pq| |p, q ∈ P}. |D| =? Θ(n2) Decomposition of P × P = {Ai}i s.t. P × P = ∪iAi, Ai = pairs with same distance. |{Ai}i| = |D| ∈ Θ(n2). What if Ai = pairs with almost same distance? Is there a decomposition with size o(n2)? Answer:

3 / 28

slide-13
SLIDE 13

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

Introduction

Motivation

P = set of n points in Rd. D = {|pq| |p, q ∈ P}. |D| =? Θ(n2) Decomposition of P × P = {Ai}i s.t. P × P = ∪iAi, Ai = pairs with same distance. |{Ai}i| = |D| ∈ Θ(n2). What if Ai = pairs with almost same distance? Is there a decomposition with size o(n2)? Answer:

3 / 28

slide-14
SLIDE 14

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

Introduction

Motivation

P = set of n points in Rd. D = {|pq| |p, q ∈ P}. |D| =? Θ(n2) Decomposition of P × P = {Ai}i s.t. P × P = ∪iAi, Ai = pairs with same distance. |{Ai}i| = |D| ∈ Θ(n2). What if Ai = pairs with almost same distance? Is there a decomposition with size o(n2)? Answer:

3 / 28

slide-15
SLIDE 15

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

Introduction

Motivation

P = set of n points in Rd. D = {|pq| |p, q ∈ P}. |D| =? Θ(n2) Decomposition of P × P = {Ai}i s.t. P × P = ∪iAi, Ai = pairs with same distance. |{Ai}i| = |D| ∈ Θ(n2). What if Ai = pairs with almost same distance? Is there a decomposition with size o(n2)? Answer: YES! Size O(n) exists! Use Well-Separated Pair Decomposition.

3 / 28

slide-16
SLIDE 16

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

Introduction

Well-Separated Pair Decomposition:

WSPD: introduced by Callahan and Kosaraju in 1995. It applications: To solve a large variety of proximity problems Paul B. Callahan S.Rao Kosaraju

4 / 28

slide-17
SLIDE 17

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

Definition of WSPD

Well-Separated Pair

Well-Separated Pair:

A, B ⊂ Rd are s-well-separated pair (s > 0 constant), if ∃ disjoint balls, DA and DB such that

5 / 28

slide-18
SLIDE 18

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

Definition of WSPD

Well-Separated Pair

Well-Separated Pair:

A, B ⊂ Rd are s-well-separated pair (s > 0 constant), if ∃ disjoint balls, DA and DB such that

A B

5 / 28

slide-19
SLIDE 19

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

Definition of WSPD

Well-Separated Pair

Well-Separated Pair:

A, B ⊂ Rd are s-well-separated pair (s > 0 constant), if ∃ disjoint balls, DA and DB such that A ⊆ DA and B ⊆ DB.

A B DB DA

rA rB

5 / 28

slide-20
SLIDE 20

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

Definition of WSPD

Well-Separated Pair

Well-Separated Pair:

A, B ⊂ Rd are s-well-separated pair (s > 0 constant), if ∃ disjoint balls, DA and DB such that A ⊆ DA and B ⊆ DB. d(DA, DB) ≥ s × max(radius(DA), radius(DB)).

A B DB DA

≥ s × max(rA, rB) rA rB

5 / 28

slide-21
SLIDE 21

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

Property of WSP’s

Property of Well-Separated Pairs

If (A, B) is a s-well-separated, p, p′ ∈ A, q, q′ ∈ B, then |pp′| ≤ (2/s)|pq| |p′q′| ≤ (1 + 4/s)|pq|

A B DB DA

rA rB

ρ

p p′ q q′

6 / 28

slide-22
SLIDE 22

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

Property of WSP’s

Property of Well-Separated Pairs

If (A, B) is a s-well-separated, p, p′ ∈ A, q, q′ ∈ B, then |pp′| ≤ (2/s)|pq| |p′q′| ≤ (1 + 4/s)|pq|

A B DB DA

rA rB

ρ

p p′ q q′

|pq| ≥ ρ ≥ s × max{rA, rB} ≥ s × |pp′| 2 .

6 / 28

slide-23
SLIDE 23

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

Property of WSP’s

Property of Well-Separated Pairs

If (A, B) is a s-well-separated, p, p′ ∈ A, q, q′ ∈ B, then |pp′| ≤ (2/s)|pq| |p′q′| ≤ (1 + 4/s)|pq|

A B DB DA

rA rB

ρ

p p′ q q′

|p′q′| ≤ |p′p| + |pq| + |qq′| ≤ 2 s|pq| + |pq| + 2 s|pq| ≤ (1 + 4 s)|pq|.

6 / 28

slide-24
SLIDE 24

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

Property of WSP’s

Property of Well-Separated Pairs

If (A, B) is a s-well-separated, p, p′ ∈ A, q, q′ ∈ B, then |pp′| ≤ (2/s)|pq| |p′q′| ≤ (1 + 4/s)|pq|

A B DB DA

rA rB

ρ

p p′ q q′

|p′q′| ≤ |p′p| + |pq| + |qq′| ≤ 2 s|pq| + |pq| + 2 s|pq| ≤ (1 + 4 s)|pq|. s = 4/ε ⇒ |p′q′| ≤ (1 + ε)|pq|.

6 / 28

slide-25
SLIDE 25

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

Definition of WSPD

Well-Separated Pair Decomposition

Well-Separated Pair Decomposition:

Let P ⊂ Rd and s > 0. A WSPD for P w.r.t. s is a set {(Ai, Bi)}m

i=1 of pairs of non-empty subsets of V s. t.

∀i, Ai and Bi are s-well-separated pair, ∀p, q ∈ V , there is exactly one index i s. t.

p ∈ Ai and q ∈ Bi or q ∈ Ai and p ∈ Bi.

More precisely: P × P =

m

  • i=1

(Ai × Bi) m : Size of WSPD.

7 / 28

slide-26
SLIDE 26

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

Definition of WSPD

Well-Separated Pair Decomposition

Well-Separated Pair Decomposition:

Let P ⊂ Rd and s > 0. A WSPD for P w.r.t. s is a set {(Ai, Bi)}m

i=1 of pairs of non-empty subsets of V s. t.

∀i, Ai and Bi are s-well-separated pair, ∀p, q ∈ V , there is exactly one index i s. t.

p ∈ Ai and q ∈ Bi or q ∈ Ai and p ∈ Bi.

More precisely: P × P =

m

  • i=1

(Ai × Bi) m : Size of WSPD.

7 / 28

slide-27
SLIDE 27

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

Definition of WSPD

Well-Separated Pair Decomposition

Well-Separated Pair Decomposition:

Let P ⊂ Rd and s > 0. A WSPD for P w.r.t. s is a set {(Ai, Bi)}m

i=1 of pairs of non-empty subsets of V s. t.

∀i, Ai and Bi are s-well-separated pair, ∀p, q ∈ V , there is exactly one index i s. t.

p ∈ Ai and q ∈ Bi or q ∈ Ai and p ∈ Bi.

More precisely: P × P =

m

  • i=1

(Ai × Bi) m : Size of WSPD.

7 / 28

slide-28
SLIDE 28

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

Definition of WSPD

Well-Separated Pair Decomposition

Well-Separated Pair Decomposition:

Let P ⊂ Rd and s > 0. A WSPD for P w.r.t. s is a set {(Ai, Bi)}m

i=1 of pairs of non-empty subsets of V s. t.

∀i, Ai and Bi are s-well-separated pair, ∀p, q ∈ V , there is exactly one index i s. t.

p ∈ Ai and q ∈ Bi or q ∈ Ai and p ∈ Bi.

More precisely: P × P =

m

  • i=1

(Ai × Bi) m : Size of WSPD.

7 / 28

slide-29
SLIDE 29

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

WSPD exists?

Question

Does a WSPD exist for any set P?

Answer

  • Yes. We can consider WSPD for P as follows

{{pi}, {qi}} ∀ distinct points pi and qi of P Size: O(n2).

WSPD of size O(n)?

(Callahan & Kosaraju (1995)) For any set of n points, we can construct a WSPD of size O(sd · n) in O(n log n) time using O(sd · n) space.

8 / 28

slide-30
SLIDE 30

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

WSPD exists?

Question

Does a WSPD exist for any set P?

Answer

  • Yes. We can consider WSPD for P as follows

{{pi}, {qi}} ∀ distinct points pi and qi of P Size: O(n2).

WSPD of size O(n)?

(Callahan & Kosaraju (1995)) For any set of n points, we can construct a WSPD of size O(sd · n) in O(n log n) time using O(sd · n) space.

8 / 28

slide-31
SLIDE 31

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

WSPD exists?

Question

Does a WSPD exist for any set P?

Answer

  • Yes. We can consider WSPD for P as follows

{{pi}, {qi}} ∀ distinct points pi and qi of P Size: O(n2).

WSPD of size O(n)?

(Callahan & Kosaraju (1995)) For any set of n points, we can construct a WSPD of size O(sd · n) in O(n log n) time using O(sd · n) space.

8 / 28

slide-32
SLIDE 32

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

How to compute WSPD?

Question

How can we find a WSPD of size O(n) for a set of n points with respect to s > 0?

The stages of the algorithms

1

Construct a tree (split tree or compressed quad tree).

2

Construct the WSPD using the tree.

9 / 28

slide-33
SLIDE 33

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

How to compute WSPD?

Question

How can we find a WSPD of size O(n) for a set of n points with respect to s > 0?

The stages of the algorithms

1

Construct a tree (split tree or compressed quad tree).

2

Construct the WSPD using the tree.

9 / 28

slide-34
SLIDE 34

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

The Split Tree

Main idea:

Compute bounding box of the points. Split the longest edge of the bounding box. Recurse on each part (left and right child) if it contains more than 1 point.

10 / 28

slide-35
SLIDE 35

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

The Split Tree

An Example of the Split Tree

u

11 / 28

slide-36
SLIDE 36

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

The Split Tree

An Example of the Split Tree

u v w

11 / 28

slide-37
SLIDE 37

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

The Split Tree

An Example of the Split Tree

u v w

11 / 28

slide-38
SLIDE 38

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

The Split Tree

An Example of the Split Tree

u v w

11 / 28

slide-39
SLIDE 39

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

The Split Tree

An Example of the Split Tree

u v w

11 / 28

slide-40
SLIDE 40

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

The Split Tree

An Example of the Split Tree

u v w

11 / 28

slide-41
SLIDE 41

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

The Split Tree

An Example of the Split Tree

u v w

11 / 28

slide-42
SLIDE 42

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

The Split Tree

An Example of the Split Tree

u v w

11 / 28

slide-43
SLIDE 43

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

The Split Tree

An Example of the Split Tree

u v w

11 / 28

slide-44
SLIDE 44

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

The Split Tree

An Example of the Split Tree

u v w

11 / 28

slide-45
SLIDE 45

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

The Split Tree

An Example of the Split Tree

u v w

11 / 28

slide-46
SLIDE 46

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

The Split Tree

Algorithm

Algorithm SPLITTREE(P, R) 1. if |P| = 1 2. then create a new node u; 3. R(u) := R(P); 4. R0(u) := R; 5. store R(u) and R0(u) with u; 6. return node u; 7. else compute the bounding box R(P) of P; 8. split R into two hyperrectangles R1 and R2; 9. P1 := P ∩ R1; 10. P2 := P \ P1; 11. v := SPLITTREE(P1, R1); 12. w := SPLITTREE(P2, R2); 13. create a new node u; 14. R(u) := R(P); 15. R0(u) := R; 16. store R(u) and R0(u) with u, with children v and w; 17. return node u;

12 / 28

slide-47
SLIDE 47

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

The Split Tree

Algorithm

Algorithm SPLITTREE(P, R) 1. if |P| = 1 2. then create a new node u; 3. R(u) := R(P); 4. R0(u) := R; 5. store R(u) and R0(u) with u; 6. return node u; 7. else compute the bounding box R(P) of P; 8. split R into two hyperrectangles R1 and R2; 9. P1 := P ∩ R1; 10. P2 := P \ P1; 11. v := SPLITTREE(P1, R1); 12. w := SPLITTREE(P2, R2); 13. create a new node u; 14. R(u) := R(P); 15. R0(u) := R; 16. store R(u) and R0(u) with u, with children v and w; 17. return node u; Time Complexity: Θ(n2) Since the height of tree can be Θ(n).

12 / 28

slide-48
SLIDE 48

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

The Split Tree

Algorithm

Algorithm SPLITTREE(P, R) 1. if |P| = 1 2. then create a new node u; 3. R(u) := R(P); 4. R0(u) := R; 5. store R(u) and R0(u) with u; 6. return node u; 7. else compute the bounding box R(P) of P; 8. split R into two hyperrectangles R1 and R2; 9. P1 := P ∩ R1; 10. P2 := P \ P1; 11. v := SPLITTREE(P1, R1); 12. w := SPLITTREE(P2, R2); 13. create a new node u; 14. R(u) := R(P); 15. R0(u) := R; 16. store R(u) and R0(u) with u, with children v and w; 17. return node u; Time Complexity: Θ(n2) Since the height of tree can be Θ(n). But there is an O(n log n) implementation for it.

12 / 28

slide-49
SLIDE 49

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

The Split Tree

O(n log n) Algorithm

Main Idea:

Compute Partial Split Tree in O(n) time. Change the Partial Split Tree to Split Tree.

Partial Split Tree

Same as Split Tree; but leaves can have size between 1 and n/2. Time needed in each node is proportional to the size

  • f smaller child.

In computation: recurse on bigger child if its size is > n/2.

13 / 28

slide-50
SLIDE 50

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

The Split Tree

O(n log n) Algorithm

Main Idea:

Compute Partial Split Tree in O(n) time. Change the Partial Split Tree to Split Tree.

Partial Split Tree

Same as Split Tree; but leaves can have size between 1 and n/2. Time needed in each node is proportional to the size

  • f smaller child.

In computation: recurse on bigger child if its size is > n/2.

13 / 28

slide-51
SLIDE 51

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

Computing the WSPD

Computing WSPD

Algorithm COMPUTEWSPD(T, s) Input: T: Split Tree, s > 0. Output: WSPD for S. 1. for each internal node u of T 2. v :=left child of u; 3. w :=right child of u; 4. FINDPAIRS(v,w);

14 / 28

slide-52
SLIDE 52

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

Computing the WSPD

Algorithm FINDPAIRS(v, w) 1. if Pv and Pw are s-well-separated pair 2. then return the node pair {v, w} 3. else if Lmax(R(v)) ≤ Lmax(R(w)) 4. then 5. wl := left child of w; 6. wr := right child of w; 7. FINDPAIRS(v, wl); 8. FINDPAIRS(v, wr); 9. else 10. vl := left child of v; 11. vr := right child of v; 12. FINDPAIRS(vl, w); 13. FINDPAIRS(vr, w); Bounding boxes is used to decide about the well-separatedness in O(1) time.

15 / 28

slide-53
SLIDE 53

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

Computing the WSPD

A

B

16 / 28

slide-54
SLIDE 54

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

Computing the WSPD

Questions

FINDPAIRS(v, w) terminates? Yes! Singletons are well-separated. Is COMPUTEWSPD(T, s) correct? Yes! Almost obvious! Time complexity of COMPUTEWSPD(T, s)? O(m), m = # WSPs.

17 / 28

slide-55
SLIDE 55

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

Computing the WSPD

Questions

FINDPAIRS(v, w) terminates? Yes! Singletons are well-separated. Is COMPUTEWSPD(T, s) correct? Yes! Almost obvious! Time complexity of COMPUTEWSPD(T, s)? O(m), m = # WSPs.

17 / 28

slide-56
SLIDE 56

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

Computing the WSPD

Questions

FINDPAIRS(v, w) terminates? Yes! Singletons are well-separated. Is COMPUTEWSPD(T, s) correct? Yes! Almost obvious! Time complexity of COMPUTEWSPD(T, s)? O(m), m = # WSPs.

17 / 28

slide-57
SLIDE 57

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

Computing the WSPD

Questions

FINDPAIRS(v, w) terminates? Yes! Singletons are well-separated. Is COMPUTEWSPD(T, s) correct? Yes! Almost obvious! Time complexity of COMPUTEWSPD(T, s)? O(m), m = # WSPs.

17 / 28

slide-58
SLIDE 58

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

Computing the WSPD

Questions

FINDPAIRS(v, w) terminates? Yes! Singletons are well-separated. Is COMPUTEWSPD(T, s) correct? Yes! Almost obvious! Time complexity of COMPUTEWSPD(T, s)? O(m), m = # WSPs.

17 / 28

slide-59
SLIDE 59

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

Computing the WSPD

Questions

FINDPAIRS(v, w) terminates? Yes! Singletons are well-separated. Is COMPUTEWSPD(T, s) correct? Yes! Almost obvious! Time complexity of COMPUTEWSPD(T, s)? O(m), m = # WSPs.

17 / 28

slide-60
SLIDE 60

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

Computing the WSPD

Is COMPUTEWSPD(T, s) correct?

Properties of WSPD

A WSPD for P w.r.t. s is a set {(Ai, Bi)}m

i=1 of pairs of non-empty

subsets of P s. t. ∀i, Ai and Bi are s-well-separated pair, ∀p, q ∈ P, there is exactly one index i s. t.

p ∈ Ai and q ∈ Bi or q ∈ Ai and p ∈ Bi.

18 / 28

slide-61
SLIDE 61

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

Computing the WSPD

Is COMPUTEWSPD(T, s) correct?

Properties of WSPD

A WSPD for P w.r.t. s is a set {(Ai, Bi)}m

i=1 of pairs of non-empty

subsets of P s. t. ∀i, Ai and Bi are s-well-separated pair, ∀p, q ∈ P, there is exactly one index i s. t.

p ∈ Ai and q ∈ Bi or q ∈ Ai and p ∈ Bi.

Split Tree p q 18 / 28

slide-62
SLIDE 62

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

Computing the WSPD

Size of WSPD

Main Idea:

Make pairs directed.

(Pu, Pv) if (Ppar(u), Pv) is not WSP . (Pv, Pu) if (Pu, Ppar(v)) is not WSP .

Each node appears in constant directed pairs as first item (Using Packing Lemma).

Lemma

Let u be any node of the split tree T. There are at most ((2s + 4) √ d + 4)d nodes v in T such that (Pu, Pv) is a directed pair in the WSPD computed by algorithm COMPUTEWSPD(T, s).

19 / 28

slide-63
SLIDE 63

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

Computing the WSPD

WSPD Theorem

Let P ⊂ Rd be a set of n points and s > 0.

1

The split tree for P can be computed in O(n log n) time.

2

Given the split tree, we can compute in O(sdn) time, a WSPD for P with respect to s of size O(sdn).

20 / 28

slide-64
SLIDE 64

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

More details ...

21 / 28

slide-65
SLIDE 65

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

WSPD: Applications

Approximation of the complete graph(Spanners). Closest pair, All Nearest Neighbour, k-closest pairs. Approximate Euclidean Minimum Spanning Tree. ...

22 / 28

slide-66
SLIDE 66

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

WSPD: Total size

Total size of WSPD

There are point sets such that for any WSPD {(Ai, Bi)}i

  • f them,
  • i

(|Ai| + |Bi|) = Ω(n2).

· · ·

23 / 28

slide-67
SLIDE 67

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

WSPD: Total size

Total size of WSPD

There are point sets such that for any WSPD {(Ai, Bi)}i

  • f them,
  • i

(|Ai| + |Bi|) = Ω(n2).

1 1/2 1/4 1/8 · · ·

23 / 28

slide-68
SLIDE 68

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

WSPD: Total size

Total size of WSPD

There are point sets such that for any WSPD {(Ai, Bi)}i

  • f them,
  • i

(|Ai| + |Bi|) = Ω(n2).

· · ·

23 / 28

slide-69
SLIDE 69

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

WSPD: Total size

Total size of WSPD

There are point sets such that for any WSPD {(Ai, Bi)}i

  • f them,
  • i

(|Ai| + |Bi|) = Ω(n2).

· · · ≥ 1/2 < 1 DAi DBi

Ai and Bi are not s-well-separated (s > 2) because d(DAi, DBi) ≥ s × 1/2. So Ai is singleton.

23 / 28

slide-70
SLIDE 70

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

Semi-Separated Pair Decomposition

Semi-Separated Pair:

A, B ⊂ Rd are s-semi-separated (s > 0), if ∃ disjoint balls, DA and DB such that

A B

24 / 28

slide-71
SLIDE 71

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

Semi-Separated Pair Decomposition

Semi-Separated Pair:

A, B ⊂ Rd are s-semi-separated (s > 0), if ∃ disjoint balls, DA and DB such that A ⊆ DA and B ⊆ DB.

A B DB DA

rA rB

24 / 28

slide-72
SLIDE 72

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

Semi-Separated Pair Decomposition

Semi-Separated Pair:

A, B ⊂ Rd are s-semi-separated (s > 0), if ∃ disjoint balls, DA and DB such that A ⊆ DA and B ⊆ DB. d(DA, DB) ≥ s × min(radius(DA), radius(DB)).

A B DB DA

≥ s × min(rA, rB) rA rB

24 / 28

slide-73
SLIDE 73

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

Semi-Separated Pair Decomposition:

Just replace WS by SS in WSPD definition.

SSPD Construcion:

For any set P an SSPD {(Ai, Bi)}m

i=1 such that

m = O(sd · n),

  • i(|Ai| + |Bi|) = O(sd · n log n).

can be constructed in near linear time and space. Note:

i(|Ai| + |Bi|) = Ω(n log n).

Proposed by Varadarajan (1998). Improved and applied to some problems by Abam et al.(2005&2008).

25 / 28

slide-74
SLIDE 74

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

Semi-Separated Pair Decomposition:

Just replace WS by SS in WSPD definition.

SSPD Construcion:

For any set P an SSPD {(Ai, Bi)}m

i=1 such that

m = O(sd · n),

  • i(|Ai| + |Bi|) = O(sd · n log n).

can be constructed in near linear time and space. Note:

i(|Ai| + |Bi|) = Ω(n log n).

Proposed by Varadarajan (1998). Improved and applied to some problems by Abam et al.(2005&2008).

25 / 28

slide-75
SLIDE 75

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

Semi-Separated Pair Decomposition:

Just replace WS by SS in WSPD definition.

SSPD Construcion:

For any set P an SSPD {(Ai, Bi)}m

i=1 such that

m = O(sd · n),

  • i(|Ai| + |Bi|) = O(sd · n log n).

can be constructed in near linear time and space. Note:

i(|Ai| + |Bi|) = Ω(n log n).

Proposed by Varadarajan (1998). Improved and applied to some problems by Abam et al.(2005&2008).

25 / 28

slide-76
SLIDE 76

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

Extention to Other Metrics

Metric Space

Metric space: (P, d), d : P × P − → R

1

d(p, q) ≥ 0, ∀p, q ∈ P .

2

d(p, q) = 0 if and only if p = q.

3

d(p, q) = d(q, p).

4

d(p, q) ≥ d(p, r) + d(r, q), ∀p, q, r ∈ P.

Diameter and Distance

Diameter D(A) := max{d(a, b) : a, b ∈ A}. Distance d(A, B) := min{d(a, b) : a ∈ A, b ∈ B}.

26 / 28

slide-77
SLIDE 77

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

Extention to Other Metrics

Metric Space

Metric space: (P, d), d : P × P − → R

1

d(p, q) ≥ 0, ∀p, q ∈ P .

2

d(p, q) = 0 if and only if p = q.

3

d(p, q) = d(q, p).

4

d(p, q) ≥ d(p, r) + d(r, q), ∀p, q, r ∈ P.

Diameter and Distance

Diameter D(A) := max{d(a, b) : a, b ∈ A}. Distance d(A, B) := min{d(a, b) : a ∈ A, b ∈ B}.

26 / 28

slide-78
SLIDE 78

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

Extention to Other Metrics

Metric Space

Metric space: (P, d), d : P × P − → R

1

d(p, q) ≥ 0, ∀p, q ∈ P .

2

d(p, q) = 0 if and only if p = q.

3

d(p, q) = d(q, p).

4

d(p, q) ≥ d(p, r) + d(r, q), ∀p, q, r ∈ P.

Diameter and Distance

Diameter D(A) := max{d(a, b) : a, b ∈ A}. Distance d(A, B) := min{d(a, b) : a ∈ A, b ∈ B}.

26 / 28

slide-79
SLIDE 79

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

Extention to Other Metrics

Metric Space

Metric space: (P, d), d : P × P − → R

1

d(p, q) ≥ 0, ∀p, q ∈ P .

2

d(p, q) = 0 if and only if p = q.

3

d(p, q) = d(q, p).

4

d(p, q) ≥ d(p, r) + d(r, q), ∀p, q, r ∈ P.

Diameter and Distance

Diameter D(A) := max{d(a, b) : a, b ∈ A}. Distance d(A, B) := min{d(a, b) : a ∈ A, b ∈ B}.

26 / 28

slide-80
SLIDE 80

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

Extention to Other Metrics

Metric Space

Metric space: (P, d), d : P × P − → R

1

d(p, q) ≥ 0, ∀p, q ∈ P .

2

d(p, q) = 0 if and only if p = q.

3

d(p, q) = d(q, p).

4

d(p, q) ≥ d(p, r) + d(r, q), ∀p, q, r ∈ P.

Diameter and Distance

Diameter D(A) := max{d(a, b) : a, b ∈ A}. Distance d(A, B) := min{d(a, b) : a ∈ A, b ∈ B}.

26 / 28

slide-81
SLIDE 81

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

Extention to Other Metrics

WSPD in a metric space

(A, B): s-well-separated if d(A, B) ≥ s × max{D(A), D(B)}.

Open Problem

Which metric spaces (P, d) admit a WSPD of subquadratic size? Design efficient algorithms that compute such a WSPD.

27 / 28

slide-82
SLIDE 82

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

Extention to Other Metrics

WSPD in a metric space

(A, B): s-well-separated if d(A, B) ≥ s × max{D(A), D(B)}.

Open Problem

Which metric spaces (P, d) admit a WSPD of subquadratic size? Design efficient algorithms that compute such a WSPD.

27 / 28

slide-83
SLIDE 83

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

Extention to Other Metrics

WSPD in a metric space

(A, B): s-well-separated if d(A, B) ≥ s × max{D(A), D(B)}.

Open Problem

Which metric spaces (P, d) admit a WSPD of subquadratic size? Design efficient algorithms that compute such a WSPD.

27 / 28

slide-84
SLIDE 84

The Well-Separated Pair Decomposition

  • M. Farshi

Definition of WSPD Compute WSPD

The Split Tree Computing WSPD

SSPD Extension to Other Metrics

Thank You.

m.farshi@gmail.com http://cs.yazd.ac.ir/farshi/

28 / 28