1 Introduction

Context In many applications, shapes are often represented as the union of a finite set of balls. Such a representation is used in biochemistry to model molecules [10, 18] or in computer graphics to detect collisions between objects [5]. Unions of balls have become ubiquitous representations of shapes, largely due to the existence of provably good conversion algorithms that allow to build them from other representations such as point clouds [2], polygonal meshes [15, 26, 29] or digital shapes [14]. Conversion algorithms generally output very large (and sometimes infinite) collections of balls. This may be the case when conversion algorithms aim at representing the shape as the union of its medial balls. A ball b is said to be medial for a given shape if every ball that contains b and is contained in the shape is equal to b. Assuming that balls are closed and the shape is compact, the union of medial balls provides an exact description of the shape, whose size however may be infinite. The centers of medial balls form the medial axis, whose stability and computation (either exact or approximated) have been widely studied; see [3] for a state-of-the-art report. For computationally demanding tasks such as the simulation of physical processes [20], shape interpolation or shape matching [8, 32], it is desirable that the collection of balls that describes a shape has a small size while its union still provides an accurate approximation of the shape. The quality of the approximation is usually measured by various quantities such as the Hausdorff distance or the difference in volume between the shape and its representation. In other situations such as collision detection, it may be important that the union of balls satisfies some geometric constraints. For instance, we may want the balls to cover the shape or at least a prescribed set of points.

Ball Approximations In this work, we introduce a novel way of constraining a collection of balls so that its union remains close to the shape. The idea is to force balls to cover a subset of the shape while remaining contained in a superset of the shape, hence allowing balls neither to cover exactly nor to be contained perfectly in the shape. To explain this more precisely, we need some notation and definitions. Unless stated otherwise, all balls considered in the paper are closed. We denote by b(xr) the (closed) ball centered at x with radius r. Given a subset \(S \subseteq \mathbb {R}^n\) and a real number \(r \ge 0\), we recall that the dilation of S by a ball of radius r is \(S^{\oplus r}=\bigcup _{x\in S}b(x,r)\) and the erosion of S by a ball of radius r is \(S^{\ominus r}=\{ x\mid b(x,r)\subseteq S \}\). Note that if S is closed, then both \(S^{\ominus r}\) and \(S^{\oplus r}\) are closed. We shall refer to \(S^{\ominus r}\) and \(S^{\oplus r}\) as the r-erosion and r-dilation.

Definition 1.1

Let \(S \subset \mathbb {R}^n\), \(\varepsilon \ge 0\) and \(\delta \ge 0\). A collection of balls \(\mathscr {B}\) is a \((\delta ,\varepsilon )\)-ball approximation of S if \(S^{\ominus \varepsilon } \subseteq \bigcup \mathscr {B}\subseteq S^{\oplus \delta }\).

Fig. 1
figure 1

A shape (in blue), its \(\varepsilon \)-erosion (in orange), its \(\delta \)-dilation (bounded by the dashed blue curve) and a \((\delta ,\varepsilon )\)-ball approximation (the three green balls)

Let us make a few remarks. Consider a \((\delta ,\varepsilon )\)-ball approximation \(\mathscr {B}\) of S; see Fig. 1 for an example. Setting \(B = \bigcup \mathscr {B}\), we thus have \(B \subseteq S^{\oplus \delta }\) and \((S^{\ominus \varepsilon })^{\oplus \varepsilon } \subseteq B^{\oplus \varepsilon }\). It follows that if \(S = (S^{\ominus \varepsilon })^{\oplus \varepsilon }\), then \(B \subseteq S^{\oplus \delta }\) and \(S \subseteq B^{\oplus \varepsilon }\), or equivalently the Hausdorff distance between B and S is smaller than or equal to the maximum of \(\delta \) and \(\varepsilon \), i.e. \(d_H(S,B) \le \max \{\delta ,\varepsilon \}\). The condition \(S = (S^{\ominus \varepsilon })^{\oplus \varepsilon }\) can be seen as some regularityFootnote 1 assumption on S. Indeed, the equality \(S = (S^{\ominus \varepsilon })^{\oplus \varepsilon }\) is satisfied if every point of S can be covered by a ball of radius \(\varepsilon \) which is contained in S. In particular, the condition holds whenever all medial balls have a radius larger than or equal to \(\varepsilon \), which in turn holds whenever the reach of S is larger than or equal to \(\varepsilon \). We recall that the reach of S was first introduced by Federer [19] and is the infimum of distances between points in the medial axis of S and points in the complement of S. Denoting the reach of S by \({\text {reach}}(S)\), we summarize our findings in the following remark:

Remark 1.2

Let \(\mathscr {B}\) be a \((\delta ,\varepsilon )\)-ball approximation of S. If \({\text {reach}}( S ) \ge \max (\delta ,\varepsilon )\) then \(d_H\bigl (\bigcup \mathscr {B},S\bigr ) \le \max (\delta ,\varepsilon )\).

Remark 1.3

S possesses \((\delta , \varepsilon )\)-ball approximations of finite cardinality whenever S is compact and \(\delta + \varepsilon > 0\).

Suppose S is compact and \(\delta + \varepsilon > 0\). To build a finite \((\delta ,\varepsilon )\)-ball approximation of S, consider the collection of open balls with radius \(\delta + \varepsilon \) centered at points in \(S^{\ominus \varepsilon }\). By construction, the collection covers \(S^{\ominus \varepsilon }\) which is compact because S is compact, implying that the collection has a finite subcover. By taking the closure of balls in that subcover, we get a collection of closed balls that are contained in \(S^{\oplus \delta }\) and thus form a finite \((\delta , \varepsilon )\)-ball approximation of S.

Main Result In this paper, we are interested in a discrete variant of the following problem:

Problem 1.4

(Ball approximation) Given a subset \(S \subseteq \mathbb {R}^n\), two non-negative real numbers \(\delta \) and \(\varepsilon \), find a \((\delta ,\varepsilon )\)-ball approximation of S of minimum cardinality.

Our main result is that a discrete decision version of this problem is NP-complete. To state the problem, we call any ball whose center has rational coordinates and whose radius is rational rational. We call any collection of rational balls rational.

Problem 1.5

(Rational ball approximation) Given a finite collection of rational balls \(\mathscr {S}\) in \(\mathbb {R}^n\), two non-negative rational numbers \(\delta \) and \(\varepsilon \) and an integer \(k>0\), answer the following question: does \(\bigcup \mathscr {S}\) has a rational \((\delta ,\varepsilon )\)-ball approximation with cardinality lower than or equal to k?

The main result of this paper is that this problem is already difficult in dimension 2:

Theorem 1.6

The rational ball approximation problem is NP-complete in \(\mathbb {R}^2\).

Related Works As mentioned above, any shape S can be exactly described by the union of its medial balls \(\mathscr {M}\). A \((\delta ,\varepsilon )\)-ball approximation of S of minimum cardinality is a collection of balls \(\mathscr {B}\) such that \(|\mathscr {B}| \le {|\mathscr {M}|}\). Indeed, note that, by Definition 1.1, \(\mathscr {M}\) itself is a \((\delta ,\varepsilon )\)-ball approximation of S. Therefore, solving Problem 1.4 offers a new framework for simplifying unions of balls with a control of the distance to the shape. Various algorithms have been proposed to compute simpler collections of balls. A family of algorithms was designed to deal with the sensitivity of the medial axis to small perturbations on the shape S: the general idea is to compute a geometric quantity for each medial ball and prune the balls whose quantity is below a given threshold (see for instance [3, 11, 12, 17] to cite only a few). A slightly different approach has been presented in [29] with the notion of scale axis, where balls of the medial axis are first inflated, the medial axis updated (resulting in a simplification) and its balls deflated. Last, hierarchical structures have also been proposed to obtain simpler collections of balls. In the context of collision detection, sphere-trees are built by iteratively merging and/or displacing balls while ensuring that the simpler set of balls includes the boundary of the input one [5, 7, 25].

Note that in all the approaches mentioned above, the simpler collection of balls results in a new shape that is either a subset or a superset of the input shape. In that respect, the \((\delta ,\varepsilon )\)-ball approximation problem offers a more general setting that encompasses these approaches: indeed, when \(\delta =0\), a \((\delta ,\varepsilon )\)-ball approximation results in a new shape that is a subset of the input shape; conversely, when \(\varepsilon =0\), the new shape is a superset of the input shape.

The \((\delta ,\varepsilon \))-ball approximation problem is also closely related to geometric set cover problems. Following [1] or [23], let \(\Sigma = (K, R)\) be a finite geometric range space where K is a finite set of points in \(\mathbb {R}^d\) and R, the range, is a finite family of simple shaped regions, like for instance rectangles, or disks. A subset \(C \subset R\) is a cover of K if any point of K belongs to at least one element of C. Computing a set cover of minimum cardinality is known as the set cover problem. The corresponding decision problem is well-known to be NP-complete, and various approximation algorithms have been proposed, from the simple greedy one [13, 27], to more convoluted algorithms using \(\varepsilon \)-nets or multiplicative weights methods [1, 6, 23]. Several variations of the geometric set cover problem have also been introduced and investigated, notably when the range R is a family of balls. Instead of minimizing the number of balls used to cover the whole set K, a related problem is to cover the set K at best using a prescribed number of balls (see for instance a greedy algorithm in [10]). For more applicative purposes, especially in sensor networks, the balls of the range R can be of prescribed centers, but undefined radii, and the goal is to find a cover that minimizes a function of the radii of the balls [16].

