## Sparse Regression via Range Counting

Jean Cardinal ∗†

Aur´ elien Ooms ‡§

January 1, 2020

## Abstract

The sparse regression problem, also known as best subset selection problem, can be cast as follows: Given a set S of n points in R d , a point y ∈ R d , and an integer 2 ≤ k ≤ d , find an affine combination of at most k points of S that is nearest to y . We describe a O n ( k -1 log d -k +2 n )-time randomized (1+ ε )-approximation algorithm for this problem with d and ε constant. This is the first algorithm for this problem running in time o n ( k ). Its running time is similar to the query time of a data structure recently proposed by Har-Peled, Indyk, and Mahabadi (ICALP'18), while not requiring any preprocessing. Up to polylogarithmic factors, it matches a conditional lower bound relying on a conjecture about affine degeneracy testing. In the special case where k = d = O (1), we also provide a simple O δ ( n d -1+ δ )-time deterministic exact algorithm, for any δ &gt; 0. Finally, we show how to adapt the approximation algorithm for the sparse linear regression and sparse convex regression problems with the same running time, up to polylogarithmic factors.

## 1 Introduction

Searching for a point in a set that is the closest to a given query point is certainly among the most fundamental problems in computational geometry. It motivated the study of crucial concepts such as multidimensional search data structures, Voronoi diagrams, dimensionality reduction, and has immediate applications in the fields of databases and machine learning. A natural generalization of this problem is to search not only for a single nearest neighbor, but rather for the nearest combination of a bounded number of points. More precisely, given an integer k and a query point y , we may wish to find an affine combination of k points of the set that is the nearest to y , among all possible such combinations. This problem has a natural interpretation in terms of sparse approximate solutions to linear systems, and is known as the sparse regression, or sparse approximation problem in the statistics and machine learning literature. Sparsity is defined here in terms of the glyph[lscript] 0 pseudonorm ‖ ‖ . 0 , the number of nonzero components. The sparse affine regression problem can be cast as follows:

Problem 1 (Sparse affine regression) . Given a matrix A ∈ R d × n , a vector y ∈ R d , and an integer 2 ≤ k ≤ d , find x ∈ R n minimizing ‖ Ax - ‖ y 2 , and such that ‖ x ‖ 0 ≤ k , and ∑ n i =1 x i = 1 .

∗ Universit´ libre de Bruxelles (ULB), Brussels, Belgium. e Email: jcardin@ulb.ac.be

† Supported by the Fonds de la Recherche Scientifique-FNRS under CDR Grant J.0146.18.

‡ BARC, University of Copenhagen, Denmark. Email: aurelien.ooms@di.ku.dk

§ Supported by the VILLUM Foundation grant 16582. Part of this research was accomplished while the author was a PhD student at ULB under FRIA Grant 5203818F (FNRS).

By interpreting the columns of A as a set of n points in R d , the problem can be reformulated in geometric terms as the nearest induced flat problem.

Problem 2 (Nearest induced flat) . Given a set S of n points in R d , an additional point y ∈ R d , and an integer k such that 2 ≤ k ≤ d , find k points of S such that the distance from y to their affine hull is the smallest.

Here the distance from a point to a flat is the distance to the closest point on the flat. Note that if we allow k = 1 in the above definition, we have the nearest neighbor problem as a special case. We consider the setting in which the dimension d of the ambient space as well as the number k of points in the sought combination are constant, and study the asymptotic complexity of the problem with respect to n . As observed recently by Har-Peled, Indyk, and Mahabadi [25], the problem is closely related to the classical affine degeneracy testing problem, defined as follows.

Problem 3 (Affine degeneracy testing) . Given a set S of n points in R d , decide whether there exists d +1 distinct points of S lying on an affine hyperplane.

The latter can be cast as deciding whether a point set is in so-called general position, as is often assumed in computational geometry problems. In the special case d = 2, the problem is known to be 3SUM-hard [6, 24]. In general, it is not known whether it can be solved in time O n ( d -δ ) for some positive δ [3, 21]. Supposing it cannot, we directly obtain a conditional lower bound on the complexity of the nearest induced flat problem. This holds even for approximation algorithms, which return an induced flat whose distance is within some bounded factor of the distance of the actual nearest flat.

Lemma 1 (Har-Peled, Indyk, and Mahabadi [25]) . If the nearest induced flat problem can be approximated within any multiplicative factor in time O n ( k - -1 δ ) for some positive δ , then affine degeneracy testing can be solved in time O n ( d -δ ) .

Proof. Suppose we have an approximation algorithm for the nearest induced flat problem. Then given an instance of affine degeneracy testing, we can go through every point y ∈ S and run this algorithm on an instance composed of the set S \ { y } , the point y , and k = d . The answer to the degeneracy testing instance is positive if and only if for at least one of these instances, the distance to the approximate nearest flat is zero. The running time is O n ( d -δ ).

## Motivations and previous works

Sparse regression is a cornerstone computational task in statistics and machine learning, and comes in a number of flavors. It is also referred to as best subset selection or, more generally, as feature selection problems [8, 31]. In practice, it is often useful to allow for the sparsity constraint by including a penalty term in the objective function, hence writing the problem in a Lagrangian form. If the glyph[lscript] 1 norm is used instead of the glyph[lscript] 0 norm, this method is known as the LASSO method [32], to which a tremendous amount of research has been dedicated in the past twenty years. In the celebrated k -SVD algorithm for sparse dictionaries design [2], the sparse coding stage consists of a number of sparse regression steps. In this context, they are typically carried out using greedy methods such as the matching pursuit algorithm [29]. Efficient sparse regression is also at the heart of compressed sensing techniques [10, 18].

Aiming at an exhaustive survey of the variants and applications of sparse regression is futile; instead, we refer to Hastie, Tibshirani, and Friedman [26] (Chapter 3), Miller [30], and references

therein. We also point to Bertsimas, Pauphilet, and Van Parys [9] for a recent survey on practical aspects of sparse regression methods.

The computational complexity of sparse regression problems is also well-studied [17, 22, 23, 31]. In general, when a solution x is sought that minimizes the number of nonzero components while being at bounded distance from y , the problem is known to be NP -hard [31]. However, the complexity of the sparse regression problem when the sparsity constraint k is taken as a fixed parameter has not been thoroughly characterized. In particular, no algorithm with running time o n ( k ) is known.

Recently, Har-Peled, Indyk, and Mahabadi [25] showed how to use approximate nearest neighbor data structures for finding approximate solutions to the sparse affine regression problem. They mostly consider the online version of the problem, in which we allow some preprocessing time, given the input point set S , to construct a data structure, which is then used to answer queries with input y . They also restrict to approximate solutions, in the sense that the returned solution has distance at most (1 + ε ) times larger than the true nearest neighbor distance for any fixed constant ε . They show that if there exists a (1 + ε )-approximate nearest neighbor data structure with preprocessing time S n, d, ε ( ) and query time Q n,d,ε ( ), then we can preprocess the set S in time n k -1 S n, d, ε ( ) and answer regression queries in time n k -1 Q n,d,ε ( ). Plugging in state of the art results on approximate nearest neighbor searching in fixed dimension [5], we obtain a preprocessing time of O n ( k log n ) with query time O n ( k -1 log n ) for fixed constants d and ε .

Har-Peled et al. [25] also consider the sparse convex regression problem, in which the coefficients of the combination are not only required to sum to one, but must also be nonnegative. In geometric terms, this is equivalent to searching for the nearest induced simplex. They describe a data structure for the sparse convex regression problem having the same performance as in the affine case, up to a O (log k n ) factor. For k = 2, they also give a (2 + ε )-approximation subquadratic-time offline algorithm. When d = O (1), the running time of this algorithm can be made close to linear.

Aclosely related problem is that of searching for the nearest flat in a set [7, 27, 28]. This was also studied recently by Agarwal, Rubin, and Sharir [1], who resort to polyhedral approximations of the Euclidean distance to design data structures for finding an approximate nearest flat in a set. They prove that given a collection of n ( k -1)-dimensional flats in R d , they can construct a data structure in time O n ( k polylog( n )) time and space that can be used to answer (1 + ε )-approximate nearest flat queries in time O (polylog( n )). They also consider the achievable space-time tradeoffs. Clearly, such a data structure can be used for online sparse affine regression: We build the structure with all possible ( n k ) flats induced by the points of S . This solution has a very large space requirement and does not help in the offline version stated as Problem 2.

In the following, we give an efficient algorithm for Problem 2, and bridge the gap between the trivial upper bound of O n ( k ) and the lower bound given by the affine degeneracy testing problem, without requiring any preprocessing.

## Our results

Nearest induced line, flat, or hyperplane. We prove that the nearest induced flat problem (Problem 2), can be solved within a (1 + ε ) approximation factor for constant d and ε in time O n ( k -1 log d -k +2 n ), which matches the lower bound on affine degeneracy testing, up to polylogarithmic factors. This is a near-linear improvement on all previous methods. The running time of our algorithm is also comparable to the query time of the data structure proposed by Har-Peled et al. [25]. The two main tools that are used in our algorithms are on one hand the approximation of

the Euclidean distance by a polyhedral distance, as is done in Agarwal, Rubin, and Sharir [1], and on the other hand a reduction of the decision version of the problem to orthogonal range queries. Note that orthogonal range searching data structures are also used in Har-Peled et al. [25], albeit in a significantly distinct fashion.

In Section 2, as warm-up, we focus on the special case of Problem 2 in which d = 3 and k = 2.

Problem 4 (Nearest induced line in R 3 ) . Given a set S of n points in R 3 , and an additional point y , find two points a, b ∈ S such that the distance from y to the line going through a and b is the smallest.

Our algorithm for this special case already uses all the tools that are subsequently generalized for arbitrary values of k and d . The general algorithm for the nearest induced flat problem is described in Section 3. In Section 4, we consider the special case of Problem 2 in which k = d , which can be cast as the nearest induced hyperplane problem.

Problem 5 (Nearest induced hyperplane) . Given a set S of n points in R d , and an additional point y , find d points of S such that the distance from y to the affine hyperplane spanned by the d points is the smallest.

For this case, we design an exact algorithm with running time O n ( d -1+ δ ), for any δ &gt; 0. The solution solely relies on classical computational geometry tools, namely point-hyperplane duality and cuttings [15, 16].

Our algorithms can be adapted to perform sparse linear regression, instead of sparse affine regression. In the former, we drop the condition that the sum of the coefficients must be equal to one. This is equivalent to the nearest linear induced k -flat problem. It can be solved in the same time as in the affine case. To see this, realize that the problem is similar to the nearest induced flat problem where the first vertex is always the origin. The obtained complexity is the same as the one for the nearest induced flat problem.

Nearest induced simplex. Adapting our algorithm to sparse convex regression, in which x is also required to be positive, is a bit more involved. Har-Peled et al. [25] augment their data structure for the nearest induced flat with orthogonal range searching data structures in ( k +1)dimensional space to solve this problem with an extra O (log k n ) factor in both the preprocessing and query time. We show we can perform a similar modification.

The sparse convex regression problem can be cast as the problem of finding the nearest simplex induced by k points of S .

Problem 6 (Nearest induced simplex) . Given a set S of n points in R d , an additional point y , and an integer k such that 2 ≤ k ≤ d , find k points of S such that the distance from y to their convex hull is the smallest.

We prove that this problem can also be approximated within a (1 + ε ) approximation factor for constant d and ε in time O n ( k -1 log d n ), hence with an extra O (log k -2 n ) factor in the running time compared to the affine case. This is described in Section 5.

Our results and the corresponding sections are summarized in Table 1.

Table 1: Results.

| Problem                                | Section   | Approximation   | Running Time                     |
|----------------------------------------|-----------|-----------------|----------------------------------|
| Problem 4: Nearest induced line in R 3 | § 2       | 1 + ε           | O ε ( n log 3 n )                |
| Problem 2: Nearest induced flat        | § 3       | 1 + ε           | O d,ε ( n k - 1 log d - k +2 n ) |
| Problem 5: Nearest induced hyperplane  | § 4       | 1               | O d,δ ( n d - 1+ δ ) , ∀ δ > 0   |
| Problem 6: Nearest induced simplex     | § 5       | 1 + ε           | O d,ε ( n k - 1 log d n )        |

## 2 A (1 + ε ) -approximation algorithm for the nearest induced line problem in R 3

We first consider the nearest induced line problem (Problem 4). We describe a near-linear time algorithm that returns a (1 + ε )-approximation to the nearest induced line in R 3 , that is, a line at distance at most (1 + ε ) times larger than the distance to the nearest line.

Theorem 1. For any positive constant ε , there is a randomized (1 + ε ) -approximation algorithm for the nearest induced line problem in R 3 running in time O ε ( n log 3 n ) with high probability.

(1 + ε ) -approximation via polyhedral distances. The proof uses the following result due to Dudley [19], that is also a major ingredient in the design of the data structure described by Agarwal, Rubin, and Sharir [1]. The polyhedral distance d Q ( y, v ) between two points y and v with respect to a polyhedron Q centered on the origin is the smallest λ such that the dilation λQ of Q centered on y contains v , hence such that v ∈ y + λQ .

Lemma 2 (Dudley [19]) . For any positive integer d and positive real ε , there exists a d -dimensional polyhedron Q of size O (1 /ε ( d -1) / 2 ) such that for every y, v ∈ R d :

$$\| y - v \| _ { 2 } \leq d _ { Q } ( y, v ) \leq ( 1 + \varepsilon ) \cdot \| y - v \| _ { 2 } \,.$$

Proof of Theorem 1. We reduce the problem to a simpler counting problem in two steps.

Edge-shooting. We use Lemma 2 for d = 3. We give an exact algorithm for computing the nearest induced line with respect to a polyhedral distance d Q , where Q is defined from ε as in Lemma 2. Given a polyhedron Q , one can turn it into a simplicial polyhedron by triangulating it. Therefore, for constant values of ε , this reduces the problem to a constant number of instances of the edge-shooting problem, defined as follows: Given an edge e of Q , find the smallest value λ such that y + λe intersects a line through two points of S . We iterate this for all edges of Q , and pick the minimum value. This is exactly the polyhedral distance from y to its nearest induced line.

Binary search. Using a randomized binary search procedure, we reduce the edge-shooting problem to a simpler counting problem, defined as follows: given the triangle ∆ defined as the convex hull of y and y + λe , count how many pairs of points a, b ∈ S are such that the line glyph[lscript] ( a, b ) through them intersects ∆. Suppose there exists a procedure for solving this problem. We can use this procedure to solve the edge-shooting problem as follows.

First initialize λ to some upper bound on the distance (for instance, initialize λ to the distance to the closest data point p ∈ S : λ = min p ∈ S ‖ p - ‖ y 2 ). Then count how many lines glyph[lscript] ( a, b ) intersects

Figure 1: The cone C a .

![image](https://ac.marcodsn.me/arxiv-markdown-images/1908.00351v2-figure-52bbaaa0-b179-4add-93a6-a5d1be744ac2.jpg)

∆, using the procedure. If there is only one, then return this value of λ . Otherwise, pick one such line uniformly at random, compute the value λ such that this line intersects y + λe . Then iterate the previous steps starting with this new value of λ . Since we picked the line at random, and since there are O n ( 2 ) such lines at the beginning of the search, the number of iterations of this binary search is O (log n ) with high probability.

We therefore reduced the nearest induced line problem to O ε ( -1 log n ) instances of the counting problem.

Orthogonal range counting queries. Data structures for orthogonal range counting queries store a set of points in R g in such a way that the number of points in a given g -rectangle (cartesian product of g intervals) can be returned quickly. Known data structures for orthogonal range counting queries in R g require O n ( log g -1 n ) preprocessing time and can answer queries in O (log g -1 n ) time [14, 34]. Note that the actual coordinates of the points do not matter: We only need to know the order of their projections on each axis. We now show how to solve the counting problem using a data structure for orthogonal range queries in R 3 .

Let us fix the triangle ∆ and a point a ∈ R 3 , and consider the locus of points b ∈ R 3 such that the line glyph[lscript] ( a, b ) intersects ∆. This is a double simplicial cone with apex a and whose boundary contains the boundary of ∆. This double cone is bounded by three planes, one for each edge of ∆. In fact, we will only consider one of the two cones, because glyph[lscript] ( a, b ) intersects ∆ if and only if either b is contained in the cone of apex a , or a is contained in the cone of apex b . Let us call C a the cone of apex a . This is illustrated on Figure 1.

Let us consider one edge f of ∆ and all the planes containing f . These planes induce a circular order on the points of S , which is the order in which they are met by a plane rotating around the supporting line of f . This is illustrated on Figure 2. Now let us denote by H f the plane containing a and f and by H + f the halfspace bounded by H f and containing ∆. The set of points of S contained in H + f is an interval in the circular order mentioned above. Hence the set of points contained in C a is the intersection of three intervals in the three circular orders defined by the three edges of ∆.

Now we can use an orthogonal range counting data structure for storing the points of S with coordinates corresponding to their ranks in each of the three orders induced by the three edges of

Figure 2: The order of the points defined by the planes containing an edge f of ∆.

![image](https://ac.marcodsn.me/arxiv-markdown-images/1908.00351v2-figure-83b9ae6f-15c2-4680-bcc0-e2522e32374e.jpg)

∆. This requires sorting them three times, in time O n ( log n ). Then for each point a ∈ S , we count the number of points b in the cone C a by querying the data structure. Note that the circularity of the order can be easily handled by doubling every point. We preprocess S in time O n ( log n ) and answer each of the n queries in time O (log 2 n ). Hence overall, this takes time O n ( log 2 n ).

glyph[negationslash]

This can be combined with the previous reductions provided we can choose a line intersecting ∆ uniformly at random within that time bound. This is achieved by first choosing a with probability proportional to the number of points b such that glyph[lscript] ( a, b ) ∩ ∆ = ∅ . Then we can pick a point b uniformly at random in this set in linear time.

Combining with the previous reductions, we therefore obtain an approximation algorithm running in time O ε ( n log 3 n ) for the nearest induced line problem in R 3 . This completes the proof of Theorem 1.

## 3 A (1 + ε ) -approximation algorithm for the nearest induced flat problem

This section is dedicated to proving our main result in full generality. We provide an efficient approximation algorithm for the nearest induced flat problem (Problem 2).

We use the following notations: aff( X ) denotes the affine hull of the set X and conv( X ) denotes its convex hull. The set { 1 2 , , . . . , n } is denoted by [ n ].

Theorem 2. For any constant positive real ε &gt; 0 and constant positive integers d and k , there is a randomized (1 + ε ) -approximation algorithm for the nearest induced flat problem in R d running in time O ε ( n k -1 log d -k +2 n ) with high probability.

Proof. The algorithm is a generalization of the one in the previous section, in which the point a is replaced by a set composed of k -1 points a , a 1 2 , . . . , a k -1 , and the edge e is now a (simplicial) ( d -k )-face of Q . Given a k -1-tuple of points a , a 1 2 , . . . , a k -1 , we characterize the locus of points a k such that the affine hull of the points a , a 1 2 , . . . , a k intersects the convex hull of y and y + λe . These hyperplanes are again such that counting all such points can be done using orthogonal range queries. More precisely, we perform the following steps.

(1 + ε ) -approximation and binary search. From Dudley's result, there exists a polyhedron of size O (1 /ε ( d -1) / 2 ) such that the induced polyhedral distance d Q ( ., . ) is a (1 + ε )-approximation of the Euclidean distance. We know that the distance d Q from the point y to the nearest induced flat is attained at a point lying on a ( d -k )-face of y + λQ . We can therefore perform the same procedure as in the previous case, except that we now shoot a ( d -k )-face e of Q , instead of an edge, in the same way as is done in Agarwal, Rubin, Sharir [1]. ∆ still denotes the convex hull of y and y + λe , which generalizes to a ( d -k +1)-simplex. The binary search procedure generalizes easily: start with a large enough λ , if there is more than one flat aff( { a , a 1 2 , . . . , a k } ) intersecting ∆ = conv( { y, y + λe } ), pick one such flat uniformly at random, and compute the value λ such that this flat intersects ∆. There are only O n ( k ) such flats at the beginning of the search, hence a search takes O (log n ) steps with high probability. We can therefore reduce the problem to O ε ( (1 -d / ) 2 log n ) instances of the following counting problem: given a ( d -k +1)-simplex ∆, count the number of k -tuples of points a , a 1 2 , . . . , a k ∈ S whose affine hull aff( a , a 1 2 , . . . , a k ) intersects ∆.

An intersection condition. We first make a simple observation that characterizes such k -tuples. Let A be a set of k points { a , a 1 2 , . . . , a k } , and let B = { b 1 , b 2 , . . . , b d -k +2 } be the set of vertices of ∆. We assume without loss of generality that the points of A together with the vertices of ∆ are in general position. We define d -k +2 hyperplanes H i = aff( A ∪ B \ { b , a i k } ) , i ∈ [ d -k +2]. We then let H + i be the halfspace supported by H i that contains b i , and H -i the halfspace that does not contain b i .

## Lemma 3.

glyph[negationslash]

$$\text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.}
\text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{} \\ \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{ } \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{]} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{.} \text{  } \text{.} \text{.} \text{.} \text{.} \text{  } \text{  } \text{.} \text{  } \text{  } \text{.} \text{  } \text{  } \text{.} \text{.} \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{   } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text
  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{\ } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{ } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{} \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  }; \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{ } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{ } \\ \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  return } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{  } \text{
}$$

