Iterated Nearest Neighb ors and



Finding Minimal Polytop es

y z

David Eppstein Je Erickson

Abstract

Weintro duce a new metho d for nding several typ es of optimal k -p oint

sets, minimizing p erimeter, diameter, circumradius, and related measures, by

testing sets of the O (k ) nearest neighb ors to each p oint. We argue that this is

b etter in a number of ways than previous algorithms, whichwere based on high

order Voronoi diagrams. Our technique allows us for the rst time to eciently

maintain minimal sets as new p oints are inserted, to generalize our algorithms

to higher , to nd minimal convex k - p olygons and p olytop es,

and to improvemany previous results. Weachievemany of our results via

a new algorithm for nding rectilinear nearest neighb ors in the plane in time

O (n log n + kn). We also demonstrate a related technique for nding minimum

area k -p oint sets in the plane, based on testing sets of nearest vertical neighbors

to each determined by a pair of p oints. A generalization of this

technique also allows us to nd minimum volume and b oundary measure sets

in arbitrary dimensions.

1 Intro duction

Anumb er of recent pap ers have discussed problems of selecting, from a set of n

p oints, the k points optimizing some particular criterion [2, 14, 20]. Criteria that

have b een studied include diameter [2], variance [2], area of the convex hull [20],

convex hull p erimeter [14,20], and rectilinear diameter and p erimeter [2]. Such

problems are useful in clustering, line detection, statistical data analysis, and other

geometric applications.

We study and improveknown algorithms for these problems. Wealsointro duce

dynamic versions of these problems, in which the optimum set must b e maintained

as new p oints are inserted. Our metho ds further generalize to higher dimensional

versions of these problems. Our techniques apply to all of the problems cited ab ove.



Portions of this pap er were presented at the 3rd and 4th ACM-SIAM Symp osia on Discrete

Algorithms [17, 19]. This pap er includes work done while Je Erickson was at the Universityof

California at Irvine. David Eppstein's researchwas partially supp orted by NSF grant CCR-9258335.

y

Department of Information and Computer Science, University of California, Irvine, CA 92717

z

Computer Science Division, University of California, Berkeley, CA 94720 1

2 D. Eppstein and J. Erickson

Many of these problems were previously solved using the following metho d, orig-

inally develop ed byDobkin et al. [14]. An ad ho c algorithm was determined, with

c

time b ounded by a p olynomial O (n ). Then, it was shown that the optimum k -p oint

set is contained in the set of p oints lab eling a single region of the order-O (k )Voronoi

diagram. Constructing the Voronoi diagram and searching the O (kn) such regions

c+1

takes a total time of O (n log n + k n). Aggarwal et al. [2] reduced the number of

c

regions to b e searched from O (kn)to O (n). Thus the time b ecomes O (n log n + k n).

However, there remains an anomaly in these time b ounds: if k is (n), the time

c

is worse than the original O (n )by a factor of n.Thus at some p oint the device

of higher order Voronoi diagrams b ecomes worthless, and one must use a simpler

algorithm.

We argue that, in this formulation, Voronoi diagrams should b e replaced bysets

of the O (k ) nearest neighb ors to eachpoint. There are several reasons whywe

b elieve this. First, the reduction to O (n) regions to b e searched is immediate, and

avoids the complicated analysis of Aggarwal et al. [2].

Second, by nding neighb ors of neighbors, we show that the numb er of regions

can b e further reduced to O (n=k ), improving the time b ounds by a factor of k and

eliminating the anomaly describ ed ab ove.

Third, our time b ounds can b e improved in a di erentway. The k nearest

neighb ors can b e found in time O (kn log n), using Vaidya's algorithm [34]. For the

rectilinear (L or L ) metric, we further improve this to O (n log n + kn) on a random

1 1

access machine. Thus we get faster time b ounds in the plane, even for problems

such as circumradius for which the reduction to Voronoi diagrams is immediate.

Fourth, our metho d lends itself well to dynamization. As p oints are inserted one

at a time, the neighb ors of eachnewpointmay b e computed quickly using standard

techniques. In contrast, the Voronoi diagram maychange byasmanyas (n) edges

at each insertion. Dynamic algorithms have b een studied for many imp ortant geo-

metric optimization problems, such as the closest pair, diameter, minimum spanning

tree, and convex hull, but this is the rst time that dynamic algorithms have b een

describ ed for minimum measure subset problems.

Fifth, our approach generalizes to higher dimensions in a way that do es not

work for Voronoi diagrams. In d,even rst order Voronoi diagrams can

dd=2e

have complexity (n ); whereas, the nearest neighb ors can still b e found in time

O (n log n) using Vaidya's algorithm [34].

Finally,by applying an old combinatorial result of Erd}os and Szekeres [21],

we can generalize our techniques to nd minimum measure convex p olygons and

p olytop es.

Avariant of our technique also yields new algorithms for nding minimum area

k -p oint sets in the plane, or minimum b oundary measure or volume k -p oint sets in

arbitrary dimensions. Our b oundary measure algorithm is a natural generalization

of our minimum p erimeter result. Instead of using the neighb ors to each p oint, we

Nearest Neighb ors and Minimal Polytop es 3

Measure Static time b ound Dynamic time b ound

2

3 4

p erimeter O (n log n + k n) O (k +log n)

2

2 3

L p erimeter O (n log n + k n) O (k +log n)

1

2

2

circumradius O (n log n + kn log k ) O (k log k +log n)

2 2 2

2 3

diameter O (n log n + k n log k ) O (k log k +log n)

2 2 2

L diameter O (minfn log n + kn; n log ng) O (k log k +log n)

1

2

3=2 3=2+" 3+"

variance O (k n log n + k n) O (k + log n)

2 3 2

area O (n log n + k n ) |

Table 1. New results for nding minimum measure k -p oint sets, given n p oints in the plane.