The key difference between \((\delta ,\varepsilon )\)-ball approximation and set cover problems lies in the assumption of a finite range space for the latter one. If the shape K to cover and the range R are infinite, another family of results exists for which the range is the (infinite) set of congruent balls of a given radius. Results on that matter go back as far as [28], that establishes a relation between the (Lebesgue) measure of a bounded set of points K in \(\mathbb {R}^2\) and the number of congruent disks of radius r necessary to cover K. When K is a simple geometric shape (disk, square, equilateral triangle), results on the maximum size (radius, side length) of a shape K that can be covered by n unit disks are documented in [21].

Paper Overview We establish Theorem 1.6 by successively proving that:

  • The rational ball approximation problem in \(\mathbb {R}^2\) is in NP. Calling a closed ball in \(\mathbb {R}^2\) a disk, this means that one can verify in polynomial time that a given rational collection of disks is indeed a solution of the problem. For this, we start by studying in Sect. 2 the boundary of the erosion of a union of disks, for which we give a full computational characterization. This result is then used in Sect. 3 to design a polynomial time algorithm to check that a given collection of disks covers the \(\varepsilon \)-erosion \(S^{\ominus \varepsilon }\) and is included in the \(\delta \)-dilation \(S^{\oplus \delta }\) using arrangements of circles.

  • The rational ball approximation problem in \(\mathbb {R}^2\) is NP-hard. We prove this through a reduction from the well-known NP-complete vertex cover problem in Sect. 4.

Preliminaries Given a subset \(X \subseteq \mathbb {R}^n\), we let \(\overline{ X }\) denote the closure of X, \(\mathring{ X } \) the interior of X and \(\partial X\) the boundary of X.

2 Studying Boundaries

Let \(\mathscr {S}\) be a finite collection of disks in \(\mathbb {R}^2\) and \(\varepsilon \) a non-negative real number. The purpose of this section is to provide a computational description of the boundary of the erosion \(\bigl (\bigcup \mathscr {S}\bigr ){}^{\ominus \varepsilon }\). For this, we introduce in Sect. 2 a superset of the boundary called the wavefront and characterize which part of the wavefront belongs to the boundary. In Sect. 2.3, we decompose the wavefront into elements that are easy to compute, based on the decomposition of \(\partial \bigl (\bigcup \mathscr {S}\bigr )\) into vertices and edges described in Sect. 2.1.

2.1 Boundary of a Finite Union of Disks

Given a finite set of (closed) disks \(\mathscr {S}\) in \(\mathbb {R}^2\), we decompose the boundary of the union \(\bigcup \mathscr {S}\) into a finite set of elements that we call vertices and edges. For this, we associate to each point \(u \in \mathbb {R}^2\) the subsets of disks that have the property to represent \(\bigcup \mathscr {S}\) locally around u (see Definition 2.1) and rely on those subsets to distinguish between vertices or edge points of \(\partial \bigl (\bigcup \mathscr {S}\bigr )\). All the section is in \(\mathbb {R}^2\), except Definition 2.1 and Property 2.2 which are stated in \(\mathbb {R}^n\).

Definition 2.1

Given a subset \(X \subseteq \mathbb {R}^n\) and a point \(u\in \mathbb {R}^n\), we say that a set of balls \(\mathscr {B}\) in \(\mathbb {R}^n\)represents X locally around u if:

  1. (i)

    for all \(b\in \mathscr {B}\), \(u \in b\);

  2. (ii)

    there exists \(r>0\) such that \(X \cap b(u,r) = \bigcup \mathscr {B}\cap b(u,r)\).

We first establish that such a set \(\mathscr {B}\) exists and is finite when X is the union of a finite collection of balls:

Property 2.2

Let \(\mathscr {S}\) be a collection of balls in \(\mathbb {R}^n\). The set \(\mathscr {S}_u=\{ b\in \mathscr {S}\mid u\in b \}\) represents \(\bigcup \mathscr {S}\) locally around u, for all \(u\in \mathbb {R}^n\).

Proof

For any ball \(b\in \mathscr {S}\), either \(u \in b\) or the distance between u and b is positive. Because \(\mathscr {S}\) is finite, \(\mathscr {S}\setminus \mathscr {S}_u\) is also finite and we let r be the smallest distance between u and a ball in \(\mathscr {S}\setminus \mathscr {S}_u\). We have \(r>0\), and by construction \(b(u,r)\cap \bigcup \mathscr {S}\subseteq \bigcup \mathscr {S}\setminus \bigcup ( \mathscr {S}\setminus \mathscr {S}_u ) \subseteq \bigcup \mathscr {S}_u\subseteq \bigcup \mathscr {S}\). Thus \(\bigcup \mathscr {S}\cap b(u,r)=\bigcup \mathscr {S}_u\cap b(u,r)\). \(\square \)

Let \(S = \bigcup \mathscr {S}\) be the union of a finite collection of disks \(\mathscr {S}\) in \(\mathbb {R}^2\). We are now ready to define vertices and edges of \(\partial S\). We say that a point \(u \in \partial S\) is a vertex if all sets \(\mathscr {B}\) that represent S locally around u have cardinality greater than 2, that is, \(| \mathscr {B} | \ge 2\). Letting \(\mathscr {V}\) be the collection of vertices of \(\partial S\), we call any maximal connected component of \(\partial S\setminus \mathscr {V}\) an edge of \(\partial S\). Then, for any point u on an edge, there exists a disk \(b \in \mathscr {S}\) such that \(\{b\}\) represents S locally around u. Notice that \(\{b\}\) is the unique set of cardinality 1 that represents S locally around u, because if two disks \(b_1\) and \(b_2\) share a common boundary point u and coincide in a neighborhood of u, then they are equal. We now show that this disk b is the same for all boundary points in a small neighborhood of u:

Property 2.3

Consider \(u\in \partial S\setminus \mathscr {V}\) and \(\{b\}\) that represents S locally around u. Then, there exists \(r>0\) such that \(\{b\}\) is the unique cardinal-wise minimum element that represents S locally around v for all \(v \in \mathring{ b } (u,r)\cap \partial S\).

Proof

Let \(r >0\) such that \(S \cap b(u,r) = b \cap b(u,r)\). Let \(\rho _v = r - \Vert u - v \Vert \) and observe that \(b(v,\rho _v) \subseteq b(u,r)\). For all \(v \in \mathring{ b } (u,r) \cap S\), we thus have that \(S \cap b(v,\rho _v) = b \cap b(v, \rho _v)\) and it follows that for all points \(v \in \mathring{ b } (u,r) \cap S\), \(\{b\}\) represents S locally around v. In particular, if \(v \in \mathring{ b } (u,r) \cap \partial S\), then \(v \in \partial S \setminus \mathscr {V}\), and uniqueness and minimality stem from the definition of an edge. \(\square \)

We deduce immediately that any edge is supported by the boundary of a unique disk in \(\mathscr {S}\). Formally:

Property 2.4

Let e be an edge of \(\partial S\). Then there is a unique \(b\in \mathscr {S}\) such that (1) \(e\subseteq \partial b\); (2) \(\{b\}\) represents S locally around each point of e.

Proof

Consider \(f :\partial S\setminus \mathscr {V}\rightarrow \mathscr {S}\) that associates to each point \(x \in \partial S\setminus \mathscr {V}\) the unique inclusion-minimum set that represents S locally around x. By Property 2.3, f is locally constant and therefore constant over each connected component of \(\partial S\setminus \mathscr {V}\). \(\square \)

2.2 Boundary of the Erosion and Wavefront

Recall that \(\mathscr {S}\) is a finite collection of disks in \(\mathbb {R}^2\) and let \(S = \bigcup \mathscr {S}\) be the union of those disks. In this section, we relate the boundary of the erosion \(\partial S^{\ominus \varepsilon }\) to a (possibly self-intersecting) curve that we call the wavefront of \(\partial S\) at time \(\varepsilon \). Roughly speaking, the wavefront at time \(\varepsilon \) is obtained by moving with speed 1 some of the points on the boundary of S a given distance \(\varepsilon \) down the inward-pointing normals. Formally, the contribution of a point \(u \in \partial S\) to the wavefront at time \(\varepsilon \) is:

$$\begin{aligned} w_{\varepsilon }(u) = \bigl \{ x\in \partial b(u,\varepsilon ) \mid \exists \, r > 0,\ b(x,\varepsilon )\cap b(u,r) \subseteq S \bigr \}. \end{aligned}$$

The wavefront of \(\partial S\) is obtained by taking the union of all contributions \(w_{\varepsilon }(\partial S) = \bigcup _{u \in \partial S} w_{\varepsilon }(u)\) (see Fig. 2). It is not difficult to see that the wavefront contains the boundary of the erosion (see Fig. 2 (a)). Indeed, if a point x belongs to the boundary of the erosion \(\partial S^{\ominus \varepsilon }\), then it is the center of a disk \(b(x,\varepsilon ) \subseteq S\) whose boundary meets the boundary of S at some point u. It follows that \(x \in \partial b(u,\varepsilon )\) and thus belongs to the contribution \(w_{\varepsilon }(u)\) of point u. The goal of this section is to establish that the boundary of the erosion \(\partial S^{\ominus \varepsilon }\) is the set of points on the wavefront \(w_{\varepsilon }(\partial S)\) at distance \(\varepsilon \) or more to vertices of \(\partial S\) (see Fig. 2 (c)):

Fig. 2
figure 2

(a) A shape defined as the union of three (blue) disks and its erosion (in orange); (b) wavefront of the boundary (red curve); (c) arrangement of circles used to decompose the erosion into cells (see Sect. 3.1). Three of the circles are centered on the (red) vertices of the boundary. The vertices of the arrangement are the black dots

Theorem 2.5

Let \(\mathscr {V}\) be the vertex set of \(\partial S\). For \(\varepsilon \ge 0\), we have

