1 Introduction

Spanners The vertices of a Euclidean graph are points in \({\mathbb {R}}^d\), and the edges are weighted by the (Euclidean) distance between their endpoints. Let \({G}=({P},{E})\) be a Euclidean graph and \({p},{q}\in {P}\) be two vertices of \({G}\). For a parameter \(t \ge 1\), a path between \({p}\) and \({q}\) in \({G}\) is a t-path if the length of the path is at most \(t\Vert {p}-{q}\Vert \), where \(\Vert {p}-{q}\Vert \) is the Euclidean distance between \({p}\) and \({q}\). The graph \({G}\) is a t-spanner of \({P}\) if there is a t-path between any pair of points \({p},{q}\in {P}\). Throughout the paper, n denotes the cardinality of the point set \({P}\), unless stated otherwise. We denote the length of the shortest path between \({p},{q}\in {P}\) in the graph \({G}\) by \({{\textsf {d}}}\left( {{p},{q}}\right) \).

Spanners have been studied extensively. The main goal in spanner constructions is to have small size, that is, to use as few edges as possible. Other desirable properties are low degrees [4, 13, 24], low weight [8, 16], low diameter [5, 6], or to be resistant to failures. The book by Narasimhan and Smid [22] gives a comprehensive overview of geometric spanners.

Robustness Here, our goal is to construct spanners that are robust according to the notion introduced by Bose et al. [9]. Intuitively, a spanner is robust if the deletion of k vertices only harms a few other vertices. Formally, a graph \({G}\) is an f(k)-robust t-spanner, for some positive monotone function f, if for any set \({{B}}\) of k vertices deleted in the graph, the remaining graph \({G}\setminus B\) is still a t-spanner for at least \(n-f(k)\) of the vertices. Note that the graph \({G}\setminus B\) has \(n-k\) vertices—namely, there are at most \({{\mathcal {L}}}\left( {k}\right) = f(k)-k\) additional vertices that no longer have good connectivity to the remaining graph. The quantity \({{\mathcal {L}}}\left( {k}\right) \) is the loss. We are interested in minimizing the loss.

The natural question is how many edges are needed to achieve a certain robustness (since the clique has the desired property). That is, for a given parameter t and function f, what is the minimal size that is needed to obtain an f(k)-robust t-spanner on any set of n points.

A priori it is not clear that such a sparse graph should exist (for t a constant) for a point set in \({\mathbb {R}}^d\), since the robustness property looks quite strong. Surprisingly, Bose et al. [9] showed that one can construct a \({{\mathcal {O}}}(k^2)\)-robust \({{\mathcal {O}}}(1)\)-spanner with \({{\mathcal {O}}}(n \log n)\) edges. Bose et al. [9] proved various other bounds in the same vein on the size of one-dimensional and higher-dimensional point sets. Their most closely related result is that for the one-dimensional point set, \({P}=\{1,2,\dots ,n\}\), and for any \(t \ge 1\), at least \(\varOmega (n\log {n})\) edges are needed to construct an \({{\mathcal {O}}}(k)\)-robust t-spanner.

An open problem left by Bose et al. [9] is the construction of \({{\mathcal {O}}}(k)\)-robust spanners—they only provide the easy upper bound of \({{\mathcal {O}}}(n^2)\) for this case. In this paper, we present several constructions for this case with optimal or near-optimal size. These results even hold for a stronger requirement on the spanners, defined next.

\({\vartheta }\)-Reliable spanners We are interested in building spanners where the loss is only fractional. Specifically, given a parameter \({\vartheta }\), we consider the function \(f(k) = (1+{\vartheta })k\). The loss in this case is \({{\mathcal {L}}}\left( {k}\right) = f(k)-k = {\vartheta }k\). A \((1+{\vartheta })k\)-robust t-spanner is a \({\vartheta }\)-reliable t-spanner.

Exact reliable spanners If the input point set is in one dimension, then one can easily construct a 1-spanner for the points, which means that the exact distances between points on the line are preserved by the spanner—indeed, simply connect the points from left to right. It becomes significantly more challenging to construct such an exact spanner that is reliable. In case of robust spanners, for a function f under some general conditions, Bose et al. [9] gave a construction of exact f(k)-robust spanners. In particular, their result implies that one can construct \({{\mathcal {O}}}(k \log k)\)-robust 1-spanners of size \({{\mathcal {O}}}(n \log n)\) and, for any \(\varepsilon >0\), \({{\mathcal {O}}}(k^{1+\varepsilon })\)-robust 1-spanners of size \({{\mathcal {O}}}(n \log \log n)\), for one-dimensional point sets.

Fault tolerant spanners Robustness is not the only definition that captures the resistance of a spanner network against vertex failures. A closely related notion is fault tolerance [18,19,20]. A graph \({G}=({P},{E})\) is an r-fault tolerant t-spanner if for any set \({{B}}\) of failed vertices with \(|{{B}}|\le r\), the graph \({G}\setminus {{B}}\) is still a t-spanner. The disadvantage of r-fault tolerance is that each vertex must have degree at least \(r+1\), otherwise the vertex can be isolated by deleting its neighbors. Therefore, the graph has size at least \(\varOmega (rn)\). There are constructions that show \({{\mathcal {O}}}(rn)\) edges are enough to build r-fault tolerant spanners. However, depending on the chosen value r the size can be too large.

In particular, fault tolerant spanners cannot have a near-linear number of edges, and still withstand a widespread failure of nodes. Specifically, if a fault tolerant spanner has m edges, then it can withstand a failure of at most 2m/n vertices. In sharp contrast, \({\vartheta }\)-reliable spanners can withstand a widespread failure. Indeed, a \({\vartheta }\)-reliable spanner can withstand a failure of close to \(n/(1+{\vartheta })\) of its vertices, and still have some vertices that are connected by short paths in the remaining graph.

Region fault tolerant spanners In a surprising result, Abam et al. [1] showed that one can build a geometric spanner with near linear number of edges, so that if the deleted set are all the points belonging to a convex region (they also delete the edges intersecting this region), then the residual graph is still a spanner for the remaining points.

1.1 Our Results

We investigate how to construct reliable spanners with very small loss, that is, \({\vartheta }\)-reliable spanners. To the best of our knowledge nothing was known on this case before this work.

Exact \({{\mathcal {O}}}(1)\)-reliable spanner in one dimension Inspired by the reliability of constant degree expanders, we show how to construct an \({{\mathcal {O}}}(1)\)-reliable exact spanner on any one-dimensional set of n points with at most \({{\mathcal {O}}}(n \log {n})\) edges.Footnote 1 The idea of the construction is to build a binary tree over the points, and to build bipartite expanders between certain subsets of nodes in the same layer. One can think of this construction as building different layers of expanders for different resolutions. The construction is described in Sect. 3.2. See Theorem 3.6 for the result.

Exact \({\vartheta }\)-reliable spanner in one dimension One can get added redundancy by systematically shifting the layers. Done carefully, this results in a \({\vartheta }\)-reliable exact spanner with \({{\mathcal {O}}}({\vartheta }^{-6} n \log n)\) edges. The construction is described in Sect. 3.3. See Theorem 3.11 for the result.

\({\vartheta }\)-Reliable \((1+\varepsilon )\)-spanners in higher dimensions   We next show a simple construction of \({\vartheta }\)-reliable spanners in \({\mathbb {R}}^d\), for d being constant, using a recent result of Chan et al. [14], which shows that one needs to maintain only a “few” linear orders. This immediately reduces the d-dimensional problem to maintaining a reliable spanner for each of these orderings, which is the problem we already solved. By applying a recursive scheme, using the same idea, we obtain the desired spanner of size \({{\mathcal {O}}}\left( {\varepsilon ^{-O(d)} {\vartheta }^{-6} n \log n (\log \log n)^{6}}\right) \). See Sect. 4 for details.

\({\vartheta }\)-Reliable \((1+\varepsilon \))-spanner with bounded spread   Since the general construction in \({\mathbb {R}}^d\) has some additional factors that seem unnecessary, we present an optimal construction for the case when the point set has bounded spread, that is, the ratio of the largest and the smallest distance of point pairs is bounded by a polynomial of n. Specifically, for points with spread \({\varPhi }\) in \({\mathbb {R}}^d\), for d being constant, and for any \(\varepsilon >0\), we construct a \({\vartheta }\)-reliable \((1+\varepsilon )\)-spanner with \({{\mathcal {O}}}\bigl ( \varepsilon ^{-d} {\vartheta }^{-2} n \log {\varPhi }\bigr )\) edges. The basic idea is to construct a well-separated pair decomposition (WSPD) directly on the quadtree of the point set, and convert every pair in the WSPD into a reliable graph using a bipartite expander. The union of these graphs is the required reliable spanner. See Sect. 5 and Lemma 5.10 for details.

Shadow   Underlying our construction is the notion of identifying the points that lose connectivity when the failure set is removed. Intuitively, a point is in the shadow if it is surrounded by failed points. We believe that this concept is of independent interest—see Sect. 3.1 for details and relevant results in one dimension.

The competition   Independently of this work, Bose et al. [7] also obtained an upper bound on the size of reliable spanners in \({\mathbb {R}}^d\). Their construction has \({{\mathcal {O}}}(n \log ^2n \log \log n)\) edges, which is close, but worse, than our bound of \({{\mathcal {O}}}(n \log n (\log \log n)^6)\) edges. For both constructions, the fundamental building blocks are expander graphs. However, the construction in [7] does not use the one-dimensional construction directly, but uses well-separated pair decomposition, centroid decomposition, and ideas for maintaining orders. In particular, inspired by the preliminary work of Buchin et al. [11], in October 2018, Bose et al.Footnote 2 achieved independently essentially the same one-dimensional results by using expanders. Our own improved one-dimensional results were announced earlier in a public talk on June 12, 2018 (this was a YRF talk in SoCG 2018). To keep things in perspective, the results of Bose et al. [7] are equivalent to our results (up to a log factor), while being technically quite different (in two and higher dimensions). In particular, their one-dimensional construction has better dependency on the reliability parameter. The main advantage of our result, beyond the aforementioned (all-important) log factor, is that it is (conceptually) simpler—the use of locality sensitive orderings [14] makes all the difference.

2 Preliminaries

2.1 Problem Definition and Notations

Let \(\left[ n \right] \) denote the set \(\{1,2,\dots ,n\}\) and let \([ i\,{:}\,j]=\{i,i+1,\dots ,j\}\).

Definition 2.1

(Robust spanner) Assume that we are given

  1. (i)

    a parameter \(t \ge 1\),

  2. (ii)

    a graph \({G}=({P},{E})\) that is a t-spanner,

  3. (iii)

    a function \(f:{\mathbb {N}} \rightarrow \mathbb {R_+}\), and

  4. (iv)

    two point sets \({P}_1, {P}_2 \subseteq {P}\).

The graph \({G}\) is an f(k)-robust t-spanner for \({P}_1 \times {P}_2\) if for any set of (failed) vertices \({{B}}\subseteq {P}\) there exists a set \({{B^+}}\supseteq {{B}}\) with \(|{{B^+}}|\le f(|{{B}}|)\) such that the subgraph

$$\begin{aligned} {G}\setminus {{B}}={G}_{{P}\setminus {{B}}}=\bigl ( {P}\setminus {{B}}, \,\{uv \in {E}({G})\mid u,v \in {P}\setminus {{B}}\}\bigr ) \end{aligned}$$