(" is an arbitrarily small p ositiveconstant.)

let each set of r points in the set de ne a particular p olytop e, for some constant r

de ned by the measure we are trying to minimize, and we examine the nearest

neighb ors to each p olytop e thus de ned. In particular, weshow that the minimum

area k -p oint set is contained in the O (k ) nearest vertical neighbors to a line segment

determined bytwo of its p oints.

2 New Results

We present algorithms for the following problems.

 We nd the k nearest rectilinear (L or L ) neighb ors to eachofasetofn

1 1

points in the plane, in time O (n log n + kn), improving the previous O (kn log n)

b ound [34].

2

 We nd the k nearest vertical neighb ors to each of the O (n ) line segments

2 2

determined by pairs of p oints in an n-p oint set, in total time O (kn + n log n).

 Given a set of n points in the plane, we nd the k -p oint set minimizing p erime-

ter, L p erimeter, circumradius, diameter, L diameter, variance, or area.

1 1

Our results are summarized in the rst column of Table 1. Weimprove all

previous results [2, 14, 20], except for variance and area, whichweimprove for

certain values of k .

 We maintain minimal p oint sets in the plane as p oints are inserted, under

avariety of \one-dimensional" measures. Our results are summarized in the

second column of Table 1. No previous b ounds are known for any of these

problems.

d

 Givenasetofn points in IR , with d> 2, we nd the k -p oint set min-

imizing circumradius, diameter, L diameter, variance, b oundary measure, 1

4 D. Eppstein and J. Erickson

Measure Time b ounds

2

d1

circumradius O (kn log n + k n log k )

O (k )

diameter O (kn log n +2 n)

2

d=21

L diameter O (kn log n + k n log k )

1

2

(d+1)=2 O (d )

variance O (k n log n + k n log k )

d O (k ) d1

b oundary measure O (n +2 n )

d 2d1 d1

L b oundary measure O (n + k n )

1

d+1

d O (k ) d

volume O (kn log n +2 n )

d

Table 2. New results for nding minimum measure k -p oint sets, given n points in IR , for

all d> 2.

L b oundary measure, or volume. Our results are summarized in Table 2. We

1

improve previous algorithms for circumradius and variance based on Voronoi

d+1

diagrams, which run in time O (n ) [2]. No previous b ounds were known for

the other problems.

 We generalize all of our results to k -p ointconvex p olygons and p olytop es.

We derive time b ounds with the same dep endence on n as the corresp onding

k -p oint set algorithms, but with an exp onential dep endence on k .Weknow

3

of no previous results for these problems, except for a O (kn ) time b ound on

nding minimum area or p erimeter k -gons [20], whichwe improve for small k .

3 Rectilinear Nearest Neighb ors

We b egin by describing a data structure for nding m rectilinear nearest neighb ors

in the plane. In the L metric, ab ove and to the rightofanypoint p,points (x; y )

1

are sorted by distance to p by the values of the function x + y .Ifwe sort all p oints

by these values, the nearest neighb ors ab ove and to the rightofeachpoint will

b e a subsequence of this sorted list. Wecombine neighb ors from each of the four

directions to nd the nearest neighb ors overall.

Our data structure is in the form of a balanced binary tree over the p oints, sorted

by their y -co ordinates. The tree ro ot covers all n points, and for eachtreenodewith

i p oints we split the p oints into two slabs, consisting of the top i=2 and the b ottom

i=2points. We build a data structure for each slab, and recursively sub divide slabs

until we reach sets of a single p oint. Each input p oint will b e in O (log n) slabs, and

the p oints ab ove and to the rightofany query p oint p can b e interpreted as the

union of p oints to the rightofp in O (log n) slabs ab ove p.

We assume m is xed. Without loss of generality m> log n. (Otherwise, we

will build our data structure to nd log n nearest neighb ors, from whichwe can

quickly cho ose the nearest m.) In each slab, we wish to determine, for a query

Nearest Neighb ors and Minimal Polytop es 5

p oint p,them nearest p oints to the rightofp.Ifwe did this for all slabs, wewould

generate O (m log n) neighb ors, and queries would b e slower than we wish. Instead,

we partition the neighb ors into chunks of (m= log n)points. Our data structure

will enable us to nd each succeeding chunk quickly, and we then combine chunks

from di erent slabs to give the nal set of m neighbors.

Within a single slab, wesweep from left to right, maintaining a list of p oints

ordered by x + y .Aswesweep across eachpoint in the slab, we add it to the list.

The p ositions to add new p oints into the list can b e found in time O (n)ifthepoints

are already sorted by x-co ordinate. Wewould like our data structure to reconstruct

the state of this list at each time in the sweep. This is a persistent oine data

structure problem [18], in whichweperformanumb er of up dates (insertions into a

linked list) and must then query di erentversions of the data structure (the list at

di erent times in the sweep).

Wemaintain, at eachpoint in the left to rightsweep, a partition of the sorted

list of p oints into chunks of b etween m= log n and 2m= log n points each. When a

new p oint is inserted in the list, it is added to a chunk. When this addition causes

achunk to have to o many p oints, it is split into smaller chunks. As we only need

remember at most m neighb ors to each query p oint, we only need keep log n chunks,

so as one chunk is split another chunk may b e removed from the end of the list.

To rememb er these manipulations we store the list of p oints in eachchunk just

b efore the chunk is split, and the list of all log n chunks at the same time. To nd

the neighb ors for a query p oint p,we determine the next time t after our left-to-right

sweep crosses p, at which some chunk is split. We then step through the sequence

of chunks existing at time t.Eachchunk contains b etween m= log n and 2m= log n

p oints, of which at least m= log n existed at the last time the chunk was split and

hence are to the rightofp.We eliminate the other p oints to the left of p.Thus

in time O (m= log n)we can nd each successivesetof (m= log n) neighb ors in the

slab.

The time and storage for rememb ering the p oints in eachchunk is O (n). However

if m is small there are O (n) times at whichachunk may split, and hence O (n log n)

storage for rememb ering the sequence of chunks at each time. Weremovethis

unwanted logarithmic factor with a data structure for maintaining lists of O (log n)

elements in a p ersistent oine manner.

Lemma 3.1. Given a sequence of n insert and delete op erations on a list, such

that the list length is always O (log n),we can construct in time and space O (n) a

data structure such that, for anyversion of the list, we can step through the list in

time O (1) per step.

Pro of: Break the sequence into O (n= log n) subsequences of O (log n) op erations

each, and treat each subsequence separately. Within a subsequence, there are

O (log n) items initially, and O (log n) items inserted. List all items by pro cess-

ing all the insert op erations and none of the delete op erations. Represent this list

6 D. Eppstein and J. Erickson

as an array of p ointers to items, so that the item in a given p osition can b e found

in O (1) time. Now represent eachversion of the list byanO (log n)-bit integer, in

which a one bit represents the presence of the item at that p osition. Each insert or

delete can b e p erformed with O (1) steps of integer arithmetic on a random access

machine, as can the op eration of moving from one element to the next in a given

version of the list. 2

By analogy to the atomic heaps of Fredman and Willard [23]we call this data

structure an atomic list. This completes the description of each slab, whichwe

summarize b elow.

Lemma 3.2. Given n p oints in the plane, sorted from left to right, we can in time

and space O (n) construct a data structure for which, given a value x,we can nd

the p oints with the smallest values of x + y ,inchunks of O (m= log n) points at a

time, in time O (m= log n) per chunk. 2

To nish the description of our data structure, wecombine results from the

O (log n) slabs into which space ab ove the query is divided. Weuseapriority queue

of one chunk from each slab. Eachchunk's priority is the largest value of x + y for any

p oint in the chunk. We removechunks one by one from the queue; when weremove

achunk we insert the next chunk from the same slab. Once wehaveremoved chunks

totalling at least m points, any remaining neighb ors will have smaller values of x + y

than the priorities of the chunks left in the queue. Suchpoints must b e in chunks

already in the queue, and we remove these chunks as well. This gives us O (log n)

chunks and hence O (m) p otential neighbors. We reduce this to m neighbors using a

linear time selection algorithm. Using a global list of all p oints, sorted by x + y ,we

can represent priorities as O (log n)-bit integers, so we can p erform priority queue

op erations in O (1) time using atomic heaps [23].

Lemma 3.3. For any xed m,we can prepro cess a set of n p oints in the plane, in

time and space O (n log n), so that the m nearest rectilinear neighb ors to any query

p oint can b e found in time O (m +logn).

Pro of: The query time is O (m +log n), once wehave determined the version of the

chunk list to use in each slab. For each slab, wemaintain an index from the left

to right order of p oints into this sequence of versions. We also index, for each slab,

the relation b etween p ositions in the left to right order of p oints in the slab, and

the same p ositions in the two smaller slabs into which it is divided. The p osition of

the query p oint in the ro ot slab can b e found by binary search, after whichwe can

follow the indices to nd the list versions for all O (log n) slabs queried in O (log n)

time. The time to construct eachslabisO (n) assuming the p oints are sorted from

left to right. This sorted order can b e maintained as slabs are split recursively,

in O (n log n) total time. Each slab requires space O (n). Thus all slabs can b e

constructed in time and space O (n log n). 2

Nearest Neighb ors and Minimal Polytop es 7

Theorem 3.1. We can nd the m nearest rectilinear neighb ors to eachofasetof

n p oints in the plane, in time O (n log n + mn) and space O (n log n). 2

Remark. Our nearest neighb or algorithm relies on the constant-time manipulation

of O (log n)-bit integers, in b oth the atomic lists and atomic heaps. Thus, our time

b ound holds only in the RAM mo del of computation. In the algebraic decision tree

mo del, our time b ound climbs by a factor of O (log log n).

4 Iterated Nearest Neighb ors

Wenowshow that in anypointset,inany dimensions, there is some p oint for which

there are few neighb ors of neighb ors. We state the result more generally,interms

of spheres satisfying certain prop erties. Given two spheres A and B ,wesay that A

is entirely within B if the closure of A is contained in the interior of B .

Lemma 4.1. Let S b e a set of spheres, so that no sphere is entirely within another

sphere, and so that no sphere contains more than m centers of spheres. Let S be

the smallest sphere in S , and let U b e the union of spheres in S having centers in

S . Then U contains O (m) sphere centers.

Pro of: Let R denote the radius of S . Because no sphere in U contains S ,itfollows

that U is contained in a sphere of radius 3R. This larger sphere can b e partitioned

into O (1) regions, each with diameter R. If any of these regions contained more

than m centers, any sphere centered in such a region either would contain to o many

centers or would b e smaller than S . 2

This result applies more generally to any family of homothetic convex b o dies,

and hence to \spheres" in any metric. We apply this result to sets of m nearest

neighb ors as follows. Given a p oint set, put a sphere around each p oint at a radius

determined byits mth nearest neighbor. This sphere will contain exactly the m

nearest neighb ors of the p oint, and the set of all such spheres will satisfy the condi-

tions of the lemma. Therefore there is some p oint for which the m nearest neighb ors

have O (m) neighb ors altogether.

This suggests the following algorithm outline. Supp ose we can prove that the

optimal k -p oint set (according to some sp eci ed criterion), if it contains a p oint, is

contained in the m nearest neighb ors of that p oint. Sort the p oints by the size of

their neighb or spheres. Collect the neighb ors of the p oints in the smallest neighbor

sphere, search for the optimal set among them, and throw out the m +1 points in the

sphere. Rep eat the preceding step until all p oints are gone, but if a smallest neighbor

sphere ever contains fewer than k points, we throw out its center immediately, since

that p oint cannot p ossibly b e in the optimal set.

8 D. Eppstein and J. Erickson

Lemma 4.2. Let  b e a measure having the prop erty that the minimum measure

k -p oint set is contained in the m rectilinear nearest neighb ors of each of its p oints,

and let T (m) (resp. S (m)) b e the time (resp. space) required to nd the optimal

d

k -p oint set among m p oints. Then, given a set of n points in IR ,we can nd the k -

p oint subset minimizing ,intimeO (mn log n + nT (m)=k ) and space O (mn + S (m)),

or in time O (n log n + mn + nT (m)=k ) and space O (n log n + mn + S (m)) if d =2.

Pro of: By our results ab ove, the rectilinear nearest neighb ors can b e found in time

O (n log n + mn) and space O (n log n) in the plane. In higher dimensions, we use

Vaidya's algorithm [34]. We only call the ad ho c algorithm when the neighb or sphere

contains k or more p oints, and those p oints are immediately discarded. Thus, the

ad ho c algorithm is called at most dn=k e times, each time on a set of size O (m)by

the previous lemma. These two op erations dominate the time and space b ounds.

We claim that at anypoint in the algorithm, if the minimal set has not yet

b een found, it contains only p oints that have not b een thrown out. Weprovethis

claim by induction; it is clearly true when the algorithm starts. If anypoint p is

in the set, then by assumption, the set is contained in p's neighb or sphere. If this

sphere contains fewer than k points, p cannot p ossibly b e in the set, and we can

safely discard it. The only other time p could b e thrown out is immediately after

wesearch for the minimal set among p's remaining neighb ors. If the minimal set

contains p, then by the inductivehyp othesis, this search will nd it. 2

The same algorithm outline will still work if the minimum measure set is con-

tained in the nearest neighb ors of each of its p oints, under any xed metric. Thus, in

higher dimensions, we could use Euclidean neighb ors instead of rectilinear neighb ors

without changing the time b ounds.

5 Minimizing One-Dimensional Measures

5.1 Perimeter

We rst demonstrate our technique on the minimum p erimeter k -p oint set problem.

The problem is to nd, given a set of n points in the plane, a set of k points for

which the p erimeter of the convex hull is minimized. This was previously solved in

2 5

O (k n log n + k n) time by Dobkin et al. [14]; this can b e improved to O (n log n +

4

k n) using the techniques of Aggarwal et al. [2] Both algorithms use a dynamic

3

programming algorithm, requiring time O (kn ) and space O (kn), as a subroutine

within each region of a certain high order Voronoi diagram [14]. We will use this

algorithm as a subroutine within each set of nearest neighbors.

Lemma 5.1. If a p oint p is in the minimum p erimeter k -p oint set, then the set is

contained in the O (k ) nearest rectilinear neighbors of p.

Nearest Neighb ors and Minimal Polytop es 9

Pro of: Let q b e the farthest p oint from p in the optimal set. Then the entire set

ts in a circle around p, of radius jpq j, and the p erimeter must b e at least 2jpq j. But

we can cover the circle with 16 squares of p erimeter jpq j;if q is not among the 16k

rectilinear nearest neighb ors of p then some square must contain at least k p oints,

and would supply a k -p oint set with smaller p erimeter. 2

Wepoint out that this lemma is also true for Euclidean neighb ors, or neighb ors

under any xed metric, with only a change in the constant factor. This will b e true

for almost all of our nearest-neighb or results.

Theorem 5.1. We can nd the minimum p erimeter k -p oint subset of a set of

3 2

n p oints in the plane, in time O (n log n + k n) and space O (n log n + kn + k ).

Pro of: This is a direct application of the two-dimensional case of Lemma 4.2. We

3

have m = O (k )by the previous lemma, and T (m)= O (km )andS (m)= O (km)

from [14]. 2

This algorithm generalizes to minimize p erimeter in any metric, but wecando

b etter in L . The minimum L p erimeter k -p oint set is the set enclosable in the

1 1

minimum p erimeter axis-aligned . Aggarwal et al. [2] solve this problem in

2 3

time O (k n log n). We use their O (n )-time brute force algorithm as a subroutine.

Theorem 5.2. We can nd the minimum L p erimeter k -p oint subset of a set of

1

2

n p oints in the plane, in time O (n log n + k n) and space O (n log n + kn). 2

5.2 Circumradius

Wenow describ e our algorithms for nding the k -p oint set contained in the smallest

d

sphere, given a set of n p oints in IR .We improve previous time b ounds, due to

2 d+1

Aggarwal et al. [2], of O (n log n+k n) in the plane and O (n ) in higher dimensions.

Their algorithms are based on higher order Voronoi diagrams.

First wedevelop a new algorithm to use as a subroutine within each neighbor

set. Consider the related problem of placing a xed-size sphere so that it covers the

maximum number of a given set of p oints. Once wehave a solution to this problem,

we can apply Megiddo's parametric searchtechnique [29] to nd the smallest sphere

whose optimal placementcovers k (or more) p oints.

Lemma 5.2. We can nd the minimum circumradius k -p oint subset of a set of

2

d

d d

n points in IR ,intimeO (n log n) and space O (n log n), or in time and space

2

O (n log n) if d =2.

10 D. Eppstein and J. Erickson

Pro of: First consider the sphere placement problem. We xeachsetofd 1

p oints and rotate a sphere around its ane hull, stopping whenever a p ointenters

or leaves the sphere. Eachsweep requires time O (n log n). Degenerate cases, where

the optimal sphere cannot b e forced to b e tangenttod points, are handled in total

d1 d

time O (n ). Thus, the entire sweep algorithm takes time O (n log n). In the

2

plane, wecansolve this problem in time and space O (n ), using a more complicated

algorithm develop ed by Chazelle and Lee [8].

To nd minimum circumradius sets, we apply parametric searching with Cole's

weighted median strategy [10]. Our sweep algorithm can b e parallelized to run in

2

d d

O (log n) steps on O (n ) pro cessors. Thus, the total time is O (n log n) in general,

2

and O (n log n) in the plane. The parametric search technique requires the con-

d

struction of an AKS sorting network [3] with O (n ) inputs, one for each pro cessor

used by the parallel implementation of the xed-parameter algorithm. This network

d

can b e built in time and space O (n log n)[3]. 2

Lemma 5.3. If a p oint p is in the minimum circumradius k -p oint set, then the set

is contained in the O (k ) rectilinear nearest neighbors of p.

Pro of: Let R b e the optimal circumradius. The minimum circumradius set is con-

tained in an axis-aligned hyp ercub e of width 4R,centered at p. This hyp ercub e can

p

d

b e partitioned into (2 d) = O (1) axis-parallel hyp ercub es with circumradius R,

none of which can contain more than k points. 2

Theorem 5.3. We can nd the minimum circumradius k -p oint subset of a set of

d 2

d1 d

n p oints in IR ,intime O (kn log n + k n log k ) and space O (kn + k log k ),orin

2

time O (n log n + kn log k ) and space O (n log n + kn + k log k ) if d =2. 2

5.3 Diameter

The diameter of a set is the largest distance b etween anytwopoints in the set.

In the plane, Aggarwal et al. [2] showhow to nd the minimum diameter k -p oint

2:5

set in time O (n log n + k n log k ). Unfortunately,weknow of no fully p olynomial

algorithm for this problem in higher dimensions, so we are forced to use a brute

force approach.

Lemma 5.4. If a p oint p is in the minimum diameter k -p oint set, then the set is

contained in the O (k ) rectilinear nearest neighbors of p.

Pro of: Let D b e the optimal diameter. The minimum diameter set is contained

in an axis-parallel hyp ercub e of width 2D ,centered at p. This hyp ercub e can b e

partitioned into a constantnumb er of smaller hyp ercub es with diameter D ,noneof

which can contain more than k p oints. 2

Nearest Neighb ors and Minimal Polytop es 11

Theorem 5.4. We can nd the minimum diameter k -p oint subset of a set of

d

O (k )

n p oints in IR , in time O (kn log n +2 n) and space O (kn), for all d> 2. 2

We can do considerably b etter than this in the plane. Aggarwal et al. [2]solve

this problem by reducing it to one of nding a maximum indep endent set in a certain

bipartite graph. For bipartite graphs, the maximum indep endent set and maximum

matching are closely related (their cardinalities add to the size of the p ointset)so

matching techniques can b e applied to this problem.

We improve on the algorithm of Aggarwal et al. by solving a dynamic matching

problem. Given a p ointsetS , and a distance D , let the graph G (S ) b e de ned

D

as follows. The vertices of G (S ) are simply the p oints in S . An edge (p; q ) will

D

exist in the graph exactly when jpq j >D; that is, the graph connects p oints that

are suciently far apart.

Lemma 5.5. Given a set S of n points, such that G (S ) is bipartite, and a maxi-

D

mum matching in G (S ),we can insert or delete a single p ointin S and up date the

D

maximum matching, in time O (n log n) and space O (n),provided G (S ) remains

D

bipartite.

Pro of: The up date can only change the matching cardinalityby one. If the up date

is a deletion of a matched p oint, weremove its edge from the matching and mark

its mate as unmatched. Then whether the up date is an insertion or a deletion, the

remaining problem is to nd a single alternating path connecting two unmatched

p oints. If such a path is found, the matching size can b e increased bychanging the

unmatched edges in it to matched edges, and vice versa.

We will go through a pro cess of marking p oints as odd or even. A p oint is lab eled

o dd (even)ifitcanbereached from an unmatched vertex by an alternating path

of o dd (even) length. In each case we rememb er the last edge on the path, so that

the entire path can b e reconstructed quickly. Once wehave p erformed this lab eling,

the existence of an alternating path can b e tested by testing if anytwoeven p oints

share an edge. This can b e done in O (n log n) time by nding the farthest pair of

even p oints.

We will maintain a data structure for a p ointsetP with the following op erations:

(1) given p oint p, nd some p ointinP farther than D from p, or rep ort that no such

p oint exists; (2) delete a given p oint from P . As noted by Aggarwal et al. [2], these

op erations can b e p erformed in O (log n) amortized time and linear space using the

circular hul l data structure of Hershb erger and Suri [25].

We start the lab eling pro cess by marking each unmatched p ointaseven (it has a

zero length path to an unmatched p oint). We build the data structure ab ove, letting

P consist of all unmarked p oints (initially, that is simply the matched p oints). We

then process each marked p oint in turn, maintaining a queue of p oints that require

pro cessing. Pro cessing an o dd p oint consists simply of marking its matcheven,

12 D. Eppstein and J. Erickson

adding it to the queue, and removing it from P . We pro cess the even p oints as

follows. While an unmarked p oint adjacent to the even p oint exists, wemarkit

o dd, add it to the queue, and removeitfromP . Suchapoint can b e found using

the nd op eration describ ed ab ove.

Once the queue is empty, all p oints are either marked or unreachable via an

alternating path. The numb er of data structure op erations is O (n), as each nd

op eration either discovers a new p ointtobemarked and removed from P ,oritis

the last such op eration p erformed in pro cessing a given p oint. Therefore the total

time used is O (n log n). The circular hull structure and the queue b oth use linear

space, so the overall space b ound is linear. 2

Lemma 5.6. We can nd the minimum diameter k -p oint subset of a set of n points

2

3

in the plane, in time O (n log n) and space O (n).

Pro of: Eachpoint can b e the endp ointofO (n) p ossible diameters; we select among

them using binary search. To test a given diameter D asso ciated with a p oint p,we

want to know whether there is some k -p oint set with diameter jpq j shorter than D .If

so, the set is contained in the lune formed byintersecting two circles of diameter D ,

one centered on p and one centered at distance D from p.Wesweep a lune around p,

covering in turn O (n) di erentpoint sets; wemust test if any of these sets contains

a small diameter k -p oint subset.

As noted by Aggarwal et al. [2], if S is the p ointsetcontained in a given lune,

then G (S ) is bipartite, and a subset of S with diameter less than D is exactly an

D

indep endent set in G (S ). If M is the maximum matching in G (S ), the size of the

D D

maximum indep endent set is jS j jM j.Thus to test if there is a large subset with

small diameter, wemay compute this matching. We do this for all O (n) p ositions

2

of the lune around p,intime O (n log n), using the dynamic matching algorithm of

Lemma 5.5.

For each p oint, we p erform a binary search among its O (n) asso ciated diameters,

and there are O (n)points for which this searchmust b e p erformed. Thus, the total

2

3

time used is O (n log n). 2

Combining this algorithm with Lemmas 4.2 and 5.4, wehave the following result.

Theorem 5.5. We can nd the minimum diameter k -p oint subset of a set of

2

2

n p oints in the plane, in time O (n log n + k n log k ) and space O (n log n + kn). 2

5.4 L Diameter

1

The algorithms in the previous two sections generalize to circumradius and diameter

in any metric, but we can make a signi cant improvementin L . The minimum 1

Nearest Neighb ors and Minimal Polytop es 13

L diameter (equivalently, minimum L circumradius) k -p oint set is the set en-

1 1

closable in the smallest axis-aligned hyp ercub e. In the plane, Aggarwal et al. [2]

give an algorithm for this problem, based on higher order L Voronoi diagrams,

1

2

that takes time O (k n log n).

Our approach is almost identical to that used to nd minimum circumradius

sets. We start with the problem of placing a xed-size axis-aligned hyp ercub e so

that it covers the maximum number of points. Once wesolve this problem, we can

parameterize it to nd the smallest axis-parallel hyp ercub e that covers at least k

p oints. Instead of parametric search, weuseamuch simpler binary search among

the p ossible L diameters.

1

Lemma 5.7. We can nd the minimum L diameter k -p oint subset of a set of n

1

2

d

d=2 d=2

p oints in IR , in time O (n log n) and space O (n ).

Pro of: Finding the optimal placementofahyp ercub e is equivalent to nding the

deep est p oint in an arrangementofhyp ercub es. We can easily adapt an algorithm

of Overmars and Yap [32], originally applied to Klee's measure problem, to nd

d=2

the deep est p oint in an arrangement of axis-aligned b oxes in time O (n log n) and

d=2

space O (n ).

To nd the optimal hyp ercub e size, we search along each co ordinate axis as

follows. We sort the p oints by the appropriate co ordinate, and de ne a triangular

matrix M of co ordinate di erences. These di erences are p otential L diameters.

1

2

We will not actually build M , since that would require time (n ), but we can

access anyentry in constant time. We binary search through M for the optimal

diameter. Since the rows and columns of M are sorted, we can select any elementin

time O (n log n)[22]. Thus, each step of the search is dominated byOvermars and

2

d=2

Yap's algorithm, and the entire search requires time O (n log n). 2

Theorem 5.6. We can nd the minimum L diameter k -p oint subset of a set of

1

d 2

d=21 d=2

n points in IR , in time O (kn log n + k n log k ) and space O (kn + k ),orin

time and space O (n log n + kn) if d =2. 2

Our planar algorithm's time and space b ounds are dominated by the rectilin-

2

ear nearest neighb ors subroutine. For k = (log n), the \ad ho c" algorithm of

Lemma 5.7 is b oth faster and more space-ecient.

5.5 Variance

The variance of a set of p oints is de ned as the sum of the squares of the distances

between pairs of p oints, divided by the number of points in the set. Equivalently, the

variance is the sum of the squares of the distances from eachpoint to the centroid

of the set [2].

14 D. Eppstein and J. Erickson

Lemma 5.8. If a p oint p is in the minimum variance k -p oint set, then the set is

d=2+1

contained in the O (k ) rectilinear nearest neighbors of p.

Pro of: Let V and R be the variance and circumradius of the minimum variance

2 2

set, and let p be any p oint in the set. We easily verify that 2R

set is contained in an axis-parallel hyp ercub e centered at p with width 4R.We can

p

d=2

partition this hyp ercub e into O (k )hyp ercub es of width 2R 2=dk, and thus of

p

circumradius R 2=k .Ifany of these spheres contain k points, their variance is at

2

most 2R , which is less than V . 2

Aggarwal et al. [2] prove that the minimum variance k -p oint set corresp onds to

one of the cells in the k th order Voronoi diagram of the original n points and derive

2

an algorithm that uses time O (n log n + k n) in the plane. Agarwal and Matousek [1]

recently discovered an algorithm for constructing planar order-k Voronoi diagrams

1+" 1

in time O (kn ). Combining their algorithm with our techniques, we can nd

2+"

minimum variance sets in the plane in time O (n log n + k n), which is slightly

worse than the existing b ound.

Lemma 5.9. Let p b e a p oint in the minimum variance k -p oint set, and let V be

the set's variance. Supp ose for some constant c> 0, the distance b etween p and

p

(d+1)=2

the set's centroid is c V=k. Then the set is contained in the O (ck ) nearest

Euclidean neighbors of p.

Pro of: Let S b e the sphere, centered at the optimal set's centroid, whichjust

contains the set, and let R b e the radius of S . S contains exactly k points [2].

p

V=k. The space Then S is contained in a sphere centered at p with radius R +2c

p

(d1)=2

between the two spheres can b e covered by O (ck ) spheres of radius V=k,

none of which can contain k points. 2

The two previous b ounds are tight in the worst case. Consider a sphere S of

1

p p

k , containing a smaller sphere S of radius k=2tangenttoS . There is a radius

2 1

cluster of k 2 p oints with arbitrarily small variance around the center of S , but

2

excluding the center itself. The surface of S and the space b etween the two spheres

2

are b oth lled with as many clusters of k=2points as p ossible, such that every two

clusters have at least unit distance b etween them. One of these clusters contains the

center of S ; another contains the tangent p oint of the two spheres. The minimum

1

variance set consists of the large cluster, the center of S , and the tangent p oint.

1

For eachpoint p in this set, every sphere centered at p that contains the set also

(d+1)=2 d=2+1

contains (k ) other p oints, and the set contains the (k )th neighbor of

the center of S .

1

1

Throughout this pap er, " represents an arbitrarily small p ositive constant. Multipli cati ve

constants hidden bytheO -notation may dep end on ".

Nearest Neighb ors and Minimal Polytop es 15

To nd the minimum variance set quickly,we need to nd a center within

p

radius c V=k of the optimal set's centroid, for some constant c>0, so that we can

(d+1)=2

search for the optimal set among its O (ck ) nearest neighbors. We describ e an

algorithm the nds a set of O (n=k )points, at least one of whichisacenter p oint.

Theorem 5.7. We can nd the minimum variance k -p oint subset of a set of

3=2 3=2+" 5=2

n p oints in the plane, in time O (k n log n + k n) and space O (kn + k ).

Pro of: We b egin by nding the k=2 nearest Euclidean neighb ors to every p oint,

in time O (kn log n) and space O (kn). We rep eatedly nd the p oint p with the

smallest neighb or sphere. If neither p nor any of the neighb ors of p are already

marked noncentral, we mark p as a p otential center p oint and mark its neighb ors

as noncentral. Eachcentral p ointmarksk=2 noncentral p oints, so this pro cess

gives us O (n=k ) p otential center p oints. The entire marking pro cess requires time

O (n log n + kn).

p

Most of the p oints in the minimal set are within 2V=k of the centroid, so every

p

2V=k. Let p b e one p oint within this radius has at least k=2 neighb ors within 2

of these p oints. When the marking algorithm reaches p, one of two things happ ens.

(1) We could mark p as a p otential center p oint. (2) We could ignore p b ecause p or

p

one of its neighb ors is marked noncentral, in which case some p oint within 5 2V=k

of the centroid is already marked central. Thus, at least one of the p otential center

p oints is an actual center p oint.

3=2

After we nd the p otential center p oints, we nd the O (k ) nearest Euclidean

3=2

neighb ors of each p otential center p oint in time O (k n log n) and space O (n). We

5=2+" 5=2

then test eachoftheO (n=k ) neighb or sets in time O (k ) and space O (k )

using Agarwal and Matousek's Voronoi diagram algorithm [1]. 2

"

This algorithm matches or improves previous time b ounds for all k in O (n ) \

2

2

(log n). For smaller values of k ,theO (n log n + k n)-time algorithm of Aggarwal

et al. is faster. For larger values of k , Agarwal and Matousek's Voronoi diagram al-

1"

gorithm is faster. Finally,fork = (n ), the fastest algorithm is based on another

2

2

Voronoi algorithm of Chazelle and Edelsbrunner [6] and runs in time O (n log n).

Mulmuley describ es an algorithm that constructs the k th order Voronoi diagram

d+1 d+1

d d e b c

d 2

2 2

of a set of n p oints in IR , in time O (k n log n + k n )[30]. To nd minimum

variance sets in higher dimensions, we use Mulmuley's algorithm as a subroutine

d+1

within eachneighbor set. We improve the previous time b ound of O (n ) [2].

Theorem 5.8. We can nd the minimum variance k -p oint subset of a set of

d

(d+1)=2 v (d)1 v (d)

n p oints in IR , in time O (k n log n + k n log k ) and space O (n + k ),

2 2

d +3d+4 d +4d+3

where v (d)= if d is even, and if d is o dd. 2

4 4

16 D. Eppstein and J. Erickson

6 Dynamization

Wenowshowhow to turn our planar algorithms into dynamic data structures,

that can maintain the minimum measure k -p ointsetaspoints are inserted. Our

algorithm is simply to maintain a data structure that can determine, for each new

p oint, its O (k ) nearest neighb ors. Then if that p ointispartofasetimproving the

previous optimum, that set will b e a subset of these neighb ors, and can b e found

using the metho ds already describ ed.

Lemma 6.1. Let  b e a measure having the prop erty that the minimum measure

k -p oint set is contained in the m nearest neighb ors of eachofitspoints, and let

T (m) (resp. S (m)) b e the time (resp. space) required to nd the optimal k -p oint set

among m points. Then in the plane, we can maintain the k -p oint set minimizing 

2

as p oints are inserted in time O (T (m)+ log n + m log n) p er insertion and space

O (n log n + S (m)).

Pro of: We apply a standard dynamic-to-static reduction technique for decomp os-

able searching problems [4] to the rectilinear nearest neighb or data structure of

Lemma 3.3. 2

Theorem 6.1. We can maintain the minimum measure k -p oint set in the plane as

2

4

p oints are inserted, with the following insertion times: O (k +log n) for p erimeter,

2 2 2

3 2 3

O (k + log n) for L p erimeter, O (k log k + log n) for circumradius, O (k log k +

1

2 2 2 2

3+"

log n) for diameter, O (k log k +log n) for L diameter, and O (k +log n) for

1

variance. 2

We can dynamize our higher dimensional results in a similar manner, using a

dynamic nearest neighb or data structure of Agarwal and Matousek [1], with results

that are just slightly b etter than brute force.

7 Nearest Vertical Neighb ors

Wenow consider the problem nearest vertical neighbors for p oints and line segments;

we use this as a subroutine in our minimum area algorithm.

Given a p oint p and a non-vertical line l , the vertical distance d(p; l ) is simply the

length of a vertical line segment connecting p and l .Thenearest vertical neighbor

to l from a p ointsetP is the p oint p 2 P minimizing the vertical distance to l .

The connection b etween this concept and minimum area p olygons is as follows.

If a triangle is formed by connecting p oint p to the endp oints of a line segment s,

where s is contained in line l , the area of the triangle is c  d(p; l ), where c is half the

length of the pro jection of s onto the x-axis. Therefore the p ointinP forming the

Nearest Neighb ors and Minimal Polytop es 17

Figure 1. Finding nearest neighb ors b etween lines and p oints: (a) primal, nearest p oint

neighb or to a line; (b) dual, vertical ray sho oting in a line arrangement.

minimum area triangle with s is the nearest vertical neighbor of l . This observation

2

was used to develop O (n ) algorithms for the minimum triangle problem [7, 16, 15].

We can tighten this characterization as follows. Let 4pq r b e the minimum

area triangle, and assume that the vertical pro jection of r is b etween those of p

and q . Then as b efore r is the nearest neighb or of line pq , but the vertical segment

connecting r and line pq actually touches segment pq . In other words, r is within

the slab de ned byvertical lines through p and q . In general wesay p is a neighbor

of segment s if it app ears vertically ab oveorbelow s, as in this case r app ears

ab oveorbelow segment pq . Then the triangle problem can b e solved by nding,

for each segment pq , the nearest neighb ors ab ove and b elow pq . Computing nearest

neighb ors to segments is harder than the original problem of nearest neighb ors to

lines but it generalizes to minimum area k -gons in a way that do es not work for

nearest neighb ors to lines.

Givenasetofn points, and a segment s (whichmay not b e determined bytwo

of the p oints) wesaythatthek nearest vertical neighbors ab ove(below) s are those

k p oints ab ove(below) the line through s, and within the slab de ned byvertical

lines through the endp oints of s, such that no other p oint with the same restrictions

is closer to s.We compute these k nearest neighb ors as follows.

First, supp ose we only care ab out the restriction that the p oints b e ab oveor

b elow the line l through s; this is the earlier problem of nearest neighb ors to a line.

By geometric duality,we can transform the line to a p oint and the p oint set to a

line arrangement; Figures 1(a) and 1(b) illustrate this transformation. Point-line

vertical distances are the same in the dual as they were in the primal. Therefore

the dual nearest neighb or is the rst line encountered byavertical raysent from

the dual p oint l .Thek nearest neighb ors are the rst k lines encountered. Thus we

can nd these neighbors by ray-shooting in the dual arrangement.

This do es not quite solve the problem we p osed, b ecause wehave not dealt with

the requirement that p oints b e ab ove or b elow the segment s, only that they b e ab ove

18 D. Eppstein and J. Erickson

or b elow the line containing s.Tosolve this we sort the p oints by their horizontal

pro jections. As well as building an arrangementandray-sho oting data structure for

the entire p oint set, we also build structures for the rst and second halves of the

sorted lists of p oints, and so on recursively.Each data structure corresp onds to a

vertical slab of the p oints; for each such structure there are two smaller structures

corresp onding to slabs containing half as manypoints.

Then for each query segment s,wecan ndasetofO (log n) slabs that contain

exactly those p oints ab oveandbelow s.We can solvethek nearest vertical neighb ors

problem by p erforming ray-sho oting queries within each slab, and selecting the b est

k p oints found.

Wenow describ e the data structures which allow us to p erform these ray-sho oting

op erations and therefore nd the nearest vertical neighb ors. Rather than build a

data structure that allows line segments to b e tested in arbitrary order, we test the

segments in left-to-right order of the p oints dual to the lines containing them. This

allows us to p erform our algorithm as a plane sweep of the dual line arrangement;

that is, wesweep a vertical line from left to right across the dual plane, and p erform

line segment neighb or nding queries and data structure up dates as the vertical line

crosses appropriate features in the arrangement.

Atanypoint in the algorithm, the sweep line will cross all of the n dual lines.

Our data structure for a single slab (corresp onding to a single dual line arrangement)

simply consists of an arrayofn elements, listing those lines in the vertical order of

their p oints of intersection with the sweep line. Then a vertical ray sho oting query

along the sweep line could b e p erformed by a binary search in the array, to lo cate

the starting p oint among the dual lines. Successive queries would then take O (1)

time by simply moving up to the next element in the array. The order of the dual

lines changes exactly when the sweep line crosses an intersection b etween twodual

lines. The change consists simply of swapping two adjacent elements in the array.

The rays at whichwe wish to sho ot corresp ond to segments pq , which are also found

as the intersection of two lines dual to p and q .Each successiveintersection can b e

found in O (log n) time, bykeeping a priority queue of the n 1 p ossible intersections

between adjacent elements in the array.

Now let us consider putting several slabs together again. Starting eachray

2

sho oting query by binary searching in each slab separately would take O (log n) time

p er segment. We can reduce this time, by using another data structure to relate

lo cations in di erent slabs to each other. Recall that for each slab, corresp onding to

an arrangementofsomem dual lines, there are two smaller slabs with m=2 dual lines

each. The sweep line in the large slab is divided into m + 1 regions bythem lines

crossing it. Each region in the large slab corresp onds to part of a region in each of the

smaller slabs. Wekeep another array,ofm + 1 elements, listing the corresp ondence

between regions of the large and small slabs. This corresp ondence only changes

when an intersection o ccurs in the large slab; other intersections will rearrange the

Nearest Neighb ors and Minimal Polytop es 19

corresp ondence of lines to regions but will not change the numb ering of the regions.

For eachintersection of two lines, we only need to up date the corresp ondence for

the region b etween the lines. Thus again each up date takes O (1) time p er slab.

Nowwe can use these arrays to lo cate the p oint dual to each segment in the

O (log n) slabs we wish to search. The p ointisanintersection in the outer slab

containing all n points, and its lo cation will already b e known when the sweep line

crosses that intersection. Then, while wehave a lo cation within a slab that contains

p oints not ab oveorbelow the queried segment, weneedtomove to lo cations in

the twochild slabs. This can b e done simply by lo oking in the appropriate arrays,

in constanttimepermove. In this way it takes O (log n) time to nd the initial

lo cations for ray sho oting in eachoftheO (log n) appropriate slabs.

Once wehave found the initial lo cations for vertical ray sho oting, we can nd

each successivevertical neighb or of the segment simply bymoving from element

to adjacent element in the appropriate array. But wemust somehowcombine the

neighb ors found in di erent slabs. To do this, we use a nal array, which tells us for

each line the p osition of that line as it crosses the sweep line in the ro ot slab of all n

p oints. This array is up dated as b efore byswapping two elements p er intersection

encountered. Using this array,we can compare neighb ors from di erent slabs, by

examining their p ositions in the sweep line. Eachvertical neighb or for the line

segmentmust b e found by selecting among O (log n) candidates, one from each slab,

each of which can b e thoughtofasaninteger having O (log n) bits, representing the

p osition in the sweep line. This selection can b e p erformed in constant time p er

op eration, using atomic heaps [23].

Theorem 7.1. Given n p oints, wecanenumerate all p oint sets found as the k

nearest vertical neighb ors of each segment formed by a pair of p oints, in total time

2 2

O (n log n + kn ) and space O (n log n).

Pro of: Eachintersection of two dual lines, causing a search from the corresp onding

segmentaswell as up dates to the data structures, can b e selected in time O (log n)

from a priority queue of p ossible intersections. Each searchfork nearest neighb ors

takes time O (log n) to nd the initial p ositions for the ray sho oting, and O (1) time

per neighb or found. Each up date takes constant time p er slab, and involves changes

in O (log n) slabs (only those slabs containing b oth dual lines that intersect to cause

2

the up date). Therefore the total time for searches and up dates is O (n (log n + k )).

Each dual line is involved in O (log n) slabs, and uses constant space p er slab, so the

total space is O (n log n). 2

Remark. Again, since our algorithm uses atomic heaps, our time b ound holds only

in the RAM mo del of computation. In the algebraic decision tree mo del, the time

b ound increases by a factor of O (log log n).

20 D. Eppstein and J. Erickson

Figure 2. Nearest neighb ors to p p : (a) vepoint set with triangle to furthest p oint; (b)

L R

seven nearest neighb ors havea ve-p oint subset in one parallelogram.

8 Minimizing Area

Wenow describ e how to use the data structure of the previous section to nd k -

p oint sets with minimum area convex hulls. The problem was previously solved by

3 2

Eppstein et al. [20] in time O (kn ) and space O (kn ).

Lemma 8.1. If p and p are the leftmost and rightmost p oints of the minimum

L R

area k -p oint set, resp ectively, then every other p oint in the set is one of the 2k 4

nearest neighbors above or b elow the segment p p .

L R

Pro of: Let q b e the p oint farthest from p p in the optimal set. Then the area of

L R

the set is at least that of 4p qp . Consider the parallelogram with twovertical sides

L R

sides through p and p , one side equal to p p , and the remaining side parallel to

L R L R

p p and through q .We can divide this parallelogram vertically into two smaller

L R

parallelograms, each with area equal to that of 4p qp . If either parallelogram

L R

contains k points, they would supply a k -p oint set with smaller area. Thus, the

large parallelogram containsatmost2k 2points, including p and p . 2

L R

For example, Figure 2(a) shows a set of ve p oints, with 4p qp outlined. Fig-

L R

ure 2(b) shows 7 = 2  5 3points ab ove p p , ve of which are in one small

L R

parallelogram.

This immediately gives us our algorithm for nding the minimum area k -p oint

set. We simply examine each p ossible segment p p , and nd the 2k 4 neighb ors

L R

ab ove and b elow it. That gives us a set of 4k 6points, in whichwe can nd the

4

minimum k -p oint set in time O (k ) using the algorithm of Eppstein et al. [20]. Thus

2 4 2

weachieve a total time of O (n log n + k n ).

4

The O (k ) term in this b ound can b e improved. First note that the convex hull

p , of the minimum k -p oint set is the union of the convex hulls ab ove and b elow p

L R

and the area of the convex hull is the sum of the areas ab ove and b elow p p . Each

L R

Nearest Neighb ors and Minimal Polytop es 21

of these twohulls must b e a minimum j -p oint set, among those sets containing b oth

p and p , for j equal to the numb er of p oints in the resp ective sets. So if we can

L R

compute all minimum such j -p oint sets, for j

top and b ottom sets in a further step taking time O (k ). In fact the algorithm of

Eppstein et al. computes all these sets. Further, it works by trying all p ossible

choices of the b ottommost p oint in the set; for each suchchoice the algorithm takes

3

O (k ) time. But in our situation we know the b ottommost p oint: it is either p

L

or p . Therefore we can compute the optimum k -p oint set among the neighb ors of

R

3

segment p p in time O (k ).

L R

Theorem 8.1. We can nd the minimum area k -p oint subset of a set of n points

2 3 2 3

in the plane, in time O (n log n + k n ) and space O (n log n + k ). 2

p

3

This improves the previous time b ound of O (kn )[20] whenever k = O ( n ).

2

Our space b ound is always an improvementover the previous O (kn ) [20].

9 Minimizing Volume and Boundary Measure

In this section, we demonstrate a natural generalization of our minimum area algo-

rithm to arbitrary dimensions. We also generalize our results for nding minimum

p erimeter sets in the plane.

d

Let T be some r -dimensional p olytop e in IR , with r

de ne the orthogonal distance from p to T to b e the Euclidean distance from p to

0

its orthogonal pro jection onto a (T ), whichwe denote p .Wecall p an orthogonal

0

neighbor of T if and only if p 2 T .We can compute the nearest orthogonal neighb ors

to any p olytop e with xed complexity in linear time.

d

Given a set of p oints A in IR , and an arbitrary p oint p 2 A,we de ne the

0

series of extremal points, extremal simplices,and bounding boxes of A with resp ect

to p , denoted p , S , and B ,respectively. While these sequences dep end on the

0 i i i

initial p oint p , the prop erties wederive hold for all initial p oints.

0

We de ne B = S = p .For each1  i  d, p is the p ointinA farthest from the

0 0 0 i

ane hull of S . S =conv(S ;p ). B is the convex hull of twocopiesof B ,

i1 i i1 i i i1

one containing p and one an equal distance from B in the opp osite direction,

i i1

situated so that B  B , and adjacent facets of B meet at right angles. For any

i1 i i

set A,wehave S (A)  conv(A)  B (A). See Figure 3 for an example.

d d

Volume and b oundary measure share the following prop erty. For some con-

stant r , the minimum measure k -p oint set is contained in the m nearest orthogonal

neighb ors to the b ounding b ox of its rst r extremal p oints (with resp ect to any

p oint in the set). For measures with this prop erty,wehave the following algorithm

outline for nding minimum measure sets. For eachsetofr points, there are r

p ossible b ounding b oxes. For eachbox, we nd its m nearest orthogonal neighb ors,

and search for the minimum measure set among them.

22 D. Eppstein and J. Erickson

3

Figure 3. Extremal p oints, extremal simplices, and b ounding b oxes in IR

Lemma 9.1. Let  b e a measure having the prop erty that the minimum measure

k -p ointsetA is contained in the m nearest orthogonal neighb ors of B (A), and let

r

f (m) b e the time required to nd the optimal k -p oint set among m points. Then,

d

given a set of n p oints in IR ,we can nd the k -p oint subset minimizing , in time

r +1 r

O (n + n f (m)). 2

We know of no fully p olynomial time algorithm to nd minimum volume or

b oundary measure sets, except in the plane [2,14,20]. A nave algorithm runs in



n

bd=2c

time O ( k ), by explicitly computing the convex hull of every k -p oint subset [5].

k

We use this algorithm as a subroutine.

Throughout this section, weletjAj and j@Aj denote the volume and b ound-

ary measure of the convex hull of A. The following lemma relates the volumes of

b ounding b oxes and extremal simplices.

d

d

Lemma 9.2. For all A  IR , jB (A)j =2 d!jS (A)j.

d d

Pro of: The volume of a d-dimensional cone is bh=d, where b is the (d1)-dimensional

measure of the base and h is the distance b etween the ap ex and the ane hull of the

base. The volume of a d-dimensional b ox with the same base measure and heightis

bh.

Weprove the lemma by induction. The lemma holds (trivially) when d =0.

Let h denote the distance b etween p and a (S ). Using the volume formulae

d d d1

ab ove, wehave jS j = h jS j=d and jB j =2h jB j. Therefore, jB j=jS j =

d d d1 d d d1 d d

2djB j=jS j. The closed form follows directly from the inductivehyp othesis. 2

d1 d1

9.1 Boundary Measure

d

Given a set A in IR ,we de ne its bounding cylinder C (A)asthesetofpoints

0

no farther orthogonally from B (A) than p (A), and we de ne B (A) as the

d2 d1

Nearest Neighb ors and Minimal Polytop es 23

3

Figure 4. A b ounding cylinder and its b oxinIR

0

smallest b oxcontaining C (A). Wehave S (A)  conv(A)  C (A)  B (A). See

d1

Figure 4.

The following lemma relates the b oundary measure of anysetA with the b ound-

0

ary measure of B (A).

d

0 d1

Lemma 9.3. For all A  IR , j@B (A)j < 2 d!j@Aj.

0

Pro of: B has 2d facets. Four of the facets have measure equal to jB j.Leth

d1 i

denote the distance b etween p and a (S ). Since h

i i1 d1 i

0 0

the rest of the facets of B have measure smaller than jB j. Therefore, j@B j <

d1

d

2djB j =2 djS j,by Lemma 9.2. The lemma follows from the observation that

d1 d1

j@Aj > 2jS (A)j. 2

d1

Lemma 9.4. The minimum b oundary measure set A is contained in the O (k )

nearest orthogonal neighbors of B (A).

d2

1

0 d

d1

Pro of: Let s(d)denote d2  d! e.We divide B (A)into s(d) congruent pieces by

slicing parallel to each opp osite pair of facets s(d) times. Each piece has b oundary

0 d1 0 d1

measure j@B (A)j=s(d) < j@B (A)j=2 d!. By the previous lemma, this is less

0

than j@Aj, so no piece can contain more than k 1 p oints. Thus, B (A)contains

d 0

at most s(d) (k 1) = O (k ) p oints. Since C (A)  B (A), C (A)alsocontains O (k )

p oints. The p oints in C (A) are the nearest orthogonal neighbors of B (A). 2

d2

Theorem 9.1. We can nd the minimum b oundary measure k -p oint subset of a

d

d O (k ) d1

set of n points in IR , in time O (n +2 n ) and space O (n). 2

We can generalize L p erimeter into higher dimensions as follows. We de ne

1

the L boundary measure of a set A as the b oundary measure of the smallest axis-

1

parallel hyp errectangle enclosing A. Using techniques similar to those used to prove

the previous theorem, wehave the following result.

24 D. Eppstein and J. Erickson

Theorem 9.2. We can nd the minimum L b oundary measure k -p oint subset

1

d

d 2d1 d1

of a set of n points in IR , in time O (n + k n ) and space O (n). 2

9.2 Volume

While it is p ossible to derive a relatively ecient minimum volume algorithm us-

ing orthogonal neighbors, we can do b etter if weuse vertical neighb ors, as in our

minimum-area algorithm. Wesaythata point p is a vertical neighb or of a p oly-

top e T if the line through p parallel to the dth co ordinate axis intersects T .

d

v

Given a set A in IR and an arbitrary p oint p 2 A,we de ne a series of vertical

0

v v

extremal p oints, extremal simplices, and b ounding b oxes, whichwe denote p , S ,

i i

v v v v v

and B , resp ectively. As b efore, we de ne S = B = p .For all 1  i  d, p is the

i 0 0 0 i

v v v v

p ointin A farthest along the ith co ordinate axis from a (S ). S = conv(S ;p ).

i1 i i1 i

v v

B is the convex hull of twocopiesof B , displaced equal distances in opp osite

i i1

v

.For anysetA,wehave directions along the ith co ordinate axis, one containing p

i

v v

S (A)  A  B (A). Clearly, Lemma 9.1 still holds if we consider vertical neighb ors

d d

v

to B (A) instead of orthogonal neighbors to B (A), and Lemma 9.2 also applies to

r

r

vertical b ounding b oxes and extremal simplices.

Lemma 9.5. The minimum volume set A is contained in the O (k ) nearest vertical

v

neighbors of B (A).

d1

v d

Pro of: We divide B (A)into 2 d! congruentconvex pieces. By Lemma 9.2, each

d

v v

piece has the same volume as S (A). Since jAj jS (A)j, no piece can contain

d d

v

more than k points. The p oints in B (A) are the nearest vertical neighb ors of

d

v

B (A). 2

d1

Wenow describ e an ecient algorithm for nding nearest vertical neighb ors to

(d 1)-dimensional b oxes. First consider the simpler problem of nding nearest

neighbors to hyp erplanes. As we did in our planar algorithm, we use geometric

duality to transform the problem into nding, in an arrangementofhyp erplanes, the

k closest hyp erplanes ab ove some query p oint. Vertical p oint-hyp erplane distances in

the dual space are the same as the corresp onding vertical hyp erplane-p oint distances

in the primal space. Thus, we can solve this problem by vertical ray-shooting in the

dual space. We will use the following result of Matousek [28].

d

Lemma 9.6 (Matousek [28]). We can prepro cess a set of n points in IR , in time

d1

d

and space O (n = log n), so that the k nearest neighb ors to a query hyp erplane

can b e found in time O (k log n). 2

We make use of a technique develop ed by Chazelle et al. [9] for answering

range queries. Given a data structure used to answer some arbitrary geometric

Nearest Neighb ors and Minimal Polytop es 25

query, they build on top of it another structure, called a partition tree, that limits

the query to the p oints within an arbitrary halfspace. The resulting data structure

d+"

can b e built in time O (n + P (n)), where P (n) is the prepro cessing time required

for the original structure; and queries are answered in time O (Q(n)logn), where

Q(n) is the original query time. By building several levels of partition trees, it is

p ossible to limit queries to the intersection of several halfspaces.

d

Lemma 9.7. We can prepro cess a set of n p oints in IR , in time and space

d1

d

O (n = log n), so that the k nearest vertical neighb ors to a query (d1)-dimensional

d+1

box can b e found in time O (k log n).

Pro of: It suces to nd vertical neighb ors to simplices, since every b ox can b e split

into a constantnumb er of simplices, and neighb ors can b e merged in time O (k ). We

build a d-level partition tree, one level for each(d 2)-face of the query simplex,

on top of Matousek's vertical ray sho oting data structure. Since the hyp erplanes

b ounding the query region are all vertical, we actually build the partition trees in

d1

IR ,by ignoring the dth co ordinate of every p oint. 2

Theorem 9.3. We can nd the minimum volume k -p oint subset of a set of n

d+1

d

d O (k ) d d1+"

p oints in IR , in time O (kn log n +2 n ) and space O (n ). 2

10 Finding Minimal Convex Sets

We wish to extend our results results to the problem of nding minimal convex

k -p oint sets, that is, sets of k points which are the vertices of some convex p olygon

or p olytop e. Our previous results were based on the fact that, if some k p oints are

contained in a small convex body,we can nd a k -p oint set with smaller p erimeter

(circumradius, diameter, convex hull volume, etc.) than that b o dy.We cannot apply

this technique directly, since k p oints contained in some convex b o dy obviously do

not necessarily form a convex set. Hence we need a result of the form that, if

enough p oints are given, some k -p oint subset will b e convex. Such results are given

by Ramsey theory [24]; indeed, the following was one of the seminal results in the

development of b oth Ramsey theory and combinatorial geometry.



2k 4

Lemma 10.1 (Erd}os and Szekeres [21]). GivenasetofES (k )  +1