$$\begin{aligned} \partial S^{\ominus \varepsilon } ~=~ w_{\varepsilon }(\partial S) \setminus (\mathscr {V}^{\oplus \varepsilon })^\circ . \end{aligned}$$

Proof

The inclusion \(\partial S^{\ominus \varepsilon } \subseteq w_{\varepsilon }(\partial S) \setminus (\mathscr {V}^{\oplus \varepsilon })^\circ \) is obvious. Let us prove the converse inclusion \( w_{\varepsilon }(\partial S) \setminus (\mathscr {V}^{\oplus \varepsilon })^\circ \subseteq \partial S^{\ominus \varepsilon }\). Take a point x in \(w_{\varepsilon }(\partial S) \setminus (\mathscr {V}^{\oplus \varepsilon })^\circ \). This implies that there is a point \(u \in \partial S \cap \partial b(x,\varepsilon )\) and \(r >0\) such that \(b(x,\varepsilon ) \cap b(u,r) \subseteq S\). Consider the half-line \(\left[ ux \right) \) with origin u and passing through x and for \(t\ge 0\), let \(z_t\in \left[ ux \right) \) such that \(d(u,z_t)=t\). Denote by \(b_t\) the disk centered at \(z_t\) and whose bounding circle goes through u, see Fig. 3 (a). By construction, the family of disks \(\{b_t\}\) is nested and their boundaries have a common intersection point u. Let us prove that \(b_{\varepsilon } \subseteq S\), which entails \(x=z_{\varepsilon } \in \partial S^{\ominus \varepsilon }\).

First, observe that for \(t>0\) small enough, we have \(b_t \subseteq b(x,\varepsilon ) \cap b(u,r) \subseteq S\) and \(\partial b_t \cap \partial S = \{u\}\). Hence, as we increase continuously t from 0 to \(+\infty \), the center \(z_t\) moves on the half-line \(\left[ ux \right) \) and the ball \(b_t\) which is contained in S for small values of t goes eventually outside S because S is bounded and \(b_\infty \) is not. Let T the largest t for which \(b_t \subseteq S\). For all \(t < T\), we have \(\partial b_t \cap \partial S = \{u\}\). We have \(T>0\) and suppose for a contradiction that \(T < \varepsilon \). We claim that \(b_T\) meets the boundary of S in another point \(y\ne u\) as in Fig. 3 (b). Indeed, for \(t>T\), let \(y_t\in b_t\cap S^\mathsf {c} \). The sequence \(( y_t )\) admits a limit point \(y\in \partial b_T\). If we had \(y=u\), then for t close enough to T, we would have \(b_{t} \subseteq b_{\varepsilon }\) and \(y_t\in b_{\varepsilon }\cap b(u,r)\subseteq S\), which is impossible. Thus \(y\ne u\). Since by hypothesis \(b_{\varepsilon } = b(x,\varepsilon )\) does not contain any vertex of \(\partial S\) in its interior, neither does \(b_{T} \subseteq b_{\varepsilon }\) and y belongs to some edge e of \(\partial S\). This edge is supported by the boundary of a ball \(b \in \mathscr {S}\) that represents S locally around y. It follows that b and \(b_T\) are tangent at y with \(b_T \subseteq b\). Since \(b \subseteq S\) cannot contain \(u \in \partial S\) in its interior, we get \(b = b_{T} \subseteq b_{\varepsilon }\) and the edge e is either the punctured circle \(\partial b_T \setminus \{u\}\) or the whole circle \(\partial b_T\) depending on whether u is a vertex of \(\partial S\) or not. In both cases, \(\partial b_T \subseteq \partial S\). Since \(b_T\) is contained in \(b_{\varepsilon }\) which is contained in S locally around u, the only possibility is that \(b_{T} = b_{\varepsilon }\), yielding \(T = \varepsilon \) and therefore a contradiction. \(\square \)

Fig. 3
figure 3

Notation for the proof of Theorem 2.5. (a) Construction of \(z_t\) and \(b_t\); (b) second boundary point y

2.3 Computational Description of the Wavefront

The goal of this section is to give a computational description of the wavefront. In particular, we shall see that the wavefront is composed of circular arcs; convex circular arcs are contributed by edges of \(\partial S\) while concave circular arcs are contributed by vertices of \(\partial S\). To describe those arcs, let us start by studying the contribution of a point \(u\in \partial S\) to the wavefront at time \(\varepsilon \). We show that this contribution can be expressed as the intersection of \(\partial b(u,\varepsilon )\) and an affine conical hull with apex u. Consider a finite collection of points \(C=\{ c_1,c_2,\ldots ,c_k \}\) in \(\mathbb {R}^2\). We recall that the affine conical hull with support C and apex \(u\in \mathbb {R}^2\) is

$$\begin{aligned} {\text {coni}}\left( u,C \right) = \biggl \{ u+\sum _{i=1}^k\lambda _i (c_i-u) \mid \lambda _i \in \mathbb {R},\ \lambda _i \ge 0 \biggr \} \text {.} \end{aligned}$$

For technical reasons, we shall need to exclude some of the points on the boundary of affine conical hulls. Writing \(\left[ ab \right] \) for the closed segment with endpoints a and b, this motivates the following definition:

$$\begin{aligned} \overset{\star }{{\text {coni}}}\left( u,C \right) = \mathring{ {\text {coni}} } \left( u,C \right) \cup \biggl ( \bigcup _{c\in C}\left[ uc \right] \biggr ) \text {.} \end{aligned}$$

Theorem 2.6

Let \(S=\bigcup \mathscr {S}\) be a finite union of disks and consider \(u\in \partial S\). Let \(\mathscr {B}\subset \mathscr {S}\) that represents S locally around u, and C the centers of disks in \(\mathscr {B}\). We have

$$\begin{aligned} w_\varepsilon \left( u \right) = \overset{\star }{{\text {coni}}}\left( u,C \right) \cap \partial b(u,\varepsilon ) \text {.} \end{aligned}$$
Fig. 4
figure 4

A shape represented locally around u by two (blue) disks \(b_1\) and \(b_2\). The contribution of u to the wavefront is the (black) circular arc, closed at \(x_1\) and open at \(x_2\). By Theorem 2.6, it is the intersection of the (orange) affine conical hull and \(\partial b(u,\varepsilon )\). The endpoint \(x_1\) belongs to the wavefront (unlike the endpoint \(x_2\)) because the disk \(b(x_1,\varepsilon )\) is locally included in the shape around u (unlike the disk \(b(x_2,\varepsilon )\))

An illustration is available in Fig. 4. Before proving the theorem, we apply it to describe for each element on the boundary of the union \(\bigcup \mathscr {S}\) its contribution to the wavefront:

Contribution of Vertices Assume that v is a vertex of \(\partial S\). Then any set \(\mathscr {B}\) that represents S locally around v is such that \(|\mathscr {B}|\ge 2\), and \(w_\varepsilon \left( v \right) \) is a concave circular arc in the general case. In the special case when \(\mathscr {S}\) has two disks \(b_1\) and \(b_2\) meeting tangentially at v and whose pair \(\mathscr {B}= \{b_1,b_2\}\) represents locally S around v, then \(w_\varepsilon \left( v \right) = \left[ c_1c_2 \right] \cap \partial b(v,\varepsilon )\), where \(c_i\) is the center of \(b_i\) for \(i \in \{1,2\}\). It follows that \(w_\varepsilon \left( v \right) \) is composed of zero, one or two degenerate circular arcs (each reduced to a point), depending on whether zero, one or two disks among \(b_1\) and \(b_2\) have radii larger than or equal to \(\varepsilon \).

Contribution of Edges Let e be an edge of \(\partial S\). By Property 2.4, there is a disk \(b \in \mathscr {S}\) whose boundary supports e and which represents S locally around each point \(u \in e\). Letting c be the center of b and plugging in Theorem 2.6 the equality \(C = \{c\}\) yields \(w_\varepsilon \left( u \right) = \left[ uc \right] \cap \partial b(u,\varepsilon ) = \left[ uc \right] \cap \partial b^{\ominus \varepsilon }\) for all \(u \in e\). It follows that the contribution \(w_{\varepsilon }(e) = \bigcup _{u \in e} w_{\varepsilon }(u)\) of an edge e is either empty if b has a radius smaller than \(\varepsilon \) or is the convex circular arc obtained by projecting e orthogonally onto \(b^{\ominus \varepsilon }\) otherwise.

The remainder of this section is dedicated to the proof of Theorem 2.6. The proof relies on two technical lemmas that we now state. Consider a family of disks that all share a common boundary point u. The first technical lemma says that if the center of one of the disk \(b_0\) is contained in the open affine conical hull formed by the centers of other disks, then \(b_0\) is contained in the union of the other disks locally around u. The second technical lemma gives a slightly weaker version of the converse.

Lemma 2.7

Let \(u \in \mathbb {R}^2\) and consider k points \(c_1,c_2,\ldots ,c_k\in \mathbb {R}^2\). Let \(c_0\in \mathring{ {\text {coni}} } \left( u,\{ c_i, 1\le i\le k \} \right) \). For \(0\le i\le k\), let \(b_i\) be the disk centered at \(c_i\) whose bounding circle goes through u. Then, there exists \(r>0\) such that \(b_0\cap b(u,r)\subseteq \bigcup _{i=1}^k b_i\).

Fig. 5
figure 5

Notation for the proof of Lemma 2.7. The bold curve represents the set of points at distance \(R_{{\mathbf {e}}}\) from the origin in directions \({\mathbf {e}}\) such that \(\left\langle {\mathbf {e}},\, c_0-u \right\rangle \ge 0\)

Proof

