On the largest empty axis-parallel box amidst n points

# On the largest empty axis-parallel box amidst n points

Adrian Dumitrescu Department of Computer Science, University of Wisconsin–Milwaukee, WI 53201-0784, USA. Email: ad@cs.uwm.edu. Supported in part by NSF CAREER grant CCF-0444188. Part of the research by this author was done at the Ecole Polytechnique Fédérale de Lausanne.    Minghui Jiang Department of Computer Science, Utah State University, Logan, UT 84322-4205, USA. Email: mjiang@cc.usu.edu. Supported in part by NSF grant DBI-0743670.
###### Abstract

We give the first nontrivial upper and lower bounds on the maximum volume of an empty axis-parallel box inside an axis-parallel unit hypercube in containing points. For a fixed , we show that the maximum volume is of the order . We then use the fact that the maximum volume is in our design of the first efficient -approximation algorithm for the following problem: Given an axis-parallel -dimensional box in containing points, compute a maximum-volume empty axis-parallel -dimensional box contained in . The running time of our algorithm is nearly linear in , for small , and increases only by an factor when one goes up one dimension. No previous efficient exact or approximation algorithms were known for this problem for . As the problem has been recently shown to be NP-hard in arbitrary high dimensions (i.e., when is part of the input), the existence of efficient exact algorithms is unlikely.

We also obtain tight estimates on the maximum volume of an empty axis-parallel hypercube inside an axis-parallel unit hypercube in containing points. For a fixed , this maximum volume is of the same order order . A faster -approximation algorithm, with a milder dependence on in the running time, is obtained in this case.

Keywords: Largest empty box, largest empty hypercube, approximation algorithm.

## 1 Introduction

Given a set of points in the unit square , let be the maximum area of an empty axis-parallel rectangle contained in , and let be the minimum value of over all sets of points in . For any dimension , given a set of points in the unit hypercube , let as the maximum volume of an empty axis-parallel hyperrectangle (-dimensional axis-parallel box) contained in , and let be the minimum value of over all sets of points in . For simplicity we sometimes omit the subscript in the planar case ().

In this paper we give the first nontrivial upper and lower bounds on . For any dimension , our estimates are within a multiplicative constant (depending on ) from each other. For a fixed , we show that the maximum volume is of the order . While the algorithmic problem of finding an empty axis-parallel box of maximum volume has been previously studied for (see below), estimating the maximum volume of such a box as a function of and seems to have not been previously considered.

We first introduce some notations and definitions. Throughout this paper, a box is an open axis-parallel hyperrectangle contained in the unit hypercube , . Given a set of points in , a box is empty if it contains no points in , i.e., . If is a box, we also refer to the side length of in the th coordinate as the extent in the th coordinate of . Throughout this paper, and are the logarithms of in base and , respectively.

Given an axis-parallel rectangle in the plane containing points, the problem of computing a maximum-area empty axis-parallel sub-rectangle contained in is one of the oldest problems studied in computational geometry. For instance, this problem arises when a rectangular shaped facility is to be located within a similar region which has a number of forbidden areas, or in cutting out a rectangular piece from a large similarly shaped metal sheet with some defective spots to be avoided [18]. In higher dimensions, finding the largest empty axis-parallel box has applications in data mining, in finding large gaps in a multi-dimensional data set [13].

Several algorithms have been proposed for the planar problem over the years [1, 2, 3, 8, 11, 17, 18, 19]. For instance, an early algorithm by Chazelle, Drysdale and Lee [8] runs in time and space. The fastest known algorithm, proposed by Aggarwal and Suri in 1987 [1], runs in time and space. A lower bound of in the algebraic decision tree model for this problem has been shown by Mckenna et al. [17].