2

k 2

p oints in general p osition in the plane, some k points form the vertices of a convex

p olygon. 2



2k 4

d

Lemma 10.2. Given a set of ES (k )  +1 points in general p osition in IR ,

d

k 2

some k points form the vertices of a convex p olytop e.

26 D. Eppstein and J. Erickson

d

Pro of: Pro ject any set of ES (k )points in IR down to any plane. By the previous

2

lemma, some k points in the pro jection form a convex p olygon. The preimage of

d

those k p oints forms a convex p olytop e in IR . 2

k

This gives us an upp er b ound of ES (k )= O (4 ). Erd}os and Szekeres also

d

k 2

conjecture that ES (k )= 2 +1 andprove that this is a lower b ound. Tighten-

2

ing the b ounds on this function remains one of the outstanding op en problems in

combinatorial geometry [11]. Weknow of no b ounds on ES (k ) other than those

d

stated here, but it is clear that the function decreases with increasing d. Clearly,

any reduction of the upp er b ound on ES (k )would sp eed up our algorithms.

d

Using the previous lemma, we can generalize all of our results, b oth static and

dynamic, to nd minimum measure convex sets. The resulting time b ounds have

the same dep endence on n as the corresp onding k -p oint set results, but with an

exp onential dep endence on k .

For each of the measures we consider, if the minimum measure set is contained