Consider the closed half-space \(H_0\) through u containing \(b_0\). We prove the theorem by establishing that \(H_0\cap b(u,r)\subseteq \bigcup _{i=1}^k b_i\), for some \(r>0\).

Notice that for all unit vectors \({\mathbf {e}}\) and real numbers \(\rho \), the point \(u + \rho {\mathbf {e}}\) belongs to \(b_i\) if and only if \(0 \le \rho \le 2\left\langle {\mathbf {e}},\, c_i-u \right\rangle \). It follows that \(u + \rho {\mathbf {e}}\) belongs to the union \(\bigcup _{i=1}^k b_i\) if and only if \(0 \le \rho \le R_{{\mathbf {e}}}\) where \(R_{{\mathbf {e}}} = 2\max _{1 \le i \le k} \left\langle {\mathbf {e}},\, c_i-u \right\rangle \); see Fig. 5.

Let \(r=\inf \{ R_{{\mathbf {e}}}\mid \left\langle {\mathbf {e}},\, c_0-u \right\rangle \ge 0 ,\ ||{{\mathbf {e}}}|| = 1 \}\). We next prove that \(r > 0\). Consider a unit vector \({\mathbf {e}}\) with \(\left\langle {\mathbf {e}},\, c_0-u \right\rangle \ge 0\). Because \(c_0\) lies in the interior of \({\text {coni}}\left( u,\{ c_i,1\le i\le k \} \right) \), there exist k real positive numbers \(\lambda _1,\lambda _2,\ldots ,\lambda _k\) such that \(c_0=u+\sum _{i=1}^k\lambda _i( c_i-u )\); see Appendix B. By linearity,

$$\begin{aligned} 0 \le \sum _{i=1}^k \lambda _i \left\langle {\mathbf {e}},\, c_i-u \right\rangle \le \biggl ( \sum _{i=1}^k \lambda _i \biggr ) \max _{1 \le i \le k} \left\langle {\mathbf {e}},\, c_i-u \right\rangle . \end{aligned}$$

Assume for a contradiction that \(\max _{1 \le i \le k} \left\langle {\mathbf {e}},\, c_i-u \right\rangle \le 0\). Since \(\lambda _i > 0\) for all \(1 \le i \le k\), this would imply that \(\left\langle {\mathbf {e}},\, c_i-u \right\rangle = 0\) for all \(1 \le i \le k\), showing that all vectors \(c_i - u\) are collinear. Hence, the affine conical hull \({\text {coni}}\left( u,\{ c_i, 1\le i\le k \} \right) \) would be either a line or a half-line, contradicting our hypothesis that its interior \(\mathring{ {\text {coni}} } \left( u,\{ c_i, 1\le i\le k \} \right) \) contains \(c_0\) and is non-empty.

To conclude, consider a point \(x\in H_0\cap b(u,r)\). Let \(\rho = \Vert x - u \Vert \) and \({\mathbf {e}}\) the unit vector such that \(x = u+\rho {\mathbf {e}}\). Because \(x\in H_0\), \(\left\langle {\mathbf {e}},\, c_0-u \right\rangle \ge 0\). Because \(x\in b(u,r)\), \(0 \le \rho \le r \le R_{{\mathbf {e}}}\). Hence, \(x\in \bigcup _{i=1}^k b_i\) and \(H_0 \cap b(u,r)\subseteq \bigcup _{i=1}^k b_i\). \(\square \)

Lemma 2.8

Let \(u\in \mathbb {R}^2\) and \(k+1\) points \(c_0,c_1,\ldots ,c_k\in \mathbb {R}^2\setminus \{ u \}\). For \(0\le i\le k\), let \(b_i\) be the disk centered at \(c_i\) whose bounding circle goes through u. If there exists \(r>0\) such that \(b_0\cap b(u,r)\subseteq \bigcup _{i=1}^k b_i\), then \(c_0\in {\text {coni}}\left( u,\{c_i, 1\le i\le k \} \right) \).

Proof

Let \(H_i^+\) be the closed half-space through u containing \(b_i\) and \(H_i^-\) the closed half-space through u that avoids the interior of \(b_i\). The inclusion \(b_0\cap b(u,r)\subseteq \bigcup _{i=1}^k b_i\) implies that \((H_0^+)^\circ \subseteq \bigcup _{i=1}^k (H_i^+)^\circ \) and \(\bigcap _{i=1}^k H_i^- \subseteq H_0^-\). We consider two cases:

  1. (a)

    The open half-space \((H_0^+)^\circ \) is equal to one of the open half-spaces \((H_i^+)^\circ \), say \((H_1^+)^\circ \). Clearly, \(c_0 \in {\text {coni}}\left( u,\{ c_1 \} \right) \).

  2. (b)

    The open half-space \((H_0^+)^\circ \) is distinct from all other half-spaces \((H_i^+)^\circ \) and contained in the union of two of them, say \((H_1^+)^\circ \) and \((H_2^+)^\circ \). In that case, u and the two centers \(c_1\) and \(c_2\) are not aligned and the vectors \(c_1 - u\) and \(c_2 - u\) span \(\mathbb {R}^2\). It follows that there exist two real numbers \(\lambda _1 \ne 0\) and \(\lambda _2 \ne 0\) such that \(c_0 - u = \lambda _1 (c_1 - u) + \lambda _2 (c_2 - u)\). Let us prove that \(\lambda _1 > 0\) and \(\lambda _2 >0\). Consider a vector \(t_1\) orthogonal to \(c_1- u\) and choose it so that \(u+t_1 \in H_2^-\). We have \(\left\langle t_1,\, c_0 - u \right\rangle = \lambda _2 \left\langle t_1,\, c_2 - u \right\rangle \). By choice of \(t_1\), we have \(u+t_1 \in H_1^- \cap H_2^- \subseteq H_0^-\) and therefore \(\left\langle t_1,\, c_0 - u \right\rangle \le 0\) and \(\left\langle t_1,\, c_2 - u \right\rangle \le 0\), showing that \(\lambda _2 > 0\). Similarly we get \(\lambda _1 > 0\). Hence, \(c_0 \in {\text {coni}}\left( u,\{ c_1, c_2 \} \right) \)\(\square \)

We are now ready to give the proof of Theorem 2.6.

Proof of Theorem 2.6

Let us establish the inclusion \(\overset{\star }{{\text {coni}}}\left( u,C \right) \cap \partial b(u,\varepsilon ) \subseteq w_\varepsilon \left( u \right) \). First, consider \(x \in \mathring{ {\text {coni}} } \left( u,C \right) \cap \partial b(u,\varepsilon )\). By Lemma 2.7, there exists \(r>0\) such that \(b(x,\varepsilon ) \cap b(u,r) \subseteq \bigcup \mathscr {B}\subseteq S\). Hence, \(x \in w_\varepsilon \left( u \right) \). Second, suppose that there exists \(c \in C\) such that \(\{x\}=\left[ uc \right] \cap \partial b(u,\varepsilon )\). Clearly, \(b(x,\varepsilon ) \subseteq b(c, \Vert c-u\Vert ) \subseteq S\). Once again, \(x \in w_\varepsilon \left( u \right) \).

Conversely, let us establish the inclusion \( w_\varepsilon \left( u \right) \subseteq \overset{\star }{{\text {coni}}}\left( u,C \right) \cap \partial b(u,\varepsilon )\). Consider \(x \in w_\varepsilon \left( u \right) \). By definition, \(x \in \partial b(u,\varepsilon )\) and there exists \(r >0\) such that \(b(x,\varepsilon ) \cap b(u,r) \subseteq S\). Since \(\mathscr {B}\) represents S locally around u, we also have \(b(x,\varepsilon ) \cap b(u,r) \subseteq \bigcup \mathscr {B}\) for r small enough. It follows by Lemma 2.8 that \(x \in {\text {coni}}\left( u,C \right) \cap \partial b(u,\varepsilon )\). If \(x \in \mathring{ {\text {coni}} } \left( u,C \right) \), we are done. Otherwise, x lies on the boundary of \({\text {coni}}\left( u,C \right) \). This boundary consists of half-lines originating from u and going through some point of C. Let \(c\in C\) such that c supports one such half-line and \(x\in \left[ uc \right) \). Without loss of generality, we may assume that the half-line \(\left[ uc \right) \) only meets C at c itself. Let us prove that \(x\in \left[ uc \right] \). Consider b the disk of \(\mathscr {B}\) centered at c, and notice that, since \(\left[ uc \right) \subset \partial {\text {coni}}\left( u,C \right) \), b supports an edge of \(\partial S\) in the neighbourhood of u. Assume by contradiction that \(x\in \left[ uc \right) \setminus \left[ uc \right] \). Then \(b\subseteq b(x,\varepsilon )\). In particular \(b(x,\varepsilon )\) contains in its interior and in a neighborhood of u part of the edge supported by b, implying that \(x\notin w_\varepsilon \left( u \right) \). \(\square \)

3 Rational \((\delta ,\varepsilon )\)-Ball Approximation is in NP

To check whether a finite collection of disks \(\mathscr {B}\) is a \((\delta ,\varepsilon )\)-ball approximation of a finite union of disks \(\bigcup \mathscr {S}\), we have to test the two inclusions \(\bigl (\bigcup \mathscr {S}\bigr )^{\ominus \varepsilon }\subseteq \bigcup \mathscr {B}\subseteq \bigl (\bigcup \mathscr {S}\bigr ){}^{\oplus \delta }\) in polynomial time. To do so, we build on results of Sect. 2 and describe a method that given the triplet \((\mathscr {S}, \varepsilon , \mathscr {B})\) returns true if and only if the first inclusion \(\bigl (\bigcup \mathscr {S}\bigr )^{\ominus \varepsilon }\subseteq \bigcup \mathscr {B}\) holds. To test the second inclusion, it suffices to apply the same method to the triplet \((\mathscr {B}, 0, \{ s^{\oplus \delta } \mid s \in \mathscr {S}\})\).

