0% found this document useful (0 votes)
29 views11 pages

Faster Algorithms For Some Geometric Graph Problem

Uploaded by

Anibal Lopez
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views11 pages

Faster Algorithms For Some Geometric Graph Problem

Uploaded by

Anibal Lopez
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/2777822

Faster Algorithms for Some Geometric Graph Problems in Higher Dimensions

Article · March 1995


DOI: 10.1145/313559.313777 · Source: CiteSeer

CITATIONS READS
112 476

2 authors, including:

Paul Callahan
Coursera, Mountain View, CA
16 PUBLICATIONS 967 CITATIONS

SEE PROFILE

All content following this page was uploaded by Paul Callahan on 31 October 2014.

The user has requested enhancement of the downloaded file.


Faster Algorithms for Some Geometric Graph Problems
in Higher Dimensions
Paul B. Callahan
 S. Rao Kosara ju
y

Abstract dealing with the complete Euclidean graph of P .


We show how to apply the well-separated pair de- In [11], Vaidya presents an algorithm to com-
composition of a point-set P in <d to signi cantly pute an approximate Euclidean minimum spanning
improve known time bounds on several geometric tree (EMST) whose weight is within 1+  of the ex-
graph problems. We rst present an algorithm to act minimum in time O(?d n log n). An observa-
nd an approximate Euclidean minimum spanning tion about the well-separated pair decomposition
tree of P whose weight is at most 1 +  times the immediately results in a matching bound, and by
exact minimum. We achieve a time complexity applying two non-trivial re nements, we reduce the
of O(n log n + (?d=2 log 1 )n), improving the best time to O(n log n + (?d=2 log 1 )n).
known bound of O(?d n log n). We then show how In [9], Ruppert and Seidel present a method
to construct a graph with O(?d+1 n) edges in which of constructing a sparse graph that approximates
the shortest path between any pair of points is the complete d-dimensional Euclidean graph in
within 1 +  of the Euclidean distance. Our time the sense that the shortest path between two
complexity is O(n log n +(?d log 1 )n), a signi cant points is within a factor of 1 +  of Euclidean dis-
improvement over the best previous algorithm that tance. The time complexity of their algorithm is
produces a graph of this size. Finally, we show how O(?d+1 n logd?1 n). We rst present a somewhat
to compute the exact Euclidean minimum spanning larger graph with this property that follows imme-
tree in time O(Td (n; n) log n), where Td (m; n) is the diately from the well-separated pair decomposition.
time to nd the bichromatic closest pair between m The size of this graph matches that of Vaidya [12],
red points and n blue points. The previous bound but our algorithm is faster by a factor of log 1 . We
was O(Td (n; n) logd n). As with the previous al- re ne our methods to compute a graph whose size
gorithm, our complexity reduces to O(Td (n; n)) if is the same as [9]. The time for our re ned al-
Td(n; n) = (n1+ ) for some > 0. gorithm is O(n log n + (?d log 1 )n), substantially
improving upon the previous bound.
1 Introduction In [1], Agarwal et al. consider the relation-
In [3] we introduced the well-separated pair decom- ship between computing the exact EMST and
position of a set P of n points in <d , and showed computing the bichromatic closest pair between
how to compute it eciently. We demonstrated its m red points and n blue points. They show
usefulness by applying it to two very di erent prob- that if Td (m; n) denotes the time to solve this
lems. In this paper, we show how it can be used problem, one can nd the exact EMST in time
to improve the bounds on several other problems O(Td (n; n) logd n). We improve this bound to
O(Td (n; n) log n) by combining Sollin's minimum
 Computer Science Department, Johns Hopkins University, spanning tree algorithm [2] with a generalization