in the m nearest neighb ors of eachofitspoints, then the minimum measure convex

k

set is contained in the O (m4 =k ) nearest neighb ors of eachofitspoints. Our pro of

technique is identical to the one used for our earlier neighbor counting lemmas. We

describ e a convex b o dy,typically a hyp ercub e, that contains the minimum measure

k

set. We then divide the b o dy into small pieces, such that if any piece contains O (4 )

p oints, then it necessarily contains a k -p ointconvex set with smaller measure then

the original minimum measure set.

Theorem 10.1. Given a set of n points in the plane, we can nd the convex k -

6k

gon with minimum p erimeter or L p erimeter, in time O (n log n +2 n) and space

1

k 4k

O (n log n +4 n +2 ).We can maintain the convex k -gon with minimum p erimeter

2

6k

or L p erimeter as p oints are inserted, in time O (2 k + log n) p er insertion and

1

4k

space O (n log n +2 ).

k

Pro of: The minimum p erimeter convex k -gon is contained in the O (4 ) nearest

neighb ors to each of its p oints. We can use the dynamic programming algorithm of

3

Eppstein et al. [20] to nd minimum p erimeter convex k -gons in time O (kn ) and

2

space O (n ). Using their algorithm as a subroutine, weachieve a static time b ound

k 3 6k