For any dimension , there is an obvious brute-force algorithm running in time and space. No significantly faster algorithms, i.e., with a fixed degree polynomial running time in , where known. Confirming this state of affairs, Backer and Keil [5, 6] recently proved that the problem is NP-hard in arbitrary high dimensions (i.e., when is part of the input). They also gave an exact algorithm running in time, for any . In particular, the running time of their exact algorithm for is . Previously, Datta and Soundaralakshmi [12] had reported an time exact algorithm for the case, but their analysis for the running time seems incomplete. Specifically, the running time depends on an upper bound on the number of maximal empty boxes (see discussions in the next paragraph), but they only gave an lower bound. Here we present the first efficient -approximation algorithm for finding an axis-parallel empty box of maximum volume, whose running time is nearly linear for small , and increases only by an factor when one goes up one dimension.

An empty box of maximum volume must be maximal with respect to inclusion. Following the terminology in [18], a maximal empty box is called restricted. Thus the maximum-volume empty box in is restricted. Naamad et al. [18] have shown that in the plane, the number of restricted rectangles is , and that this bound is tight. It was conjectured by Datta and Soundaralakshmi [12] that the maximum number of restricted boxes is for each (fixed) . The conjecture has been recently confirmed by Backer and Keil [5, 6] (for ). Here we extend (Theorem 7, Appendix D) the constructions with restricted boxes for in [18] and in [12] for arbitrary . Independently and simultaneously, Backer and Keil have also obtained this result [4, 5, 6]. Hence the maximum number of restricted boxes is for each fixed . This means that any algorithm for computing a maximum-volume empty box based on enumerating restricted boxes is inefficient in the worst case. On the other hand, at the expense of giving an -approximation, our algorithm does not enumerate all restricted boxes, and achieves efficiency by enumerating all canonical boxes (to be defined) instead.

#### Our results are:

(I)

In Section 2 we show that for . More precisely: , and . From the other direction we have , and for any . Here is the th prime.

(II)

In Section 3 we exploit the fact that the maximum volume is in our design of the first efficient -approximation algorithm for finding the largest empty box: Given an axis-parallel -dimensional box in containing points, there is a -approximation algorithm, running in time, for computing a maximum-volume empty axis-parallel box contained in .

(III)

In Appendix B we show that the estimate also holds for the maximum volume (or area) of an axis-aligned hypercube (or square) amidst point in . In Appendix C we present a faster -approximation algorithm for finding the largest empty hypercube: Given an axis-parallel -dimensional hypercube in containing points, there is a -approximation algorithm, running in time, for computing a maximum-volume empty axis-parallel hypercube contained in .

(IV)

In Appendix D we derive an lower bound on the number of restricted boxes in -space, for fixed . This matches the recent upper bound of Backer and Keil [5, 6]. Following their idea, we further narrow the gap between the bounds (in the dependence of ) based on a finer estimation.

## 2 Empty rectangles and boxes

### 2.1 Empty rectangles in the plane

#### The lower bound.

We start with a very simple-minded lower bound; however, as it turns out, it is very close to optimal. One can immediately see that , by partitioning the unit square with vertical lines through each point: out of at most resulting empty rectangles, the largest rectangle has area at least . Thus we have:

###### Proposition 1.
 A(n)≥1n+1. (1)

The following observation is immediate from invariance under scaling with respect to any of the coordinate axes.

###### Observation 1.

Assume that holds for some and . Then, given points in an axis-aligned rectangle , there is an empty rectangle contained in of area at least .

Using the next two lemmas we will slightly improve the trivial lower bound in our next Theorem 1. Let be the solution in of the quadratic equation .

###### Lemma 1.

Given points in the unit square, there exists an empty rectangle with area at least . This bound is tight, i.e., .

###### Proof.

Let , and assume without loss of generality that , and . Write , and . Consider the three empty rectangles , , and . Their areas are , , and , respectively. If or , we are done, as one of the first two rectangles has area at least . So we can assume that and . Then it follows that

 (1−x)(1−y)≥(1−ξ)2=ξ,

so the third rectangle has area at least , as required.

To see that this bound is tight, take , , and check that the largest empty rectangle has area . ∎