glyph[negationslash]

glyph[negationslash]

Proof. ( ⇒ ) Suppose that a k ∈ ( ⋂ i H + i ) ∪ ( ⋂ i H -i ). Hence there exists i ∈ [ d -k + 2] such that a k ∈ H -i , and j ∈ [ d -k +2] such that a k ∈ H + j . We show that aff( A ) ∩ ∆ = ∅ . Let us consider the intersection of the two halfspaces H -i and H + j with the ( k -1)-dimensional subspace aff( A ). In this subspace, both halfspaces have the points a , a 1 2 , . . . , a k -1 on their boundary, and contain a k . Hence it must be the case that H -i ∩ aff( A ) = H + j ∩ aff( A ). Therefore, every point p ∈ aff( A ) either lies in H -i , or in H -j . In both cases, it is separated from ∆ by a hyperplane, and p ∈ ∆.

( ⇐ ) Suppose that aff( A ) ∩ ∆ = ∅ . We now show that there exists i ∈ [ d -k + 2] such that a k ∈ H -i , and j ∈ [ d -k + 2] such that a k ∈ H + j . Since both aff( A ) and ∆ are convex sets, if aff( A ) ∩ ∆ = ∅ then there exists a hyperplane H containing aff( A ) and having ∆ on one side. Since the points of A are affinely independent, it can then be rotated to contain all points of A except a k , and separate a k from ∆. After this, it has d -( k -1) degrees of freedom left, and can be further rotated to contain a whole ( d -k )-face of ∆, while still separating ∆ from a k . For some i ∈ [ d -k +2], this is now the hyperplane H i that separates some vertex b i from a k , and a k ∈ H -i .