of O (n log n + k (4 ) n=k )=O (n log n +2 n). The dynamic time b ound follows

directly from Lemma 6.1. Our algorithms work under any metric. 2

Theorem 10.2. Given a set of n points in the plane, we can nd the convex k -gon

10k

with minimum circumradius or L diameter, in time O (n log n +2 n=k ) and space

1

k

O (n log n +4 n).We can maintain the convex k -gon with minimum circumradius

2

10k

or L diameter as p oints are inserted, in time O (2 +log n) p er insertion and

1

k

space O (n log n +4 ).

Nearest Neighb ors and Minimal Polytop es 27

Measure Static time b ound Dynamic time b ound

2

6k 6k

p erimeter O (n log n +2 n) O (2 k +log n)

2

6k 6k

L p erimeter O (n log n +2 n) O (2 k +log n)

1

2

10k 10k

circumradius O (n log n +2 n=k ) O (2 + log n)

2

10k 10k

L diameter O (n log n +2 n=k ) O (2 + log n)

1

2 2

2

2k +O (k ) 2k +O (k )

diameter O (n log n +2 n) O (2 +log n)

2 2

2

2k +k lg k +O (k ) 2k +k lg k +O (k )

variance O (n log n +2 n) O (2 +log n)

2 6k 2

area O (n log n +2 n ) |