The proof of the next lemma appears in Appendix A.

###### Lemma 2.

Given points in the unit square, there exists an empty rectangle with area at least . This bound is tight, i.e., .

###### Theorem 1.

Given points in the unit square, there exists an empty rectangle with area at least . That is, .

###### Proof.

Write , for some and . Partition into rectangles of equal width. There exists at least one rectangle with at most points in its interior. By Lemma 2 and Observation 1, contains an empty rectangle of area at least

 14⋅1k+1≥54⋅1n+5=(54−o(1))⋅1n,

as claimed. ∎

The lower bound derived in the proof, , is better than for all . For , the resulting bound is . An alternative partition, yielding the same bound in Theorem 1, can be obtained by dividing into rectangles with vertical lines through every th point of the set. Slightly better lower bounds, particularly for small values of can be obtained by constructing different partitions tailored for specific values of (with a number of points other than in a few of the rectangles), and using estimates on , , etc. For instance, from Lemma 2 we can derive that . Incidentally, we remark that a suitable -point construction gives from the other direction that .

#### The upper bound.

Let be the van der Corput set of points [9, 10], with coordinates , , constructed as follows [7, 16]: Let . If is the binary representation of , where , then . Observe that all points in lie in the unit square .

###### Theorem 2.

For the van der Corput set of points, , the area of the largest empty axis-parallel rectangle is less than .

###### Proof.

Let be any open empty axis-parallel rectangle inside the unit square. We next show111The argument we use here is similar to that used for bounding the geometric discrepancy of the van der Corput set of points. that the area of is less than . Following the presentation in [16, p. 39], a canonical interval is an interval of the form for some positive integer and an integer .

Let be the longest canonical interval contained in the projection of the empty rectangle onto the -axis (recall that is open, so this projection is an open interval). Then the side length of along must be less than because otherwise the projection would contain a longer canonical interval of length .

Let be the binary representation of an integer , . In the van der Corput construction, a point in with -coordinate has its -coordinate in the canonical interval if and only if , which happens exactly when . In this case, is a constant . It then follows that the side length of along is at most . Therefore the area of is less than , as required. ∎

.

### 2.2 Empty boxes in higher dimensions

As in the planar case, is immediate, by partitioning the hypercube with axis-parallel hyperplanes, one through each of the points. By projecting the points on one of the faces of , and proceeding by induction on , it follows that the lower bound in Theorem 2 carries over here too. Thus we have:

###### Proposition 2.

. Moreover, .

We next show that, modulo a constant factor depending on , this estimate is also best possible. Let be the Halton-Hammersely set of points [14, 15], with coordinates , , constructed as follows [7, 16]: Let be the th prime number. Each integer has a unique base- representation , where . Let , and let , . Then all points in are inside the unit hypercube .

###### Theorem 3.

For the Halton-Hammersely set of points, , the volume of the largest empty axis-parallel box is less than , where is the th prime.

###### Proof.

Let be any open empty box inside the unit hypercube. We next show that the volume of is less than . Generalizing the planar case, a canonical interval of the axis , , is an interval of the form for some positive integer and an integer . Note that .

First consider each axis , . Let be a longest canonical interval (there could be more than one for ) contained in the projection of the empty box onto the axis . Then the side length of along must be less than because otherwise the projection would contain a longer canonical interval of length .

Next consider the axis . Let be the base- representation of an integer , and . In the Halton-Hammersely construction, a point in with -coordinate has its -coordinate in the canonical interval if and only if , which happens exactly when . In this case, is a constant .

Note that the integers , , are relatively prime. By the Chinese remainder theorem, it follows that a point in with -coordinate has its -coordinate in the canonical interval for all if and only if for some integer . Therefore the side length of along is at most . Consequently, the volume of is less than . ∎

###### Corollary 2.

.

It is known that as [20].

## 3 A (1−ε)-approximation algorithm for finding the largest empty box