Similarly, the same hyperplane H can instead be rotated in order to contain all points of A except a k , and have a k and ∆ this time on the same side. It can then be further rotated to contain a ( d -k )-face of ∆, while still having ∆ and a k on the same side. Now for some j ∈ [ d -k +2], this is now the hyperplane H j that has b j and a k on the same side, and a k ∈ H + j .

Note that for the case k = 2 and d = 3 the set ( ⋂ i H + i ) ∪ ( ⋂ i H -i ) is the double cone of apex a ; the lower part ( ⋂ i H + i ) is the cone C a in Figure 1. The case where k = 3 and d = 3 is illustrated on Figure 3.

Figure 3: Illustration of Lemma 3 in the case k = d = 3. The plane through a , a 1 2 , a 3 intersects the line segment ∆ if and only if a 3 is located either above or below the two planes H ,H 1 2 .

![image](https://ac.marcodsn.me/arxiv-markdown-images/1908.00351v2-figure-91c50157-b338-4c4c-bb2a-ac8ee74038bb.jpg)

Reduction to orthogonal range queries. We now show that in perfect analogy with the previous section, we can solve the counting problem efficiently using an orthogonal range counting data structure.

glyph[negationslash]

Consider a vertex b i of ∆ and a ( k -2)-subset T of points of S , denoted by T = { a , a 1 2 , . . . , a k -2 } . Let us denote by f the facet of ∆ that is induced by the vertices b j such that j = . Now consider i the hyperplane containing f together with T , and one additional point p of S . These hyperplanes all contain aff( f ∪ T ), which is a ( d -2)-flat. Let us consider the unit normal vectors to these hyperplanes centered on some point contained in this ( d -2)-flat. These vectors lie in the orthogonal flat of dimension d -( d -2) = 2, hence in a plane. Therefore, they induce a circular order on the points of S . Hence for a fixed set of k -2 points of S and a fixed facet f of ∆, we can assign a rank to each other point of S . These will play the role of the coordinates of the points in the range counting data structure.

We now observe that counting the number of k -tuples whose affine hull intersects ∆ amounts to orthogonal range counting with respect to these coordinates. Indeed, fix the first ( k -2)-subset of points T = { a , a 1 2 , . . . , a k -2 } , and compute the rank of each other point of S with respect to the circular order of the hyperplanes defined above, around each facet f of ∆. Now consider a ( k -1)th point a k -1 . From Lemma 3, all points a k contained in the range ( ⋂ i H + i ) ∪ ( ⋂ i H -i ) are such that aff( a , a 1 2 , . . . , a k ) intersects ∆. But this range is the union of two ( d -k +2)-rectangles in the space of coordinates that we defined. The coordinates of these two ( d -k +2)-rectangles are defined by the coordinates of a k -1 . We can therefore set up a new orthogonal range counting data structure for each ( k -2)-subset T , and perform 2 n queries in it, two for each additional point a k -1 ∈ S .

We can now outline our algorithm for solving the counting problem:

- 1. For each ( k -2)-subset T of points a , a 1 2 , . . . , a k -2 in ( S k -2 ) :

glyph[negationslash]

- (a) For each vertex b i of ∆, compute the rank of each point of S with respect to the hyperplanes containing f = conv( { b j : j = i } ) and T .
- (b) Build a ( d -k +2)-dimensional range counting data structure on S using these ranks as coordinates.
- (c) For each other point a k -1 ∈ S :

- i. Perform two range counting queries using the rectangular ranges corresponding to ⋂ i H + i and ⋂ i H -i , respectively.
- (d) Return the sum of the values returned by the range counting queries.

Note that there are a few additional technicalities which we have to take care of. First, the orders defined by the hyperplanes are circular, hence we are really performing range queries on a torus. This can be easily fixed, as mentioned previously, by doubling each point. Then we have to make sure to avoid double counting, since any permutation of the a i in the enumeration of k -tuples yields the same set A , and hence, the same flat aff( A ). (Note that in § 2 we avoided double counting by observing that only one of a ∈ C b and b ∈ C a can be true.) This only affects the counting problem and is not problematic if we consider ordered subsets T ; it causes each intersecting flat to be counted exactly k ! times. 1 The termination condition for the binary search can be changed to when the range count is k ! and the sampling method for finding a uniform random binary search pivot is unaffected since each candidate flat is represented an equal number of times.

As for the running time analysis, step 1b costs O n ( log d -k +1 n ), while step 1(c)i costs O (log d -k +1 n ) and is repeated n -k +2 times, hence costs O n ( log d -k +1 n ) overall as well [14, 34]. These are multiplied by the number of iterations of the main loop, yielding a complexity of O n ( k -1 log d -k +1 n ) for the counting procedure.

glyph[negationslash]

Finally, this counting procedure can be combined with the binary search procedure provided we can choose a flat intersecting ∆ uniformly at random within that time bound. This is achieved by first choosing a set prefix { a , a 1 2 , . . . , a k -1 } ∈ ( S k -1 ) with probability proportional to the number of points a k ∈ S such that aff( { a , a 1 2 , . . . , a k } ) ∩ ∆ = ∅ . Then we can pick a point a k uniformly at random in this set in linear time. Multiplying by the number of edge-shooting problems we have to solve, the counting procedure is invoked O ε ( (1 -d / ) 2 log n ) times, yielding the announced running time.

## 4 An exact algorithm for the nearest induced hyperplane problem

In this section we consider the special case k = d , the nearest induced hyperplane problem (Problem 5). The previous result gives us a randomized (1 + ε )-approximation algorithm running in time O ε ( n d -1 log 2 n ) for this problem. We describe a simple deterministic O n ( d -1+ δ )-time exact algorithm using only standard tools from computational geometry.

Theorem 3. The nearest induced hyperplane problem can be solved in deterministic time O n ( d -1+ δ ) for any δ &gt; 0 .

The first tool we need is point-hyperplane duality. Let ¯ be the hyperplane arrangement that is H dual to S , in which each point of S is now a hyperplane. Note that every vertex of this arrangement is the dual of a hyperplane induced by d points of S .

Unfortunately, while some dualities preserve vertical distances, there does not exist a duality that preserves euclidean distances. To overcome this obstacle, we make a topological observation. Recall that the zone of a hyperplane h in an arrangement ¯ H (not including h ) is the union of the d -cells of ¯ intersected by H h . Similarily, we define the refined zone of a hyperplane h in an arrangement

1 Enumerating each subset T exactly once as ( k -2)-tuples in lexicographic order and only constructing the orthogonal range searching data structure on the points of S that come after a k -2 reduces this overcounting to 2 times per flat. In our case, this is unnecessary since k is constant.

Figure 4: The candidate nearest hyperplanes.

![image](https://ac.marcodsn.me/arxiv-markdown-images/1908.00351v2-figure-b4b70012-ed0b-4bc4-86b1-a15a4aadc0fd.jpg)

¯ H (not including h ) to be the union of the d -simplices of the bottom-vertex decomposition of ¯ H intersected by h .

Lemma 4. Let ¯ H be the hyperplane arrangement that is dual to S , and ¯ y the hyperplane dual to the point y . The induced hyperplane that is nearest to y corresponds to a vertex of the refined zone of ¯ y in the arrangement ¯ H .

Proof. Consider the arrangement of all ( n k ) hyperplanes induced by subsets of k points in S . Then clearly, the induced hyperplane nearest to y must be one of the hyperplanes bounding the cell of this arrangement that contains y (see Figure 4 for an illustration with d = 2). Consider a rectilinear motion of y towards this nearest hyperplane. In the dual arrangement ¯ , H this corresponds to a continuous motion of the hyperplane ¯ that at some point hits a vertex of the arrangement. Because y it is the first vertex that is hit, it must belong to a cell of the bottom vertex decomposition of ¯ H that ¯ intersects, hence to the refined zone of ¯. y y

We refer to chapter 28 of the Handbook of Discrete and Computational Geometry [33] for background on hyperplane arrangements and their decompositions.

The second tool is an upper bound on the complexity of a zone in an arrangement [20]. The complexity of a zone is the sum of the complexities of its cells, and the complexity of a cell is the number of faces of the cell (vertices, edges, . . . ). The upper bound is as follows:

Theorem 4 (Zone Theorem [20]) . The complexity of a zone in an arrangement of n hyperplanes in R d is O n ( d -1 ) .

In particular, this result gives an upper bound of O n ( d -1 ) vertices for a given zone. Since the complexity of a refined zone is not more than the complexity of the corresponding zone, this bound also holds for the complexity of a given refined zone.

The third tool is Chazelle's efficient construction of cuttings [15]. A cutting of R d is a partition of R d into disjoint regions. Given a set of hyperplanes H in R d , a 1 r -cutting for H is a cutting of R d such that each region is intersected by no more than | H | r hyperplanes in H . In particular, we are interested in Chazelle's construction when r is constant. In that case, only a single step of his construction is necessary and yields regions that are the simplices of the bottom-vertex decomposition of some subset of H .

Theorem 5 (Chazelle [15, Theorem 3.3]) . Given a set H of n hyperplanes in R d , for any real constant parameter r &gt; 1 , we can construct a 1 r -cutting for those hyperplanes consisting of the O r ( d ) simplices of the bottom-vertex decomposition of some subset of H in O n ( ) time.

More details on cuttings can be found in chapters 40 and 44 of the Handbook [33].

Lemma 5. For any positive constant δ , given a hyperplane h and an arrangement of hyperplanes ¯ H in R d , the vertices of the refined zone of h in ¯ H can be computed in time O n ( d -1+ δ ) .

Proof. Using Theorem 5 with some constant r , we construct, in linear time, a 1 r -cutting of the arrangement consisting of O r ( d ) simplicial cells whose vertices are vertices of ¯ . H To find the vertices of the refined zone, we only need to look at those cells that are intersected by ¯. y If such a cell is not intersected by any hyperplane of ¯ H then its vertices are part of the refined zone of ¯. y Otherwise, we recurse on the hyperplanes intersecting that cell. From Theorem 4, there are at most O r ( d -1 ) such cells. The overall running time for the construction is therefore:

$$T ( n ) \leq O \left ( r ^ { d - 1 } \right ) T \left ( \frac { n } { r } \right ) + O ( n ).$$

For all constant δ &gt; 0, we can choose a sufficiently large constant r , such that T n ( ) = O n ( d -1+ δ ), as claimed.

Proof of Theorem 3. From Lemma 5, we find the vertices of the refined zone of ¯ in the arrangement y ¯ H in time O n ( d -1+ δ ). Then we compute the distance from y to each of the induced hyperplanes corresponding to vertices of the refined zone in time O n ( d -1 ). From Lemma 4, one of them must be the nearest.

## 5 A (1 + ε ) -approximation algorithm for the nearest induced simplex problem

We now consider the nearest induced simplex problem (Problem 6). The algorithm described in § 2 for the case k = 2 and d = 3 can be adapted to work for this problem.

As in § 2, consider the computation of the nearest induced segment under some polyhedral distance d Q approximating the Euclidean distance. The reduction from this computation to edgeshooting still works with some minor tweak: if we shoot edges to find the nearest induced segment under d Q , we may miss some of the segments. Fortunately, the points of these missed segments that are nearest to our query point under d Q must be endpoints of those segments. We can take those into account by comparing the nearest segment found by edge-shooting to the nearest neighbor, found in linear time. As before, edge-shooting is reduced to a counting problem.

Referring to the proof of Theorem 1 and Figure 1, the analogue of the counting problem in § 2 for the nearest induced segment problem amounts to searching for the points b lying in the intersection of the cone C a with the halfspace bounded by aff(∆) that does not contain a . In dimension d , the affine hull of ∆ is a hyperplane, and we restrict b to lie on one side of this hyperplane.

We therefore get a (1 + ε )-approximation O n ( log d n )-time algorithm for the nearest induced segment problem in any fixed dimension d . This compares again favorably with the (2 + ε )-approximation O n ( log n )-time algorithm proposed by Har-Peled et al. [25].

We generalize this to arbitrary values of k and prove the following result.

Theorem 6. For any constant positive real ε &gt; 0 and constant positive integers d and k , there is a randomized (1 + ε ) -approximation algorithm for the nearest induced simplex problem in R d running in time O n ( k -1 log d n ) with high probability.

Again, we compute the nearest induced simplex under some polyhedral distance d Q . As in the case k = 2, ( d -k )-face-shooting can be adapted to take care of missed simplices: for each 2 ≤ k ′ ≤ k , shoot ( d -k ′ )-faces of Q to find the nearest ( k ′ -1)-simplex. For k ′ = 1, find the nearest neighbor in linear time. For any ( k -1)-simplex, let 0 ≤ k ′ ≤ k be the smallest natural number such that no ( d -k ′ )-face of Q hits the simplex when shot from the query point. It is obvious that, for all t &lt; k ′ , some ( d -t )-face of Q hits the simplex, and that, for all t ≥ k ′ , no ( d -t )-face of Q hits the simplex. For the sake of simplicity, we hereafter focus on solving the face-shooting problem when k ′ = k , thus ignoring the fact a simplex can be missed. Because the obtained running time will be of the order of ˜ ( O n k ′ -1 ), the running time will be dominated by this case.

In order to reduce face-shooting to range counting queries, we need an analogue of Lemma 3 for convex combinations. Let A be a set of k points { a , a 1 2 , . . . , a k } , and let ∆ be a ( d -k +1)-simplex with vertices in B = { b 1 , b 2 , . . . , b d -k +2 } . We suppose that these points are in general position. We define the hyperplanes H i = aff( A ∪ B \{ b , a i k } ), for i ∈ [ d -k +2], and G j = aff( A ∪ B \{ a , a j k } ), for j ∈ [ k -1]. We let H + i be the halfspace supported by H i that contains b i , and G -j the halfspace supported by G j that does not contain a j .

## Lemma 6.

glyph[negationslash]

$$\text{t.s.} \text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text	$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text
$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text#\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{	$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\test$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text}$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text`$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text'$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text.$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text<$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$
$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\test{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\test}$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\test
$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$\text{$$$

glyph[negationslash]

Proof. ( ⇐ ) Suppose that a k ∈ ( ⋂ i H + i ) ∩ ( ⋂ j G -j ). We have that conv( A ) ∩ ∆ = ∅ if and only if both aff( A ) ∩ ∆ = ∅ and conv( A ) ∩ aff(∆) = ∅ hold. From Lemma 3, we already have aff( A ) ∩ ∆ = ∅ . It therefore remains to show that conv( A ) ∩ aff(∆) = ∅ .

glyph[negationslash]

glyph[negationslash]

glyph[negationslash]

glyph[negationslash]

glyph[negationslash]

glyph[negationslash]

glyph[negationslash]

We first prove that ( ⋂ j G j ) ∩ conv( A ) = ∅ . We proceed by induction on k . It can easily be shown to hold for k = 2. Let us suppose it holds for k -1, and prove it for k . The hyperplane G k -1 separates a k -1 from a k . Consider the point a ′ k -1 of the segment between a k -1 and a k that lies on G k -1 . Let A ′ = { a , a 1 2 , . . . , a k -2 , a ′ k -1 } . Consider the intersection G ′ j of all hyperplanes G j for j ∈ [ k -2] with the subspace aff( A ′ ). In the subspace aff( A ′ ), The hyperplanes G ′ j for j ∈ [ k -2] all separate a j from a ′ k -1 . Hence we can apply induction on A ′ and the hyperplanes G ′ in dimension k -2, and we have that ( ∩ j ∈ [ k -2] G ′ j ) ∩ conv( A ′ ) = ∅ . Now because a ′ k -1 ∈ conv( { a k -1 , a k } ), we also have that ( ∩ j ∈ [ k -1] G j ) ∩ conv( A ) = ∅ .

glyph[negationslash]

Now we also observe that ⋂ j G j = aff(∆). The fact that aff(∆) ⊆ ⋂ j G j is immediate since each G j contains aff(∆). To prove that ⋂ j G j cannot contain more than aff(∆) it suffices to show that those flats are of the same dimensions. Since the set A ∪ B is in general position, a j (and a k ) cannot lie on G j . Then we claim that the G j are in general position. Indeed if they are not, then there must be some 1 ≤ k ′ ≤ k -1 where ∩ j ≤ k ′ -1 G j = ∩ j ≤ k ′ G j . However, this is not possible since a k ′ ∈ ∩ j ≤ k ′ -1 G j but a k ′ ∈ ∩ j ≤ k ′ G j . The dimension of ⋂ j G j is thus d -k + 1, the same as the dimension of aff(∆).

glyph[negationslash]

Therefore, conv( A ) ∩ aff(∆) = ∅ , as needed.

glyph[negationslash]

( ⇒ ) Suppose that a k ∈ ( ⋂ i H + i ) ∩ ( ⋂ j G -j ). Then one of the halfspace does not contain a k . It can be of the form H + i or G -j . In both cases, all points of A are either contained in the hyperplane H i

Figure 5: Illustration of Lemma 6 in the case d = 3 and k = 2. The segment a a 1 2 intersects ∆ if and only if a 2 is located in the colored region below ∆.

![image](https://ac.marcodsn.me/arxiv-markdown-images/1908.00351v2-figure-a41c2bd1-0e73-4730-b59a-5f05d82ab9de.jpg)

or G j , or lie in H -i or G -j . Hence the hyperplane H i or G j separates the interiors of the convex hulls. From the general position assumption, it also separates the convex hulls.

The Lemma is illustrated on Figures 5 and 6 in the cases d = 3, k = 2, and d = k = 3.

Proof of Theorem 6. The algorithm follows the same steps as the algorithm described in the proof of Theorem 2, except that the ranges used in the orthogonal range counting data structure are different, and involve a higher-dimensional space.

We reduce the problem to that of counting the number of k -subsets A of S whose convex hull intersects a given ( d -k +1)-simplex ∆. We already argued that when fixing the first k -2 points a , a 1 2 , . . . , a k -2 , the hyperplanes H i induce a circular order on the points of S . Similarly, when the points a , a 1 2 , . . . , a k -2 are fixed, the hyperplanes G j all contain the ( d -2)-flat aff( A ∪ B \ { a , a j k -1 , a k } ), hence also induce a circular order on the points of S . Thus for each ( k -2)-subset of S , we can assign ( d -k +2)+( k -1) = d +1 coordinates to each point of S , one for each family of hyperplanes. We then build an orthogonal range query data structure using these coordinates. For each point a k -1 , we query this data structure and count the number of points a k such that a k ∈ ( ⋂ i H + i ) ∩ ( ⋂ j G -j ). From Lemma 6, we can deduce the number of subsets A whose convex hull intersects ∆.

We can decrease by one the dimensionality of the ranges by realizing that the supporting hyperplane of G -k -1 is unique as it does not depend on a k -1 , only the orientation of G -k -1 does. To only output points a k such that a k ∈ G -k -1 we construct two data structures: one with the points above G k -1 and one with the points below G k -1 . We query the relevant data structure depending whether a k -1 is above or below G k -1 . This spares a logarithmic factor and yields an overall running time of O n ( k -1 log d -1 n ) for the counting problem. Multiplying by the O (log n ) rounds of binary search yields the claimed result.

Figure 6: Illustration of Lemma 6 in the case k = d = 3. The triangle a a a 1 2 3 intersects ∆ if and only if a 3 is located in the colored region.

![image](https://ac.marcodsn.me/arxiv-markdown-images/1908.00351v2-figure-cc06a9a6-8ea7-407d-ad7a-987693c92fc8.jpg)

## 6 Discussion

We put the complexity of sparse regression on par with that of degeneracy testing in the fixeddimensional setting, and proposed the first o n ( k ) algorithm for this problem. A clear practical advantage of the structure proposed by Har-Peled et al. [25] is that one can reuse approximate nearest neighbor data structures that circumvent the curse of dimensionality, such as those based on locality-sensitive hashing [4]. Our technique based on approximating the Euclidean distance by a polyhedral distance, on the other hand, incurs an exponential dependence on d .

Some marginal improvements can probably be obtained by exploiting the structure of the problem further. For instance, we really only need orthogonal range emptiness queries in order to solve the decision version of our problem Also, we do not harness the power of the Word RAM model for speeding up the search [12, 13]. For other relevant techniques, we refer to the excellent presentation by Timothy Chan at WADS'13 on 'the art of shaving logs'[11].

## Acknowledgments

The authors wish to thank the reviewers of a preliminary version of this manuscript, who provided useful comments, as well as John Iacono and Stefan Langerman for insightful discussions.

## References

- [1] P. K. Agarwal, N. Rubin, and M. Sharir. Approximate nearest neighbor search amid higherdimensional flats. In 25th Annual European Symposium on Algorithms, ESA 2017, September 4-6, 2017, Vienna, Austria , pages 4:1-4:13, 2017.
- [2] M. Aharon, M. Elad, and A. Bruckstein. K-SVD: An algorithm for designing overcomplete

dictionaries for sparse representation. IEEE Transactions on Signal Processing , 54(11):43114322, Nov 2006.

- [3] N. Ailon and B. Chazelle. Lower bounds for linear degeneracy testing. J. ACM , 52(2):157-171, 2005.
- [4] A. Andoni and P. Indyk. Near-optimal hashing algorithms for approximate nearest neighbor in high dimensions. Commun. ACM , 51(1):117-122, 2008.
- [5] S. Arya, D. M. Mount, N. S. Netanyahu, R. Silverman, and A. Y. Wu. An optimal algorithm for approximate nearest neighbor searching fixed dimensions. J. ACM , 45(6):891-923, 1998.
- [6] L. Barba, J. Cardinal, J. Iacono, S. Langerman, A. Ooms, and N. Solomon. Subquadratic algorithms for algebraic 3SUM. Discrete &amp; Computational Geometry , 61(4):698-734, 2019.
- [7] R. Basri, T. Hassner, and L. Zelnik-Manor. Approximate nearest subspace search. IEEE Trans. Pattern Anal. Mach. Intell. , 33(2):266-278, 2011.
- [8] D. Bertsimas, A. King, and R. Mazumder. Best subset selection via a modern optimization lens. Ann. Statist. , 44(2):813-852, 04 2016.
- [9] D. Bertsimas, J. Pauphilet, and B. Van Parys. Sparse Regression: Scalable algorithms and empirical performance. arXiv e-prints , Feb 2019.
- [10] E. J. Cand` es, J. K. Romberg, and T. Tao. Robust uncertainty principles: exact signal reconstruction from highly incomplete frequency information. IEEE Trans. Information Theory , 52(2):489-509, 2006.
- [11] T. M. Chan. The art of shaving logs. https://web.archive.org/web/20191224144646/ http://tmc.web.engr.illinois.edu/talks/wads13\_talk.pdf , August 2013.
- [12] T. M. Chan, K. G. Larsen, and M. Patrascu. Orthogonal range searching on the RAM, revisited. In Proceedings of the 27th ACM Symposium on Computational Geometry, Paris, France, June 13-15, 2011 , pages 1-10, 2011.
- [13] T. M. Chan and B. T. Wilkinson. Adaptive and approximate orthogonal range counting. ACM Trans. Algorithms , 12(4):45:1-45:15, 2016.
- [14] B. Chazelle. A functional approach to data structures and its use in multidimensional searching. SIAM J. Comput. , 17(3):427-462, 1988.
- [15] B. Chazelle. Cutting hyperplanes for divide-and-conquer. Discrete &amp; Computational Geometry , 9:145-158, 1993.
- [16] B. Chazelle and J. Friedman. A deterministic view of random sampling and its use in geometry. Combinatorica , 10(3):229-249, 1990.
- [17] G. Davis, S. Mallat, and M. Avellaneda. Adaptive greedy approximations. Constructive Approximation , 13(1):57-98, Mar 1997.
- [18] D. L. Donoho. Compressed sensing. IEEE Trans. Information Theory , 52(4):1289-1306, 2006.

- [19] R. M. Dudley. Metric entropy of some classes of sets with differentiable boundaries. Journal of Approximation Theory , 10(3):227 - 236, 1974.
- [20] H. Edelsbrunner, R. Seidel, and M. Sharir. On the zone theorem for hyperplane arrangements. SIAM J. Comput. , 22(2):418-429, 1993.
- [21] J. Erickson and R. Seidel. Better lower bounds on detecting affine and spherical degeneracies. Discrete &amp; Computational Geometry , 13:41-57, 1995.
- [22] D. P. Foster, S. Kale, and H. J. Karloff. Online sparse linear regression. In Proceedings of the 29th Conference on Learning Theory, COLT 2016, New York, USA, June 23-26, 2016 , pages 960-970, 2016.
- [23] D. P. Foster, H. J. Karloff, and J. Thaler. Variable selection is hard. In Proceedings of The 28th Conference on Learning Theory, COLT 2015, Paris, France, July 3-6, 2015 , pages 696-709, 2015.
- [24] A. Gajentaan and M. H. Overmars. On a class of o n ( 2 ) problems in computational geometry. Comput. Geom. , 5:165-185, 1995.
- [25] S. Har-Peled, P. Indyk, and S. Mahabadi. Approximate sparse linear regression. In 45th International Colloquium on Automata, Languages, and Programming, ICALP 2018, July 913, 2018, Prague, Czech Republic , pages 77:1-77:14, 2018.
- [26] T. Hastie, R. Tibshirani, and J. H. Friedman. The elements of statistical learning: data mining, inference, and prediction, 2nd Edition . Springer series in statistics. Springer, 2009.
- [27] A. Magen. Dimensionality reductions in glyph[lscript] 2 that preserve volumes and distance to affine spaces. Discrete &amp; Computational Geometry , 38(1):139-153, 2007.
- [28] S. Mahabadi. Approximate nearest line search in high dimensions. In Proceedings of the Twenty-Sixth Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2015, San Diego, CA, USA, January 4-6, 2015 , pages 337-354, 2015.
- [29] S. Mallat and Z. Zhang. Matching pursuits with time-frequency dictionaries. IEEE Trans. Signal Processing , 41(12):3397-3415, 1993.
- [30] A. Miller. Subset Selection in Regression . Chapman and Hall/CRC, 2002.
- [31] B. K. Natarajan. Sparse approximate solutions to linear systems. SIAM J. Comput. , 24(2):227234, 1995.
- [32] R. Tibshirani. Regression shrinkage and selection via the lasso. Journal of the Royal Statistical Society. Series B (Methodological) , 58(1):267-288, 1996.
- [33] C. D. T´th, J. O'Rourke, and J. E. Goodman, editors. o Handbook of Discrete and Computational Geometry . Chapman and Hall/CRC, 3rd edition, 2017.
- [34] D. E. Willard. New data structures for orthogonal range queries. SIAM J. Comput. , 14(1):232253, 1985.
Jean Cardinal Aurélien Ooms
Sparse Regression via Range Counting
The sparse regression problem, also known as best subset selection problem,
can be cast as follows: Given a set $S$ of $n$ points in $\mathbb{R}^d$, a
point $y\in \mathbb{R}^d$, and an integer $2 \leq k \leq d$, find an affine
combination of at most $k$ points of $S$ that is nearest to $y$. We describe a
$O(n^{k-1} \log^{d-k+2} n)$-time randomized $(1+\varepsilon)$-approximation
algorithm for this problem with \(d\) and \(\varepsilon\) constant. This is the
first algorithm for this problem running in time $o(n^k)$. Its running time is
similar to the query time of a data structure recently proposed by Har-Peled,
Indyk, and Mahabadi (ICALP'18), while not requiring any preprocessing. Up to
polylogarithmic factors, it matches a conditional lower bound relying on a
conjecture about affine degeneracy testing. In the special case where $k = d =
O(1)$, we also provide a simple $O_\delta(n^{d-1+\delta})$-time deterministic
exact algorithm, for any \(\delta > 0\). Finally, we show how to adapt the
approximation algorithm for the sparse linear regression and sparse convex
regression problems with the same running time, up to polylogarithmic factors.