Table 3. New results for nding minimum measure convex k -gons, given n points in the

plane. (Compare Table 1.)

k

Pro of: The minimum circumradius convex k -p oint set is contained in the O (4 )

nearest neighb ors to eachofitspoints. Edelsbrunner and Guibas [15] describ e an

algorithm that nds, given a set of n points, the largest (cardinality) convex subset

2

that includes a given leftmost p oint, in time O (n ) and space O (n). For eachpoint

p and each circumcircle containing it, rotate the p oints within the circle so that p

is leftmost, and nd the largest convex subset containing p. Since each p ointison

2

O (n ) circumcircles, the resulting algorithm nds the minimum circumradius convex

5

k -gon in time O (n ) and space O (n). We use this algorithm as a subroutine. 2

Theorem 10.3. Given a set of n points in the plane, we can nd the convex k -gon

2 6k 2 4k

with minimum area, in time O (n log n +2 n ) and space O (n log n +2 ).

k

Pro of: The minimum area convex k -p ointsetsiscontained in the O (4 ) nearest

vertical neighb ors to the segment joining its leftmost and rightmost p oints. We can

use the dynamic programming algorithm of Eppstein et al. [20] to nd minimum

3 2

area convex k -gons in time O (kn ) and space O (n ). As in the k -p oint set problem,