Before describing our method in Sect. 3.2, we explain in Sect. 3.1 how to encode the erosion (or union) of a finite union of disks using cells of an arrangement of circles.

3.1 Capturing the Erosion Through an Arrangement

We recall that a finite set of circles \(\mathscr {C}\) induces a subdivision of the plane that consists of vertices, edges and faces. A vertex is an intersection point of two circles in \(\mathscr {C}\). An edge is a maximal connected portion of a circle that is not intersected by any other circle in \(\mathscr {C}\). A face is a maximal connected region of \(\mathbb {R}^2\) not intersected by any circle in \(\mathscr {C}\). The subdivision is referred to as the arrangement induced by \(\mathscr {C}\). Vertices, edges and faces are called the cells of the arrangement. Arrangements induced by circles have a size quadratic in the number of circles and can be computed in polynomial time [31].

We say that a set of cells in an arrangement captures a set \(X \subseteq \mathbb {R}^2\) if we can label cells as in or out in such a way that cells with label in form a partition of the set X. In this section, we show that the erosion \(\bigl (\bigcup \mathscr {S}\bigr )^{\ominus \varepsilon }\) can be captured by the cells of the arrangement induced by the set of circles:

$$\begin{aligned} \mathscr {C}_{\varepsilon }(\mathscr {S}) = \{ \partial b(v,\varepsilon ) \mid v\in \mathscr {V}\} \cup \bigl \{ \partial b^{\ominus \varepsilon } \mid b\in \mathscr {S}\text { and } {\text {radius}}(b) \ge \varepsilon \bigr \}. \end{aligned}$$

We shall see that labeling the arrangement can be done in polynomial time. Furthermore, the arrangement can be computed in an exact manner [34] because all circles involved in the construction are rational (center coordinates and radii are rational numbers).

Denote by \(\mathcal {A}_{\varepsilon }(\mathscr {S})\) the arrangement formed by circles in \(\mathscr {C}_{\varepsilon }(\mathscr {S})\). We already know from Sect. 2.3 that the wavefront is composed of circular arcs supported by the set of circles \(\mathscr {C}_{\varepsilon }(\mathscr {S})\). The boundary of the erosion \(\partial S^{\ominus \varepsilon }\) being a subset of the wavefront, it is also composed of circular arcs supported by \(\mathscr {C}_{\varepsilon }(\mathscr {S})\). It is easy to check that the boundary of the erosion is captured by the vertices and edges of \(\mathcal {A}_{\varepsilon }( \mathscr {S})\) (see Fig. 2 (c)). It follows that every cell of \(\mathcal {A}_{\varepsilon }( \mathscr {S})\) is either inside or outside the erosion. We establish the following result:

Lemma 3.1

We can label in polynomial time \(\mathcal {A}_{\varepsilon }( \mathscr {S})\) in such a way that cells with label in form a partition of the erosion \(\bigl (\bigcup \mathscr {S}\bigr )^{\ominus \varepsilon }\).

To label cells in the arrangement, we need the following technical lemma. We call each edge reduced to a point degenerate.

Lemma 3.2

Let e be a non-degenerate edge of \(\mathcal {A}_{\varepsilon }( \mathscr {S})\) that supports the boundary of the erosion. Then e is adjacent to a face in the erosion and a face in its complement.

Proof

Let \(S=\bigcup \mathscr {S}\) and \(x\in e\). By Theorem 2.5, there is \(u\in \partial S\) such that \(x\in w_\varepsilon \left( u \right) \setminus \bigl ( \mathscr {V}^{\oplus \varepsilon } \bigr ){}^\circ \). Let \(z_t\) be the point on half-line \(\left[ ux \right) \) such that \(d(z_t,u)=t\) (see Fig. 3 (a)). To establish the lemma, we proceed in three steps:

  1. (1)

    First, we prove that \(z_t\notin \bigl ( \mathscr {V}^{\oplus t} \bigr ){}^\circ \) for all t close enough to \(\varepsilon \). Recall that \(x \notin \bigl ( \mathscr {V}^{\oplus \varepsilon } \bigr ){}^\circ \) or equivalently \(d(x, \mathscr {V}) \ge \varepsilon \). We claim that if we exclude u from the vertex set \(\mathscr {V}\), then the distance from x to the remaining vertices of \(\mathscr {V}\) can only be larger, that is, \(d(x, \mathscr {V}\setminus \{ u \}) > \varepsilon \). Indeed, if this is not the case, then x would be equidistant to u and a vertex \(v \in \mathscr {V}\setminus \{u\}\). This would imply that x lies on at least two circles of the arrangement (the one supporting e and another bounding \(b(v,\varepsilon )\)). Hence, x would be a vertex of the arrangement, contradicting our assumption that x lies on edge e. It follows that we can find \(T > \varepsilon \) such that for all \(0 \le t \le T\), we have \(d(z_t,\mathscr {V}\setminus \{ u \}) \ge d(z_T,\mathscr {V}\setminus \{ u \}) -d(z_t,z_T) > T -( T-t )= t\). Hence, \(d(z_t, \mathscr {V}) \ge t\) for all \(0 \le t \le T\) or equivalently \(z_t\notin \bigl ( \mathscr {V}^{\oplus t} \bigr ){}^\circ \) for all \(0 \le t \le T\).

  2. (2)

    Second, we prove that \(z_t\in w_t( u )\) for all t close enough to \(\varepsilon \). Let F a collection of disks that represents S locally around u and C the collection of their centers. Recall that by Theorem 2.6, \(w_t( u )=\overset{\star }{{\text {coni}}}\left( u,C \right) \cap \partial b(u,t)\), hence \(x\in \overset{\star }{{\text {coni}}}\left( u,C \right) \). We want to prove that we also have \(z_t\in \overset{\star }{{\text {coni}}}\left( u,C \right) \), for t in an open neighbourhood of \(\varepsilon \). If \(x\in \mathring{ {\text {coni}} } \left( u,C \right) \), then for all \(t > 0\), \(z_t\in \mathring{ {\text {coni}} } \left( u,C \right) \). If \(x\notin \mathring{ {\text {coni}} } \left( u,C \right) \), then there is \(c\in C\) such that \(x\in \left[ uc \right] \). Without loss of generality we can assume that \(\overset{\star }{{\text {coni}}}\left( u,C \right) \cap \left[ ux \right) =\left[ uc \right] \). We claim that \(x\ne c\). Indeed let b be the disk in F centered at c and let r be its radius. Assume for a contradiction that \(x=c\). Then, \(r=\varepsilon \) and \(b^{\ominus \varepsilon } = \{ c \}\), showing that \(c = x\) is a degenerate edge of the arrangement and contradicting our assumption that \(x \in e\) lies on a non-degenerate edge of the arrangement. Thus, \(x\ne c\) and \(r>\varepsilon \). Also for all \(0\le t\le r\), we have \(z_t\in \left[ uc \right] \subseteq \overset{\star }{{\text {coni}}}\left( u,C \right) \), hence \(z_t\in w_t( u )\).

  3. (3)

    Steps (1) and (2) imply that for t close enough to \(\varepsilon \), we have \(z_t\in w_t\left( u \right) \setminus \bigl ( \mathscr {V}^{\oplus t} \bigr ){}^\circ \). By Theorem 2.5, this implies that \(z_t\in \partial \bigl ( S^{\ominus t} \bigr )\) and thus that \(d(z_t,\partial S)=t\). In particular, for \(t<\varepsilon \), \(d(z_t,\partial S) < \varepsilon \) and \(z_t\in \bigl ( S^{\ominus \varepsilon } \bigr )^\mathsf {c} \) while for \(t>\varepsilon \), \(d(z_t, \partial S) > \varepsilon \) and \(z_t\in S^{\ominus \varepsilon }\), which suffices to conclude. \(\square \)

We now prove Lemma 3.1.

Proof of Lemma 3.1

We label cells in \(\mathcal {A}_{\varepsilon }( \mathscr {S})\) as follows:

  1. (a)

    We label as boundary all cells on the boundary of the erosion \(\bigl ( \bigcup \mathscr {S}\bigr ){}^{\ominus \varepsilon }\), using results in Sect. 2. More precisely, we compute first vertices and edges on the boundary of \(\bigcup \mathscr {S}\) (building for instance the arrangement \(\mathcal {A}_0( \mathscr {S})\)). Then, for each element on the boundary of \(\bigcup \mathscr {S}\), we compute its contribution to the wavefront (using Theorem 2.6). Each contribution is composed of cells and we label the cells belonging to the boundary of the erosion \(\bigl ( \bigcup \mathscr {S}\bigr ){}^{\ominus \varepsilon }\) as boundary. To detect such cells, we use Theorem 2.5 and keep those lying outside \(\bigl ( \mathscr {V}^{\oplus \varepsilon } \bigr ){}^\circ \).

  2. (b)

    We label as in each face covered by a disk \(b^{\ominus \varepsilon }\) for \(b\in \mathscr {S}\) and label as out each face covered by a disk \(b(v,\varepsilon )\) for \(v\in \mathscr {V}\). If no faces have received a label so far, this means that \(S^{\ominus \varepsilon }\) is either empty or a finite collection of singletons. In this case, each singleton is labeled in, all other cells are labeled out and we are done. Otherwise, we continue.

  3. (c)

    Starting from a face either with label in or label out, we do a traversal of the arrangement \(\mathcal {A}_{\varepsilon }( \mathscr {S})\), stepping from one face to an adjacent face. If we cross an edge labeled boundary, the face currently visited receives a label different from the face on the other side of the crossed edge. Otherwise, the face currently visited receives the same label as the face on the other side. Lemma 3.2 guarantees that after this step, all faces are properly labeled.

  4. (d)

    To label remaining vertices and edges, we use the fact that the erosion is a closed set. We thus give label in to every vertex or edge bounding a face labeled in. Other vertices and edges receive the label out.

