Well-separated pair decomposition explained

In computational geometry, a well-separated pair decomposition (WSPD) of a set of points

S\subsetRd

, is a sequence of pairs of sets

(Ai,Bi)

, such that each pair is well-separated, and for each two distinct points

p,q\inS

, there exists precisely one pair which separates the two.

The graph induced by a well-separated pair decomposition can serve as a k-spanner of the complete Euclidean graph, and is useful in approximating solutions to several problems pertaining to this.[1]

Definition

Let

A,B

be two disjoint sets of points in

Rd

,

R(X)

denote the axis-aligned minimum bounding box for the points in

X

, and

s>0

denote the separation factor.

We consider

A

and

B

to be well-separated, if for each of

R(A)

and

R(B)

there exists a d-ball of radius

\rho

containing it, such that the two spheres have a minimum distance of at least

s\rho

.[2]

We consider a sequence of well-separated pairs of subsets of

S

,

(A1,B1),(A2,B2),\ldots,(Am,Bm)

to be a well-separated pair decomposition (WSPD) of

S

if for any two distinct points

p,q\inS

, there exists precisely one

i

,

1\leqi\leqm

, such that either

p\inAi

and

q\inBi

, or

q\inAi

and

p\inBi

.[1]

Construction

Split tree

By way of constructing a fair split tree, it is possible to construct a WSPD of size

O(sdn)

in

O(nlgn)

time.[2]

The general principle of the split tree of a point set is that each node of the tree represents a set of points and that the bounding box of is split along its longest side in two equal parts which form the two children of and their point set. It is done recursively until there is only one point in the set.

Let denote the size of the longest interval of the bounding hyperrectangle of point set and let denote the size of the i-th dimension of the bounding hyperrectangle of point set . We give pseudocode for the Split tree computation below.

Let be the node for if // is a hyperrectangle which each side has a length of zero. Store in the only point in S. else Compute Let the i-th dimension be the one where Split along the i-th dimension in two same-size hyperrectangles and take the points contained in these hyperrectangles to form the two sets and . Store and as, respectively, the left and right children of . return

This algorithm runs in

O(n2)

time.

We give a more efficient algorithm that runs in

O(nlgn)

time below. The goal is to loop over the list in only

O(n)

operations per step of the recursion but only call the recursion on at most half the points each time.

Let be the i-th coordinate of the j-th point in such that is sorted according to the i-th coordinate and be the point. Also, let be the hyperplane that splits the longest side of in two. Here is the algorithm in pseudo-code:

if // is a hyperrectangle which each side has a length of zero. Store in the only point in . else repeat Compute Let the i-th dimension be the one where while and Let and be respectively, the left and right children of . if else if until

To be able to maintain the sorted lists for each node, linked lists are used. Cross-pointers are kept for each list to the others to be able to retrieve a point in constant time. In the algorithm above, in each iteration of the loop, a call to the recursion is done. In reality, to be able to reconstruct the list without the overhead of resorting the points, it is necessary to rebuild the sorted lists once all points have been assigned to their nodes. To do the rebuilding, walk along each list for each dimension, add each point to the corresponding list of its nodes, and add cross-pointers in the original list to be able to add the cross-pointers for the new lists. Finally, call the recursion on each node and his set.

WSPD computation

The WSPD can be extracted from such a split tree by calling the recursive function on the children of every node in the split tree. Let / denote the children of the node . We give pseudocode for the function below.

FindWSPD(T, s) for each node u that is not a leaf in the split tree T do FindPairs(ul, ur)

We give pseudocode for the function below.

FindPairs(v, w) if and are well-separated with respect to report else if Recursively call and else Recursively call and

Combining the -well-separated pairs from all the calls of gives the WSPD for separation .

It is clear that the pairs returned by the algorithm are well-separated because of the return condition of the function .

Now, we have to prove that for any distinct points

p

and

q

in

S

, there is a unique pair

\{A,B\}

so that (i)

p\inA