we can reduce the time complexitybycombining j -gons, j

of each segment p p . As in the k -p oint set problem, all minimum j -gons can b e

L R

k 3 6k

computed in time O ((4 ) )=O (2 ), and the results can b e combined in time O (k ).

2 6k 2

Therefore the total time is O (n log n +2 n ). 2

We are unable to generalize our planar diameter and variance algorithms, or any

of our algorithms in higher dimensions, to nd minimal convex sets. Consequently,

wemust use brute force within the neighb or sets, and our resulting time b ounds are

heavily exp onential in k . Nevertheless, for suciently small k , our algorithms are

faster than brute force. We summarize our planar results in Table 3, and our higher

dimensional results in Table 4.

28 D. Eppstein and J. Erickson

Measure Time b ound

2

2k 2k +O (k )

circumradius O (2 n log n +2 n)

2

2k 2k +O (k )

diameter O (2 n log n +2 n)

2

2k 2k +O (k )

L diameter O (2 n log n +2 n)

1

2 d1

k (d1)=2 2k + k lg k +O (k )

2

variance O (4 k n log n +2 n)

2

d 2k +O (k ) d1

b oundary measure O (n +2 n )

2

d 2k +O (k ) d1

L b oundary measure O (n +2 n )

1

2

d+1

d 2k +O (k ) d

volume O (kn log n +2 n )

Table 4. New results for nding minimum measure k -vertex convex p olytop es, given n

d

p oints in IR , for all d> 2. (Compare Table 2.)