Clearly, all steps can be done in time polynomial in the size of the arrangement. \(\square \)

3.2 Checking Set Inclusion

We explain in this section how to check the inclusion \(\bigl (\bigcup \mathscr {S}\bigr ){}^{\ominus \varepsilon }\subseteq \bigcup \mathscr {B}\) in polynomial time. We compute the arrangement \(\mathcal {A}_{\varepsilon }(\mathscr {S})\) and label its cells as in or out depending on whether they belong to the erosion \(\bigl (\bigcup \mathscr {S}\bigr ){}^{\ominus \varepsilon }\) or not as explained in the previous section. Likewise, we compute a second arrangement \(\mathcal {A}_0(\mathscr {B})\) and label its cells as in or out depending on whether they belong to the union \(\bigcup \mathscr {B}\) or not. We then overlay the two arrangements. This operation consists in computing the arrangement of the joint collection of circles, and it is possible to do so while inheriting the labels from both input arrangements [4, 35]. By inspecting the labels of the overlay, we can thus determine if every cell in the erosion is also in the union and conclude on the inclusion test. All operations can be done in polynomial time. In Appendix A, we provide an alternative method that does not use any overlay.

4 Rational \((\delta ,\varepsilon )\)-Ball Approximation is NP-Hard

In this section, we establish that the rational \((\delta ,\varepsilon )\)-ball approximation problem in \(\mathbb {R}^n\) is NP-hard for \(n=2\). We prove NP-hardness through a reduction from a variant of the vertex cover problem. Recall that for a graph \(G=(V,E)\), a subset \(C\subseteq V\) is a vertex cover of G if every edge of E is incident to a vertex of C. Finding a minimum vertex cover is NP-hard, even when restricted to cubic planar graphs, that is, planar graphs of degree at most 3 [22]. We shall perform the reduction from this particular variant. Given a cubic planar graph \(G=(V,E)\) and rational numbers \(\delta >0\) and \(\varepsilon \ge 0\), we show below how to build a finite collection \(\mathscr {S}(G,\delta ,\varepsilon )\) of disks in the plane such that G has a vertex cover of cardinality k if and only if \(\bigcup \mathscr {S}(G,\delta ,\varepsilon )\) admits a \((\delta ,\varepsilon )\)-ball approximation of cardinality \(k+L\), where L is an integer depending only on \(\mathscr {S}(G,\delta ,\varepsilon )\). Note that the reduction presented below works for all values \(\delta > 0\). When \(\delta = 0\), a similar reduction is presented in Appendix C that requires slightly more complicated vertex gadgets for degree-three vertices.

4.1 Reduction from Vertex Cover

Gadgets We build the set of disks \(\mathscr {S}(G,\delta ,\varepsilon )\) from the tuple \((G,\delta ,\varepsilon )\) by converting each vertex of G into a vertex gadget and each edge of G into an edge gadget. The vertex gadget for a vertex \(v \in V\) consists of disks of radius \(\varepsilon \), one for each edge incident to v. The edge gadget for an edge \(e \in E\) is a finite non-empty set of disks of odd length, which all share the same radius \(\varepsilon \); see Fig.  6 (b). Disks in the gadgets are obtained by first associating to each edge \(e = \{v,w\}\) a finite sequence of disks of length at least three. Disks in the sequence have radius \(\varepsilon \). The centers of those disks are called the rotulae of edge e. We distinguish two types of rotulae: Extreme rotulae are the centers of the two extreme disks in the sequence and are denoted as \(c_{ve}\) and \(c_{we}\). Regular rotulae are the centers of other disks. The rotulae of two consecutive disks in the sequence are said to be neighbors of one another. Note that extreme rotulae have only one neighbor and regular rotulae have two neighbors. The edge gadget for e is the set of disks in the sequence centered at regular rotulae. The vertex gadget for v is the set of disks \(b(c_{ve},\varepsilon )\), where e ranges over all edges incident to v. Hence, a vertex gadget may contain up to three disks depending on the degree of the vertex that generated the gadget. We say that an extreme rotulae \(c_{ve}\) and a vertex x are linked to one another whenever \(v=x\). Finally, we define \(\mathscr {S}(G,\delta ,\varepsilon )\) as the collection of disks resulting from the conversion of vertices and edges into vertex gadgets and edge gadgets respectively.

At this point, we have not specified the centers of disks yet, nor the number of rotulae per edge that we need (only that it should be an odd number). We postpone to Sect. 4.2 the description of how disks composing gadgets are chosen. This will be done from an orthogonal grid drawing of G; see Fig. 6 for an example. At this stage it suffices to know that we can always choose disks composing gadgets so that they fulfill the properties (i)–(viii) listed below. To simplify notations, we shall refer to \(\mathscr {S}(G,\delta ,\varepsilon )\) and \(S(G,\delta ,\varepsilon ) = \bigcup \mathscr {S}(G,\delta ,\varepsilon )\) simply as \(\mathscr {S}\) and S.

  1. (i)

    The \(\varepsilon \)-erosion \(S^{\ominus \varepsilon }\) is exactly the collection of rotulae.

  2. (ii)

    Any disk \(b\subseteq S^{\oplus \delta }\) contains at most two regular rotulae.

  3. (iii)

    If a disk \(b\subseteq S^{\oplus \delta }\) contains two regular rotulae, then they are neighbors of each other and b does not contain any other rotula (neither regular nor extreme).

  4. (iv)

    Let c be a regular rotula, \(c_1\) and \(c_2\) its two neighbors. There exist two disks \(b_1,b_2 \subseteq S^{\oplus \delta }\) such that \(\{ c_1,c \}\subseteq b_1\) and \(\{ c_2,c \}\subseteq b_2\).

  5. (v)

    Any disk \(b\subseteq S^{\oplus \delta }\) contains at most three extreme rotulae.

  6. (vi)

    If a disk \(b\subseteq S^{\oplus \delta }\) contains two or three extreme rotulae, then these extreme rotulae are linked to the same vertex and b only contains extreme rotulae linked to that vertex.

  7. (vii)

    Let v be a vertex. There exists a disk \(b\subseteq S^{\oplus \delta }\) that contains all extreme rotulae linked to v.

  8. (viii)

    If a disk \(b\subseteq S^{\oplus \delta }\) contains both a regular rotula and an extreme rotula, then these are neighbors and b does not contain any other rotula (neither regular nor extreme).

Fig. 6
figure 6

Conversion from (a) an orthogonal grid drawing of a graph G with 5 vertices and 5 edges to (b) the collection of disks \(\mathscr {S}(G,\delta ,\varepsilon )\) with 10 (purple) vertex rotulae and 31 (blue) edge rotulae. The \(\delta \)-dilation of the union of disks is bounded by the dashed blue lines

Canonical Coverings We ask for the smallest number of disks contained in \(S^{\oplus \delta }\) that suffices to cover the rotulae of a given edge \(e = \{v,w\} \in E\). Recall that the rotulae of e include the two extreme rotulae \(c_{ve}\) and \(c_{we}\) used to build the vertex gadgets of v and w in addition to the regular rotulae used to build the edge gadget of e. By construction, e has an odd number of rotulae greater than or equal to 3. Let \(2\ell (e)+1\) be this number, where \(\ell (e)\ge 1\) is an integer. From property (ii) we need at least \(\lceil (2\ell (e)-1)/2 \rceil =\ell (e)\) disks in \(S^{\oplus \delta }\) in order to cover regular rotulae of e. By (iv) there always exists a collection of \(\ell (e)\) disks in \(S^{\oplus \delta }\) which covers these regular rotulae plus one of the two extreme rotulae of e, and that extreme rotula can be chosen arbitrarily. Indeed, it suffices to cover pairs of neighbouring rotulae with disks in \(S^{\oplus \delta }\), while making sure that the extreme rotula to cover and its neighbour are one of these pairs (see Fig. 7). This gives two possible coverings of the regular rotulae of e (one for each extreme rotulae of e) which we shall refer to as canonical for e. Furthermore, properties (iii) and (viii) guarantee that any disk containing a regular rotula will only contain rotulae of the same edge. Therefore it is necessary and sufficient to use \(\ell (e)\) disks in \(S^{\oplus \delta }\) to cover the regular rotulae of an edge e, and these \(\ell (e)\) disks exclusively cover rotulae of e. However, one of the two extreme rotula of e will not be covered by these \(\ell (e)\) disks and one extra disk is required to cover all rotulae of e for a total of \(\ell (e)+1\) disks. Unlike the previous \(\ell (e)\) disks, by (v) this extra disk may be used to cover extreme rotulae of several edges assuming these extreme rotulae are all linked to the same vertex. We define \(L=\sum _{e\in E}\ell (e)\) which is the smallest number of disks needed to cover all regular rotulae and which can be achieved by taking for each edge, one of its two possible canonical coverings.

Fig. 7
figure 7

A canonical covering of an edge gadget with two green disks. Same color convention as in Fig. 6 (b)

Property 4.1

If G has a vertex cover \(C\subseteq V\), then S has a \((\delta ,\varepsilon \))-ball approximation \(\mathscr {B}\) with \(| \mathscr {B} | = L+| C |\).

Proof