induced by \({G}\) on \({P}\setminus {{B}}\) is a t-spanner for \(({P}_1 \setminus {{B^+}}) \times ({P}_2 \setminus {{B^+}})\). That is, \({G}\setminus {{B}}\) has a t-path between all pairs of points \({p}\in {P}_1\setminus {{B^+}}\) and \({q}\in {P}_2 \setminus {{B^+}}\). If \({P}_1 = {P}_2 = {P}\), then \({G}\) is a f(k)-robust t-spanner. The vertices of \({{B^+}}\setminus {{B}}\) are the vertices harmed by \({{B}}\), and the quantity \({\mathcal {L}}{(k)} = f(k) -k \ge |{{B^+}}|-|{{B}}|\) is the loss.

Definition 2.2

For a parameter \({\vartheta }>0\), a graph \({G}\) that is a \((1+{\vartheta })k\)-robust t-spanner is a \({\vartheta }\)-reliable t-spanner.

Definition 2.3

For a number \(x > 0\), let \(\text {pow}_2\left( {x}\right) = 2^{\left\lceil {\log x} \right\rceil }\) be the smallest number that is a power of 2 and is at least as large as x.

2.2 Expanders

For a set X of vertices in a graph \({G}=({V},{E})\), let

$$\begin{aligned} {{\varGamma }}{(X)}= \{ v \in {V}\mid uv \in {E}\text { and } u \in X\} \end{aligned}$$

be the neighbors of X in \({G}\). The following lemma, which is a standard expander construction, provides the main building block of our one-dimensional construction. We provide the proof only for the sake of completeness, as this is well known. The survey by Hoory et al. [17] gives a comprehensive study of expanders.

Lemma 2.4

Let LR be two disjoint sets, with a total of n elements, and let \({\xi }\in (0,1)\) be a parameter. One can build a bipartite graph \({G}= (L \cup R, E)\) with \({{\mathcal {O}}}(n/{\xi }^2)\) edges, such that

  1. (I)

    for any subset \(X \subseteq L\), with \(|X|\ge {\xi }|L|\), we have \(|{{\varGamma }}{(X)}|> (1-{\xi })|R|\), and

  2. (II)

    for any subset \(Y \subseteq R\), with \(|Y|\ge {\xi }|R|\), we have \(|{{\varGamma }}{(Y)}| > (1-{\xi })|L|\).

Proof

This is a variant of an expander graph. See [21, Sect. 5.3] for a similar construction.

Let \(c=\lceil 3/{\xi }^2\rceil \). For every vertex in L, pick randomly and uniformly (with repetition) \(\ell = c \lceil n/|L|\rceil \) neighbors in R. Do the same for every vertex in R, picking \(c \lceil n/|R|\rceil \) neighbors at random from L. Let \({G}\) be the resulting graph, after removing redundant parallel edges. Clearly, the number of edges is as required.

As for the claimed properties, fix a subset \(X \subseteq L\) of size at least \({\xi }|L|\), and fix a subset on the right, \(Z \subseteq R\) of size \(\le (1-{\xi })|R|\). Notice that there are at most \(2^n\) choices for both X and Z. The probability that all the edges we picked for the vertices of X stay inside Z, is at most

$$\begin{aligned} (1-{\xi })^{\ell |X|}\le & {} (1-{\xi })^{\ell {\xi }|L|}\le (1-{\xi })^{c {\xi }n}\\\le & {} \exp {\biggl (\!-{\xi }\cdot \frac{3}{{\xi }^2} \cdot {\xi }n\biggr )}= \exp {( -3 n)}\le \frac{1}{8^n}, \end{aligned}$$

since \(c \ge 3/{\xi }^2\) and \(1-{\xi }\le \exp (-{\xi })\). In particular, for a given X the probability that this happens for any subset Z is less than \(2^n / 8^n = 1/4^n\). Thus, with probability less than \(2^n / 4^n = 1/2^n\) there is an \(X\subseteq L\) with \({{\varGamma }}{(X)} \le (1-{\xi })n\). Using the same argument for \(Y\subseteq R\) we get that the random graph does not have the desired properties with probability \(2/2^n<1\) (for \(n>1\)). This implies that a graph with the desired properties exists. \(\square \)

Remark

The above construction is randomized, but simple algebraic deterministic constructions are known [3, 15, 23]. One can improve their expansion ratio by repeatedly squaring them. These constructions are implicit, and are easily constructed quickly on the fly. As such, in the following, we assume that the expanders of Lemma 2.4 are readily available for use in our constructions.

Remark

It is not hard to show that regular expanders (i.e., not bipartite, as constructed above) are reliable graphs. That is, deleting a set of vertices leaves almost all the remaining vertices in a single connected component.

3 Building Reliable Spanners in One Dimension

3.1 Bounding the Size of the Shadow

Our purpose is to build a reliable 1-spanner in one dimension. Intuitively, a point in \(\left[ n \right] \) is in trouble, if many of its close by neighbors belong to the failure set \({{B}}\). Such an element is in the shadow of \({{B}}\), defined formally next.

Definition 3.1

Consider an arbitrary set \({{B}}\subseteq \left[ n \right] \) and a parameter \(\alpha \in (0,1)\). A number i is in the left \(\alpha \)-shadow of \({{B}}\), if and only if there exists an integer \(j \ge i\), such that \(|[ i\,{:}\,j] \cap {{B}}|\ge \alpha |[ i\,{:}\,j]|\). Similarly, i is in the right \(\alpha \)-shadow of \({{B}}\), if and only if there exists an integer h, such that \(h \le i\) and \(|[ h\,{:}\,i] \cap {{B}}| \ge \alpha |[ h\,{:}\,i]|\). The \(\alpha \)-shadow of \({{B}}\), denoted by \({\mathcal {S}}({\alpha }, {{{B}}})\), is the union of the left \(\alpha \)-shadow and the right \(\alpha \)-shadow. See Fig. 1 for a visual interpretation of the shadow.

Fig. 1
figure 1

Consider a set \({{B}}\subseteq \left[ n \right] \), the points \(p_i=(i,1 + |[1,i-1] \cap {{B}}|)\), for \(i=1,\ldots ,n\), and the associated polyline \(\sigma \) resulting from connecting these points from left to right (the squares are the points that belong to \({{B}}\)). A number \(i \in \left[ n \right] \setminus {{B}}\) is in the left \(\alpha \)-shadow of \({{B}}\), if the ray emanating from \(p_i\) to the right, with slope \(\alpha \), hits \(\sigma \)

Lemma 3.2

For any \({{B}}\subseteq \left[ n \right] \) and \(\alpha \in (0,1)\), \(|{\mathcal {S}}({\alpha }, {{{B}}})|\le (1 +2\lceil 1/\alpha \rceil )|{{B}}|\).

Proof

Fix a set \({{B}}= \left\{ {{q}_1< \cdots < {q}_b} \right\} \). Let \({P}_0 = \left\{ {{p}_1< \cdots < {p}_{n-b}} \right\} \) be all the points of \(\left[ n \right] \setminus {{B}}\), where \(b= |{{B}}|\). Let the set H be initially empty. Consider the process where in the ith iteration, for \(i =1,\ldots , b\), \(L_i\) (resp. \(R_i\)) is the set of \(\lceil {1/\alpha }\rceil \) largest (resp. smallest) numbers of \({P}_{i-1}\) that are smaller (resp. larger) than \({q}_i\). We set \(H = H \cup L_i \cup R_i \cup \left\{ {{q}_i} \right\} \), and \({P}_{i} = {P}_{i-1} \setminus ( L_i \cup R_i)\).

The claim is that if \(k \in \left[ n \right] \) is in (say) the left \(\alpha \)-shadow of \({{B}}\), then \(k \in H\). If \(k \in {{B}}\) then the claim is immediate, so assume that \(k \notin {{B}}\). Next, fix a witness interval \(J = [ k\,{:}\,k']\), such that \(|{J\cap {{B}}}| \ge \alpha |{J}|\). Observe that the above process handles all the elements of \(J^* = {{B}}\cap J\) in turn. When handling an element \(q \in J^*\), as long as \(k \notin H\), the process either adds k to H, or adds at least \(1 + \left\lceil {1/\alpha } \right\rceil \) new points of J (that were not previously in H) to H—indeed, the last \(1 + \lceil {1/\alpha }\rceil \) “free” points in the interval \([ k\,{:}\,q]\) are added to H. Suppose that \(k \notin H\) at the end of the process. Then, we have

$$\begin{aligned} |J|\ge |H \cap J|\ge (1+ \lceil {1/\alpha }\rceil ) \alpha |{J}|>|J|, \end{aligned}$$

which is a contradiction.

Applying the above argument symmetrically implies that, at the end of the process, H contains all the points in the right and left shadows of \({{B}}\). \(\square \)

One can get a better bound if \(\alpha \) is close to one, as testified by the following. This is crucial to achieve \({\vartheta }\)-reliability, since Lemma 3.2 is not sharp when \(\alpha \) is close to one.

Lemma 3.3

Fix a set \({{B}}\subseteq \left[ n \right] \), let \(\alpha \in (2/3,1)\) be a parameter, and let \({\mathcal {S}}({\alpha }, {{{B}}})\) be the set of elements in the \(\alpha \)-shadow of \({{B}}\). We have that \(|{\mathcal {S}}({\alpha }, {{{B}}})|\le |{{{B}}}| /(2\alpha -1)\).

Proof

Let \(c= 1-1/\alpha < 0\). For \(i=1,\ldots , n\), let \(x_i = c\) if \(i \in {{B}}\), and \(x_i=1\) otherwise. For any interval I of length \(\varDelta \), with \(\tau \varDelta \) elements in \({{B}}\), such that \(x(I) = \sum _{i \in I} x_i \le 0\), we have that

$$\begin{aligned} x(I) \le 0&\iff (1-\tau ) \varDelta + c \tau \varDelta \le 0\iff 1-\tau \le -\tau c\iff 1/\tau \le 1-c\\&\iff 1/\tau \le 1-(1-1/\alpha )\iff {1}/{\tau } \le {1}/{\alpha }\iff \tau \ge \alpha . \end{aligned}$$

An element \(j \in \left[ n \right] \) is in the left \(\alpha \)-shadow of \({{B}}\) if and only if there exists an integer \(j'\), such that \(|[ j\,{:}\,j'] \cap {{B}}|\ge \alpha |[ j\,{:}\,j']|\) and, by the above, \(x([ j\,{:}\,j'])\le 0\). Namely, an integer j in the left \(\alpha \)-shadow of \({{B}}\) corresponds to some prefix sum of the \(x_i\)s starting at j and adding up to some non-positive sum. From this point on, we work with the sequence of numbers \(x_1, \ldots , x_n\), using the above summation criterion to detect the elements in the left \(\alpha \)-shadow.