11 Conclusions and Op en Problems

Wehave presented several algorithms for nding minimum measure k -p ointsets

under a variety of measures, b oth in the plane and in higher dimensions. Our results

are based on a common metho d. Given a set of p oints, we compute the nearest

neighb ors to each subset of r p oints, where r is a small constant determined by the

relevant measure, and then search within eachneighb or set using another algorithm.

For most of the measures wehave examined, r =1.For these measures, we can

reduce the number of neighborsetstosearchdown to O (n=k )by nding neighb ors

of neighb ors. Our planar results were achieved through the use of a new algorithm

that nds the m nearest rectilinear neighb ors of each of a given set of n points, in

time O (n log n + mn) on a random access machine. Wehave also presented versions

of our algorithms which maintain minimum measure sets as p oints are inserted and

versions which nd, or dynamically maintain, minimum measure convex sets.

Eppstein et al. [20] also consider the problem of nding minimal empty convex

p olygons. Unfortunately, our metho ds do not suce to solve this problem, except

for a few sp ecial cases. In the plane, every set of ve p oints contains an emptyconvex

quadrilateral, and every set of ten p oints contains an emptyconvex p entagon; our

techniques can b e applied to these cases. However, it is op en whether there is a

largest set with no emptyconvex hexagon (see, for example, [31]), and there are

arbitrarily large p oint sets that contain no emptyconvex heptagons [26]. Weknow

of no similar results in higher dimensions.

Our results suggest several op en problems. None of our results is known to

b e optimal. Faster algorithms, or matching lower b ounds, would b e interesting.

In particular, is it p ossible to nd higher-dimensional k -p oint sets with minimum

diameter, volume, or b oundary measure without resorting to brute force? Dobkin

et al. [14] and Eppstein et al. [20] present dynamic programming algorithms which

can b e used to solveavariety of minimum and maximum measure problems in the

plane, but it seems highly unlikely that their approach can b e adapted to higher

Nearest Neighb ors and Minimal Polytop es 29

dimensional problems. Similarly,wehave b een unable to generalize our minimum

diameter algorithm, or the earlier algorithms of Aggarwal et al. [2], into higher

dimensions.

Are there faster algorithms for nding nearest neighb ors? An ecient technique

for nding neighb ors of (d 2)- ats might also lead to a faster minimum b oundary

measure algorithm. Finally, is it p ossible to nd rectilinear neighb ors of p oints in

higher dimensions in o(mn log n) time?

12 Recent Results

Dickerson et al. [13] describ e an algorithm for nding k nearest neighb ors in the

plane, under any metric, in time O (n log n + kn log k ) and space O (n). Except

for L -diameter, we can replace our neighb or algorithm with theirs in each of the

1

algorithms in Section 5, without decreasing the time. The resulting algorithms all

follow the algebraic decision tree mo del of computation. In fact, we can improve the

p erformance of our variance algorithm by substituting the new neighb or algorithm

for Vaidya's. The new algorithm is faster than the one describ ed by Aggarwal

et al. [2] for all values of k .

Theorem 12.1. We can nd the minimum variance k -p oint subset of a set of

3=2+" 5=2

n p oints in the plane, in time O (n log n + k n) and space O (kn + k ). 2

Very recently, Datta et al. [12]develop ed new algorithms for each of the prob-

lems we discuss in Section 5, except variance, using a searchtechnique develop ed by

Lenhof and Smid [27] that do es not require the computation of nearest neighb ors

and follows the algebraic decision tree mo del. In the plane, their algorithms use the

same time and less space than the solutions we present here; in higher dimensions,

they improve b oth b oth time and space b ounds. They also present faster algo-

rithms for maintaining the optimal set as p oints are inserted, and new algorithms

for maintaining the optimal set as p oints are inserted and deleted, using techniques

develop ed by Smid [33]. Their dynamic algorithms work eciently in all dimensions.

References

[1] P. K. Agarwal and J. Matousek. Ray sho oting and parametric search. In 24th ACM

Symp. Theory Comput., pages 517{526, 1992.

[2] A. Aggarwal, H. Imai, N. Katoh, and S. Suri. Finding k points with minimum diameter

and related problems. J. Algorithms, 12:38{56, 1991.

[3] M. Ajtai, J. Komlos, and E. Szemeredi. Sorting in c log n parallel steps. Combinatorica, 3:1{19, 1983.

30 D. Eppstein and J. Erickson

[4] J. L. Bentley and J. B. Saxe. Decomp osable searching problems I: Static-to-dynamic

transformation. J. Algorithms, 1:301{358, 1980.

[5] B. Chazelle. An optimal convex hull algorithm and new results on cuttings. In 32nd

IEEE Symp. Found. Comput. Sci., pages 29{38, 1991.

th

[6] B. Chazelle and H. Edelsbrunner. An improved algorithm for constructing k -order

Voronoi diagrams. IEEE Trans. Comput., C-36:1349{1354, 1987.

[7] B. Chazelle, L. J. Guibas, and D. T. Lee. The p ower of geometric duality. BIT,

25:76{90, 1985.

[8] B. M. Chazelle and D. T. Lee. On a circle placement problem. Computing, 36:1{16,

1986.

[9] B. Chazelle, M. Sharir, and E. Welzl. Quasi-optimal upp er b ounds for simplex range

searching and new zone theorems. In 6th ACM Symp. Comput. Geom., pages 23{33,

1990.

[10] R. Cole. Slowing down sorting networks to obtain faster sorting algorithms. J. ACM,

34:200{208, 1987.

[11] H. P. Croft, K. J. Falconer, and R. K. Guy. UnsolvedProblems in Geometry. Springer-

Verlag, 1990.

[12] A. Datta, H.-P. Lenhof, C. Schwarz, and M. Smid. Static and dynamic algorithms

for k -p oint clustering problems. Rep ort MPI-I-93-108, Max-Planck-Institut Inform.,

Saarbruc  ken, Germany,1993. To app ear in Proc. 3nd Workshop Algorithms Data

Struct.

[13] M. T. Dickerson and R. L. Drysdale and J. R. Sack. Simple algorithm for enumerating

interp oint distances and nding k nearest neighb ors. Internat. J. Comput. Geom. Appl.

2:221{239, 1993.

[14] D. P. Dobkin, R. L. Drysdale, and L. J. Guibas. Finding smallest p olygons. In F. P.

Preparata, editor, Computational Geometry,volume 1 of Advances in Computing Re-

search, pages 181{214. JAI Press, 1983.

[15] H. Edelsbrunner and L. J. Guibas. Top ologically sweeping an arrangement. J. Comput.

Syst. Sci., 38:165{194, 1989.

[16] H. Edelsbrunner, J. O'Rourke, and R. Seidel. Constructing arrangements of lines and

hyp erplanes with applications. SIAM J. Comput., 15:341{363, 1986.

[17] D. Eppstein. New algorithms for minimum area k -gons. In 3rdACM-SIAM Symp.

Discrete Algorithms, pages 83{88, 1992.

[18] D. Eppstein. Persistence, oine algorithms, and space compaction. Technical Rep ort

91-54, Dept. Information and Comput. Sci., U. C. Irvine, 1991.

[19] D. Eppstein and J. Erickson. Iterated nearest neighb ors and nding minimal p olytop es.

In 4th ACM-SIAM Symp. Discrete Algorithms, pages 64{73, 1992.

[20] D. Eppstein, M. Overmars, G. Rote, and G. Wo eginger. Finding minimum area k -gons.

Discrete Comput. Geom., 7:45{58, 1992.

Nearest Neighb ors and Minimal Polytop es 31

[21] P. Erd}os and G. Szekeres. A combinatorial problem in geometry. Compositio Math.,

2:463{470, 1935.

[22] G. N. Frederickson and D. B. Johnson. The complexity of selection and ranking in

X + Y and matrices with sorted rows and columns. J. Comput. Syst. Sci., 24:197{208,

1982.

[23] F. W. Fredman and D. E. Willard. Trans-dichotomous algorithms for minimum span-

ning trees and shortest paths. In 31st IEEE Symp. Found. Comput. Sci., pages 719{725,

1990.

[24] R. L. Graham, B. L. Rothschild, and J. H. Sp encer. Ramsey Theory. John Wiley &

Sons, Second edition, 1990.

[25] J. Hershb erger and S. Suri. Finding tailored partitions. In 5th ACM Symp. Comput.

Geom., pages 255{265, 1989.

[26] J. D. Horton. Sets with no emptyconvex 7-gons. Canad. Math. Bul l., 26:482{484,

1983.

[27] H.-P. Lenhof and M. Smid. Enumerating the k closest pairs optimally.InProc. 33rd

Annu. IEEE Sympos. Found. Comput. Sci., pages 380{386, 1992.

[28] J. Matousek. On vertical ray-sho oting in arrangements. Comput. Geom. Theory. Appl.,

2:279{285, 1993.

[29] N. Megiddo. Applying parallel computation algorithms in the design of serial algo-

rithms. J. ACM, 30:852{865, 1983.

d

[30] K. Mulmuley. Output sensitive construction of levels and Voronoi diagrams in R of

order 1 to k .In22nd ACM Symp. Theory Comput., pages 322{330, 1990.

[31] M. H. Overmars, B. Scholten, and I. Vincent. Sets without emptyconvex 6-gons. Bul l.

EATCS, 37:160, 1989.

[32] M. H. Overmars and C.-K. Yap. New upp er b ounds in Klee's measure problem. SIAM

J. Comput., 20:1034{1045, 1991.

[33] M. Smid. Maintaining the minimal distance of a p oint set in p olylogarithmic time.

Discrete Comput. Geom., 7:415{431, 1992.

[34] P.M.Vaidya. An O (n log n) algorithm for the all-nearest-neighb ors problem. Discrete

Comput. Geom., 4:101{115, 1989.

Received July 15, 1992, and in revised form June ?, 1993.