By (i), we know that any \((\delta ,\varepsilon )\)-ball approximation of S is a collection of disks contained in \(S^{\oplus \delta }\) whose union covers the rotulae of all edges of G. To build such a \((\delta ,\varepsilon )\)-ball approximation, we use property (vii) and start by selecting for each vertex \(v\in C\) a disk that covers all extreme rotulae linked to v. This gives a set \(\mathscr {C}\) of \(| C |\) disks that cover at least one extreme rotula per edge. Using the appropriate canonical covering of each edge, that is, the one excluding the extreme rotula already covered by \(\mathscr {C}\), we complete the set \(\mathscr {C}\) into a \((\delta ,\varepsilon )\)-ball approximation adding L more disks. \(\square \)

Property 4.2

If S has a \((\delta ,\varepsilon )\)-ball approximation \(\mathscr {B}\), then G has a vertex cover C with \(| C |\le | \mathscr {B} |-L\).

Proof

Without loss of generality, we may assume that all disks in \(\mathscr {B}\) cover at least one rotula. Indeed, if a disk b does not cover any rotula, it can be removed from \(\mathscr {B}\) while keeping the property that \(\mathscr {B}\) is a \((\delta ,\varepsilon )\)-ball approximation. Starting from \(\mathscr {B}\), we first deduce a \((\delta ,\varepsilon )\)-ball approximation \(\mathscr {R}\) of S having the property that it contains one of the two canonical coverings of each edge \(e \in E\). For \(e \in E\), let \(\mathscr {B}_e=\{ b\in \mathscr {B}\mid \text {b{ containsaregularrotulaof}e} \}\). Note that for different edges the \(\mathscr {B}_e\) are disjoint and that \(| \mathscr {B}_e |\ge \ell (e)\). Given an extreme rotula \(c_{ve}\), we denote by \(\mathscr {C}_{ve}\) the canonical covering that contains \(c_{ve}\) and all the regular rotulae of edge e. Initializing \(\mathscr {R}\) to \(\mathscr {B}\), we modify \(\mathscr {R}\) as follows, applying the following transformation to each edge e of G:

  • If disks in \(\mathscr {B}_e\) cover no extreme rotula, we replace \(\mathscr {B}_e\) by one of the two canonical coverings of e.

  • If disks in \(\mathscr {B}_e\) cover one extreme rotula, we replace \(\mathscr {B}_e\) by the canonical covering of e that covers this extreme rotula.

  • If disks in \(\mathscr {B}_e\) contain both extreme rotulae of e, then \(| \mathscr {B}_e |\ge \ell (e)+1\). We choose arbitrarily one of the two extreme rotulae, say \(c_{ve}\), and let b be a disk in \(S^{\oplus \varepsilon }\) containing the other extreme rotula \(c_{we}\) but no regular rotula. We replace \(\mathscr {B}_e\) by \(\mathscr {C}_{ve} \cup \{ b \}\).

Each of these substitutions preserves the \((\delta ,\varepsilon )\)-ball approximation property and does not increase the cardinality of the resulting collection of disks. Consider the disks of \(\mathscr {R}\) that do not contain any regular rotula, \(\mathscr {C}=\mathscr {R}\setminus \bigl ( \bigcup _{e\in E}\mathscr {R}_e \bigr )\). By construction, \(| \mathscr {C} | = | \mathscr {R} | - L \le | \mathscr {B} |-L\) and \(\mathscr {C}\) covers at least half of the extreme rotulae (at least one for each edge). Let C be the set of vertices \(v \in V\) linked to an extreme rotula covered by a disk in \(\mathscr {C}\). We claim that C is a vertex cover of G and that its cardinality satisfies \(| C |\le | \mathscr {C} |\). All \(b\in \mathscr {C}\) must contain at least one extreme rotula, thus C is empty if and only if \(\mathscr {C}\) is empty. In this particular case, G has no edges because otherwise \(\mathscr {R}\) would only cover half of the extreme rotulae. It follows that in this case the empty set is a vertex cover of G. Assume now that \(\mathscr {C}\) is not empty. By construction, any \(b\in \mathscr {C}\) covers only extreme rotulae, which by (vi) are all linked to the same vertex v. It is thus possible to map each \(b \in \mathscr {C}\) to one vertex \(v \in C\), showing that \(|C| \le |\mathscr {C}|\). To see that C is a vertex cover, recall that \(\mathscr {C}\) covers exactly one of the two extreme rotulae of each edge. The definition of C thus ensures it contains at least one endpoint of each edge. \(\square \)

4.2 Practical Construction

Given as input a graph G and rational numbers \(\delta > 0\) and \(\varepsilon \ge 0\), we build a collection of rational disks fulfilling properties (i) to (viii). To do so, we first relax the condition that the collection is rational and build a collection of disks \(\mathscr {S}\) that satisfies properties (i) to (viii). We then show at the end of the section how to perturbate \(\mathscr {S}\) so as to make disks in the collection rational while maintaining properties (i) to (viii). To build \(\mathscr {S}\), we rely on the following result:

Theorem 4.3

([9]) There is a linear time and space algorithm to draw a connected cubic graph on an orthogonal grid.

Recall that the drawing of a graph G on an orthogonal grid is a drawing of G such that each vertex is drawn as a vertex grid and each edge is drawn as a chain of horizontal and vertical segments of the grid; see Fig. 6 (a) for an example of such a drawing. Given a drawing of G on an orthogonal grid, we describe a way to convert it into an appropriate collection of disks \(\mathscr {S}\). To perform the conversion, we fix the size of the grid to \(8(\delta +\varepsilon )\) so that we can fit square blocks of size \(4(\delta +\varepsilon ) \times 4(\delta +\varepsilon )\) as in Fig. 8. Note that in Figs. 6, 7, 8, 9 and 10, we set \(\varepsilon =2\delta \).

Fig. 8
figure 8

Drawing (in blue) of a cubic graph on an orthogonal grid and grid division into blocks. Gray lines represent the grid and dashed red lines are the blocks

There are two different ways in which the blocks meet the graph drawing: the block either contains one vertex or only a portion of one edge. Blocks containing a vertex only vary depending on the number and layout of incident edges. Similarly, blocks containing a portion of an edge vary depending on whether the edge bends within the block or not. In each case, we convert the graph drawing covered by the block into a set of disks of radii \(\varepsilon \). For blocks containing a vertex, see Fig. 9 for the four subcases. Similarly for edges, we have two subcases. However, recall that edge gadgets must have an odd number of rotulae. To achieve this, we use the fact that every edge necessarily crosses at least one block in a straight line and provide an odd and an even conversion for this type of block. The three block conversions are presented in Fig. 10. Finally, we build \(\mathscr {S}\) by converting the orthogonal graph drawing of G into a set of disks using the seven types of blocks described in Figs. 9 and 10. Each block contains between two and six rotulae, the positions of which depend on parameters \(\delta \) and \(\varepsilon \). An extra parameter t is also used within two blocks.

Fig. 9
figure 9

Block conversions for (a) a degree-3 vertex; (b) a degree-1 vertex; (c) a degree-2 vertex in a bend; (d) a degree-2 vertex in a straight-line. The red dashed square delimits the block. The medial axis of \(S^{\oplus \delta }\) that intersects each block is the set of black segments. Same color convention as in Fig. 6 (b)

Fig. 10
figure 10

Block conversions (a) when the edge bends within the block; (b, c) when the edge traverses the block in a straight line. (b) uses an even number of disks and (c) an odd number. The medial axis of \(S^{\oplus \delta }\) that intersects each block is the set of black segments. Same color convention as in Fig. 6 (b)

Theorem 4.4

For all values \(1< t < 2 - {1}/{\sqrt{2}}\), the collection of disks \(\mathscr {S}\) resulting from the conversion of the orthogonal graph drawing satisfies properties (i) to (viii).

Before proving the theorem, we give some definitions and study the medial axes of \(S= \bigcup \mathscr {S}\) and \(S^{\oplus \delta }\). For simplicity, we write \(b_x\) for \(b(x,\varepsilon )\) and \(B_x\) for \(b(x,\delta +\varepsilon )\). We also identify a vertex \(v \in V\) and its drawing as a vertex grid. Given two disks \(b_1 = b(c_1,r_1)\) and \(b_2 = b(c_2,r_2)\) we recall that a convex combination of \(b_1\) and \(b_2\) is a disk whose equation is \(\alpha \pi _1(x) + (1-\alpha ) \pi _2(x) \le 0\) where \(\alpha \ge 0\) and \(\pi _i(x) = \Vert x-c_i\Vert ^2 - r_i^2\) for \(1 \le i \le 2\). If b is the convex combination of \(b_1\) and \(b_2\) determined by coefficient \(\alpha \), then the center of b is \(\alpha c_1 + (1-\alpha ) c_2\) and \(\partial b\) passes through \(\partial b_1 \cap \partial b_2\). Recall that disks in \(\mathscr {B}\) are independent if for every subset \(\mathscr {B}' \subseteq \mathscr {B}\), including \(\mathscr {B}' = \emptyset \), there is a point in \(\bigcap \mathscr {B}'\) that does not belong to any disk not in \(\mathscr {B}'\). If three disks \(b_1\), \(b_2\) and \(b_3\) are independent, then the boundary of their union \(\bigcup _{1 \le i \le 3} b_i\) has exactly three vertices and the circumdisk of these vertices is contained in the union of the three disks. We call the circumdisk the branching disk of the collection \(\{b_1,b_2,b_3\}\). Because of the way in which rotulae are placed within each block, the following property holds:

Property 4.5

Consider a degree-three vertex v and let \(c_1\), \(c_2\) and \(c_3\) be the three extreme rotulae linked to v. The three disks \(b_{c_1}\), \(b_{c_2}\) and \(b_{c_3}\) may intersect pairwise but do not have a common intersection. The three disks \(B_{c_1}\), \(B_{c_2}\) and \(B_{c_3}\) are independent.