Let be an axis-parallel -dimensional box in containing points. In this section, we present an efficient -approximation algorithm for computing a maximum-volume empty axis-parallel box contained in .

###### Theorem 4.

Given an axis-parallel -dimensional box in containing points, there is a -approximation algorithm, running in

 O((8edε2)d⋅n⋅logdn)

time, for computing a maximum-volume empty axis-parallel box contained in .

We first set a few parameters.

#### Parameters.

We assume that , and , which cover all cases of interest. To somewhat simplify our calculations we also assume that . Let us choose parameters

 δ=ε2d,  m=⌈1δ⌉=⌈2dε⌉,  and a=11−δ. (2)

Let be the unique positive integer such that

 ak−1≤n+1

We next derive some inequalities that follow from this setting. By assumptions and , we have , and . Then a simple calculation shows that

 a=11−δ≤1+65δ=1+3ε5d. (4)

It is also clear that . So satisfies

 1<1+δ

Since and , it follows from the second inequality in (3) that . We now derive an upper bound on as a function of , and . First observe that

 loga=log11−δ≥log(1+δ).

We also have

 ln(1+δ)≥0.9δ  for δ≤16.

From (3) we deduce the following sequence of inequalities:

 k−1≤log(n+1)loga≤log(n+1)log(1+δ)=log(n+1)⋅ln2ln(1+δ)≤log(n+1)⋅ln20.9δ≤0.78log(n+1)δ. (6)

From (6), a straightforward calculation (where we use and ) gives

 k≤0.78log(n+1)δ+1≤0.78log(n+1)+1/6δ≤lognδ=2dε⋅logn. (7)

#### Overview of the algorithm.

By a direct generalization of Observation 1, we can assume w.l.o.g. that . Let be the set of points contained in . The algorithm generates a finite set of canonical boxes; to be precise, only a subset of large canonical boxes. For each large canonical box , a corresponding canonical grid is considered, and is placed with its lowest corner at each such grid position and tested for emptiness and containment in . The one with the largest volume amongst these is returned in the end.

#### Canonical boxes and their associated grids.

Consider the set of canonical boxes, whose all side lengths are elements of

 X={aiak+1,i=0,1,…,k−1}. (8)

For a given canonical box , with sides , consider the canonical grid associated with with points of coordinates

 (i1X1m,…,idXdm),  i1,…,id≥0 (9)

contained in .

Let be a maximum-volume empty box in , with . By the trivial inequality of Proposition 2, we have . This lower bound is crucial in the design of our approximation algorithm, as it enables us to bound from above the number of large canonical boxes (canonical boxes of smaller volume can be safely ignored).

Consider the following set of intervals

 I={[aiak+1,ai+1ak+1),i=0,1,…,k}. (10)

Observe that for each , the extent in the th coordinate of is at least , since otherwise we would have , a contradiction. Let be the extent in the th coordinate of , for . By the above observation, for each , belongs to one of the last intervals in the set . That is, there exists an integer , such that

 Zi∈[ayi+1ak+1,ayi+2ak+1). (11)

The next lemma shows that contains an (empty) canonical box with side lengths

 Xi=ayiak+1, i=1,…,d, (12)

at some position in the canonical grid associated with it. We call such a canonical box contained in a maximum-volume empty box, a large canonical box. Two key properties of large canonical boxes are proved in Lemma 4 and Lemma 5.

###### Lemma 3.

If for each , the extent in the th coordinate of belongs to the interval as in (11), then contains an (empty) large canonical box with side lengths as in (12) at some position in the canonical grid associated with it.

###### Proof.

It is enough to prove the containment for each coordinate axis . Let and be the corresponding intervals of and , respectively. Assume for contradiction that the placement of with its left end point at the first canonical grid position in is not contained in . But then we have, by taking into account the grid cell lengths:

 ayi+1ak+1≤|I|<|I0|+|I0|m≤|I0|+δ⋅|I0|=(1+δ)ayiak+1,