For a location \(j \in \left[ n \right] \) that is in the left \(\alpha \)-shadow, let \(W_{j} = [ j\,{:}\,j']\) be the witness interval for j—this is the shortest interval that has a non-positive sum that starts at j. Let \(I = W_{k} = [ k\,{:}\,k']\) be the shortest witness interval, for any number in \({\mathcal {S}}({\alpha }, {{{B}}}) \setminus {{B}}\). For any \(j \in [ k+1\,{:}\,k']\), we have \(x([ k\,{:}\,j-1]) + x([ j\,{:}\,k'])=x([ k\,{:}\,k'])\le 0\). Thus, if \(x_j =1\), this implies that either j or k have shorter witness intervals than I, which is a contradiction to the choice of k. We conclude that \(x_j < 0\) for all \(j \in [ k+1\,{:}\,k']\), that is, \([ k+1\,{:}\,k'] \subseteq {{B}}\).

Letting \(\ell = |{I}| = k'-k+1\), we have that

$$\begin{aligned} \frac{\ell -1}{\ell } \ge \alpha \iff \ell -1 \ge \alpha \ell \iff \ell \ge \frac{1}{1-\alpha }\iff \ell \ge \left\lceil {\frac{1}{1-\alpha }} \right\rceil \ge 3, \end{aligned}$$

as \(\alpha \ge 2/3\). In particular, by the minimality of I, we have that \(\ell = \lceil {1/(1-\alpha )}\rceil \).

Let \(J = [ k\,{:}\,k'-1] \subset I\). We have that \(x(J) > 0\). For any \(j \in {\mathcal {S}}({\alpha }, {{{B}}}) \setminus {{B}}\) such that \(j \ne k\), consider the witness interval \(W_{j}\). If \(j >k\), then \(j > k'\), as all the elements of I, except k, are in \({{B}}\). If \(j < k\) and \(j' \in J\), then \(\tau = x( [ k\,{:}\,j']) > 0\), which implies that \(x([ j\,{:}\,k-1]) = x(W_{j}) -\tau < 0\), but this is a contradiction to the definition of \(W_{j}\). Namely, all the witness intervals either avoid J, or contain it in their interior. Given a witness interval \(W_{j}\) such that \(J \subset W_{j}\), we have \(x(W_{j} \setminus J) = x(W_{j}) - x(J) < x(W_{j}) \le 0\), since \(x(J) > 0\).

So consider the new sequence of numbers \(x_{\left[ n \right] \setminus J} = x_1, \ldots , x_{k-1}, x_{k'},\ldots x_n\) resulting from removing the elements that correspond to J from the sequence. Reclassify which elements are in the left shadow in the new sequence. By the above, any element that was in the shadow before, is going to be in the new shadow. As such, one can charge the element k, that is in the left shadow (but not in \({{B}}\)), to all the other elements of J (that are all in \({{B}}\)). Applying this charging scheme inductively, charges all the elements in the left shadow (that are not in \({{B}}\)) to elements in \({{B}}\). We conclude that the number of elements in the left shadow of \({{B}}\) that are not in \({{B}}\) is bounded by

$$\begin{aligned} \frac{|{{B}}|}{|J|- 1}=\frac{|{{B}}|}{\ell - 2}=\frac{|{{B}}|}{\lceil {1/(1-\alpha )}\rceil -2}\le \frac{1-\alpha }{{1} -2(1-\alpha )}|B|=\frac{1-\alpha }{2\alpha -1}|{{B}}|. \end{aligned}$$

The above argument can be applied symmetrically to the right shadow. We conclude that

$$\begin{aligned} |{\mathcal {S}}({\alpha }, {{{B}}})|\le |{{B}}| + 2\frac{1-\alpha }{2\alpha -1}|{{B}}|=\frac{2 \alpha -1 +2 -2\alpha }{2\alpha -1}|{{{B}}}|=\frac{|{{B}}|}{2\alpha -1}. \end{aligned}$$

\(\square \)

3.2 Construction of \({{\mathcal {O}}}(1)\)-reliable Exact Spanners in One Dimension

3.2.1 Constructing the Graph \({{H}}\)

Assume n is a power of two, and consider building the natural full binary tree T with the numbers of \(\left[ n \right] \) as the leaves. Every node v of T corresponds to an interval of numbers of the form \([ i\,{:}\,j]\), which we refer to as the block of v, see Fig. 2. Let \({{\mathcal {I}}}\) be the resulting set of all blocks. On each level one can sort the blocks of the tree from left to right. Two adjacent blocks of the same level are neighbors. For a block \(I \in {{\mathcal {I}}}\), let \(\text {next}\left( {I}\right) \) and \(\text {prev}\left( {I}\right) \) be the blocks (on the same level) directly to the right and left of I, respectively.

We build the graph of Lemma 2.4 with \({\xi }={1}/{16}\) for any two neighboring blocks in \({{\mathcal {I}}}\). Let \({{H}}\) be the resulting graph when taking the union over all the sets of edges generated by the above.

Fig. 2
figure 2

The binary tree built over \(\left[ n \right] \). The block of node v is the interval \([ i\,{:}\,j]\)

3.2.2 Analysis

Here, we show that the resulting graph \({{H}}\) is an \({{\mathcal {O}}}(k)\)-robust 1-spanner with \({{\mathcal {O}}}(n\log n)\) edges.

Lemma 3.4

The graph \({{H}}\) has \({{\mathcal {O}}}(n\log {n})\) edges.

Proof

Let \(h=\log {n}\) be the depth of the tree T. For \(i=1,2,\dots ,h\), on the ith level of T there are \(2^{h-i}\) nodes, and the blocks of these nodes have size \(2^i\). The number of pairs of adjacent blocks on level i is \(2^{h-i}-1\) and each pair contributes \({{\mathcal {O}}}(2^i)\) edges. Therefore, each level of T contributes \({{\mathcal {O}}}(n)\) edges. Summing this up for all levels implies the bound.\(\square \)

There is a natural path between two leaves in the tree T going through their lowest common ancestor. However, we need something somewhat different here, as the path has to move forward (from left to right) in the 1-path.

Given two numbers i and j, where \(i<j\), consider the two blocks \(I, J \in {{\mathcal {I}}}\) that correspond to the two numbers at the bottom level. Set \(I_0 =I\) and \(J_0 = J\). We now describe a canonical walk from I to J, where initially \(\ell =0\). During the walk we have two active blocks \(I_\ell \) and \(J_\ell \), that are both on the same level. For any block \(I \in {{\mathcal {I}}}\) we denote its parent by p(I). At every iteration we bring the two active blocks closer to each other by moving up in the tree.

Specifically, repeatedly do the following:

  1. (A)

    If \(I_\ell \) and \(J_\ell \) are neighbors then the walk is done.

  2. (B)

    If \(I_\ell \) is the right child of \(p(I_\ell )\), then set \(I_{\ell +1} = \text {next}\left( {I_{\ell }}\right) \) and \(J_{\ell +1} = J_\ell \), and continue to the next iteration.

  3. (C)

    If \(J_\ell \) is the left child of \(p(J_\ell )\), then set \(I_{\ell +1} = {I_{\ell }}\) and \(J_{\ell +1} = \text {prev}\left( {J_\ell }\right) \), and continue to the next iteration.

  4. (D)

    Otherwise, algorithm ascends. It sets \(I_{\ell +1} = p(I_\ell )\) and \(I_{\ell +1} = p(J_\ell )\), and it continues to the next iteration.

It is easy to verify that this walk is well defined, and let

$$\begin{aligned} \pi (i,j)\equiv \,\underbrace{I_0 \rightarrow I_1 \rightarrow \cdots \rightarrow I_\ell }_{\textsc {ascent}}\rightarrow \underbrace{J_\ell \rightarrow \cdots \rightarrow J_0}_{\textsc {descent}} \end{aligned}$$

be the resulting walk on the blocks where we removed repeated blocks. Figure 3 illustrates the path of blocks between two vertices i and j.

Fig. 3
figure 3

The canonical path between the vertices i and j in two different representations. The blue nodes and blocks correspond to the ascent part and the red nodes and blocks correspond to the descent part of the walk

In the following, consider a fixed set \({{B}}\subseteq \left[ n \right] \) of faulty nodes. A block \(I \in {{\mathcal {I}}}\) is \(\alpha \)-contaminated, for some \(\alpha \in (0,1)\), if \(|I \cap {{B}}|\ge \alpha |I|\).

Lemma 3.5

Consider two nodes \(i,j \in \left[ n \right] \), with \(i<j\), and let \(\pi (i,j)\) be the canonical path between i and j. If any block of \(\pi = \pi (i,j)\) is \(\alpha \)-contaminated, then i or j are in the \(\alpha /3\)-shadow of \({{B}}\).

Proof

Assume the contamination happens in the left half of the path, i.e., at some block \(I_t\), during the ascent from i to the connecting block to the descent path into j, see Fig. 4. By construction, there could be only one block before \(I_t\) on the path of the same level, and all previous blocks are smaller, and there are at most two blocks at each level. Furthermore, for two consecutive \(I_j, I_{j+1}\) that are blocks of different levels, \(I_j \subseteq I_{j+1}\). Thus we have that either \(i \in I_t\), or \(i \in \text {prev}\left( {I_t}\right) \), or \(i \in {\text {prev}}({\text {prev}}(I_t))\), since there are at most \(|I_t|+ |I_t|/2+ \dots +2+1 = 2|I_t|-1\) vertices that are contained in the path before the block \(I_t\). Notice that if \(i \in I_t\), then it is the leftmost point of \(I_t\).

So, let r be the maximum number in \(I_t\), and observe that \(|[ i\,{:}\,r]|\le 3|I_t|\). Furthermore, since \(I_t\) is \(\alpha \)-contaminated, we have

$$\begin{aligned} |[ i\,{:}\,r] \cap {{B}}|\ge |I_t \cap {{B}}|\ge \alpha |I_t|\ge \frac{\alpha }{3}|[ i\,{:}\,r]|. \end{aligned}$$

Thus, the number i is the \(\alpha /3\)-shadow, as claimed. The other case, when the contamination happens in the right part during the descent, is handled symmetrically.\(\square \)

Fig. 4
figure 4

Contamination

Theorem 3.6

The graph \({{H}}\), constructed above, on the set \(\left[ n \right] \) is an \({{\mathcal {O}}}(1)\)-reliable exact spanner and has \({{\mathcal {O}}}(n\log {n})\) edges.

Proof

The size is proven in Lemma 3.4. Let \(\alpha =1/32\). Let \({{B^+}}\) be the set of vertices that are in the \(\alpha /3\)-shadow of \({{B}}\), that is, \({{B^+}}= {\mathcal {S}}({\alpha /3}, {{{B}}})\). By Lemma 3.2 we have that \(|{{B^+}}|\le (1+2\lceil {3/\alpha }\rceil )|{{B}}|\le 200 |{{{B}}}|\).

Consider any two vertices \(i,j \in \left[ n \right] \setminus {{B^+}}\). Let \(\pi (i,j)\) be the canonical path between i and j. None of the blocks in this path are \(\alpha \)-contaminated, by Lemma 3.5. Let \({\mathcal {S}}\) be the set of all vertices that have a 1-path from i to them (after removing the vertices of \({{B}}\)). Consider the ascent part of the path \(\pi (i,j):I_0 \rightarrow I_1 \rightarrow \cdots \rightarrow I_\ell \). The claim is that for every block \(I_t\) in this path, we have that at least 3/4 of the vertices have 1-paths from i (i.e., \(|I_t \cap {\mathcal {S}}|\ge 3|I_t|/4\)).

This claim is proven by induction. The claim trivially holds for \(I_0\). Now, consider two consecutive blocks \(I_t \rightarrow I_{t+1}\). There are two cases:

  1. (i)

    \(I_{t+1} = \text {next}\left( {I_t}\right) \).   Then, the graph \({{H}}\) includes the expander graph on \(I_t, I_{t+1}\) described in Lemma 2.4. At least \(3|I_t|/4\) vertices of \(I_t\) are in \({\mathcal {S}}\). As such, at least \(15|I_{t+1}|/16\) vertices of \(I_{t+1}\) are reachable from the vertices of \(I_t\). Since \(I_{t+1}\) is not \(\alpha \)-contaminated, at most an \(\alpha \)-fraction of vertices of \(I_{t+1}\) are in \({{B}}\), and it follows that \(|I_{t+1} \cap {\mathcal {S}}|\ge (15/16-\alpha )|I_{t+1}|\ge 3|I_{t+1}|/4\), as claimed.

  2. (ii)

    \(I_{t+1}\) is the parent of \(I_t\).   In this case, \(I_t\) is the left child of \(I_{t+1}\). Let \(I_t'\) be the right child of \(I_{t+1}\). Since \(I_{t+1}\) is not \(\alpha \)-contaminated, we have that \(|I_{t+1} \cap {{B}}|\le \alpha |I_{t+1}|\). As such,

    $$\begin{aligned} |I_{t}' \cap {{B}}|\le |I_{t+1} \cap {{B}}|\le 2\alpha |I_{t}'|. \end{aligned}$$

    Now, by the expander construction on \((I_t,I_t')\), and arguing as above, we have

    $$\begin{aligned} |I_{t}' \cap {\mathcal {S}}|\ge \biggl ( \frac{15}{16} -2\alpha \biggr )|I_t'|\ge \frac{3}{4}|I_{t}'|. \end{aligned}$$

    which implies that \(|I_{t+1} \cap {\mathcal {S}}|\ge 3|I_{t+1}|/4\).

The symmetric claim for the descent part of the path is handled in a similar fashion. Therefore, at least 3/4 of the points in \(J_\ell \) can reach j with a 1-path. Using these and the expander construction between \(I_\ell \) and \(J_\ell \), we conclude that there is a 1-path from i to j in \({{H}}\setminus {{B}}\), as claimed. \(\square \)

Note that it is easy to generalize the construction for arbitrary n. Let h be the integer such that \(2^{h-1}< n < 2^h\) and build the graph \({{H}}\) on \(\{1,2,3,\dots ,2^h\}\). Since \({{H}}\) is a 1-spanner, the 1-paths between any pair of vertices of \(\left[ n \right] \) do not use any vertices from \(\{n+1,\dots ,2^h\}\). Therefore, we can simply delete the part of \({{H}}\) that is beyond n to obtain an \({{\mathcal {O}}}(1)\)-reliable 1-spanner on \(\left[ n \right] \). Since we defined \({{B^+}}\) to be the shadow of \({{B}}\), the \({{\mathcal {O}}}(1)\)-reliability is inherited automatically.

We also note that no effort was made to optimize the constants in the above construction.

3.3 Construction of \({\vartheta }\)-reliable Exact Spanners in One Dimension

Here, we show how to extend Theorem 3.6, to build a 1-spanner on \(\left[ n \right] \), such that for any fixed \({\vartheta }\in (0,1)\) and any set \({{B}}\) of k deleted vertices, at most \((1+{\vartheta })k\) vertices are no longer connected (by a 1-path) after the removal of \({{B}}\). The basic idea is to retrace the construction of Theorem 3.6, and extend it to this more challenging case. There are two main new ingredients: (i) a shifting scheme, and (ii) using much larger intervals when ascending from a level upward. Unfortunately, the details are somewhat tedious.

3.3.1 The Construction

Let \(\left[ n \right] \) be the ground set, assume that n is a power of two, and let \(h = \log n\). Let

$$\begin{aligned} {N}= \text {pow}_2 \left( \frac{c}{{\vartheta }^2}\right) \qquad \text {and}\qquad {\xi }= \frac{1}{32N}, \end{aligned}$$
(3.1)

where c is a sufficiently large constant (e.g., \(c\ge 512\)). We first connect any \(i \in \left[ n \right] \) to all the vertices that are within distance at most 3N from it, by adding an edge between the two vertices. Let \({G}_0\) be the resulting graph.

Let \(i_0 = \log N\). For \(i=i_0, \ldots , h-1\) and \(j=1,\ldots , N\), let

$$\begin{aligned} {\varDelta }(i,j) = 1+\frac{(j-1)2^i}{N} - 2^i. \end{aligned}$$

For a fixed i, the \({\varDelta }(i,j)\)’s are N equally spaced numbers in the interval \([ 1-2^{i}\,{:}\,1-2^i/N]\), starting at its left endpoint. Here, i is the resolution of \({\varDelta }(i,j)\), the shift corresponding to resolution i is \(2^i / N\), and the number of different shifts is N. For \(k=0,\ldots , n/2^i\), and ij as above, the corresponding block is

$$\begin{aligned} {\texttt {I}}\left( {i, j, k}\right) = \bigl [{\varDelta }(i,j)+k2^i:{\varDelta }(i,j)+(k+1)2^i -1\bigr ]. \end{aligned}$$

Such a block is an interval of length \(2^i\) that starts at \({\varDelta }(i,j)+k2^i\), see Fig. 5. The set of all intervals/blocks of interest is

(3.2)
Fig. 5
figure 5

The shifted intervals \(I(i,{\cdot }\,,{\cdot }\,)\) for \(i=3\) with \({N}=4\) and \(n=64\). Each interval has length \(2^i=8\), there are \({N}=4\) different shifts and there are \({n}/{2^i}+1=9\) blocks per each shift

Constructing the graph \({{H}_{{\vartheta }}}\).   Let \({\mathrm {G_E}}\left( {i,j,k}\right) \) denote the expander graph of Lemma 2.4, constructed over \({\texttt {I}}\left( {i, j, k}\right) \) and \({\texttt {I}}\left( {i, j, k+1}\right) \), with the value of the parameter \({\xi }\) as specified in (3.1). We define \({{H}_{{\vartheta }}}\) to be the union of all the graphs \({\text {G}_{{\mathrm{E}}}}\) over all choices of ijk, also including the graph \({G}_0\) (described above). The last step is to delete vertices from \({{H}_{{\vartheta }}}\) that are outside the range of interest \(\left[ n \right] \).

Remark

As before, if n is not a power of two, repeat the construction on \(\left[ \text {pow}_2\left( {n}\right) \right] \), and remove redundant vertices.

3.3.2 Analysis of \({{H}_{{\vartheta }}}\)

Lemma 3.7

The graph \({{H}_{{\vartheta }}}\) has \({{\mathcal {O}}}( {\vartheta }^{-6} n \log n)\) edges.

Proof

There are \({{\mathcal {O}}}(\log n)\) resolutions. For every such resolution the number of different shifts is \({N}= {{\mathcal {O}}}( 1/{\vartheta }^2) \). For every shift, the number of edges created is bounded by \({{\mathcal {O}}}(n {\xi }^{-2}) = {{\mathcal {O}}}(n /{\vartheta }^4)\), by Lemma 2.4. Thus, \({{H}_{{\vartheta }}}\) has \({{\mathcal {O}}}( {\vartheta }^{-6} n \log n)\) edges.\(\square \)

In the following, let \(\llbracket s, \ell \rrbracket = [ s\,{:}\,s + \ell -1]\) be the set of consecutive integers starting at s and containing \(\ell \) numbers.

Definition 3.8

For two vertices \(x,y \in \left[ n \right] \), y is a descendant of x (and x is an ancestor of y) in \({{H}_{{\vartheta }}}\), if \(x < y\) and there is a 1-path between x and y in \({{H}_{{\vartheta }}}\). For a set \({{B}}\subseteq \left[ n \right] \), and a vertex s, let \({\mathcal {D}}= {\mathcal {D}}({{H}_{{\vartheta }}},s,{{B}})\) be the set of all descendants of s in the graph \({{H}_{{\vartheta }}}\setminus {{B}}\). Similarly, for a vertex t, let \({\mathcal {A}}= {\mathcal {A}}({{H}_{{\vartheta }}},t,{{B}})\) be the set of ancestors of t in \({{H}_{{\vartheta }}}\setminus {{B}}\). For an interval \(I\subseteq \left[ n \right] \), the set \(I\cap {\mathcal {D}}\) is the set of all nodes in I that are descendants of s in the graph \({{H}_{{\vartheta }}}\setminus {{B}}\). In a symmetric fashion, the set of ancestors in I that can reach a node t is denoted by \(I\cap {\mathcal {A}}\).

Now, we show that if a point outside of the shadow has a reasonably large fraction of descendants in an interval, then, one can find an extended interval, which is \(\varTheta (1/{\vartheta })\) times longer and has the same property. The crucial part is to carefully choose two consecutive blocks of \({{\mathcal {I}}}\), so that the expander between them can be used to extend the set of descendants.

Lemma 3.9

Let \({{B}}\subseteq \left[ n \right] \) be the set of deleted locations, \(\alpha = 1-{\vartheta }/4\), and \({s}\) be a location in \(\left[ n \right] \) that is not in the \(\alpha \)-shadow of \({{B}}\). Let \({h}\ge {N}\) be an integer number, and let \(c\ge 512\) be the constant from the construction. Let \({\mathcal {D}}= {\mathcal {D}}({{H}_{{\vartheta }}},{s},{{B}})\), and assume that \(|\llbracket {s}, {h}\rrbracket \cap {{\mathcal {D}}}|\ge {\vartheta }{h}/32\). Then, for some number \({\ell }\), \(8{h}/{\vartheta }\le {\ell }\le c{h}/(8{\vartheta })\), we have \( |\llbracket {s}, {\ell }\rrbracket \cap {{\mathcal {D}}}|\ge {\vartheta }{\ell }/32\).

Fig. 6
figure 6

The intervals \({{\textsf {L}}}\) and \({{\textsf {R}}}\) and their relation to \({s}\), \({h}\), \({\varDelta }\), and \({\ell }\)

Proof

The idea is to choose the right resolution in the construction of \({{H}_{{\vartheta }}}\). As a first step, let

$$\begin{aligned} {\varDelta }=\text {pow}_2 \left( \frac{{\vartheta }{h}}{64}\right) \quad \implies \quad \frac{{\vartheta }{h}}{64}\le {\varDelta }\le \frac{{\vartheta }{h}}{32} \end{aligned}$$

be the desired shift. We pick the resolution i such that the shift used, \(2^i/{N}\), is equal to \({\varDelta }\) (i.e., \({\varDelta }= 2^i/{N}\)). This implies that \(i = \log ({N}{\varDelta })\). There is a choice of j and k, such that the right endpoint of \({{\textsf {L}}}= {\texttt {I}}\left( {i, j, k}\right) \) lies in the interval \(\llbracket {s}+h, {\varDelta }\rrbracket \). Notice that \(\llbracket {s}, {h}\rrbracket \subseteq {{\textsf {L}}}\), since

$$\begin{aligned} {h}+ {\varDelta }\le \biggl (1+\frac{64}{{\vartheta }}\biggr ) {\varDelta }= \biggl (1+\frac{64}{{\vartheta }}\biggr ) \frac{2^i}{{N}} \le \biggl (1+\frac{64}{{\vartheta }}\biggr ) \frac{{\vartheta }^2}{c} 2^i \le 2^i \end{aligned}$$

holds. Let \({{\textsf {R}}}= {\texttt {I}}\left( {i, j, k+1}\right) \) and \({\ell }= {\text {right}}\left( {{{\textsf {R}}}}\right) - {s}+1\), where \({\text {right}}\left( {{{\textsf {R}}}}\right) \) is the right endpoint of the interval \({{\textsf {R}}}\), see Fig. 6. Observe that \({\vartheta }h /64 \le {\varDelta }\le {\vartheta }h/32\) and

$$\begin{aligned} {\ell }\ge 2^i={N}{\varDelta }\ge \frac{c}{{\vartheta }^2} \cdot \frac{{\vartheta }{h}}{64}=\frac{c}{64}\cdot \frac{{h}}{{\vartheta }}\ge \frac{8{h}}{{\vartheta }}, \end{aligned}$$

since \(c\ge 512\). Similarly,

$$\begin{aligned} {\ell }\le 2\cdot 2^i=2 {N}{\varDelta }\le 2 \cdot \frac{2c}{{\vartheta }^2} \cdot \frac{{\vartheta }{h}}{32}=\frac{c}{8}\cdot \frac{{h}}{{\vartheta }}. \end{aligned}$$

Let \(U = \llbracket {s}, {h}\rrbracket \cap {\mathcal {D}}\). By assumption, \(|{U}|\ge {\vartheta }h/32\). Since the interval \({{\textsf {L}}}\) is of length \(2^i\), we have

$$\begin{aligned} \frac{|{{\textsf {L}}}\cap {\mathcal {D}}|}{|{{\textsf {L}}}|}\ge \frac{|U|}{2^i}\ge \frac{{\vartheta }{h}/32}{{N}{\varDelta }}\ge \frac{{\vartheta }{h}/32}{{N}{\vartheta }{h}/32}=\frac{1}{{N}} \ge {\xi }. \end{aligned}$$

Since \({s}\) is not in the \(\alpha \)-shadow of \({{B}}\), it follows that the interval \(\llbracket {s}, {\ell }\rrbracket \) contains at least \({\vartheta }{\ell }/4\) elements that are not in \({{B}}\). Let \(\tau \) be the fraction of elements of \({{\textsf {R}}}\) that are not in \({{B}}\). We have that

$$\begin{aligned} \tau =\frac{|{{\textsf {R}}}\setminus {{B}}|}{|{{\textsf {R}}}|}&\ge \frac{{\vartheta }{\ell }/4- {h}- {\varDelta }}{2^i}\ge \frac{{\vartheta }(2^i + h)/4 - ({h}+ {\varDelta })}{2^i}\\&\ge \frac{{\vartheta }(2^i + 32\cdot 2^i/({\vartheta }{N}))/4-({64}/{{\vartheta }} + 1){2^i}/{{N}}}{2^i} \\&=\frac{{\vartheta }}{4} + \frac{8}{{N}} - \biggl (1+\frac{64}{{\vartheta }}\biggr )\frac{1}{{N}}\ge \frac{{\vartheta }}{4} - \frac{64}{{\vartheta }{N}}\ge \frac{{\vartheta }}{4} - \frac{64{\vartheta }}{c}\ge \frac{{\vartheta }}{8}. \end{aligned}$$

Let \(U' \subseteq {{\textsf {R}}}\) be the set of all nodes that are connected by an edge of \({{H}_{{\vartheta }}}\) to U. Note that all the nodes of \(U'\) are descendants of s. The graph \({\mathrm {G_E}}\left( {i,j,k}\right) \) guarantees that \(|U'| \ge (1-{\xi })|{{{\textsf {R}}}}|\), where \({\mathrm {G_E}}\left( {i,j,k}\right) \) is the expander graph built over \({{\textsf {L}}}\) and \({{\textsf {R}}}\). We have that

$$\begin{aligned} |\llbracket {s}, {\ell }\rrbracket \cap {\mathcal {D}}|&\ge |({{\textsf {R}}}\setminus {{B}}) \cap U'|=|{{\textsf {R}}}\setminus {{B}}|-|({{\textsf {R}}}\setminus {{B}}) \cap \overline{U'}|\\&\ge | {{\textsf {R}}}\setminus {{B}}| - |{{\textsf {R}}}\cap {\overline{U}}'|\ge |{{\textsf {R}}}\setminus {{B}}| - {\xi }2^i=(\tau - {\xi }) 2^i. \end{aligned}$$

Since \({\xi }\le {\vartheta }/16\), we have

$$\begin{aligned} \frac{ |\llbracket {s}, {\ell }\rrbracket \cap {\mathcal {D}}|}{{\ell }}\ge \frac{ (\tau - {\xi }) 2^i}{2\cdot 2^i}=\frac{\tau - {\xi }}{2}\ge \frac{{\vartheta }/8 - {\vartheta }/16}{2}=\frac{{\vartheta }}{32}. \end{aligned}$$

\(\square \)

Remark

One can state a symmetric version of Lemma 3.9 about the number of ancestors that can reach a target node \({t}\).

Lemma 3.10

Let \({{B}}\subseteq \left[ n \right] \) be the set of faulty vertices, and let \({\mathcal {S}}({\alpha }, {{{B}}})\) be its \(\alpha \)-shadow with \(\alpha = 1-{\vartheta }/4\). Let \({s}, {t}\) be two vertices in \(\left[ n \right] \setminus {\mathcal {S}}({\alpha }, {{{B}}})\) such that \({s}< {t}\). Then, there is a 1-path between \({s}\) and \({t}\) in \({{H}_{{\vartheta }}}\setminus {{B}}\). Further, this path between \({s}\) and \({t}\) uses at most \(2\log {n}\) edges.

Proof

If \(|{s}- {t}|\le 3N\), then the two vertices are connected by an edge in \({{H}_{{\vartheta }}}\) by construction, and the claim holds.

Let \({{\textsf {L}}}\) and \({{\textsf {R}}}\) be two adjacent consecutive blocks of the same size in \({{\mathcal {I}}}\) (see (3.2)) such that \({s}\in {{\textsf {L}}}\) and \({t}\in {{\textsf {R}}}\), and these are the smallest blocks for which this property holds. If there are several pairs of intervals of the same size that have the desired property, we pick the pair such that \(\min {({\text {right}}\left( {{{\textsf {L}}}}\right) - {s}, {t}- {\text {left}}\left( {{{\textsf {R}}}}\right) )}\) is maximized (i.e., the common boundary between the two intervals is as close to the middle \(({s}+{t})/2\) as possible). Let \(2^i =|{{\textsf {R}}}| =|{{\textsf {L}}}|\). It is easy to verify that \(2^i/2 \le |[ {s}\,{:}\,{t}]| \le 2\cdot 2^i\). Indeed, the lower bound holds by the minimality of \({{\textsf {L}}}\) and \({{\textsf {R}}}\). Otherwise, the right half of \({{\textsf {L}}}\) and the left half of \({{\textsf {R}}}\) would also be a valid choice and would have smaller size. The upper bound follows from the fact that \(|{{\textsf {L}}}|+|{{\textsf {R}}}|= 2\cdot 2^i\).

Set \(L_0 = \llbracket {s}, {N}\rrbracket \) and \(R_0 = [ {t}- {N}+1\,{:}\,{t}]\). Since \({s}\) and \({t}\) are not in the \(\alpha \)-shadow, we have that \(|{L_0 \setminus {{B}}} |\ge {\vartheta }|{L_0}|/4\) and \(|{R_0 \setminus {{B}}} |\ge {\vartheta }|{R_0}|/4\). For \(i > 0\), in the ith iteration, let \(L_i\) be the interval starting at s of length \(\varTheta ( |L_{i-1}| /{\vartheta })\) such that a fraction of at least \({\vartheta }/32\) of its elements are descendants of s that are not in \({{B}}\). The existence of such an interval is guaranteed by Lemma 3.9. Similarly, we expand the right interval \(R_{i-1}\) in a symmetric way.

Let j be the first iteration such that \(L_{j+1} \not \subseteq {{\textsf {L}}}\). By the choice of \({{\textsf {L}}}\) and \({{\textsf {R}}}\) and by Lemma 3.9, we have

$$\begin{aligned} \frac{2^i}{4}-\frac{2^i}{{N}}\le |L_{j+1}|\le \frac{c}{8{\vartheta }}|L_{j}|. \end{aligned}$$

This implies that

$$\begin{aligned} \frac{|{{{\textsf {L}}}\cap {\mathcal {D}}}|}{|{{{\textsf {L}}}}|}&\ge \frac{|L_j\cap {\mathcal {D}}|}{|{{\textsf {L}}}|} \ge \frac{{\vartheta }|L_j|/32 }{ 2^i }\\&\ge \frac{{\vartheta }}{32} \cdot \frac{8{\vartheta }}{c}\biggl (\frac{1}{4} - \frac{1}{{N}}\biggr )\ge \frac{{\vartheta }}{32} \cdot \frac{8{\vartheta }}{c}\cdot \frac{1}{8}\ge \frac{1}{32{N}}={\xi }. \end{aligned}$$

Applying the same argumentation, using Lemma 3.9 for the reachable ancestors, we have that

$$\begin{aligned} \frac{|{{\textsf {R}}}\cap {\mathcal {A}}|}{|{{\textsf {R}}}|}\ge {\xi }\end{aligned}$$

(i.e., there are at least \({\xi }|{{{\textsf {R}}}}|\) elements in \({{\textsf {R}}}\) that have a 1-path to \({t}\) in \({{H}_{{\vartheta }}}\setminus {{B}}\)). The graph \({{H}_{{\vartheta }}}\) contains an expander \({\mathrm {G_E}}\left( {i,j,k}\right) \) built over \({{\textsf {L}}}\) and \({{\textsf {R}}}\). By the pigeonhole principle and the properties of the expander between \({{\textsf {L}}}\) and \({{\textsf {R}}}\), there is an edge between a vertex of \({{\textsf {L}}}\cap {\mathcal {D}}\) and a vertex of \({{\textsf {R}}}\cap {\mathcal {A}}\). That is, there is a 1-path between s and t in \({{H}_{{\vartheta }}}\setminus {{B}}\), as desired.

By Lemma 3.9 we have \(8|{L_{i}}| \le 8|{L_{i}}|/{{\vartheta }} \le |{L_{i+1}}|\) for \(i=0,\dots ,j\). Therefore, the number of iterations we do to expand \(L_0\) is less than \(\log {n}\). The same is true for \(R_0\). Thus, the number of edges that we used for the 1-path is bounded by \(2\log {n}\). \(\square \)

Theorem 3.11

For parameters n and \({\vartheta }>0\), the graph \({{H}_{{\vartheta }}}\) constructed over \(\left[ n \right] \), is a \({\vartheta }\)-reliable exact spanner. Furthermore, \({{H}_{{\vartheta }}}\) has \({{\mathcal {O}}}({\vartheta }^{-6} n \log n)\) edges.

Proof

The bound on the number of edges is from Lemma 3.7. Next, fix the set \({{B}}\). Define the set \({{B^+}}\) to be the \((1-{\vartheta }/4)\)-shadow of \({{B}}\). By Lemma 3.3 we have that \(|{{{B^+}}}|\le |{{{B}}}|/(2(1-{\vartheta }/4)-1)=|{{{B}}}|/(1 - {\vartheta }/2 )\le (1+{\vartheta })|{{{B}}}|\). A 1-path in \({{H}_{{\vartheta }}}\setminus {{B}}\) between any two vertices in \(\left[ n \right] \setminus {{B^+}}\) exists by Lemma 3.10. \(\square \)

4 Building a Reliable Spanner in \({\mathbb {R}}^d\)

4.1 First Construction

In the following, we assume that \({P}\subseteq [0,1)^d\)—this can be done by an appropriate scaling and translation of space. We use a recent result of Chan et al. [14], which introduced locality-sensitive orderings. These orderings (which are the same as total orders and are extensions of the \({\mathcal {Z}}\)-order) can be thought as an alternative to quadtrees and related structures. For an ordering \(\sigma \) of \([0,1)^d\), and two points \({p},{q}\in [0,1)^d\) such that \({p}\prec _\sigma {q}\), let

$$\begin{aligned} ({p},{q})_{\sigma } = \{{z}\in [0,1)^d\mid {p}\prec _\sigma {z}\prec _\sigma {q}\} \end{aligned}$$

be the open interval between \({p}\) and \({q}\) in the order \(\sigma \). Further, let \(\text {ball}\left( {{p}, r}\right) = \{{z}\in [0,1)^d\mid \Vert {p}-{z}\Vert \le r\}\) denote the ball centered at \({p}\) with radius r.

Theorem 4.1

[14] For \(\delta \in (0,1)\), there is a set \(\varPi ^{+}(\delta )\) of at most \(M(\delta ) = {{\mathcal {O}}}( \delta ^{-d} \log \delta ^{-1} )\) orderings of \([0,1)^d\), such that for any two (distinct) points \({p}, {q}\in [0,1)^d\), with \(\ell = \Vert {p}-{q}\Vert \), there is an ordering \(\sigma \in \varPi ^{+}\), and a point \({z}\in [0,1)^d\), such that

  • \({p}\prec _\sigma {q}\),

  • \(({p},{z})_\sigma \subseteq {\text {ball}}{({p},\delta \ell )}\),

  • \(({z},{q})_\sigma \subseteq {\text {ball}}{({q},\delta \ell )}\), and

  • \({z}\in {\text {ball}}{({p},\delta \ell )}\) or \({z}\in {\text {ball}}{({q},\delta \ell )}\).

Furthermore, given such an ordering \(\sigma \), and two points \({p},{q}\), one can compute their ordering, according to \(\sigma \), using \({{\mathcal {O}}}(d\log \delta ^{-1})\) arithmetic and bitwise-logical operations.

First, we give a very simple construction and analysis, for building reliable spanners, using the theorem above and the one-dimensional construction. We present it to convey the basic principle of this technique. Then, by tuning the parameters, we repeat the construction to obtain a reliable spanner of size \({{\mathcal {O}}}\left( {n \log n (\log \log n)^{6}}\right) \). This construction has a more elaborate analysis, with similar ideas but used in an iterative manner.

4.1.1 Construction in Detail

Given a set \({P}\) of n points in \([0,1)^d\), and parameters \(\varepsilon , {\vartheta }\in (0,1)\), let \(\delta = \varepsilon / ({c}\log n)\),

$$\begin{aligned} M=M(\delta )={{\mathcal {O}}}(\delta ^{-d} \log \delta ^{-1} )={{\mathcal {O}}}\biggl ( \varepsilon ^{-d} \log ^d\!n\log \frac{\log n}{\varepsilon } \biggr ), \end{aligned}$$

and \({c}\) be some sufficiently large constant. Next, let \({\vartheta }' = {\vartheta }/ M\) and \(\varPi ^{+}= \varPi ^{+}(\delta )\) be the set of orderings from Theorem 4.1. For each ordering \(\sigma \in \varPi ^{+}\), compute the \({\vartheta }'\)-reliable exact spanner \({G}_\sigma \) of \({P}\), see Theorem 3.11, according to \(\sigma \). Let \({G}\) be the graph resulting from taking the union of \({G}_\sigma \) for all \(\sigma \in \varPi ^{+}\).

4.1.2 Analysis

Lemma 4.2

The graph \({G}\), constructed above, is a \({\vartheta }\)-reliable \((1+\varepsilon )\)-spanner and has size

$$\begin{aligned} {{\mathcal {O}}}\biggl ( \varepsilon ^{-7d} {\vartheta }^{-6} n \log ^{7d}\!n \log ^{7} \frac{\log n}{\varepsilon }\biggr ). \end{aligned}$$

Proof

Given a (failure) set \({{B}}\subseteq {P}\), let \({{B^+}}\) be the union of all the harmed sets resulting from \({{B}}\) in \({G}_{\sigma }\), for all \(\sigma \in \varPi ^{+}\). We have \(|{{B^+}}|\le (1 + M \cdot {\vartheta }')|{{B}}| = (1 + {\vartheta }) |{{B}}|\).

Consider any two points \({p}, {q}\in {P}\setminus {{B^+}}\). By Theorem 4.1, for \(\ell = \Vert {p}-{q}\Vert \), there exists an ordering \(\sigma \in \varPi ^{+}\), and a point \({z}\in [0,1)^d\), such that \(({p},{z})_\sigma \subseteq {\text {ball}}{({p},\delta \ell )}\) and \(({z},{q})_\sigma \subseteq {\text {ball}}{({q},\delta \ell )}\) (and \({z}\) is in one of these balls).

By Lemma 3.10, the graph \({G}_\sigma \setminus {{B}}\subseteq {G}\setminus {{B}}\) contains a monotone path \(\pi \), according to \(\sigma \), with \(h = {{\mathcal {O}}}( \log n)\) hops, connecting \({p}\) to \({q}\). Let \({p}= {p}_1, \ldots ,{p}_{h+1} = {q}\) be this path. Observe that there is a unique index i such that \({z}\in ({p}_i,{p}_{i+1})\). We have the following:

  • For all \(j \ne i\), \(\Vert {p}_j-{p}_{j+1}\Vert \le 2\delta \ell \), since \({p}_j\) and \({p}_{j+1}\) are contained in a ball of radius \(\delta \ell \).

  • \(\Vert {p}_i-{p}_{i+1}\Vert \le \Vert {p}_i-{p}\Vert + \Vert {p}-{q}\Vert +\Vert {q}-{p}_{i+1}\Vert \le \ell + 2\delta \ell \).

As such, the total length of \(\pi \) is \(\sum _{j=1}^h \Vert {p}_j-{p}_{j+1}\Vert \,{\le }\, (1+ 2\delta h)\ell \le (1+\varepsilon )\ell \), as desired, if \({c}\) is sufficiently large. Namely, \({G}\) is the desired reliable spanner. The number of edges of \({G}\) is

$$\begin{aligned} M \cdot {{\mathcal {O}}}\left( { ({\vartheta }')^{-6} n \log n}\right)&={{\mathcal {O}}}\left( { M (M/{\vartheta })^6 n \log n}\right) \\&={{\mathcal {O}}}\biggl ( \varepsilon ^{-7d} {\vartheta }^{-6} n \log ^{7d}\! n \log ^{7}\frac{\log n}{\varepsilon } \biggr ). \end{aligned}$$

\(\square \)

4.2 An Improved Construction

Given a set \({P}\) of n points in \([0,1)^d\), and parameters \(\varepsilon , {\vartheta }\in (0,1)\), let \(\delta = \varepsilon / {c}\),

$$\begin{aligned} M=M(\delta )={{\mathcal {O}}}(\delta ^{-d} \log \delta ^{-1} )={{\mathcal {O}}}( \varepsilon ^{-d} \log \varepsilon ^{-1}), \end{aligned}$$

and \({c}\) be some sufficiently large constant. Next, let \({\vartheta }' = {\vartheta }/ (3NM)\) where \(N=\lceil {\log \log n}\rceil +1\) and \(\varPi ^{+}= \varPi ^{+}(\delta )\) be the set of orderings from Theorem 4.1. For each ordering \(\sigma \in \varPi ^{+}\), compute the \({\vartheta }'\)-reliable exact spanner \({G}_\sigma \) of \({P}\), see Theorem 3.11, according to \(\sigma \). Let \({G}\) be the graph resulting from taking the union of \({G}_\sigma \) for all \(\sigma \in \varPi ^{+}\).

Theorem 4.3

The graph \({G}\), constructed above, is a \({\vartheta }\)-reliable \((1+\varepsilon )\)-spanner and has size

$$\begin{aligned} {{\mathcal {O}}}\biggl ( \varepsilon ^{-7d} \log ^7 \frac{1}{\varepsilon } \cdot {\vartheta }^{-6}n \log n (\log \log n)^{6}\biggr ). \end{aligned}$$

Proof

First, we show the bound on the size. There are M different orderings for which we build the graph of Theorem 3.11. Each of these graphs has \({{\mathcal {O}}}\left( { ({\vartheta }')^{-6} n \log n}\right) \) edges. Therefore, the size of \({G}\) is

$$\begin{aligned} M \cdot {{\mathcal {O}}}\left( { ({\vartheta }')^{-6} n \log n}\right)&={{\mathcal {O}}}\biggl ( M \biggl ( \frac{3NM}{ {\vartheta }} \biggr )^{\!6} n \log n\biggr )\\&={{\mathcal {O}}}\biggl ( \varepsilon ^{-7d} \log ^7\frac{1}{\varepsilon } \cdot {\vartheta }^{-6}n \log n (\log \log n)^{6}\biggr ). \end{aligned}$$

Next, we identify the set of harmed vertices \({{B^+}}\) given a set of failed vertices \({{B}}\subseteq {P}\). First, let \({{B}}_1\) be the union of all the \((1-{\vartheta }'/4)\)-shadows resulting from \({{B}}\) in \({G}_{\sigma }\), for all \(\sigma \in \varPi ^{+}\). Then, for \(i = 2,\dots ,N\), we define \({{B}}_i\) in a recursive manner to be the union of all the \((1-{\vartheta }'/4)\)-shadows resulting from \({{B}}_{i-1}\) in \({G}_{\sigma }\), for all \(\sigma \in \varPi ^{+}\). We set \({{B^+}}= {{B}}_N\).

By the recursion and Lemma 3.3 we have that

$$\begin{aligned} |{{B}}_i|&\le \biggl (\frac{|{{B}}_{i-1}|}{2(1-{\vartheta }'/4)-1} -|{{B}}_{i-1}|\biggr )M + |{{B}}_{i-1}|\\&=\frac{|{{B}}_{i-1}|-(1-{\vartheta }'/2)|{{B}}_{i-1}|}{1 -{\vartheta }'/2 }M + |{{B}}_{i-1}|=\frac{{\vartheta }'|{{B}}_{i-1}|}{2 - {\vartheta }'}M + |{{B}}_{i-1}|\\&\le (1+{\vartheta }'M)|{{B}}_{i-1}|=\biggl (1+\frac{{\vartheta }}{3N}\biggr )|{{B}}_{i-1}|. \end{aligned}$$

Therefore, we obtain

$$\begin{aligned} |{{B^+}}|=|{{B}}_N|\le \biggl (1+\frac{{\vartheta }}{3N}\biggr )^{\!N}|{{B}}|\le \exp \biggl (N \frac{{\vartheta }}{3N}\biggr )\cdot |{{B}}|\le (1 + {\vartheta })|{{B}}|, \end{aligned}$$

using \(1+x \le e^x \le 1+3x\), for \(x\in [0,1]\).

The claim is that there is a \((1+\varepsilon )\)-path \({\hat{\pi }}\) between any pair of vertices \({p},{q}\in {P}\setminus {{B^+}}\equiv {P}\setminus {{B}}_N\) such that the path \({\hat{\pi }}\) does not use any vertices of \({{B}}\). By Theorem 3.11, for the right choice of \(\sigma \), the graph \({G}_\sigma \setminus {{B}}_{N-1} \subseteq {G}\setminus {{B}}_{N-1}\) contains a monotone path connecting \({p}\) to \({q}\), according to \(\sigma \). Observe that there is a unique edge \(({p}',{q}')\) on this path that “jumps” from the locality of \({p}\) to the locality of \({q}\). Formally, we have the following:

  • \(\Vert {p}'-{q}'\Vert \le \Vert {p}-{q}\Vert + 2\delta \Vert {p}-{q}\Vert =(1 + 2 \varepsilon /{c})\Vert {p}-{q}\Vert \).

  • \(\Vert {p}-{p}'\Vert \le 2\delta \Vert {p}-{q}\Vert = 2\varepsilon \Vert {p}-{q}\Vert /{c}\), and similarly \(\Vert {q}-{q}'\Vert \le 2\varepsilon \Vert {p}-{q}\Vert /{c}\).

  • \({p}',{q}'\in {P}\setminus {{B}}_{N-1}\).

We fix the edge \(({p}',{q}')\) to be used in the computed path \({\hat{\pi }}\) connecting \({p}\) to \({q}\). We still need to build the two parts of the path \({\hat{\pi }}\) between \({p},{p}'\) and \({q},{q}'\).

This procedure reduced the problem of computing a reliable path between two points \({p},{q}\in {P}\setminus {{B}}_N\), to computing two such paths between two points of \({P}\setminus {{B}}_{N-1}\) (i.e., \({p}, {p}'\) and \({q}, {q}'\)). The benefit here is that both \(\Vert {p}-{p}'\Vert \) and \(\Vert {q}-{q}'\Vert \) are much smaller than \(\Vert {p}-{q}\Vert \). We now repeat this refinement process \(N-1\) times.

To this end, let \(Q_i\) be the set of active pairs that needs to be connected on the ith level of the recursion. Thus, we have that \(Q_0 = \{({p},{q}) \}\), \(Q_1=\{({p},{p}'), ({q},{q}')\}\), and so on. We repeat this \(N-1\) times. On the ith level there are \(|Q_i|=2^i\) active pairs. Let \((x,y)\in Q_i\) be such a pair. Then, there is an edge \((x',y')\) in the graph \({G}\setminus {{B}}_{N-(i+1)}\), such that

  • \(\Vert x'-y'\Vert \le \Vert x-y\Vert (1 + 2 \varepsilon /{c}) \le (2\varepsilon /{c})^i (1 + 2 \varepsilon /{c}) \Vert {p}-{q}\Vert \);

  • \(\Vert x-x'\Vert \le 2\varepsilon \Vert x-y\Vert /{c}\le (2\varepsilon /{c})^{i+1}\Vert {p}-{q}\Vert \) and \(\Vert y-y'\Vert \le (2\varepsilon /{c})^{i+1}\Vert {p}-{q}\Vert \);

  • \(x',y'\in {P}\setminus {{B}}_{N-(i+1)}\).

The edge \((x',y')\) is added to the path \({\hat{\pi }}\). After \(N-1\) iterations the set of active pairs is \(Q_{N-1}\) and for each pair \((x,y)\in Q_{N-1}\) we have that \(x,y\in {P}\setminus {{B}}_1\). For each of these pairs \((x,y)\in Q_{N-1}\) we apply Theorems 4.1 and 3.11 to obtain a path of length at most \(2\Vert x-y\Vert \log n\) between x and y (and this subpath of course does not contain any vertex in \({{B}}\)). We add all these subpaths to connect the active pairs in the path \({\hat{\pi }}\), which completes \({\hat{\pi }}\) into a path.

Now, we bound the length of path \({\hat{\pi }}\). Since, for all \((x,y)\in Q_{N-1}\), we have \(\Vert x-y\Vert \le \Vert p-q\Vert \cdot (2\varepsilon /{c})^{N-1}\) and \(|Q_{N-1}|=2^{N-1}\), the total length of the subpaths calculated, in the last step, is

$$\begin{aligned}&\sum _{(x,y) \in Q_{N-1}}\!\!\!{\text {length}}{({\hat{\pi }}[ x, y])} \le 2^{N-1} \Vert p-q\Vert \cdot \biggl (\frac{2\varepsilon }{{c}}\biggr )^{\!N-1}2\log n\\&\qquad \le \Vert p-q\Vert \cdot \biggl (\frac{4\varepsilon }{{c}}\biggr )^{\!\log \log n} 2\log n\le \Vert p-q\Vert \cdot \varepsilon ^{\log \log n} \biggl (\frac{4}{{c}}\biggr )^{\!\log \log n}2\log n\\&\qquad \le \Vert p-q\Vert \cdot \frac{\varepsilon }{4}\cdot \frac{1}{\log n}\cdot 2\log n=\frac{\varepsilon }{2}\Vert p-q\Vert , \end{aligned}$$

for large enough n and \({c}\ge 8\). The total length of the long edges added to \({\hat{\pi }}\) in the recursion is bounded by

$$\begin{aligned}&\sum _{i=0}^{N-2} 2^i \Vert p-q\Vert \biggl (\frac{2\varepsilon }{{c}}\biggr )^{\!i}\biggl (1 + \frac{2\varepsilon }{{c}}\biggr )\le \Vert p-q\Vert \biggl (1 + \frac{2\varepsilon }{{c}}\biggr )\sum _{i=0}^{\infty }\biggl (\frac{4\varepsilon }{{c}}\biggr )^{\!i}\\&\quad =\Vert p-q\Vert \biggl (1 + \frac{2\varepsilon }{{c}}\biggr )\frac{1}{1-{4\varepsilon }/{{c}}} =\Vert {p}-{q}\Vert \biggl (1 + \frac{6\varepsilon }{{c}- 4\varepsilon }\biggr )\le \biggl (1 + \frac{\varepsilon }{2}\biggr )\Vert p-q\Vert , \end{aligned}$$

which holds for \({c}\ge 16\). Therefore, the computed path \({\hat{\pi }}\) between \({p}\) and \({q}\) is a \((1+\varepsilon )\)-path in \({G}\setminus {{B}}\), which concludes the proof of the theorem. \(\square \)

5 Construction for Points with Bounded Spread in \({\mathbb {R}}^d\)

The input is again a set \({P}\subset {\mathbb {R}}^d\) of n points, and parameters \({\vartheta }\in (0,1/2)\) and \(\varepsilon \in (0,1)\). The goal is to build a \({\vartheta }\)-reliable \((1+\varepsilon )\)-spanner on \({P}\) that has optimal size under the condition that the spread \(\varPhi ({P})\) is bounded by a polynomial of n.

5.1 Preliminaries

Definition 5.1

For a point set \({P}\subseteq {\mathbb {R}}^d\), let \({\text {diam}}({P})= \max _{{p},{q}\in {P}} \Vert {p}-{q}\Vert \) denote the diameter of \({P}\). Let \({\text {c{}p}}\left( {{P}}\right) =\min _{{p},{q}\in {P}, {p}\ne {q}} \Vert {p}-{q}\Vert \) denote the closest pair distance in \({P}\). Furthermore, let \({\varPhi }({P}) = \text {diam}\left( {{P}}\right) /{\text {c{}p}}\left( {{P}}\right) \) be the spread of \({P}\).

Definition 5.2

Let \(s>0\) be a real number and let \({B}\) and \({C}\) be sets of points in \({\mathbb {R}}^d\). The sets \({B}\) and \({C}\) are s-separated if \({{\textsf {d}}}\left( {{B},{C}}\right) \ge s\cdot \max {(\text {diam}\left( {{B}}\right) ,\text {diam}\left( {{C}}\right) )}\), where \({{\textsf {d}}}\left( {{B},{C}}\right) = \min _{{p}\in {B}, {q}\in {C}}\Vert {p}-{q}\Vert \).

Definition 5.3

Let \({P}\) be a set of n points in the plane and let \(s>0\) be a real number. An s-well-separated pair decomposition (s-WSPD) of \({P}\) is a collection \({{\mathcal {W}}}= \{({B}_i,{C}_i)\}_{i=1}^m\) of pairs of subsets of \({P}\), such that

  • the sets \({B}_i\) and \({C}_i\) are s-separated, for all \(i=1,2,\dots ,m\); and

  • for any \({p},{q}\in {P}\) (\({p}\ne {q}\)) there exists a unique pair \(({B}_i,{C}_i) \in {{\mathcal {W}}}\), such that \({p}\in {B}_i\) and \({q}\in {C}_i\) (or \({q}\in {B}_i\) and \({p}\in {C}_i\)).

The well-separated pair decomposition was introduced by Callahan and Kosaraju [12]. The size of a WSPD is the number of pairs m, and the weight of a pair decomposition \({\mathcal {W}}\) is defined as \(\omega ({\mathcal {W}}) = \sum _{i=1}^m(|{B}_i| + |{C}_i|)\). There are several ways to compute an s-WSPD. Here, we use a quadtree-based approach, which has important properties that we can exploit. More precisely, we use the following result of Abam and Har-Peled [2, Lemma 2.8] for computing a WSPD.

Lemma 5.4

Let \({P}\) be a set of n points in \({\mathbb {R}}^d\), with spread \(\varPhi =\varPhi ({P})\), and let \(\varepsilon >0\) be a parameter. Then, one can compute an \(\varepsilon ^{-1}\)-WSPD for \({P}\) of total weight \({{\mathcal {O}}}(n\varepsilon ^{-d} \log {\varPhi })\). Furthermore, any point of \({P}\) participates in at most \({{\mathcal {O}}}(\varepsilon ^{-d} \log {\varPhi })\) pairs.

5.2 The Construction of \({{G}_{{\varPhi }}}\)

First, compute a quadtree \({T}\) for the point set \({P}\). For any node \(v\in {T}\), let \(\Box _{v}\) denote the cell (i.e., square or cube, depending on the dimension) represented by v. Let \({P}_{v} = \Box _{v} \cap {P}\) be the point set stored in the subtree of v. Compute a \(({6}/{\varepsilon })\)-WSPD \({{\mathcal {W}}}\) of \({P}\), such that each pair consists of two cells of \({T}\), using Lemma 5.4. The pairs in \({{\mathcal {W}}}\) can be represented by pairs of nodes \(\{u,v\}\) of the quadtree \({T}\). Note that the algorithm of Lemma 5.4 uses the diameters and distances of the cells of the quadtree, that is, for a pair \(\{u,v\}\in {{\mathcal {W}}}\), we have

$$\begin{aligned} \frac{6}{\varepsilon }\cdot \max {(\text {diam}\left( {\Box _{u}}\right) ,\text {diam}\left( {\Box _{v}}\right) )}\le {{\textsf {d}}}\left( {\Box _{u},\Box _{v}}\right) . \end{aligned}$$

For any pair \(\{u,v\}\in {{\mathcal {W}}}\), we build the bipartite expander of Lemma 2.4 on the sets \({P}_{u}\) and \({P}_{v}\) so that the expander property holds with \({\xi }={\vartheta }/8\). Furthermore, for every two nodes u and v that have the same parent in the quadtree \({T}\) we add the edges of the bipartite expander of Lemma 2.4 between \({P}_{u}\) and \({P}_{v}\). Let \({{G}_{{\varPhi }}}\) be the resulting graph when taking the union over all the sets of edges generated by the above.

5.3 Analysis

Lemma 5.5

The graph \({{G}_{{\varPhi }}}\) has \({{\mathcal {O}}}({\xi }^{-2} \varepsilon ^{-d}n\log {\varPhi ({P})} )\) edges.

Proof

By Lemma 5.4, every point participates in \({{\mathcal {O}}}(\varepsilon ^{-d}\log {\varPhi ({P})})\) WSPD pairs. By Lemma 2.4 the average degree in all the expanders is at most \({{\mathcal {O}}}(1/{\xi }^2 )\), resulting in the given bound on the number of edges. There are also additional pairs between a node in \({T}\) and its parent, but since every point participates in only \({{\mathcal {O}}}(\log {\varPhi ({P})})\) such pairs, the number of edges is dominated by the expanders on the WSPD pairs. It follows that the number of edges in the resulting graph is \({{\mathcal {O}}}({\xi }^{-2} \varepsilon ^{-d}n\log {\varPhi ({P})})\). \(\square \)

We note that there are point sets, with unbounded spread, such that any WSPD on them has weight \(\varOmega (n^2)\). A simple example is a sequence of points along a line with exponentially increasing distances. Thus, requiring the bounded spread on the point set is unavoidable to achieve optimal size by using the above construction.

Definition 5.6

For a number \(\gamma \in (0,1)\), and failed set of vertices \({{B}}\subseteq {P}\), a node v of the quadtree \({T}\) is in the \(\gamma \)-shadow if \(|{{B}}\cap {P}_{v}|\ge \gamma |{P}_{v}|\). Naturally, if v is in the \(\gamma \)-shadow, then the points of \({P}_{v}\) are also in the shadow. As such, the \(\gamma \)-shadow of \({{B}}\) is the set of all the points in the shadow—formally, \({{{\mathcal {S}}}}\left( {\gamma ,{{B}}}\right) =\bigcup _{v\in T,\,|{{B}}\cap {P}_{v}|\ge \gamma |{P}_{v}|}{P}_{v}\).

Let \(\gamma = 1-{\vartheta }/2\). Note that \({{B}}\subseteq {{{\mathcal {S}}}}\left( {\gamma ,{{B}}}\right) \), since every point of \({{B}}\) is stored as a singleton in a leaf of \({T}\).

Definition 5.7

For a node x in \({T}\), let \(n(x) = |{{P}_{x}}|\), and \(b(x) = |{{P}_{x} \cap {{B}}}|\).

Lemma 5.8

Let \(\gamma = 1-{\vartheta }/2\) and \({{B}}\subseteq {P}\) be fixed. Then, the size of the \(\gamma \)-shadow of \({{B}}\) is at most \((1+{\vartheta })|{{{B}}}|\).

Proof

Let H be the set of nodes of \({T}\) that are in the \(\gamma \)-shadow of \({{B}}\). A node \( u \in H\) is maximal if none of its ancestors is in H. Let \(H' = \left\{ {u_1,\ldots , u_m} \right\} \) be the set of all maximal nodes in H, and observe that \(\bigcup _{u\in H'} {P}_{u} = \bigcup _{v\in H} {P}_{v} = {\mathcal {S}}({\gamma }, {{{B}}})\). For any two nodes \(x,y\in H'\), we have \({P}_{x} \cap {P}_{y} = \varnothing \). Therefore,

$$\begin{aligned} |{{B}}|=\sum _{u \in H'} b(u)\ge \sum _{u \in H'} \gamma n(u)=\gamma |{\mathcal {S}}({\gamma }, {{{B}}})|. \end{aligned}$$

Dividing both sides by \(\gamma \) implies the claim, since \(1/\gamma = 1 / (1-{\vartheta }/2) \le 1+{\vartheta }\). \(\square \)

Lemma 5.9

Let \(\gamma = 1-{\vartheta }/2\). Fix a node \(u \in {T}\) of the quadtree, the failure set \({{B}}\subseteq {P}\), its shadow \({{B^+}}= {{{\mathcal {S}}}}\left( {\gamma ,{{B}}}\right) \), and the residual graph \({H}= {{G}_{{\varPhi }}}\setminus {{B}}\). For a point \({p}\in {P}_{u} \setminus {{B^+}}\), we define the set

Then, \(|{R_{u}(p)}|\ge 3{\xi }|{{P}_{u}}|\).

Proof

Let \(u_1,u_2,\dots ,u_j=u\) be the sequence of nodes in the quadtree, from the leaf \(u_1\) that contains (only) \({p}\) to the node u. A level of a point \({q}\in {P}_{u}\), denoted by \({\ell }\left( {{q}}\right) \), is the first index i, such that \({q}\in {P}_{u_i}\). A skipping path in \({{G}_{{\varPhi }}}\) is a sequence of edges \({p}{q}_1, {q}_1 {q}_2, \ldots {q}_{m-1} {q}_{m}\) such that \({\ell }\left( {{q}_i}\right) < {\ell }\left( {{q}_{i+1}}\right) \), for all i.

Let \({Q}_{i}\) be the set of all points in \({P}_{u_i} \setminus {{B}}\) that are reachable by a skipping path in \({H}\) from \({p}\). We claim, for \(i=1,\ldots , j\), that

$$\begin{aligned} |{Q}_{i}|\ge (1-{\xi }) n(u_i) -b(u_i) \ge (1 - {\xi }- \gamma ) n(u_{i})=\biggl (\frac{{\vartheta }}{2} - {\xi }\biggr )n(u_{i})=3{\xi }n(u_i), \end{aligned}$$

since \({\xi }= {\vartheta }/8\) and \({p}\) is not in the \(\gamma \)-shadow. The claim clearly holds for \(u_1\). So, assume inductively that the claim holds for \(u_1,\ldots ,u_{j-1}\). Let \(v_1, \ldots , v_m\) be the children of \(u_j\) that have points stored in them (excluding \(u_{j-1}\)). There is an expander between \({P}_{u_{j-1}}\) and \({P}_{v_i}\), for all i, as a subgraph of \({{G}_{{\varPhi }}}\). It follows, by induction, that

$$\begin{aligned} |{Q}_{j}|&\ge (1-{\xi })n{(u_{j-1})} -b{(u_{j-1})}+\sum _i \bigl ((1-{\xi }) n(v_i) - b(v_i)\bigr )\\&=(1-{\xi }) n{(u_{j-1})}+\sum _i (1-{\xi }) n{(v_i)}-b{(u_{j-1})} - \sum _i b{(v_i)}\\&=(1-{\xi }) n{(u_{j})}-b{(u_{j})}. \end{aligned}$$

Observe that a skipping path from \({p}\) to \({q}\in {P}_{u_j}\) has length at most

$$\begin{aligned} \sum _{i=1}^j {\text {diam}}(\Box _{u_i})\le {\text {diam}}(\Box _{u_j})\sum _{i=1}^j 2^{1-j}\le 2 \cdot {\text {diam}}(\Box _{u_j}). \end{aligned}$$

Thus, \( {Q}_{j} \subseteq R_{u}(p)\), and the claim follows. \(\square \)

Now we are ready to prove that \({{G}_{{\varPhi }}}\) is a reliable spanner.

Lemma 5.10

For a set \({P}\subseteq {\mathbb {R}}^d\) of n points, parameters \(\varepsilon \in (0,1)\) and \({\vartheta }\in (0,1/2)\), the graph \({{G}_{{\varPhi }}}\) is a \({\vartheta }\)-reliable \((1+\varepsilon )\)-spanner with \({{\mathcal {O}}}( \varepsilon ^{-d} {\vartheta }^{-2} n \log {\varPhi }({P}))\) edges, where \( {\varPhi }({P})\) is the spread of \({P}\).

Proof

Let \({\xi }={\vartheta }/8\) and \(\gamma = 1 - {\vartheta }/2\). The bound on the number of edges follows by Lemma 5.5.

Let \({{B}}\) be a set of faulty vertices of \({{G}_{{\varPhi }}}\), and let \({H}= {{G}_{{\varPhi }}}\setminus {{B}}\) be the residual graph. We define \({{B^+}}\) to contain the vertices that are in the \(\gamma \)-shadow of \({{B}}\). Then, we have \({{B}}\subseteq {{B^+}}\) and \(|{{B^+}}|\le (1+{\vartheta }) |{{{B}}}|\) by Lemma 5.8. Finally, we need to show that there exists a \((1+\varepsilon )\)-path between any \({p},{q}\in {P}\setminus {{B^+}}\).

Let \(\{u,v\}\in {{\mathcal {W}}}\) be the pair that separates \({p}\) and \({q}\) with \({p}\in {P}_{u}\) and \({q}\in {P}_{v}\), see Fig. 7. Let \(R_{u}(p)\) (resp. \(R_{v}(q)\)) be the set of points in \({P}_{u}\) (resp. \({P}_{v}\)) that are reachable in \({H}\) from \({p}\) (resp. \({q}\)) with paths that have lengths at most \(2 \cdot \text {diam}\left( {\Box _{u}}\right) \) (resp. \(2 \cdot \text {diam}\left( {\Box _{v}}\right) \)). By Lemma 5.9, \(\left| {R_{u}(p)} \right| \ge 3 {\xi }n(u) \ge {\xi }n(u)\) and \(|{R_{v}(q)}| \ge 3 {\xi }n(v)\).

Since there is a bipartite expander between \({P}_{u}\) and \({P}_{v}\) with parameter \({\xi }\), by Lemma 2.4, the neighborhood Y of \({R}_{u\!\!}\left( {{p}}\right) \) in \({P}_{v}\) has size at least \((1-\xi ) {n}{(v)}\). Observe that \(|Y \cap {R}_{v\!}\left( {{q}}\right) |=|{R}_{v\!}\left( {{q}}\right) \setminus ({P}_{v} \setminus Y)|\ge |{R}_{v\!}\left( {{q}}\right) | - |{{P}_{v} \setminus Y}|\ge 3 {\xi }{n}{(v)} -{\xi }{n}{(v)} > 0\). Therefore, there is a point \({q}'\in Y \cap {R}_{v\!}\left( {{q}}\right) \), and a point \({p}'\in {R}_{u\!\!}\left( {{p}}\right) \), such that \({p}'{q}' \in {E}\left( {{{G}_{{\varPhi }}}}\right) \). We have

$$\begin{aligned} {\textsf {d}}_{H}(p,q)&\le {\textsf {d}}_{H}({{p}},{{p}'})+{\textsf {d}}_{H}({{p}'},{{q}'}) +{\textsf {d}}_{H}({{q}'},{{q}})\\&\le 2 \cdot \text {diam}\left( {\Box _{u}}\right) + \Vert {p}'-{q}'\Vert + 2\cdot \text {diam}\left( {\Box _{v}}\right) \\&\le 3\cdot \text {diam}\left( {\Box _{u}}\right) + {{\textsf {d}}}\left( {\Box _{u},\Box _{v}}\right) +3\cdot \text {diam}\left( {\Box _{v}}\right) \\&\le \biggl (1 + 6 \cdot \frac{\varepsilon }{6}\biggr )\cdot {{\textsf {d}}}\left( {\Box _{u},\Box _{v}}\right) \le (1 + \varepsilon )\cdot \Vert {p}-{q}\Vert . \end{aligned}$$

\(\square \)

Fig. 7
figure 7

The pair \(\{u,v\}\in {{\mathcal {W}}}\) that separates \({p}\) and \({q}\). The blue path is a \((1+\varepsilon )\)-path between \({p}\) and \({q}\) in the graph \({{G}_{{\varPhi }}}\setminus {{B}}\)

6 Conclusions

A natural open question is whether \({\vartheta }\)-reliable spanners can be constructed with \({{\mathcal {O}}}(n\log n)\) edges for general point sets. There are different approaches that lead to near optimal bounds. While we use the one-dimensional construction with a careful application of locality-sensitive orderings, Bose et al. [7] uses WSPD, centroid decomposition and an idea of Willard [25] for order maintenance. Another natural open question is how to construct reliable spanners that are required to be subgraphs of a given graph.