Let us denote by \(B^\star _v\) the branching disk of the collection \(\{B_{c_1}, B_{c_2}, B_{c_3}\}\). Observe that since we place the three extreme rotulae \(c_1\), \(c_2\) and \(c_3\) linked to v in such a way that they form an equilateral triangle, the circumdisk of \(c_1\), \(c_2\) and \(c_3\) is \(B_v\) and furthermore \(B_v^\star = B_v\).

Property 4.6

For \(1< t < 2 - {1}/{\sqrt{2}}\), medial disks of \(S= \bigcup \mathscr {S}\) are

  • disks of \(\mathscr {S}\);

  • convex combinations of disks \(b_{c_1}\) and \(b_{c_2}\) such that \(\partial b_{c_1} \cap \partial b_{c_2}\) consists of two points and one of the following holds:

    1. (1)

      \({c_1}\) and \({c_2}\) are two neighboring rotulae;

    2. (2)

      \({c_1}\) and \({c_2}\) are extreme rotulae linked to the same vertex.

Property 4.7

For \(1< t < 2 - {1}/{\sqrt{2}}\), medial disks of \(S^{\oplus \delta }\) are

  • disks centered at rotulae with radius \(\delta +\varepsilon \);

  • convex combinations of disks \(B_{c_1}\) and \(B_{c_2}\) where \(c_1\) and \(c_2\) are two neighboring rotulae;

  • convex combinations of disks \(B_{c_1}\) and \(B_{c_2}\) where \(c_1\) and \(c_2\) are extreme rotulae linked to the same degree-two vertex;

  • convex combinations of disks \(B_{v}^\star \) and \(B_{c}\) where v is a degree-three vertex and c is an extreme rotulae linked to v.

We are now ready to prove Theorem 4.4.

Proof of Theorem 4.4

Property (i) holds because Property 4.6 implies that every medial disk b of S is the convex combination of two (possibly identical) disks of \(\mathscr {S}\). Since all disks of \(\mathscr {S}\) share the same radius \(\varepsilon \), the radius of b does not exceed \(\varepsilon \) and is equal to \(\varepsilon \) if and only if \(b \in \mathscr {S}\). It follows that the \(\varepsilon \)-erosion of S is the collection of rotulae.

Let us prove that every disk B of \(S^{\oplus \delta }\) contains at most two rotulae, except medial disks \(B_v\) centered at degree-three vertices v which contain the three extreme rotulae linked to v. Notice that it suffices to establish this for medial disks of \(S^{\oplus \delta }\) since any disk \(B \subseteq S^{\oplus \delta }\) is always contained in a medial disk of \(S^{\oplus \delta }\). Consider a medial disk B of \(S^{\oplus \delta }\). Property 4.7 implies that one of the following two situations occurs:

  • B is the convex combination of disks \(B_{c_1}\) and \(B_{c_2}\) where \({c_1}\) and \({c_2}\) are two neighboring rotulae or two extreme rotulae linked to the same degree-two vertex. In that case, it is easy to check that the only rotulae contained in \(B_{c_1} \cup B_{c_2}\) are \({c_1}\) and \({c_2}\) and since \(B \subseteq B_{c_1} \cup B_{c_2}\), the only rotulae that B may contain are \({c_1}\) and \({c_2}\).

  • B is the convex combination of disks \(B_v^\star \) and \(B_{c}\) where v is a degree-three vertex and c is an extreme rotula linked to v. In that case, \(B_v^\star \cup B_{c}\) contains four rotulae; see Fig. 11. One of them is c, two of them lie on \(\partial B_v^\star \setminus B_{c}\) and one of them lies on \(\partial B_{c} \setminus B_v^\star \). It follows that if \(B \ne B_v^\star \), then B avoids \(\partial B_v^\star \setminus B_{c}\) while being contained in \(B_v^\star \cup B_{c}\), implying that B contains at most two rotulae. If \(B = B_v^\star \), then B contains the three extreme rotulae linked to v.

From there, by carefully studying the type of rotulae contained in disks of \(S^{\oplus \delta }\), properties (ii), (iii), (v), (vi), (viii) follow easily.

Property (iv) holds because the distance between two neighboring rotulae \(c_1\) and \(c_2\) has been adjusted so that \(\Vert {c_1} - {c_2}\Vert \le \sqrt{2}(\delta +\varepsilon )\), implying that the convex combination of \(B_{c_1}\) and \(B_{c_2}\) centered at the midpoint of segment \(c_1c_2\) contains both \(c_1\) and \(c_2\); see Fig. 7.

Property (vii) holds because one can always find a disk of \(S^{\oplus \delta }\) that contains all extreme rotulae \(c_1\), ..., \(c_k\) linked to a degree-k vertex v. If \(k = 1\), take \(B_{c_1}\); if \(k=2\), take the convex combination of \(B_{c_1}\) and \(B_{c_2}\) centered at the midpoint of segment \(c_1c_2\); if \(k=3\), take \(B_v\). \(\square \)

Fig. 11
figure 11

\(B_v^\star \cup B_{c}\) contains four rotulae : three extreme rotulae in pink, and a regular one in blue

We now explain how to perturbate the set \(\mathscr {S}\) so as to get a collection of rational disks which fulfills properties (i) to (viii). Observe that by construction we only need to perturbate coordinates of some of the disks centered at extreme rotulae linked to degree-three vertices. Precisely, let v be a degree-three vertex whose extreme rotulae are \(c_1\), \(c_2\) an d \(c_3\). Assume \(c_1\) and \(c_2\) lie on the same vertical line L. Then, the coordinates of the three points are rational except the y-coordinates of \(c_1\) and \(c_2\). We perturbate \(c_1\) and \(c_2\) so as to get rational points by moving \(c_1\) and \(c_2\) along the vertical line L towards each other so as to decrease \(\Vert c_1-c_2\Vert \) while keeping the property that \(c_1c_2c_3\) is isosceles. We note that under a sufficiently small motion of points \(c_1\) and \(c_2\), Properties 4.5 to 4.7 still hold. Doing this for all degree-three vertices, we get a collection of rational disks which still satisfies properties (i) to (viii). To see this, it suffices to adapt the proof of Theorem 4.4, showing that every disk of \(S^{\oplus \delta }\) contains at most two rotulae, except some of the disks centered “near” degree-three vertices v which contain the three extreme rotulae linked to v.

5 Conclusion

The main contribution of this paper is the proof that the rational \((\delta ,\varepsilon )\)-ball approximation problem is NP-complete in \(\mathbb {R}^2\). As a by-product, we immediately get that the problem is also NP-hard in \(\mathbb {R}^n\) for \(n>2\). Indeed, each instance \(\mathscr {S}_2\) of the problem in \(\mathbb {R}^2\) can be transformed in polynomial time into an instance \(\mathscr {S}_n\) of the problem in \(\mathbb {R}^n\), replacing disks in \(\mathscr {S}_2\) by n-dimensional balls in \(\mathbb {R}^n\) with the same centers and radii. It is easy to see that \(\mathscr {S}_2\) has a \((\delta ,\varepsilon )\)-ball approximation of cardinality k if and only if \(\mathscr {S}_n\) has a \((\delta ,\varepsilon )\)-ball approximation of cardinality k.

In our proof of NP-hardness in \(\mathbb {R}^2\), we have chosen carefully the set of disks composing the shape, so that its erosion is composed of a finite set of points (the rotulae). It follows that the reduction from vertex cover induces a set cover problem of a finite set of points (the rotulae), using an infinite range of balls (the medial axis of the dilation). We notice however that it is possible to define a similar construction where the erosion of the shape is an infinite set of points too. Furthermore, a construction where the shape, its erosion and its dilation are arcwise-connected is also possible. To build such variants, it suffices to tune the radii of disks composing the gadgets, and distances between consecutive disks so that the eight properties (i)–(viii) are fulfilled. This does not change the overall result.

Ascertaining the computational complexity of a problem is often the first step before the design of algorithms that return either an optimal solution for a simple subclass of inputs, or an approximated solution for wider classes of inputs. In [30], we investigate the \((\delta ,\varepsilon )\)-ball approximation problem for the subclass of shapes S defined as a finite union of balls in \(\mathbb {R}^2\), with an acyclic medial axis \({\text {MA}}\left( S \right) \). We design a greedy algorithm that computes an optimal \((\delta ,\varepsilon )\)-ball approximation of S in polynomial time with respect to the size of \({\text {MA}}\left( S \right) \). Whether or not this algorithm can be extended for acyclic finite unions of balls in \(\mathbb {R}^3\) remains an open question.

In the \((\delta ,\varepsilon )\)-ball approximation definition, the core set to cover and the outer set that must not be crossed over are defined through mathematical morphology operators. It is natural to investigate an even more general version of the problem:

Problem 5.1

Given a shape \(S \subseteq \mathbb {R}^n\), a subset \(S^-\) of S and a superset \(S^+\) of S, find the smallest collection of balls whose union X satisfies \(S^- \subset X \subset S^+\).

When the shape is defined as a finite union of balls \(S = \bigcup \mathscr {S}\), an obvious choice for \(S^-\) is to consider the union of balls obtained by deflating balls in \(\mathscr {S}\), either decreasing each radius by a constant \(\varepsilon \) or multiplying each radius by a factor \(\mu < 1\) as in [29]. In both cases, keeping for \(S^+\) the \(\delta \)-dilation, it is not difficult to see that the associated decision problem is again NP-complete, using the same reduction. We ask what would be the complexity of Problem 5.1 for other choices of \(S^-\) and \(S^+\).