and consequently,

 a<1+δ.

We reached a contradiction to the 2nd inequality in (5), and the proof is complete. ∎

We now show that the (empty) large canonical box from the previous lemma yields a -approximation for the empty box of maximum volume.

###### Lemma 4.
 vol(B0)≥(1−ε)⋅vol(B).
###### Proof.

By (12) and (11),

 vol(B0)=d∏i=1ayiak+1=1a2dd∏i=1ayi+2ak+1≥1a2d⋅vol(B).

It remains to be shown that

 1a2d≥1−ε.

But this follows from our choice of and from Bernoulli’s inequality:

 (1+x)q≥1+qx, for any x≥−1, and any positive integer q.

Indeed,

 1a2d=(1−ε2d)2d≥1−2d⋅ε2d=1−ε,

and the proof of Lemma 4 is complete. ∎

Observe that the number of canonical boxes in is exactly , and by (7) is bounded from above as follows:

 kd≤(2dε)d⋅logdn. (13)

We can prove however a better upper bound on the number of large canonical boxes.

###### Lemma 5.

The number of large canonical boxes in is at most

 (2eε)d⋅logdn.
###### Proof.

Recall that satisfies

for some integers . It follows immediately that

 dk−k−d≤d∑i=1yi≤dk−d, (14)

and we want an upper bound on the number of solutions of (14). Make the substitution , for . So , for . The above inequalities are equivalent to

 0≤d∑i=1zi≤k. (15)

Let be a nonnegative integer. It is well-known (see for instance [21]) that the number of nonnegative integer solutions of the equation equals , that is, when we ignore the upper bound on each . Summing over all values of , and using a well-known binomial identity (see for instance [21, p. 217]) yields that the number of solutions of (15), hence also of (14), is no more than

 k∑t=0(t+d−1d−1)=(k+d−1+1d−1+1)=(k+dd).

A well-known upper bound approximation for binomial coefficients

 (nk)≤(enk)k,

for positive integers and with , further yields that

 (k+dd)≤(e(k+d)d)d=ed(k+dd)d. (16)

We now check that

 k+d≤lognδ.

Recall inequality (6). A straightforward calculation (where we use , , and ), gives

 k+d≤0.78log(n+1)δ+d+1=0.78log(n+1)+d+12dεδ≤lognδ=2dε⋅logn, (17)

as claimed. Substituting this upper bound into (16) yields

 (k+dd)≤ed(2ddε⋅logn)d=(2eε)d⋅logdn, (18)

as required. This expression is an upper bound on the number of solutions of (14), hence also on the number of large canonical boxes in . ∎

Given a grid with cell lengths , we superimpose it so that the origin of is a grid point of the above grid. Denote the corresponding grid cells by index tuples , where . Note that some of the grid cells on the boundary of may be smaller. Given a grid superimposed on , let be the number of cells (with nonempty interior) into which is partitioned.

Consider a (fixed) canonical box, say , with side lengths as in (12). The associated canonical grid, say , has side lengths times smaller in each coordinate. We now derive an upper bound on the number of canonical grid positions where a canonical box is placed and tested for emptiness, according to (9).

###### Lemma 6.

The number of canonical grid positions for placing in is bounded as follows:

 M(G0)≤12⋅(2dε)d⋅n.
###### Proof.

We have

Observe that

 m⋅ak+1ayi+1=m⋅ak+1+ayiayi≤m⋅ak+1+ak−1ayi≤(m+1)ak+1ayi.

By substituting this bound in the product we get that

 M(G0) ≤d∏i=1(m+1)⋅ak+1ayi=(m+1)dd∏i=1ak+1ayi=(m+1)d⋅akd+d∏di=1ayi ≤(m+1)d⋅akd+dakd−k−d=(m+1)d⋅a2d⋅ak. (19)