Baltimore, MD 21218. Supported by the National Science Foun- of our all-nearest-neighbors algorithm [3] based on
dation under Grant CCR-9107293 and by an ARCS foundation the well-separated pair decompostion. For both
award.
y Computer Science Department, Johns Hopkins University, the old and new bounds, the complexity reduces
Baltimore, MD 21218. Supported by the National Science
Foundation under Grant CCR-9107293
to O(Td (n; n)) when Td (n; n) = (n1+ ) for > 0.
1
2
In section 2 we de ne the well-separated pair We have previously shown [3] that for xed
decomposition. In sections 3, 4, and 5, we treat d, we can compute a well-separated pair de-
the problems of approximate EMST, approximate composition containing O(sd n) pairs in time
complete Euclidean graph, and exact EMST, re- O(n log n + sd n). For technical reasons, we used a
spectively. slightly stronger de nition of \well-separated" than
that given above. The resulting decomposition also
2 The Well-Separated Pair Decomposition satis es the current de nition, which is more nat-
Let P be a set of points in <d , where d is a constant ural.
denoting the dimension. We say that point-sets
A and B are well-separated i they can each be 3 Approximate EMST
enclosed in d-spheres of radius r whose distance of Let P = fx1; : : :; xn g be a set of points in
closest approach is at least sr, where s is a positive <d and suppose we have constructed a well-
real number we refer to as the separation. separated pair decomposition of P with separation
We will often assume that P has a binary tree s. The pairs in our decomposition are given as
T associated with it, where each leaf of T is labelled fA1 ; B1g; fA2; B2g; : : :; fAm; Bm g.
by a singleton set containing one of the points in In the following, we wish to consider those
P , and each internal node is labelled by the union graphs whose vertices are the points in P . We
of all sets labelling the leaves of its subtree. We will consider edges between points a and b to be
will refer to each node in T by the name of the set weighted by Euclidean distance, denoted d(a; b).
labelling it. Since leaves are labelled by singleton We assume for simplicity that all distances are
sets, we may also refer to them by the names of distinct. Our results can easily be extended to
points. include degenerate cases.
We de ne the interaction product, denoted , Given any edge fa; bg, there is a unique well-
between any two point-sets A and B as follows: separated pair fAi ; Bi g in our decomposition such
that a 2 Ai and b 2 Bi . This follows from
A B = ffp; p0gjp 2 A; p0 2 B; and p 6= p0g conditions ii and iii in the de nition. We de ne
a substitute for fa; bg to be any edge fa0 ; b0g such
Note that P P is the set of all distinct pairs of that a0 2 Ai and b0 2 Bi .
points in P . Now let T be the Euclidean minimum spanning
A set ffA1 ; B1g; : : :; fAm ; Bm gg of pairs of tree (EMST) of P , and let T 0 be a graph formed by
non-empty subsets of A and B is said to be a replacing every edge in T by one of its substitutes.
realization of A B i Lemma 3.1. If s > 2, then T 0 is a spanning
i. Ai \ Bi = ; for all i = 1; : : :; m. tree of P .
ii. (Ai Bi ) \ (Aj Bj ) = ; for all i, j such that Proof. Let Fj denote the spanning forest of P
1  i < j  m. induced by the j smallest edges of T , for j =
0; : : :; n ? 1, and let Fj0 denote the subgraph of T 0
iii. A B = Ai Bi
[
m
induced by the substitutes of the edges of Fj . We
i=1 claim that two points are connected in Fj0 i they
The realization is said to be well-separated if it are connected in Fj . Our lemma is easily seen to
satis es the additional property correspond to the case j = n ? 1.
iv. Ai and Bi are well-separated for all i = We proceed by induction on j . The basis is
1; : : :; m trivial, because F0 and F00 are both empty graphs.
We de ne a well-separated pair decomposition Now, assume that our claim is true for j ? 1, and
of P to be a structure consisting of a binary tree T let fa; bg be the j th smallest edge of T , with a 2 Ai
associated with P , and a well-separated realization and b 2 Bi .
of P P such that all Ai and Bi in the realization Consider any pair of points whose distance is
are nodes in T . less than d(a; b). Such a pair must be connected
3
in Fj ?1 , because otherwise we could construct a well-separated pair. This graph has linear size and
spanning tree smaller than T by replacing fa; bg would allow us to nd the EMST very rapidly.
with an edge between such a pair. Unfortunately, we do not know how to compute
Because s > 2, Ai and Bi can each be enclosed this graph eciently.
in spheres of diameter less than d(a; b), and this
bounds the interpoint distance within these sets. 3.1 First Approximation Algorithm
Combining this with the previous observation, we We now consider the application of Lemma 3.2
see that all pairs of points in Ai are connected to the ecient computation of an -approximate
in Fj ?1 , as are all pairs of points in Bi . By the EMST for some  > 0. Our rst algorithm is
inductive hypothesis, this holds for Fj0?1 as well. based on the following inequality, which holds for
The addition of fa; bg to Fj ?1 connects the all a 2 Ai , b 2 Bi :
component containing the points in Ai with the
component containing the points in Bi . By the (3.1) d(a; b)  (1 + 4=s)d(Ai; Bi )
preceding observation, the addition of a substitute This can be derived easily from the geometry of
for fa; bg to Fj0?1 does likewise. The set of vertices well-separated sets.
in the new component must be the same for both If we let s = 4=, and compute the well-
Fj and Fj0 , so the connectivity claim is preserved. 2 separated pair decomposition, we can construct the
We now consider the problem of constructing graph G by choosing an arbitrary edge between
an -approximate EMST of P ; i.e., a spanning tree each well-separated pair. The size of G is the same
of P whose total weight is within a factor 1+ of the as the numberp of ppairs, which is no more than
EMST. As in the O(?d n log n) algorithm of Vaidya 2(n ? 1)(3(s d + 2 d + 1) + 2)d + n ? 1, as shown
[11], we will rst compute a sparse graph G that by the authors [3]. Since d is constant, the size of
contains an approximate EMST as a subgraph. G is O(?d n).
For a well-separated pair fAi ; Bi g, let d(Ai ; Bi) We can construct an -approximate EMST by
denote the minimum distance between two points rst computing a well-separated pair decomposi-
such that one lies in Ai and the other lies in tion in time O(n log n + ?d n), and then comput-
Bi . Let G(s; ) be the set of graphs G de ned ing the minimum spanning tree of G using a stan-
by a well-separated pair decomposition of P with dard algorithm. This can easily be done in time
separation s such that for every pair fAi; Bi g O(?d n log n), matching Vaidya's result. We will
in the decomposition, G contains a unique edge improve on this by choosing the edge for each pair
fa; bg such that a 2 Ai, b 2 Bi, and d(a; b)  more carefully, and nding a graph G of size O(n)
(1 + )d(Ai ; Bi ). We will refer to such an edge as independent of .
an -approximate closest pair between Ai and Bi .
Lemma 3.2. Let G be a graph in G(s; ). If 3.2 Re ning the Bound on 
s > 2, the minimum spanning tree of G is an - For each well-separated pair of sets, we are in-
approximate EMST of P . terested in nding a pair of points that approxi-
mates the closest pair between the sets to within
Proof. For every edge in the exact EMST, G a factor of 1 + . In (3.1), we approximated the
contains a substitute whose weight is within 1+  of distance between points in well-separated sets by a
that edge. By Lemma 3.1, T 0 , the tree induced by constant, leaving a linear error term of  = O(s?1 ).
the substitutes, is an -approximate EMST. The Suppose we instead use a linear approximation. In-
minimum spanning tree of G has weight at most tuitively, we should then expect  to be O(s?2 ).
that of T 0 , so it is also an -approximate EMST. 2 This is the rst re nement we will need for our
Note that if we let  = 0 in the above lemma, improved algorithm.
we obtain the corollary that the exact EMST is For convenience in the following analysis, we
the minimum spanning tree of the graph formed will treat points as vectors, allowing operations
by taking the closest pair of points between each such as addition and dot product. Recall that the
4
square of the Euclidean distance between points a The preceding observation allows us to nd an
and b is (a ? b)  (a ? b). O(s?2 )-approximate closest pair between Ai and
Assume, as before, that a 2 Ai and b 2 Bi . Bi in time O(jAij + jBi j), a clear improvement
Since Ai and Bi are well-separated, we can enclose over the naive O(jAi jjBij) bound. However, it will
them in d-spheres of radius r whose distance of not be ecient to carry out such a minimization
closest approach is at least sr. Let a0 be some on each pair separately. Instead, we make use of
point lying in the d-sphere enclosing Ai , and let the fact that for a separation of s, we need only
b0 be some point lying in the d-sphere enclosing consider O(sd?1 ) distinct values of u. Because Ai
Bi . We represent a and b by a0 + a and b0 + b, and Bi come from a hierarchical decomposition, we
respectively. If we substitute these expressions into can compute all necessary maxima and minima in
the above dot product and rearrange the terms, we O(sd?1 n) time, providing a substantial speed-up.
obtain Intuitively, we choose the u vectors to be a
uniform mesh of points on the surface of a d-cube
((a0 ? b0) + (a ? b))  ((a0 ? b0) + (a ? b)) of length 2l centered at the origin. More formally,
we de ne the set to be those vectors of the form
We can expand this expression into (i1 ; : : :; id) such that for j = 1; : : :; d, ij is an
(a0 ? b0)2 + 2(a0 ? b0 )  (a ? b) + (a ? b)2 integer in the range [?l; l] and for at least one j ,
jij j = l. The size of this set is clearly O(ld?1). We
Note that the Euclidean norms of a and b will later show how to choose l in terms of s.
are bounded above by 2r. If we consider them to We use the following approach to nd a vector
be points in a d-sphere of radius 2r, we can argue in the preceding set corresponding to each well-
from geometrical considerations that separated pair fAi ; Big. Construct d-spheres of
radius r enclosing Ai and Bi such that the distance
0  (a ? b)2  (4r)2 between these spheres is exactly sr. These may be
found by expanding the spheres used to prove that
and thus bound the last term of our expression. the sets are well-separated.
Suppose we could determine a pair a0 2 Ai , Let OA be the center of the sphere enclosing Ai ,
b0 2 Bi that minimized just the rst two terms of and let OB be the center of the sphere enclosing Bi .
our expression. By our bound on the third term, it Let u^ be the vector obtained by scaling OA ? OB
would be within (4r)2 of the minimum of the whole uniformly so that the maximum absolute value over
expression. This minimum must be at least (sr)2 all its coordinates is l. Now, let u be the vector that
since sr is a lower bound on d(Ai; Bi ). Hence, results from replacing each coordinate of u^ with its
nearest integer. Such a vector is clearly a member
(d(a0; b0))2  (1 + (4=s)2)(d(Ai; Bi ))2 of the set we have de ned. For this choice of u to be
valid, we must be able to nd some a0 in the sphere
Using standard error analysis techniques, we obtain enclosing Ai and some b0 in the sphere enclosing Bi
(3.2) d(a0; b0)  (1 + O(s?2 ))d(Ai; Bi) such that a0 ? b0 has the same direction as u.
Note that OA ? OB = u^ for some scalar . Let
Now we consider the problem of determin- b0 = OB and choose a0 so thatpa0 ? b0 = u. The
ing the pair fa0 ; b0g. The vectors a0 and b0 are distance from u^ to u is at most d=2, because each
constant, so the problem reduces to minimizing coordinate was changed by at most 1=2. Hence,
u  (a ? b), where u is some vector in the di- p distance from OA ? OB to a0 ? b0 is at most
the
rection of a0 ? b0 . By adding the constant term d=2. Because b0 = OB , this is the same as the
u  (a0 ? b0) to this function, we obtain the equiva- distance from OA to a0. To show that a0 lies in the
lent problem of minimizing u  (a ? b), or u  a ? u  b. p enclosing Ai, itpthen suces to show that
sphere
Since the choice of a is independent of the choice of d=2  r, or  2r= d. p
b, we need only minimize u  a and maximize u  b. Choose l to be d(s + 2) d=2e. The maximum
5
absolute value of any coordinate of OA ? OB cannot c?1=2 , where c is a constant chosen to insure that
exceed (s + 2)r, since this is the distance between d(a0; b0)  (1 + )d(Ai ; Bi). The existence of c fol-
OA and OB . Thus  (s + 2)r=l. Substituting for lows from inequality (3.2).
l, we obtain the inequality we wish to prove. We need to insure that for every fAi ; Bi g in
Therefore, given the preceding formula for l, the coarse decomposition, Ai Bi has a realization
we can always nd some u in our set with the same composed of pairs in the ne decomposition. This
direction as a0 ? b0 for some allowable choice of a0 is clearly guaranteed if we use the same tree for
and b0. Since l is linear in s, the size of our set of both decompositions, and apply the algorithm
vectors is O(sd?1 ), as claimed. we have previously developed for computing the
We are nally ready to compute an approx- pairs [3]. We associate every fAi; Bi g with a
imate closest pair of points between every well- list containing the corresponding pairs in the ne
separated pair. We rst compute, for every sub- decomposition.
set S in our decomposition tree and every vector We rst compute all -approximate closest
u in our set, the point a(u; S ) 2 S that minimizes pairs in the ne decomposition. The time for
ua(u; S ), and the point b(u; S ) 2 S that maximizes this step is O((?d=2 log 1 )n) using the previous
u  b(u; S ). We compute these functions bottom-up method. Now, for every fAi; Bi g in the coarse de-
on the decomposition tree, so the time required is composition, we nd its -approximate closest pair
O(sd?1 n). by taking the minimum of the corresponding pairs
Now, for every well-separated pair fAi ; Big, we in the ne decomposition. The total time over all
take the approximate closest pair between Ai and pairs is linear in the size of the ne decomposition,
Bi to be fa(u; Ai); b(u; Bi)g for the u corresponding which is O(?d=2 n).
to Ai and Bi . We use the method outlined above. Now, take G to be the graph induced by edges
The time to calculate u^ is O(1). If we are allowed between the -approximate closest pairs of the
to use the oor function and array indexing, we coarse decomposition. The size of G is O(n),
can determine a(u; Ai) and b(u; Bi) in constant and by Lemma 3.2, G contains an -approximate
time from u^. Otherwise, the time required is at EMST. Using a straightforward method, this tree
most O(log(sd?1 )), which is O(log s). There are can be extracted in time O(n log n), independent
O(sd n) well-separated pairs, so the total time is of . Our nal bound on the time to construct
O((sd log s)n). an -approximate EMST is therefore O(n log n +
Now suppose  = s?2 . Using the above tech- (?d=2 log 1 )n).
nique, we can construct a graph G of size O(sd n),
which by Lemma 3:2 contains an -approximate 4 Approximate Complete Euclidean Graph
EMST as a subgraph. In other words, the size Up until this point, we have been interested in the
of G is O(?d=2 n), and the time to compute G set of graphs G(s; ) because each graph contains
is O((?d=2 log 1 )n). This gives a substantial im- an approximate EMST as a subgraph. However,
provement over Vaidya's algorithm. these graphs are interesting in their own right,
because they are approximations to the complete
3.3 Final Approximation Algorithm d-dimensional Euclidean graph in the sense of
It is worthwhile to reduce the size of G further Chew [5].
before applying a standard minimum spanning tree In any such graph, the length of the shortest
algorithm, because such algorithms have superlin- path between two points is within a constant factor
ear time complexity. To do this, we compute two of their Euclidean distance. Note that these graphs
well-separated pair decompositions of P . We com- can be treated as a special case of spanners [4].
pute a coarse decomposition using a separation in- Sparse graphs with this property have received a
dependent of , but greater than 2. For eciency, great deal of attention [5, 6, 7, 9, 10, 12]. We
it should be as close to 2 as possible. We also com- summarize this property of our graphs in the
pute a ne decomposition, using a separation of following lemma:
6
Lemma 4.1. Let G be a graph in G(s; ). If previous techniques, but this will only improve the
s > 4 then there is a path from a to b along the constants, while making our algorithm harder to
edges in G with length at most implement. Vaidya [12] has shown how to produce
1 +  d(a; b) a graph of the same size, but the time complexity
of his algorithm is greater by a factor of log 1 .
1 ? 4s?1 We can reduce the size of our graph by a
Proof. We give a recursive method for construct- factor of 1 using some observations due to Ruppert
ing a path from a to b, and then prove the length and Seidel [9]. These re nements will increase
bound. Note that G must contain exactly one edge the running time of our algorithm by a factor of
fa0; b0g that is a substitute for fa; bg. If a 6= a0, log 1 . In contrast, the algorithm of [9] has time
then recursively construct a path from a to a0 , and complexity O( ?d+1 n logd?1 n). Our graph can be
if b 6= b0, then recursively construct a path from at most a d-dependent constant factor larger than
b0 to b. Concatenate these two paths to the edge that of [9].
fa0; b0g, forming a path from a to b. Ruppert and Seidel de ne their graph in terms
We prove the length bound by strong induction of a partition of the space around each point a into
on the number of edges in the path. If the path narrow polyhedral cones, each containing an axis,
contains just one edge, the claim clearly holds, or ray internal to the cone, such that for any point
since the length of the path is exactly d(a; b). b in the cone, the angle between the axis and the
Otherwise, we can assume inductively that the line segment ab is at most =k for some k > 6.
claim holds for the path from a to a0 and the In their graph, an edge is introduced between
path from b0 to b. Because fa0; b0g is an -closest a and the point in P contained in each cone that
pair between Ai and Bi , the length of this edge minimizes distance from a projected along the axis
is at most (1 + )d(a; b). Combining this with the of the cone. A graph that minimized Euclidean
inductive hypothesis, the length of the path from distance would work as well, but it appears more
a to b is at most dicult to compute, since Yao [13] has shown that
we can compute the exact EMST given such a
(1 + )d(a; b) + 1 ?1 +4s?1 (d(a; a0) + d(b; b0)) graph. To nd a path that approximates distance
between a and b, we rst traverse the edge fa; b0g,
Because a; a0 2 Ai and b; b0 2 Bi , where b0 is neighbor of a in the cone containing b.
the well-separated set condition guarantees that We recursively construct a path from b0 to b.
d(a; a0); d(b; b0)  2s?1 d(a; b). Substituting this To see intuitively why such a path approxi-
bound into the above formula gives us the claim mates Euclidean distance, note that in any edge
of our lemma. 2 traversal, we are guaranteed to head in approxi-
As long as  = O(s?1 ), the formula of the mately the direction of our target, and we are not
preceding lemma is easily seen to be 1 + O(s?1 ). allowed to overshoot it by too much. Hence, the
Suppose we construct a well-separated pair decom- progress that we have made is proportional to the
position of P with separation s. Let G be the distance we have travelled. After travelling su-
graph used in our rst approximate EMST algo- cient distance by such moves, we are guaranteed to
rithm. That is, for every fAi ; Bi g, choose an ar- reach the destination. Ruppert and Seidel prove
bitrary pair of points a 2 Ai , b 2 Bi . Now, by an approximation factor of 1=(1 ? 2 sin =k), which
inequality (3.1), G is in G(4s?1 ; s). To guarantee is clearly 1 + O(k?1 ). One can bound the num-
that the length of the shortest path between two ber of cones to O(kd?1 ) in general and exactly k
points in G is within a factor of 1 +  of Euclidean in the planar case. The size of the graph is thus
distance, we need only let s = c ?1 for a suciently O(kd?1 n).
large constant c. G has O( ?d n) edges, and the al- We construct a similar graph by letting the u
gorithm to compute it requires O(n log n +  ?d n) vectors de ned in the preceding section serve as
time. Note that we can decrease  to O(s?2 ) using the axes of our conical space decomposition. It
7
is easy to verify that for all a 2 Ai , b 2 Bi in a O(kd?1 n). Including the time to construct the
well-separated pair decomposition with separation well-separated pair decomposition, we can nd the
s, the vector a ? b and some vector u in our set form approximation to the complete Euclidean graph in
an angle bounded by O(s?1 ). We refer to such a u time O(n log n + (kd log k)n). This is considerably
as the approximate direction of the pair fAi ; Bi g, faster than the time bound of Ruppert and Seidel
since it approximates the direction from Bi to Ai . for d > 2 and the resulting graph also contains
We choose s so that this angle is bounded by =k. O(kd?1 n) edges. Our constant will in general
Note that s = O(k). be somewhat larger. By taking  = O(k?1 ) we
We de ne our graph in terms of the edges achieve our claimed bounds on the size and time
incident to any point a 2 P . For convenience, to compute an approximation to the complete
assume that if a 2 Ai [ Bi for some pair fAi; Bi g Euclidean graph.
then a 2 Ai . This is just a matter of naming the Even for the planar case, our algorithm can be
sets. For every u vector, a has an edge to the point faster, because the dependence on k is added to
b, if one exists, that minimizes ?b  u over all i for the dependence on log n, not multiplied. In this
which u is the approximate direction of the pair case, we can improve our constant by choosing 2k
fAi; Big and b 2 Bi. u vectors placed uniformly at angles of =k, each
The size of such a graph is O(sd?1 n) by the acting as the axis of a degree 2=k planar cone.
claim of the preceding section; this is O(kd?1 n). Every point in the plane is then covered by two
To see that it is an approximation to the complete overlapping cones. The resulting graph is only
Euclidean graph, consider the following method of twice as large as that of [9].
constructing a path from a to b. Let fAi; Bi g be the Note that we cannot succeed in using k non-
unique well-separated pair such that a 2 Ai , b 2 overlapping cones because, even for large s we
Bi . Then traverse the edge fa; b0g corresponding might have vectors from the same well-separated
to the approximate direction u of fAi; Bi g, and pair that lie in adjacent cones, making it impossible
recursively construct a path from b0 to b. Because to choose an approximate direction for that pair.
our bounds on the angles are the same as [9], we
achieve the same approximation. 5 Exact EMST
Using the well-separated pair decomposition, Agarwal et al. [1] have considered the relationship
we can eciently compute our graph. It is easy to between the Euclidean minimum spanning tree
see that the edge from a corresponding to u must and the bichromatic closest pair. In the latter
be to some b(u; Bi) (as de ned in the preceding problem, we are given a set of n red and m blue
section) such that a 2 Ai . We can compute all points, and are asked to nd the closest pair of
b(u; Bi) bottom-up in O(kd?1 n) steps. points such that one is red and the other is blue.
For every S in the decomposition tree, let They have shown that if Td (m; n) is the time to
^b(u; S ) denote the point b = b(u; S 0) that minimizes nd the bichromatic closest pair in d dimensions,
?bu over all S 0 such that fS; S 0g is a well-separated then an EMST for n points can be constructed in
pair with approximate direction u. If no such time O(Td (n; n) logd n). Moreover, if Td (n; n) =
point exists, let ^b(u; S ) take a special value such (n1+ ) for some xed > 0, then the time
that ?^b(u; S )  u = +1. We can compute all of becomes O(Td (n; n)).
these values in time O((kd log k)n), since there are In this section we show how to use the
O(kd n) pairs to consider and we can nd u for each well-separated pair decomposition to compute the
pair in O(log k) steps as in the preceding section. EMST in time O(Td (n; n) log n). Our time com-
Then, the edge from a corresponding to u is plexity will also become O(Td(n; n)) if Td (n; n) =
simply the point b = ^b(u; S ) that minimizes ?b  u (n1+ ). For d > 2, all known algorithms require
over all nodes S in the path from the root of (n1+ ) to compute the bichromatic closest pair
the decomposition tree to the node a. This can between n red and n blue points, so this is not an
be computed using a top-down process in time immediate improvement over the rst algorithm.
8
However, our result sheds additional light on the forest, a set of candidate points that contains
relationship between the EMST and bichromatic the nearest point outside this component. For
closest pair. Also, if Td (n; n) could be reduced to the sake of eciency, we will need to guarantee
O(n polylog n) time, then our result would repre- that the sum of the number of candidates over all
sent a substantial improvement. While this may components is O(n).
be too optimistic in the most general case, it seems We will search for candidates top-down on the
attainable for a wide variety of input distributions tree, maintaining, for each node in the tree, a list of
that occur in practice. all the components that can have candidates in the
The intuition behind our algorithm comes from subtree of that node. Using the well-separated pair
the observation that if we compute the all-nearest- decomposition in a manner almost identical to our
neighbors of a point-set P , then these pairs already all-nearest-neighbors algorithm [3], we can insure
give us at least half the edges of our minimum span- that the size of each list is O(1). Ultimately, we will
ning tree. Optimal algorithms exist to compute all- push these lists down to the leaves, and the candi-
nearest-neighbors, so it is natural to ask whether dates corresponding to a given component will be
similar algorithms can be run through log2 n stages, just those leaves that contain that component in
reducing the number of unknown edges in half at their lists. We apply bichromatic closest pair to
each stage, and nally resulting in the spanning extract the nearest point outside each component
tree. from the set of candidates.
We show how the all-nearest-neighbors algo- The following is a sketch of our algorithm.
rithm of the authors [3] can be adapted for this The use of well-separated pairs is implicit in the
purpose. In order to accomplish this task, we will relationship between this technique and the all-
invoke bichromatic closest pair as a primitive oper- nearest-neighbors algorithm of [3]. Details will be
ation at each stage. For simplicity, we assume that given in the nal version.
all interpoint distances in P are distinct, break- The lists maintained around each node will con-
ing ties in some systematic way. Our procedure sist of points, as in our nearest-neighbors algo-
is based on Sollin's Algorithm [2] for computing rithm, but each point will represent a whole compo-
the minimum spanning tree of a general graph. A nent. In general, if a point a is paired with a node
high-level outline is as follows. B, then the distance between a and any point in
We proceed in dlog2 ne stages. At stage i = 0, B will be a constant approximation of the distance
every point in P is a separate component in a trivial between that point and the component containing
spanning forest. We nd, for each component a. Intuitively, if too many points are paired with
containing less than 2i+1 vertices, the nearest point B, then one of them will represent a component
not in that component. that is closer to another point in the component list
We add the minimum edge connecting this than to any point in B . Such a component can be
point to the component, thus merging the com- eliminated. The algorithm is essentially the same
ponent with its nearest neighbor. The same edge as the top-down part of our all-nearest-neighbors
may be introduced in two di erent ways, in which procedure with the packing arguments generalized
case we add just one copy. It is easy to verify in a straightforward way.
that no cycles are possible as long as distances are Now it remains to extract the nearest point to
distinct. At the ith intermediate stage, compo- each component. Let k be the number of compo-
nents have size at least 2i , and the nal stage is nents containing less than 2i+1 vertices, and let Pj
the EMST of P . be the set of candidates for the j th component.
Note that the rst stage of this algorithm is After the preceding procedure, every leaf is paired
simply the all-nearest-neighbors problem. Later with a constant
P number of components. Conse-
stages correspond to the same problem generalized quently, kj=1 jPj j = O(n).
to sets of points. To solve this problem, we For each component, nd its nearest neighbor
rst construct for every component of the current as follows. Split Pj into djPj j=2i+1e subsets of size
9
at most 2i+1 , and solve the bichromatic closest pair dominate, so such a speed-up can have great sig-
problem for each subset paired with the compo- ni cance.
nent. The solution that minimizes distance is the
pair connecting the component to its nearest neigh- References
bor. [1] P. K. Agarwal, H. Edelsbrunner, O. Schwartzkopf,
We invoke bichromatic closest pair at most and E. Welzl. Euclidean minimum spanning trees
Pkj=1 djPj j=2i+1e times. We know that k = O(n=2i) and bichromatic closest pairs. Discrete and Com-
at stage i, so this sum is O(n=2i ). The sets in each [2] putational Geometry, 6:407{422, 1991.
i+1
invocation have size at most 2 . Having found C. Berge and A. Ghouila-Houri. Programming,
Games, and Transportation Networks. John Wiley
the closest pair between components, we merge and Sons, Inc., 1965.
them and continue with the next phase. The cost of [3] P. B. Callahan and S. R. Kosaraju. A decomposi-
merging can be amortized over the whole algorithm tion of multi-dimensional point-sets with applica-
without a ecting the complexity. tions to k-nearest-neighbors and n-body potential
The time spent computing bichromatic clos- elds. In Proceedings 24th Annual AMC Sympo-
i i+1
est pairs at each phase is O((n=2 )Td(2 ; 2 )). i+1 sium on the Theory of Computing, pages 546{556,
1992.
Since Td is at least linear, this dominates the time [4] B. Chandra, G. Das, G. Narasimhan, and
for each phase. For some constant c, the number J. Soares. New sparseness results on graph span-
of steps summed over all phases is at most ners. In 8th Annual ACM Symposium on Compu-
tational Geometry, pages 192{201, 1992.
X
dlog2 ne cn
i+1 i+1 [5] L. P. Chew. There is a planar graph almost as
2i Td (2 ; 2 ) good as the complete graph. In Proceedings Second
i=0 Annual Symposium on Computational Geometry,
pages 160{177, 1986.
The total time complexity is therefore [6] D. B. Dobkin, S. J. Friedman, and K. J. Supowit.
O(Td(n; n) log n) in general, including O(n log n) Delaunay graphs are almost as good as complete
time to compute the well-separated pair decompo- graphs. In Proceedings 28th Annual Symposium
sition, and O(Td(n; n)) if Td (n; n) = (n1+ ). on Foundations of Computer Science, pages 20{
26, 1987.
6 Concluding Remarks [7] M. Keil. Approximating the complete Euclidean
graph. In Proceedings First Scandinavian Work-
The well-separated pair decomposition seems use- shop on Algorithm Theory, pages 208{213, 1988.
ful for eliminating factors of logd?1 n in the time to [8] F. P. Preparata and M. I. Shamos. Compu-
solve certain geometric problems. In [9] this factor tational Geometry: An Introduction. Springer-
resulted from the use of range trees (see [8]) and in Verlag, 1985.
[1] it resulted from a recursive approach \inspired [9] J. Ruppert and R. Seidel. Approximating the d-
by the range tree structure." This seems to indicate dimensional complete Euclidean graph. In Third
that other problems making use of range trees may Canadian Conference on Computational Geome-
be solved with our decomposition, which is more try, pages 207{210, 1991.
[10] J. S. Salowe. Construction of multidimensional
naturally suited to proximity problems than the spanner graphs with applications to minimum
former. Additionally, our primary data structures spanning trees. In 7th Annual ACM Symposium
are substantially simpler than range trees, and the on Computational Geometry, pages 256{261, 1991.
algorithms we present here make use of no complex [11] P. M. Vaidya. Minimum spanning trees in k-
auxiliary structures. For this reason, we feel that dimensional space. SIAM Journal on Computing,
our methods are preferable in practice. 17:572{582, 1988.
Another trend we note is that for approxima- [12] P. M. Vaidya. A sparse graph almost as good
tion algorithms whose time increases with preci- as the complete graph on points in k dimensions.
Discrete and Computational Geometry, 6:369{381,
sion, our approximation-dependent term is linear 1991.
in n for any xed approximation, unlike [9] and [13] A. C. Yao. On constructing minimum spanning
[11]. When high precision is desired, this term may trees in k-dimensional space and related problems.
10
SIAM Journal on Computing, 11:721{736, 1982.

View publication stats

You might also like