and

q\inB

or (ii)

p\inB

and

q\inA

. Assume without loss of generality that (i) holds.

Let

u

be the lowest common ancestor of

p

and

q

in the split tree and let

v

and

w

be the children of

u

. Because of the last assumption,

p

is in the subtree of

v

and

q

in the subtree of

w

. A call to is necessarily done in . Because, each time there is a recursion, the recursion tree creates two branches that contain all the points of the current recursion call, there will be a sequence of call to leading to having

p

in

A

and

q

in

B

.

Because

u

is the lowest common ancestor of

p

and

q

, calling on the children of a higher node would result of

p

and

q

not being in a pair and calling on the children in one of the nodes of one of the subtrees of

u

would result by

p

or

q

not being in any pair. Thus, the pair

\{A,B\}

is the unique one separating

p

and

q

.

Each time the recursion tree split in two, there is one more pair added to the decomposition. So, the algorithm run-time is in the number of pairs in the final decomposition.

Callahan and Kosaraju proved that this algorithm finds a Well-separated pair decomposition (WSPD) of size

O(sdn)

.[2]

Properties

Lemma 1: Let

\{A,B\}

be a well-separated pair with respect to

s

. Let

p,p'\inA

and

q\inB

. Then,

|pp'|\leq(2/s)|pq|

.

Proof: Because

p

and

p'

are in the same set, we have that

|pp'|\leq2\rho

where

\rho

is the radius of the enclosing circle of

A

and

B

. Because

p

and

q

are in two well-separated sets, we have that

|pq|\geqs\rho

. We obtain that:

\begin{align} &

|pp'|
2

\leq\rho\leq

|pq|
s

\\ \Leftrightarrow&\\ &

|pp'|
2

\leq

|pq|
s

\\ \Leftrightarrow&\\ &|pp'|\leq

2
s

|pq|\\ \end{align}

Lemma 2: Let

\{A,B\}

be a well-separated pair with respect to

s

. Let

p,p'\inA

and

q,q'\inB

. Then,

|p'q'|\leq(1+4/s)|pq|

.

Proof: By the triangle inequality, we have:

|p'q'|\leq|p'p|+|pq|+|qq'|

From Lemma 1, we obtain:

\begin{align} |p'q'|&\leq(2/s)|pq|+|pq|+(2/s)|pq|\\ &=(1+4/s)|pq| \end{align}

Applications

The well-separated pair decomposition has application in solving a number of problems. WSPD can be used to:

O(nlgn)

time.[1]

O(nlgn+k)

time.[1]

O(nlgn)

time.[3]

O(nlgn)

time.[1]

(1-\epsilon)

-approximation of the diameter of a point set in

O(nlgn)

time.[1]

O(nlgn)

time.[1]

(1+\epsilon)

-approximation of the Euclidean minimum spanning tree in d dimensions in

O(nlgn+(\epsilon-2lg2

1
\epsilon

)n)

time.[4]

Notes and References

  1. Web site: The well-separated pair decomposition and its applications . 16 August 2005 . 26 March 2014 . Smid, Michiel.
  2. A Decomposition of Multidimensional Point Sets with Applications to k-Nearest-Neighbors and n-Body Potential Fields . Callahan, P. B. . Kosaraju, S. R. . amp . Journal of the ACM . January 1995 . 42 . 1 . 67–90 . 10.1145/200836.200853. free .
  3. Bespamyatnikh. Sergei. Segal. Michael . Fast Algorithms for Approximating Distances.. Algorithmica . 33 . 2 . 263–269. 2002. 10.1007/s00453-001-0114-7. 9758120 .
  4. Arya. Sunil. Mount. David M.. A fast and simple algorithm for computing approximate euclidean minimum spanning trees. Proceedings of the Twenty-Seventh Annual ACM-SIAM Symposium on Discrete Algorithms. 2016. 1220–1233 . 10.1137/1.9781611974331.ch85 . 978-1-61197-433-1 .