For the last inequality above we used (14). We now bound from above each of the three factors in (3). For bounding the second and the third factors we use inequalities (4) and (3), respectively.

 (m+1)d=(⌈2dε⌉+1)d≤(2dε+2)d=(2dε)d(1+εd)d≤(2dε)d⋅eε≤e(2dε)d.
 a2d≤(1+3ε5d)2d≤e6ε/5≤e6/5.
 ak=a⋅ak−1≤a(n+1)≤65⋅(n+1)≤13n10, for n≥12.

Substituting these upper bounds in (3) gives the desired bound:

 M(G0)≤e11/5(2dε)d⋅13n10≤12⋅(2dε)d⋅n.

#### Testing canonical boxes for emptiness.

Given a grid with cell lengths , denote the corresponding grid cell counts or cell numbers (i.e., the number of points) in cell by . For simplicity, we can assume w.l.o.g. that in all the grids that are generated by the algorithm, no point of lies on a grid cell boundary. Indeed the points of on the boundary of can be safely ignored, and the above condition holds with probability if instead of the given , the algorithm uses a value chosen uniformly at random from the interval ; see also the setting of the parameters in (2). Given a grid , and dimensions (array sizes) , a floating box at some position aligned with it, that is, whose lower left corner is a grid point, and with the specified dimensions is called a grid box. All the canonical boxes generated by our algorithm are in fact grid boxes.

The next four lemmas (78910) outline the method we use for efficiently computing the number of points in in a rectangular box, over a sequence of boxes. In particular these boxes can be tested for emptiness within the same specified time.

###### Lemma 7.

Let be a grid with cell lengths , superimposed on , with cells. Then the number of points of lying in each cell, over all cells, can be computed in time.

###### Proof.

The number of points in each cell of is initialized to . For each point , its cell index tuple (label) is computed in time using the floor function for each coordinate, and the corresponding cell count is updated. ∎

Remark. If the floor function is not an option, the number of points in each cell can be computed using binary search for each coordinate. The resulting time complexity is .

Denote by the number of points in in the box with lower left cell , and upper right cell ; we refer to the numbers as corner box numbers.

###### Lemma 8.

Given a grid with cell lengths placed at the origin, with cells, and grid cell counts , over all cells, the corner box numbers , over all cells, can be computed in time.

###### Proof.

Define , if for some . Let be a binary vector. Let the parity of be . By the inclusion-exclusion principle, the corner box numbers are given by the following formula with at most operations:

 N(i1,i2,…,id)=n(i1,i2,…,id)+∑cb=(b1,b2,…,bd)b≠(0,0,…,0)(−1)π(b)+1N(i1−b1,i2−b2,…,id−bd).

Since has cells, the bound follows. ∎

###### Lemma 9.

Given is a grid with cell lengths placed at the origin, with cells, and corner box numbers , over all cells. Let be a (canonical) grid box with dimensions (array sizes) , and lower left cell . Then the number of points of in , denoted , can be computed in time.

###### Proof.

Let be the upper right cell of . By the inclusion-exclusion principle, the corner box number can be computed as follows:

 N(j1,j2,…,jd)=N(B0)+∑b=(b1,b2,…,bd)b≠(0,0,…,0)(−1)π(b)+1N(j1−b1M1,j2−b2M2,…,jd−bdMd).

Hence can be extracted from the above formula with at most operations. ∎

Let be the number of points in in the canonical box of dimensions (array sizes) , and lower left cell .

###### Lemma 10.

Given is a grid with cell lengths placed at the origin, with cells, and corner box numbers , over all cells. Then the numbers (counts) , over all cells, can be computed in time.

###### Proof.

There are cells determined by in , and for each, apply the bound of Lemma 9. ∎

#### The last step in the proof of Theorem 4.

For each canonical box, say , there is a unique associated canonical grid, say . The time taken to test for emptiness and containment in when placed at all grid positions in , is obtained by adding the running times in lemmas 7, 8, and 10:

 O(d⋅n+M(G0)+2d⋅M(G0)