1 Introduction

Sustainability is a major concern impacting today’s politics, economy, and industry. Accordingly, sustainability sciences are well-established by now. Yet, the interdisciplinary scientific field “computational sustainability” [20, 21], which combines practical and theoretical computer science with sustainability sciences, is quite young. For instance, the Institute for Computational Sustainability at Cornell University was founded in 2008, the 1st International Conference on Computational Sustainability (CompSust’09) took place in 2009, and special tracks on computational sustainability and AI were established at AAAI [17] and IJCAI [35]. This work contributes to computational sustainability: We model problems of elaborately placing wildlife crossings and give complexity-theoretical and algorithmic analysis for each. Wildlife crossings are constructions (mostly bridges or tunnels [33]) that allow wildlife animals to safely cross human-made transportation lines (e.g., roads). We will refer to wildlife crossings as green bridges.

There are numerous reports on wildlife-vehicle collisions [22, 26, 37]. Huijser et al. [26] identify several endangered animal species suffering from high road mortality and estimate the annual cost associated with wildlife-vehicle collisions with around 8 billion US dollars. Wildlife fencing with wildlife crossings can reduce collisions by over 80% [26], enables populations to sustain [36], and are thereby among the most cost-effective [25]. The implementation, though, is a delicate problem, as depicted by Huijser et al. [26, p.16]:

The location, type, and dimensions of wildlife crossing structures must be carefully planned with regard to the species and surrounding landscape. For example, grizzly bears, deer, and elk tend to use wildlife overpasses to a greater extent than wildlife underpasses, while black bears and mountain lions use underpasses more frequently than overpasses. In addition, different species use different habitats, influencing their movements and where they want to cross the road.

Apart from these delicacies, another challenge is to obtain good data about the specific areas inhabited by a species [39]: While it is arguably easier to answer whether some animal species habitates a certain patch of land in the positive, it seems more challenging to rule it out. Clearly, high data quality is a crucial for deciding on where to place green bridges.

In this work, we consider the task of (re-)connecting habitats under varying connectivity requirements by placing as few green bridges as possible, thus minimizing the cost. We assume to be given a set of land patches which are disconnected by roads, the set of inhabited patches for each animal, and possible locations for green bridges, each of which connects two patches. This is canonical to model as a graph: vertices represent the land patches, edges represent the possible locations for green bridges, and for each animal species we are given a vertex subset of the inhabited patches. The goal in the model now is to find an edge set that sufficiently connects the habitats of each species. In particular, we comparatively study in terms of computational complexity and parameterized algorithmics the following three different (families of) decision problems.Footnote 1

figure a

Input: An undirected graph \(G=(V,E)\), a set \(\mathscr {H}=\{V_1,\dots ,V_r\}\) of habitats where \(V_i\subseteq V\) for all \(i\in \{1,\ldots , r\}\), and \(k\in \mathbb {N}_0\).

Question: Is there an edge set \(F\subseteq E\) with \(|F|\le k\) such that for every \(i\in \{1,\ldots , r\}\), it holds that \(V_i\subseteq V(G[F])\) and

\(\Pi \equiv {}\) d -Reach:

\(G[F]^d[V_i]\) is connected?

(Problem 2)

(Section 3)

\(\Pi \equiv {}\) d -Closed:

\(G[F]^d[V_i]\) is a clique?

(Problem 6)

(Section 4)

\(\Pi \equiv {}\) d -Diam(eter):

\({{\,\textrm{diam}\,}}(G[F][V_i])\le d\)?

(Problem 7)

(Section 5)

Our problems address both the challenge in obtaining high quality data as well as the question to what connectivity is sufficient. Connectivity is addressed by the different requirements on the solution: While d -Reach GBP simply ensures connectivity of each habitat along length-d paths, d -Closed GBP additionally requires every two patches of each habitat to be connected by such a path. The latter is also true for d -Diam GBP, which additionally requires that such a path only uses the habitat’s patches. In this sense, d -Diam GBP generalizes 1-Reach GBP. Moreover, d -Diam GBP and d -Closed GBP are equivalent for \(d=1\). See Fig. 1 for relationships between the problems in terms of Karp reductions.

As for the data quality, recall that it is arguably easier to tell with sufficient certainty that some animal species inhabits a certain area, but harder to rule it out with the same certainty, especially for areas that are adjacent to habitated areas. This property is captured very well by d -Reach GBP and d -Closed GBP. Herein, one should choose d antiproportionally to the data quality. For instance, with perfect data quality, that is, perfect knowledge about each species’ habitat, one may choose \(d=1\) (and hence, d -Diam GBP is also amenable). Imperfect data quality is reflected by a choice of \(d > 1\). Here, we relax the connectivity constraints and allow for “hops” within the connected habitat. If for example \(d=2\) and a possibly uninhabited area v is adjacent to two inhabited areas u and w, then u and w may be connected by \(\{u, v\}\) and \(\{v, w\}\), thus “hopping” over v.

Fig. 1
figure 1

A diagram of interconnections between the problems (for the definition of Connect GBP see Problem 1). An edge from problem A to problem B means that any solution to A is also a solution to B. Problems with d omitted from the problem name require that there is a solution for some value of d

Our Contributions

Our results are summarized in Table 1. We settle the classic complexity and parameterized complexity (regarding the number k of green bridges and the number r of habitats) of the three problems. While d -Reach GBP is (surprisingly) already NP-hard for \(d=1\) on planar or maximum degree \(\Delta =4\) graphs, d -Closed GBP and d -Diam GBP become NP-hard for \(d\ge 2\), but admit an \((r+\Delta )^{O(1)}\)-sized problem kernel and thus are linear time solvable if \(r+\Delta \) is constant. All variants are para-NP-hard when parameterized by r. d -Reach GBP and d -Closed GBP are fixed-parameter tractable regarding k when \(d\le 2\), but become \({\text {W[1]}}\)-hard (yet \({\text {XP}}\)) regarding k and \(k+r\) when \(d>2\). Additionally, we prove that d -Reach GBP admits an rd-approximation in \(O(mn+rnd)\) time.

Table 1 Overview of our results

Further related work

Our problems deal with finding (small) spanning connected subgraphs obeying some (connectivity) constraints. These problems are applicable in a wide range of areas and typically take the form of a special case or variant of 1-Reach GBP. Areas include computer networks [6], social networks [2], graph drawing [4], combinatorial auctions [7], reconfigurable computing [16], vacuum technology [14], and structural biology [1].

1-Reach GBP on cliques is also known as the Subset Interconnection Design problem: Given sets \(V_1, \dots , V_r\), find a graph G with \(V(G) = V_1 \cup \dots \cup V_r\) with the minimum number of edges such that \(G[V_i]\) is connected for each i. This problem was first introduced by [13] and proven to be NP-hard by [15]. It was also studied in terms of its approximability [2] and its parameterized complexity [5].

Closely related to our problems are also Steiner multigraph problems [18, 34], which were also studied in the context of wildlife corridor construction [29, 30]. Requiring small diameter appears also in the context of spanning trees [32] and Steiner forests [11]. An edge-weighted version of 4-Diam GBP is proven to be \({\text {NP}}\)-hard even if there are only two different weights [31]. Kim et al. [27] study the problem of deleting few edges to augment a graph’s diameter to a constant. Gionis et al. [19] studied a variant of 2-Diam GBP in which for any solution F and habitat \(V_i\), \(G[F][V_i]\) must induce a star, and gave an efficient approximation algorithm for it. Herrendorf [24] studied the same variant as well as the 1-Reach GBP problem (under a different name) in terms of their parameterized complexity.

Connecting habitats arbitrarily

The following obvious model just requires that each habitat is connected.

Problem 1

Input: An undirected graph \(G=(V,E)\), a set \(\mathscr {H}=\{V_1,\dots ,V_r\}\) of habitats where \(V_i\subseteq V\) for all \(i\in \{1,\ldots , r\}\), and an integer \(k\in \mathbb {N}_0\).

Question: Is there a subset \(F\subseteq E\) with \(|F|\le k\) such that for every \(i\in \{1,\ldots , r\}\) it holds that in G[F] exists a connected component containing \(V_i\)?

Connect GBP with edge costs is also known as Steiner Forest [18] and generalizes the well-known \({\text {NP}}\)-hard Steiner Tree problem. Gassner [18] proved Steiner Forest to be \({\text {NP}}\)-hard even if every so-called terminal net contains two vertices, if the graph is planar and has treewidth three, and if there are two different edge costs, each being upper-bounded linearly in the instance size. It follows that Connect GBP is also \({\text {NP}}\)-hard in this case. Bateni et al. [3] proved that Steiner Forest is polynomial-time solvable on treewidth-two graphs and admits approximation schemes on planar and bounded-treewidth graphs.

From a modeling perspective, solutions for Connect GBP may be highly scattered: Patches of the same species’ habitat may be arbitrarily far away from another; thus, to reach another patch of their habitat, animals may need to take long walks through areas of their habitats when only using green bridges to cross streets. It is likely that species with scattered habitats will not make use of the green bridges. With our models we avoid such solutions.

2 Preliminaries

Let \(\mathbb {N}\) and \(\mathbb {N}_0\) be the natural numbers without and with zero, respectively. We use basic definitions from graph theory [10] and parameterized algorithmics [8].

Graph Theory

Let \(G=(V,E)\) be an undirected graph with vertex set V and edge set \(E\subseteq \left( {\begin{array}{c}V\\ 2\end{array}}\right) \). We also denote by V(G) and E(G) the vertices and edges of G, respectively. For \(V'\subseteq V\), let \(G[V']=(V',E\cap \left( {\begin{array}{c}V'\\ 2\end{array}}\right) )\) denote the graph G induced by a vertex set \(V'\). For \(F\subseteq E\) let \(V(F):= \{v\in V\mid \exists e\in F :\, v\in e\}\) and \(G[F]:= (V(F),F)\) denote the graph G induced by the edge set F. A path P is a graph with \(V(P) := \{v_1, \ldots , v_n\}\) and \(E(P) := \{\{v_i,v_{i+1}\} \mid 1 \le i < n \}\). The length of the path P is |E(P)|. The distance \({{\,\textrm{dist}\,}}_G(v,w)\) between vertices \(v,w \in V(G)\) is the length of the shortest path between v and w in G. The diameter \({{\,\textrm{diam}\,}}(G)\) is the length of longest shortest path over all vertex pairs. For \(p\in \mathbb {N}\), the graph \(G^p\) is the p-th power of G containing the vertex set V and edge set \(\{\{v,w\}\in \left( {\begin{array}{c}V\\ 2\end{array}}\right) \mid {{\,\textrm{dist}\,}}_G(v,w)\le p\}\). For \(F\subseteq E\), \(V'\subseteq V\), and \(d\in \mathbb {N}\), the graph \(G[F]^d[V']\) is understood as \(((G[F])^d)[V']\). Let \(N_G(v):= \{w\in V\mid \{v,w\}\in E\}\) be the (open) neighborhood of v, and \(N_G[v]:= N_G(v)\cup \{v\}\) be the closed neighborhood of v. For \(p\in \mathbb {N}\), let \(N_G^p(v):= \{w\in V\mid \{v,w\}\in E(G^p)\}\) be the (open) p-neighborhood of v, and \(N_G^p[v]:= N_G^p(v)\cup \{v\}\) be the closed p-neighborhood of v. Two vertices \(v,w\in V\) are called twins if \(N_G(v)=N_G(w)\). The (vertex) degree \(\deg _G(v):= |N_G(v)|\) of v is the number of its neighbors. The maximum degree \(\Delta (G):= \max _{v\in V}\deg _G(v)\) is the maximum over all (vertex) degrees.

3 Connecting Habitats with a Patch at Short Reach

The following problem ensures that any habitat patch can reach the other patches via patches of the same habitat and short strolls over “foreign” ground.

Problem 2

Input:An undirected graph \(G=(V,E)\), a set \(\mathscr {H}=\{V_1,\dots ,V_r\}\) of habitats where \(V_i\subseteq V\) for all \(i\in \{1,\ldots , r\}\), and an integer \(k\in \mathbb {N}_0\).

Question:Is there a subset \(F\subseteq E\) with \(|F|\le k\) such that for every \(i\in \{1,\ldots , r\}\) it holds that \(V_i\subseteq V(G[F])\) and \(G[F]^d[V_i]\) is connected?

Theorem 1

d -Reach Green Bridges Placement is

  1. (i)

    if \(d=1\), \({\text {NP}}\)-hard even on planar graphs, or if \(r\ge 7\) but solvable in linear time if \(r \le 2\);

  2. (ii)

    if \(d=2\), \({\text {NP}}\)-hard even on graphs with maximum degree four and \(r=2\) or graphs with diameter four and \(r=1\), and in \({\text {FPT}}\) regarding k;

  3. (iii)

    if \(d\ge 3\), \({\text {NP}}\)-hard and \({\text {W[1]}}\)-hard regarding \(k+r\).

Moreover, d -Reach GBP admits an rd-approximation of the minimum number of green bridges in \(O(mn+rnd)\) time.

We will first present the approximation algorithm. Afterwards, we will present the results in (i)-(iii) in the order above.

3.1 An \((r\cdot d)\)-Approximation for d -Reach GBP

In this section we will present the approximation algorithm of Theorem 1. The approximation algorithm computes for every habitat \(V_i\) a spanning tree in \(G^d[V_i]\), and adds the edges of the corresponding paths to the solution F. Each of the spanning trees then is a d-approximation for just the one habitat, hence the union of the spanning trees is an rd-approximation for all habitats.

Lemma 1

For \(r=1\), d -Reach GBP admits a d-approximation of the minimum number of green bridges in \(O(mn)\) time.

Proof

We start off by computing in \(O(mn)\) time the graph \(H := G^d\) as well as for every edge \(e = \{u, v\} \in E(H)\) the corresponding path \(P_e\) from u to v of length at most d in G. If \(H[V_1]\) is not connected, then return no. If not, then compute a minimum spanning tree \(T \subseteq H[V_1]\) in \(O(n \log n)\) time. For each edge \(e = \{u, v\} \in E(T)\) compute in \(O(m)\) time the corresponding path \(P_e \subseteq G\) from u to v of length at most d. Finally, return the set \(F := \bigcup _{e \in E(T)} E(P_e)\), computable in \(O(m)\) time. Clearly, \(G[F]^d[V_1]\) is connected. As a minimum solution \(F^*\) has at least \(|V_1|-1\) edges, and every path \(P_e\) consists of at most d edges,

$$\begin{aligned} |F| = |\bigcup _{e\in E(T)} E(P_e)| \le \sum _{e \in E(T)} E(P_e) \le (|V_1|-1)\cdot d \le d|F^*|. \end{aligned}$$

\(\square \)

Proposition 1

d -Reach GBP admits an rd-approximation of the minimum number of green bridges in \(O(mn + rnd)\) time.

Proof

We initially compute the shortest paths between all vertex pairs in G in O(mn) time. We obtain the graph \(H := G^d\) as a byproduct. If for some \(i \in \{1,\ldots ,r\}\), \(H[V_i]\) is not connected, then return no. If not, then compute for each \(i \in \{1,\ldots ,r\}\) a spanning tree \(T_i\) of \(H[V_i]\), or return no if \(H[V_i]\) is not connected. Let \(F_i \subseteq E(G)\) be the edge set corresponding to \(T_i\) as in the proof of Lemma 1. As \(G[F_i]^d[V_i]\) is connected, \(F := \bigcup _{i=1}^r F_i\) is a solution.

Note that each of the r spanning trees \(T_i\) contains at most n edges, and for each of these edges \(e \in F_i\) we can determine the corresponding paths \(P_e \subseteq G\) of length at most d in \(O(d)\) time. We obtain an overall running time of \(O(mn + rnd)\).

As for the approximation ratio, let \(F^*\) be a minimum solution, and for every \(i \in \{1,\ldots ,r\}\) let \(F^*_i \subseteq E(G)\) be a minimum-size edge set such that \(G[F^*_i]^d[V_i]\) is connected. As \(|F^*| \ge \max _{i\in \{1,\ldots ,r\}} |F^*_i|\), we have

$$\begin{aligned} |F| \le \sum _{i=1}^r |F_i| \le \sum _{i=1}^r d|F^*_i| \le r \cdot d|F^*|. \end{aligned}$$

\(\square \)

3.2 When a next habitat is directly reachable (\(d=1\))

Recall that setting \(d=1\) may reflect perfect knowledge about the habitats. In this case, we want that in G[F], each habitat \(V_i\) forms a connected component.

Du and Miller [15] showed that 1-Reach GBP is NP-hard even when the input graph is complete. We give two reductions that show NP-hardness in some restricted cases. From the second reduction we can also derive that presumably there is no polynomial kernel with respect to the budget k. Lastly, we show that if there are only two habitats, then the problem can be solved in linear time.

We start with proving that 1-Reach GBP is \({\text {NP}}\)-hard on series-parallel graphs. As every series-parallel graph is planar, we also obtain the same hardness result for planar graphs. Further, the provided reduction also shows that the problem is unlikely to admit a kernel whose size is bounded polynomially in the parameter.

Proposition 2

1-Reach GBP is \({\text {NP}}\)-hard and, unless \({\text {NP}}\subseteq {\text {coNP}}/{\text {poly}}\), admits no problem kernel of size \(k^{O(1)}\), even on series-parallel graphs.

We will give a linear parametric transformation from the following problem:

Problem 3

Input:A universe U, a set \(\mathscr {F}\subseteq 2^U\) of subsets of U, and an integer k.

Question:Is there a hitting set \(U' \subseteq U\) with \(|U'|\le k\) such that for all \(F\in \mathscr {F}\) we have \(F\cap U' \ne \emptyset \)?

Note that Hitting Set admits no problem kernel of size polynomial in |U| unless \({\text {NP}}\subseteq {\text {coNP}}/{\text {poly}}\) [12].

Construction 1

For an instance \(\mathscr {I}=(U,\mathscr {F},k)\) of Hitting Set with \(U=\{1,\ldots ,n\}\) and \(\mathscr {F}=\{F_1, \dots , F_m\}\), construct an instance \(\mathscr {I}':= (G',\mathscr {H},k')\) with habitats \(\mathscr {H}=\{S,V_1,\dots ,V_m\}\) and \(k':= n+k\) as follows (see Fig. 2 for an illustration).

Fig. 2
figure 2

Illustration to Construction 1 for 1-Reach GBP on series-parallel (and thus planar) graphs. In this example, there are e.g. \(F_p\supseteq \{1,i,j\}\) and \(F_q\supseteq \{i,j,n\}\). In case of a yes-instance, the red-colored edges are in every solution (Observation 3).

Add to \(G'\) the vertex set \(V_U := \{x_i \mid i \in U\}\) as well as the two vertices s and t, and the edge sets \(E^* := \bigcup _{i=1}^n\{\{s, x_i\}\}\) and \(E_U := \bigcup _{i=1}^n\{\{x_i, t\}\}\). Finally, let \(S:=\{s\}\cup \bigcup _{i=1}^n \{x_i\}\), and for each \(F_j \in \mathscr {F}\) let \(V_j := \{s, t\}\cup \bigcup _{i \in F_j} \{x_i\}\).

Observation 2

The graph \(G'\) constructed in Construction 1 is planar and series-parallel.

Observation 3

Let \(\mathscr {I}'\) be a yes-instance. Then every solution F contains all edges in \(E^*\).

Proof

By construction, G[S] is a star with center s. Hence, all edges in G[S] are contained in every solution. Since \(E^* = E(G[S])\), the claim follows. \(\square \)

Lemma 4

Let \(\mathscr {I}'\) be the instance obtained from an instance \(\mathscr {I}\) using Construction 1. Then, \(\mathscr {I}\) is a yes-instance if and only if \(\mathscr {I}'\) is a yes-instance.

Proof

\((\Rightarrow )\quad \) Let \(U' \subseteq U\) be a solution for instance \(\mathscr {I}\). We claim that \(F:= E^* \cup \bigcup _{i \in U'}\{\{x_i,t\}\}\) is a solution for \(\mathscr {I}'\). Note that \(|F| \le n+k\). Observe that \(G'[F][S]\) is connected. Suppose now that there is \(V_j\) such that \(G'[F][V_j]\) is not connected. Let \(F_j\) be the corresponding set. Since \(E^*\subseteq F\), none of the edges \(\{\{x_i, t\} \mid i\in F_j\}\) are contained in F. It follows that \(F_j \cap U'=\emptyset \), contradicting the fact that \(U'\) is a solution for \(\mathscr {I}\).

\((\Leftarrow )\quad \) Let F be a solution to \(\mathscr {I}'\). By Observation 11 we know that \(E^*\subseteq F\). We claim that \(U' := \{i\in U \mid \{x_i, t\} \in F\}\) is a solution for \(\mathscr {I}\). Clearly \(|U'| \le k\). Suppose \(U'\) is not a solution. Then there is an \(F_j \in \mathscr {F}\) with \(F_j \cap U'=\emptyset \). But then \(G'[F][V_j]\) is not connected, a contradiction. \(\square \)

Next, we prove that 1-Reach GBP is \({\text {NP}}\)-hard even if we are given a constant number of habitats.

Proposition 3

1-Reach GBP is \({\text {NP}}\)-complete even if \(r=7\).

We reduce from the following \({\text {NP}}\)-hard problem.

Problem 4

Input:A directed graph \(D=(W,A)\) and two distinct vertices \(s,t\in W\) such that \(\text {outdeg}(t)=\text {indeg}(s)=0\).

Question:Is there an s-t path that visits every vertex exactly once?

Fig. 3
figure 3

Illustration to Constructions 2 and 3. Part (a) shows an exemplary directed graph which is a yes-instance for DHP. Applying Construction 2 on (a) yields (b). Applying Construction 3 on (b) yields the instance whose graph is depicted in (c) and two habitats of which are depicted in (d) and (e). Vertices marked yellow in (d) are contained in the habitat \(X_\textrm{out}\). Vertices marked red in (e) are contained in the habitat \(Y_\textrm{out}\). The graph induced by \(Y_\textrm{out}\) contains the red edges

We first recall a well-known reduction to Hamiltonian Path (HP), the undirected variant. Then, we reduce HP to 1-Reach GBP. For both constructions, we refer to Fig. 3 for an illustrative example.

Construction 2

Construct the undirected graph \(G'=(V',E')\) as follows. For each vertex \(v\in W\setminus \{s,t\}\), \(G'\) contains the path \(P_v=(v_\textrm{in},v,v_\textrm{out})\). Moreover, it contains the paths \(P_s=(s,s_\textrm{out})\) and \(P_t=(t_{in},t)\). For every arc \((v,w)\in A\), add the edge \((v_\textrm{out}, w_\textrm{in})\).

Recall the following.

Observation 5

(Dst) is a yes-instance of DHP if and only if \((G',s,t)\), obtained from (Dst) using Construction 2, is a yes-instance of HP.

Next, we construct from \(G'\) the instance of 1-Reach GBP.

Construction 3

Let \(G'=(W',E')\) obtained from \((D=(W,A),s,t)\) using Construction 2. We now construct the graph \(G=(V,E)\) from \(G'\) with habitat set

$$\begin{aligned} \mathscr {H}=\{X_\textrm{out},X_\textrm{in},X_\textrm{out}^*,X_\textrm{in}^*,V_\textrm{all},Y_\textrm{out},Y_\textrm{in}\} \end{aligned}$$

as follows.Add the new vertices \(x_\textrm{out},x_\textrm{in},y_\textrm{out},y_\textrm{in}\), that is, let

$$\begin{aligned} V:= V'\cup \{x_\textrm{out},x_\textrm{in},y_\textrm{out},y_\textrm{in}\} . \end{aligned}$$

Moreover, make \(x_\textrm{out}\) adjacent to \(v_\textrm{out}\) for each \(v\in W\setminus \{t\}\), make \(y_\textrm{out}\) adjacent to \(v_\textrm{out}\) for each \(v\in W\setminus \{t\}\), make \(x_\textrm{in}\) adjacent to \(v_\textrm{in}\) for each \(v\in W\setminus \{s\}\), make \(y_\textrm{in}\) adjacent to \(v_\textrm{in}\) for each \(v\in W\setminus \{s\}\), Next, let \(V_\textrm{all}:= W'\) and

$$\begin{aligned} X_\textrm{out}^*:= & {} \{x_\textrm{out}\} \cup \bigcup _{v\in W\setminus \{t\}}\{v_\textrm{out}\}, \quad \quad \quad \quad \quad \qquad X_\textrm{out} := X_\textrm{out}^* \cup \bigcup _{v\in W\setminus \{s\}}\{v_\textrm{in}\}, \\ X_\textrm{in}^*:= & {} \{x_\textrm{in}\} \cup \bigcup _{v\in W\setminus \{s\}}\{v_\textrm{in}\}, \quad \quad \quad \quad \quad \quad \qquad X_\textrm{in} := X_\textrm{in}^* \cup \bigcup _{v\in W\setminus \{t\}}\{v_\textrm{out}\}, \\ Y_\textrm{out}:= & {} \{y_\textrm{out}\} \cup \bigcup _{v \in W \setminus \{t\}} \{v_\textrm{out}, v\},\text { and} \quad \quad \quad \quad Y_\textrm{in} := \{y_\textrm{in}\} \cup \bigcup _{v \in W \setminus \{s\}} \{v_\textrm{in}, v\}. \end{aligned}$$

Finally, let \(k:= 2(n-2)+2 + 4(n-1) + (n-1) = 7(n-1)\), where \(n = |W|\). \(\diamond \)

As the habitats \(X^*_\textrm{out}\), \(X^*_\textrm{in}\), \(Y_\textrm{out}\), and \(Y_\textrm{in}\) induce trees in G, we have the following.

Observation 6

If \((G,\mathscr {H},k)\), obtained from \((G',s,t)\) using Construction 3, is a yes-instance of  1-Reach GBP, then every solution contains all edges contained in \(P_v\) for every \(v\in W\) and all edges incident with \(x_\textrm{out}\), with \(x_\textrm{in}\), with \(y_\textrm{out}\), and with \(y_\textrm{in}\).

Lemma 7

The instance \(I'=(G',s,t)\), obtained from (Dst) using Construction 2, is a yes-instance of HP if and only if \(I=(G,\mathscr {H},k)\), obtained from \((G',s,t)\) using Construction 3, is a yes-instance of  1-Reach GBP.

Proof

Let \(F':= \bigcup _{v\in W} E(P_v) \cup \{e\in E\mid e\cap \{x_\textrm{out},x_\textrm{in},y_\textrm{out},y_\textrm{in}\} \ne \emptyset \}\) and let \(n := |W|\). Note that \(|F'| = 2(n-2) + 2 + 4(n-1)\).

\((\Rightarrow )\quad \) Let \(P = (s, v^2, \dots , v^{n-2}, t)\) be an s-t path in D that visits every vertex exactly once. We claim that \(F := F' \cup F''\) is a solution for instance I, where \(F'' := \{u_\textrm{out}, v_\textrm{in} \mid (u, v) \in A(P)\}\). Clearly \(|F| \le |F'| + |F''| = k\). Note that the set \(F'\) already connects the habitats \(X^*_\textrm{out}\), \(X^*_\textrm{in}\), \(Y_\textrm{out}\), and \(Y_\textrm{in}\). Note that P is a subgraph of D that is weakly connected and in which every vertex has indegree one and every vertex has outdegree one, except for s (indegree zero) and t (outdegree zero). Hence, for every \(v \in W\) there exists an edge \((v, w) \in A(P)\), and thus \(\{v_\textrm{out}, w_\textrm{in}\} \in F''\). Therefore, \(G[F][X_\textrm{in}]\) is connected. The argumentation for \(G[F][X_\textrm{out}]\) being connected is analogous. Finally, as P is a connected subgraph, F contains the edges of an s-t path that contains all vertices in \(V_\textrm{all}\).

\((\Leftarrow )\quad \) Let F be a solution to I. Due to Observation 6, we know that \(F'\subseteq F\), and hence for \(F'':= F\setminus F'\) we have \(|F''|\le k-(6(n-1)) = n-1\). By definition of \(X_\textrm{out}\) and \(X_\textrm{in}\), we know that in G[F], every \(v_\textrm{out}\) is adjacent to at least one \(w_\textrm{in}\), and every \(v_\textrm{in}\) is adjacent to at least one \(w_\textrm{out}\). Thus, in the graph \(P:= (W,E^*)\) with \(E^*=\{(v,w)\mid (v_\textrm{out},w_\textrm{in})\in F''\}\), every vertex has indegree and outdegree one, except for s (indegree zero) and t (outdegree zero). We claim that P is weakly connected. Consider any two vertices \(v, w \in W\). By our assumption there exists a v-w path \(P'\) in \(G[F][V_\textrm{all}]\). Note that \(G[F'][V_\textrm{all}]\) has n connected components, each of which contains exactly one vertex in W. Hence, \(P'\) contains at least one edge in \(F''\), and an additional edge in \(F''\) for each additional vertex in W that is visited by \(P'\). This edge set \(E(P') \cap F''\) corresponds to the edges of an undirected v-w path in P. Hence, P is connected. Together with the above properties of P, it follows that P is a Hamiltonian s-t path. \(\square \)

Lastly, we show that 1-Reach GBP becomes tractable for \(r=2\). Let \(\alpha :\mathbb {N}\rightarrow \mathbb {N}\) be the inverse of the single-valued Ackermann function.

Proposition 4

1-Reach GBP is solvable in \(O((n+m) \alpha (n))\) time if \(r=2\).

Proof

Assume that both \(G[V_1]\) and \(G[V_2]\) are connected (otherwise, safely return no) and that \(V_1 \cap V_2 \ne \emptyset \) (otherwise, a tree spanning over \(V_i\) for each \(i \in \{1, 2\}\) is a valid, minimum-size solution). We first compute a spanning forest \(T_{\cap }\) within \(G[V_1 \cap V_2]\), using breadth-first search. Afterwards, for each \(i \in \{1, 2\}\), we run Kruskal’s [28] algorithm to extend the forest \(T_{\cap }[V_i]\) to a spanning tree \(T_i\) that spans over the vertices in \(V_i\). Let \(F := E(T_1) \cup E(T_2)\). We return yes if and only if \(|F| \le k\). As each \(v \in V_i\) is visited at most once, the algorithm runs in \(O((n+m) \alpha (n))\) time by using the disjoint-set structure [38].

To prove the correctness of the algorithm, we show that F is a minimum-cardinality solution. Since both \(G[V_1]\) and \(G[V_2]\) are connected, \(G[F][V_i]\) is connected for each \(i \in \{1, 2\}\). It remains to show that F is of minimum cardinality. Consider some minimum-cardinality solution \(F'\). Let \(F_i':= E(G[F'][V_i])\) for each \(i\in \{1,2\}\), and let \(F_\cap ':= E(G[F'][V_1\cap V_2])\). Observe that \(|E(T_{\cap })|\ge |F_\cap '|\) as otherwise there is cycle in \(G[F'][V_1\cap V_2]\) contradicting the fact that \(F'\) is of minimum-cardinality. It follows that

$$\begin{aligned} |F'| = |F_1'| + |F_2'| - |F_\cap |\ge & {} |V_1|-1 + |V_2|-1 - |F_\cap | \\\ge & {} |V_1|-1 + |V_2|-1 - |E(T_\cap )| = |F|. \end{aligned}$$

\(\square \)

3.3 One hop between habitat patches (\(d=2\))

In this section we prove that 2-Reach GBP is already \({\text {NP}}\)-complete even if there are two habitats and the graph has maximum degree four, or if there is only one habitat. Afterwards we show that 2-Reach GBP still admits a problem kernel with respect to k. If the graph is planar, we can show that the kernelization is polynomial in the number of vertices.

Proposition 5

d -Reach GBP with \(d\ge 2\) is \({\text {NP}}\)-complete even if (i) \(r=2\) and \(\Delta \le 4\) or (ii) \(r=1\) and the input graph has diameter 2d.

For the sake of presentation, we prove Proposition 5(i) for \(d=2\). Afterwards, we briefly explain how to adapt the proof for \(d>2\) and for Proposition 5(ii).

Construction 4

Let \(\mathscr {I}=(G, k)\) be an instance of 3-Regular Vertex Cover with \(G=(V, E)\) and \(V=\{1,\ldots ,n\}\) construct an instance of 2-Reach GBP with graph \(G'=(V',E')\), habitat sets \(V_1\) and \(V_2\), and integer \(k':= |E|+(n-1)+k\) as follows (see Fig. 4(a) for an illustration).

Fig. 4
figure 4

Illustration for 2-Reach GBP with (a) \(r=2\) and \(\Delta =4\) (\(k'=m+(n-1)+k\)) and (b) \(r=1\) (\(k'=m+k\))

Add the vertex set \(V_E:= \{v_e\mid e\in E\}\) and add \(v_e\) with \(e=\{i,j\}\in E\) to habitat \(V_1\). Next, add the vertex sets \(V_G=\{v_i\mid i\in V\}\), and connect each \(v_i\) with all edge-vertices corresponding to an edge incident with i, i.e., add the edge set \(E_G:= \bigcup _{i\in V}\{\{v_i,v_e\}\mid i\in e\}\). Next, add the vertex set \(V_X:= \{x_i\mid i\in V\}\), connect each \(x_i\) with \(v_i\), and add \(x_i\) to \(V_1\) and to \(V_2\). Finally, add the edge set \(\{\{x_i,x_{i+1}\}\mid i\in \{1,\ldots ,n-1\}\}\). \(\diamond \)

Observation 8

Let \(\mathscr {I}=(G,k)\) be an instance of 3-Regular Vertex Cover and let \(\mathscr {I}'=(G',\{V_1,V_2\},k')\) be the instance obtained from \(\mathscr {I}\) using Construction 4. If \(\mathscr {I}'\) is a yes-instance, then every solution contains all edges in \(G[V_X]\).

Proof

Suppose not, and let F be a solution without some edge \(\{x_i,x_{i+1}\}\). Note that in \(G-\{\{x_i, x_{i+1}\}\}\), the distance between \(x_i\) and \(x_{i+1}\) is at least four; thus \(G[F]^2[V_X] = G[F]^2[V_2]\) is not be connected. A contradiction. \(\square \)

Lemma 9

Let \(\mathscr {I}=(G,k)\) be an instance of 3-Regular Vertex Cover and let \(\mathscr {I}'=(G',f,k')\) be the instance obtained from \(\mathscr {I}\) using Construction 4. If \(\mathscr {I}'\) is a yes-instance, then there is a solution \(F\subseteq E(G')\) such that \(\deg _{G'[F]}(v_e)=1\) for all \(e\in E(G)\).

Proof

Clearly, in every solution, we have \(\deg _{G'[F]}(v_e)\ge 1\). Let F be a minimum solution with a minimum number of edges incident to vertices in \(\{v_e \mid e\in E\}\). Suppose that there is at least one \(e=\{i,j\}\in E\) such that \(\deg _{G'[F]}(v_e)=2\), that is, \(\{v_e, v_i\}, \{v_e, v_j\} \in F\). Since F is a solution, there is a path P in \(G'[F]\) from \(v_e\) to some \(x_i\). Let \(\{v_e,v_i\}\) be the first edge on this path. Let \(F':= (F \setminus \{v_e,v_j\})\cup \{v_j,x_j\}\). We claim that \(F'\) is a solution, yielding a contradiction to the fact that F is a solution with a minimum number of edges incident with vertices in \(V_E\).

Only a vertex \(v_{e'}\) can be disconnected from any \(V_X\) by removing \(\{v_e,v_j\}\) from F. This vertex cannot be on the path P, and hence is connected to \(v_e\) via edge \(\{v_e,v_j\}\). Since now edge \(\{v_j,x_j\}\) is present, \(v_{e'}\) is again connected to \(V_X\). \(\square \)

Lemma 10

Let \(\mathscr {I}=(G,k)\) be an instance of 3-Regular Vertex Cover and let \(\mathscr {I}'=(G',\{V_1,V_2\},k')\) be the instance obtained from \(\mathscr {I}\) using Construction 4. Then \(\mathscr {I}\) is a yes-instance if and only if \(\mathscr {I}'\) is a yes-instance.

Proof

\((\Rightarrow )\quad \) Let \(S\subseteq V\) be a vertex cover of size k in G. We construct a solution \(F\subseteq E'\) as follows. Let \(F_X=\bigcup _{i=1}^{n-1} \{\{x_i,x_{i+1}\}\}\) and \(F_V:= \{\{v_i,x_i\}\mid i\in S\}\). We define the auxiliary function \(g:E\rightarrow V'\) with \(g(\{i,j\})=v_{\min (\{i,j\}\cap S)}\). Let \(F_E:= \bigcup _{e=\{i,j\}\in E} \{v_e,g(e)\}\). Let \(F:= F_X\cup F_V\cup F_E\). Note that \(|F|=|F_X|+|F_V|+|F_E|\le |E|+(n-1)+k = k'\). Moreover, every \(v_e\in V_E\) is connected to \(x_i\) via a path \((v_e,v_i,x_i)\), where \(i\in (e\cap S)\). Finally, observe that \(G'[F][V_X]\) is connected.

\((\Leftarrow )\quad \) Let \(\mathscr {I}'\) be a yes-instance. Due to Lemma 9 there is a solution \(F\subseteq E'\) such that \(\deg _{G'[F]}(v_e)=1\) for all \(e\in E\). Due to Observation 8, we know that the edges \(\bigcup _{i=1}^{n-1} \{\{x_i,x_{i+1}\}\}\subseteq F\). Let \(S:= \{i\in V\mid \{v_i,x_i\}\in F\}\). We claim that S is a vertex cover. Suppose not, that is, there is an edge \(e\in E\) such that \(e\cap S=\emptyset \). That means that the unique neighbor of \(v_e\), say \(v_i\), is not adjacent with \(x_i\) in \(G'[F]\). Since \(\deg _{G'[F]}(v_e)=1\) for all \(e\in E\), \(N_{G'[F]}[v_i]\) forms a connected component in \(G'[F]^2\) not containing \(x_i\). This contradicts the fact that F is a solution. \(\square \)

Remark 1

  1. (i)

    To make the reduction work for \(d\ge 3\), it is enough to subdivide each edge \(\{v_e,v_i\}\) \((d-2)\) times and set \(k':= (d-1)m+(n-1)+k\).

  2. (ii)

    If we contract all \(x_i\), set \(V_2=\emptyset \) (i.e., only one habitat remains), and set \(k':= (d-1)m+k\), then the reduction is still valid (see Fig. 4(b) for an illustration). Thus, Proposition 5(ii) follows.

The reduction in the proof of Proposition 5 requires k to be linear in the input instance’s size. We next prove that, indeed, 2-Reach GBP is fixed-parameter tractable with respect to k by showing that it admits a problem kernel of size exponential in k.

Proposition 6

2-Reach GBP admits a problem kernel with at most \(2k+\left( {\begin{array}{c}2k\\ k\end{array}}\right) \) vertices, at most \(\left( {\begin{array}{c}2k\\ 2\end{array}}\right) +k\left( {\begin{array}{c}2k\\ k\end{array}}\right) \) edges, and at most \(2^{2k}\) habitats.

Let \(\bar{V}:= V\setminus \bigcup _{V'\in \mathscr {H}} V'\) for a graph \(G=(V,E)\) and habitat set \(\mathscr {H}=\{V_1,\dots ,V_r\}\). The following reduction rules are immediate.

Reduction rule 1

  1. (i)

    If \(|V_i|=1\) for some i, delete \(V_i\).

  2. (ii)

    If a vertex in \(\bar{V}\) is of degree at most one, delete it.

  3. (iii)

    If there is an \(i\in \{1,\ldots ,r\}\) with \(|V_i|>1\) and an \(v\in V_i\) of degree zero, return a trivial no-instance.

  4. (iv)

    If there is a vertex \(v\in V\setminus \bar{V}\) of degree at most one, delete it (also from \(V_1,\dots ,V_r\)), and set \(k:= k-1\).

Clearly, k edges can connect at most 2k vertices; thus we obtain the following.

Reduction Rule 2

If \(|V\setminus \bar{V}|>2k\), then return a trivial no-instance.

So we have at most 2k vertices in habitats. Next, we upper-bound the number of non-habitat vertices. No minimal solution has edges between two such vertices.

Reduction Rule 3

If there is an edge \(e \in E\) with \(e\subseteq \bar{V}\), then delete e.

Moreover, no minimum solution connects through non-habitat twins.

Reduction Rule 4

If \(N(v)\subseteq N(w)\) for distinct \(v,w\in \bar{V}\), then delete v.

We still need to bound the number of vertices in \(\bar{V}\). For an n-element set S let \(\mathscr {F} \subseteq 2^{S}\) be a family of subsets such that for every \(A, B \in \mathscr {F}\) we have \(A \not \subseteq B\). Then \(|\mathscr {F} | \le \left( {\begin{array}{c}n\\ \lfloor n/2 \rfloor \end{array}}\right) \) by Sperner’s Theorem. Hence, after applying the reduction rules, we get an instance with at most \(2k+\left( {\begin{array}{c}2k\\ k\end{array}}\right) \) vertices and \(\left( {\begin{array}{c}2k\\ 2\end{array}}\right) +2k\left( {\begin{array}{c}2k\\ k\end{array}}\right) \) edges.

Finally, we can upper-bound the number of habitats by simply deleting duplicates.

Reduction Rule 5

If \(V_i=V_j\) for distinct \(i,j\in \{1,\ldots ,r\}\), then delete \(V_j\).

It follows that we can safely assume that \(r\le 2^{2k}\). Thus, Proposition 6 follows. Unfortunately, improving the problem kernel to polynomial-size appears unlikely.

Proposition 7

Unless \({\text {NP}}\subseteq {\text {coNP}}/{\text {poly}}\), d -Reach GBP for \(d\ge 2\) admits no problem kernel of size \(k^{O(1)}\), even if \(r\ge 1\) is constant.

We will give a linear parametric transformation from the following problem:

Problem 5

Input:A universe U, a set \(\mathscr {F}\subseteq 2^U\) of subsets of U, and an integer k.

Question:Is there \(\mathscr {F}'\subset \mathscr {F}\) with \(|\mathscr {F}'|\le k\) such that \(\bigcup _{F\in \mathscr {F}'} F=U\)?

The construction is basically the same as for Proposition 5(ii). Note that Set Cover admits no problem kernel of size polynomial in \(|U|+k\), unless \({\text {NP}}\subseteq {\text {coNP}}/{\text {poly}}\) [12].

Proof

Let \(\mathscr {I}=(U,\mathscr {F},k)\) be an instance of Set Cover, with \(U=\{u_1,\dots ,u_n\}\). Construct an instance \(\mathscr {I}':= (G,V_1,k')\) of 2-Reach GBP with \(k'=|U|+k\) as follows (see Fig. 5). Let G be initially empty. Add the vertex set \(V_U:= U\), the vertex set \(V_\mathscr {F}:= \{v_F\mid F\in \mathscr {F}\}\), and the vertex x. Set \(V_1:= V_U\cup \{x\}\). Make each vertex in \(V_\mathscr {F}\) adjacent with x. Finally, for each \(F\in \mathscr {F}\), add the edge set \(\{\{v_i,v_F\}\mid u_i\in F\}\).

The proof that \(\mathscr {I}\) is a yes-instance if and only if \(\mathscr {I}'\) is a yes-instance is analogous with the correctness proof for Proposition 5(ii).

Since Set Cover admits no problem kernel of size polynomial in \(|U|+k\), unless \({\text {NP}}\subseteq {\text {coNP}}/{\text {poly}}\) [12], neither does 2-Reach GBP when parameterized by \(k'=|U|+k\). \(\square \)

Fig. 5
figure 5

Illustration for the construction in the proof of Proposition 7 for 2-Reach GBP with \(r=1\). In this example, \(U=\{u_1,\dots ,u_n\}\) and we have \(\{u_1,u_i,u_j,u_n\}= F\in \mathscr {F}\)

Proposition 7 holds for general graphs. In fact, for planar graphs, the above reduction rules allow for an \(O(k^3)\)-vertex kernel. The number of habitats in the kernel however may still be exponential in k.

Proposition 8

2-Reach GBP on planar graphs admits a problem kernel with \(O(k^3)\) vertices and edges and at most \(2^{2k}\) habitats.

Observation 11

Suppose all reduction rules were applied exhaustively. Then

  1. (i)

    there are at most \(\left( {\begin{array}{c}2k\\ 2\end{array}}\right) \) vertices of degree two in \(\bar{V}\), and

  2. (ii)

    there are at most \(3\left( {\begin{array}{c}2k\\ 3\end{array}}\right) \) vertices of degree at least three in \(\bar{V}\).

Proof

(i) By Reduction Rules 3, 2 and 4, every degree-two vertex in \(\bar{V}\) has a pairwise different pair of neighbors in \(V \setminus \bar{V}\). As there are \(\left( {\begin{array}{c}2k\\ 2\end{array}}\right) \) (unordered) vertex pairs in \(V \setminus \bar{V}\), there are at most \(\left( {\begin{array}{c}2k\\ 2\end{array}}\right) \) degree-two vertices in \(\bar{V}\), otherwise one of the reduction rules was not applied exhaustively.

(ii) Any three vertices uvw in a planar graph share at most two neighbors, that is, \(|N(u)\cap N(v)\cap N(w)| \le 2\). Suppose there are more than \(3\left( {\begin{array}{c}2k\\ 3\end{array}}\right) \) vertices in \(\bar{V}\) of degree at least three. Then, by Reduction Rules 3 to 4, there are three vertices \(u,v,w\in \bar{V}\) such that \(|N(u)\cap N(v)\cap N(w)| \ge 3\), a contradiction to G being planar. \(\square \)

As \(|V\setminus \bar{V}| \le 2k\) and we deleted all degree-one vertices, Proposition 8 follows.

3.4 At Least Two Hops Between Habitat Patches (\(d\ge 3\))

If the data is more sparse, that is, the observed habitats to connect are rather scattered, then the problem becomes significantly harder to solve from the parameterized complexity point of view.

Proposition 9

d -Reach GBP with \(d\ge 3\) is \({\text {NP}}\)-complete and \({\text {W[1]}}\)-hard when parameterized by \(k+r\).

We give the construction for d being odd. Afterwards, we explain how to adapt the reduction to d being even. The reduction is from the Multicolored Clique problem, where, given a k-partite graph \(G=(U^1,\dots ,U^k,E)\), the question is whether there is a clique containing exactly one vertex from each part. Multicolored Clique is \({\text {NP}}\)-hard and \({\text {W[1]}}\)-hard when parameterized by k.

Construction 5

Let (G) with \(G=(U^1,\dots ,U^k,E)\) be an instance of Multicolored Clique where \(G[U^i]\) forms an independent set for every \(i\in \{1,\ldots ,k\}\). Assume without loss of generality that \(U^i=\{u^i_1,\dots ,u^i_{|V^i|}\}\). Let \(k':= \frac{(d-1)}{2}k+\left( {\begin{array}{c}k\\ 2\end{array}}\right) \). Construct the instance \((G',\{V_1,\dots ,V_{\left( {\begin{array}{c}k\\ 2\end{array}}\right) }\},k')\) as follows (see Fig. 6 for an illustration).

Let \(g:\left( {\begin{array}{c}\{1,\ldots ,k\}\\ 2\end{array}}\right) \rightarrow \{1,\ldots ,\left( {\begin{array}{c}k\\ 2\end{array}}\right) \}\) be a bijective function. Let \(G'\) be initially G. For each \(i\in \{1,\ldots ,k\}\), add a vertex \(v_i\) to \(G'\), add \(v_i\) to each habitat \(V_\ell \) with \(i\in g^{-1}(\ell )\), and connect \(v_i\) with \(u^i_j\) for each \(j\in \{1,\ldots ,u^i_{|U^i|}\}\) via a path with \(\frac{d-1}{2}\) edges, where \(v_i\) and \(u_i^j\) are the endpoints of the path.

Fig. 6
figure 6

Illustration to Construction 5 for d -Reach GBP for \(d\ge 3\)

Remark 2

For every even \(d\ge 4\), we can adapt the reduction for \(d-1\): At the end of the construction, subdivide each edge between two vertices that are in the original graph G.

Observation 12

In the obtained instance, for every \(\ell \in \{1,\ldots ,\left( {\begin{array}{c}k\\ 2\end{array}}\right) \}\), it holds that, \(V_\ell =\{v_i,v_j\}\) where \(\{i,j\}=g^{-1}(\ell )\), and for every \(i,j\in \{1,\ldots ,k\}\), \(i\ne j\), it holds that \(\{\ell '\mid \{v_i,v_j\}\subseteq V_{\ell '}\}=\{\ell \}\) with \(\ell =g(\{i,j\})\).

Observation 13

If the obtained instance is a yes-instance, then in every minimal solution F, for every \(i\in \{1,\ldots ,k\}\) there is exactly one \(u^i_j\) in G[F].

Proof

Note that each \(v_i\) must be connected with at least one vertex from \(U^i\) in \(G'[F]\). Thus, \(|V(G'[F])\cap U^i|\ge 1\). Moreover, from each \(i,j\in \{1,\ldots ,k\}\), \(i\ne j\), F must contain an edge between \(U^i\) and \(U^j\), since \({{\,\textrm{dist}\,}}_{G'}(v_i,u)+{{\,\textrm{dist}\,}}_{G'}(v_j,u')\ge d-1\) for every \(u\in U^i\), \(u'\in U^j\). Since additionally \(k'= \frac{(d-1)}{2}k+\left( {\begin{array}{c}k\\ 2\end{array}}\right) \), it follows that \(v_i\) cannot be connected with two vertices from \(U^i\) in \(G'[F][U^i\cup \{v_i\}]\). Hence, if there are two vertices \(u,u'\in U^i\cap F\), with u being connected to \(v_i\) in \(G'[F][U^i\cup \{v_i\}]\), then \(u'\) is not part of an \(v_a\)-\(v_b\) path in \(G'[F]\) of length at most d for every \(a,b\in \{1,\ldots ,k\}\). It follows that F is not minimal. \(\square \)

Lemma 14

Let \(\mathscr {I}=(G)\) with \(G=(U^1,\dots ,U^k,E)\) be an instance of Multicolored Clique and let \(\mathscr {I}'=(G',\mathscr {H},k')\) be the instance obtained from \(\mathscr {I}\) using Construction 5. Then \(\mathscr {I}\) is a yes-instance if and only if \(\mathscr {I}'\) is a yes-instance.

Proof

\((\Rightarrow )\quad \) Let \(W\subseteq V(G)\) be a multicolored clique. Let F contain \(\left( {\begin{array}{c}W\\ 2\end{array}}\right) \) and all edges of a path from \(v_i\) to \(U^i\cap W\). We claim that F is a solution. Note that \(|F|=\left( {\begin{array}{c}k\\ 2\end{array}}\right) +k\frac{d-1}{2}\). Since \(V_\ell \) is of size two for all \(\ell \in \{1,\ldots ,\left( {\begin{array}{c}k\\ 2\end{array}}\right) \}\) (Observation 12), we only need to show that \(v_i,v_j\) with \(\{i,j\}=g^{-1}(\ell )\) is connected by a path of length at most d. We know that \(v_i\) is connected to some \(u^i_x\) by a path of length \((d-1)/2\), which is adjacent to some \(u^j_y\), which is connected to \(v_j\) by a path of length \((d-1)/2\). Thus, \(v_i\) and \(v_j\) are of distance d.

\((\Leftarrow )\quad \) Let F be a solution. Note that \(|F|=\left( {\begin{array}{c}k\\ 2\end{array}}\right) +k\frac{d-1}{2}\). We claim that \(W:= V(G'[F])\cap V(G)\) is a multicolored clique. First, observe that \(|W|=k\) since for every \(v_i\) there is exactly one \(u^i_{\ell _i}\) in \(G'[F]\) (Observation 13). Suppose that W is not a multicolored clique, that is, there are \(U^i\) and \(U^j\) such that there is no edge in F between them. Then \(v_i\) and \(v_j\) are of distance larger than d in \(G'[F]\), contradicting that F is a solution. \(\square \)

4 Connecting Habitats at Short Pairwise Distance

In the next problem, we require short pairwise reachability.

Problem 6

Input:An undirected graph \(G=(V,E)\), a set \(\mathscr {H} = \{V_1, \dots , V_r\}\) of habitats where \(V_i\subseteq V\) for all \(i\in \{1,\ldots , r\}\), and \(k \in \mathbb {N}_0\).

Question:Is there a subset \(F\subseteq E\) with \(|F|\le k\) such that for every \(i\in \{1,\ldots , r\}\) it holds that \(V_i\subseteq V(G[F])\) and \(G[F]^d[V_i]\) is a clique?

Note that if \(G[F]^d[V_i]\) is a clique, then \({{\,\textrm{dist}\,}}_{G[F]}(v,w) \le d\) for all \(v,w\in V_i\). Further, d -Closed GBP is an unweighted variant of the 2NET problem [9].

Theorem 2

d -Closed Green Bridges Placement is,

  1. (i)

    if \(d=1\), linear-time solvable;

  2. (ii)

    if \(d=2\), \({\text {NP}}\)-hard even on bipartite graphs of diameter three and \(r=1\), and in \({\text {FPT}}\) regarding k;

  3. (iii)

    if \(d\ge 3\), \({\text {NP}}\)-hard and \({\text {W[1]}}\)-hard regarding k even if \(r=1\).

Further, d -Closed GBP is linear-time solvable if the number of habitats and the maximum degree are constant.

We first show the linear-time solvability for constant number of habitats and maximum degree. Afterwards we present the results in (i)-(iii).

4.1 Graphs of Constant Maximum Degree

2-Reach GBP is \({\text {NP}}\)-hard if the number r of habitats and the maximum degree \(\Delta \) are constant (Proposition 5). 2-Closed GBP is linear-time solvable in this case:

Proposition 10

d -Closed GBP admits an \(O(r\Delta (\Delta -1)^{3d/2})\)-sized problem kernel computable in \(O(r(n+m))\) time.

Proof

Let \(\mathscr {I} = (G, \mathscr {H}, k)\) be an instance of d -Closed GBP. For every \(i\in \{1,\ldots ,r\}\), fix a vertex \(u_i\in V_i\). We assume that we have \(V_i \subseteq N_G^d[u_i]\) for all \(i\in \{1,\ldots ,r\}\), otherwise \(\mathscr {I}\) is a no-instance. Now let \(W_i = N_G^{\lceil 3d/2\rceil }[u_i]\) and let \(G' := G[\bigcup _{i=1}^r W_i]\). Note that \(G'\) contains at most \(r\Delta (\Delta - 1)^{\lceil 3d/2\rceil }\) vertices and can be computed by r breadth-first searches. We claim that \(G'\) contains every path of length at most d between every two vertices \(v, w\in V_i\), for every \(i \in \{1,\ldots ,r\}\). Recall that an edge set \(F \subseteq E\) is a solution if and only if for every \(i\in \{1,\ldots ,r\}\) and for every \(v, w\in V_i\), the graph G[F] contains a path of length at most d from v to w. As by our claim \(G'\) contains any such path, this implies that \(\mathscr {I}\) is a yes-instance if and only if \(\mathscr {I}':=(G',\mathscr {H},k)\) is a yes-instance (note that \(V_i \subseteq V(G')\) for every \(i \in \{1,\ldots ,r\}\)).

Assuming that \(V_i \subseteq N_G^d[u_i]\), \(G[W_i]\) contains all paths of length at most d between \(u_i\) and any \(v\in V_i\). So let \(v, w \in V_i\) be two vertices, both distinct from \(u_i\). As \(v, w \in N^d_G[u_i]\) and \(W_i=N^{\lceil 3d/2\rceil }_G[u_i]\), the subgraph \(G[W_i]\) contains all vertices in \(N^{\lceil d/2\rceil }_G[v]\) and \(N^{\lceil d/2\rceil }_G[w]\). Consider now a path of length at most d between v and w. Suppose it contains a vertex \(x \in V(G) \setminus (N^{\lceil d/2\rceil }_G[v]\cup N^{\lceil d/2\rceil }_G[w])\). Then \({{\,\textrm{dist}\,}}_G(v, x) + {{\,\textrm{dist}\,}}_G(w, x) > 2 \lceil d/2 \rceil \ge d\), a contradiction to x being on a path from v to w of length at most d. The claim follows. \(\square \)

4.2 When Every Habitat Must be Complete (\(d=1\))

For \(d=1\), the problem is solvable in linear time: Check whether each habitat induces a clique. If so, check if the union of the cliques is small enough.

Observation 15

1-Closed GBP is solvable in linear time.

Proof

We employ the following algorithm: For each \(i\in \{1,\ldots ,r\}\), let \(G_i := G[V_i]\) and return no if \(G_i\) is not a clique. Finally, return yes if \(|\bigcup _{i=1}^r E(G_i)|\le k\), and no otherwise. Clearly, if the algorithm returns yes, then \(\mathscr {I}\) is yes-instance. Conversely, let \(\mathscr {I}\) be a yes-instance and let \(F'\) be a solution to \(\mathscr {I}\). We know that for every \(i\in \{1,\ldots ,r\}\), and any two vertices \(v,w\in V_i\), edge \(\{v,w\}\) must be in \(F'\). It follows that \(\bigcup _{i=1}^r E(G_i)\subseteq F'\). Thus, \(|\bigcup _{i=1}^r E(G_i)|\le |F'|\le k\) and the algorithm correctly returns yes. \(\square \)

4.3 When Each Part is Just Two Steps Away (\(d=2\))

For \(d=2\), d -Closed GBP becomes \({\text {NP}}\)-hard already on quite restrictive inputs. It is however, as we show at the end of this section, still fixed-parameter tractable when parameterized by k.

Proposition 11

2-Closed GBP is \({\text {NP}}\)-complete, even if \(r=1\) and the input graph is bipartite and of diameter three.

Construction 6

Let \(\mathscr {I}=(G,k)\) with \(G=(V,E)\) be an instance of Vertex Cover, and assume without loss of generality that \(V=\{1,\ldots ,n\}\). Construct an instance of 2-Closed GBP with graph \(G'=(V',E')\), habitat \(V_1\), and integer \(k':= 2|E|+k+3\) as follows (see Fig. 7 for an illustration).

Fig. 7
figure 7

Illustration to Construction 6 for 2-Closed GBP

To construct \(G'\) and \(V_1\), add the vertex set \(V_E:= \{v_e\mid e\in E\}\) and add \(V_E\) to \(V_1\). Add two designated vertices \(y'\) and y, add y to \(V_1\), and make \(y'\) adjacent with y and all vertices in \(V_E\). Add a designated vertex x, add x to \(V_1\), and introduce a path of length two from x to y (call the inner vertex z). Add the vertex set \(V_G:= \{v_i\mid i\in V\}\), and make each \(v_i\) adjacent with x and all edge-vertices corresponding to an edge incident with i, i.e., add the edge set \(E_G:= \bigcup _{i\in V}\{\{v_i,v_e\}\mid i\in e\}\). \(\diamond \)

Observation 16

Let \(\mathscr {I}' = (G', \{V_1\}, k')\) be an instance obtained from applying Construction 6 on an instance \(\mathscr {I}=(G, k)\) of Vertex Cover. If \(\mathscr {I}'\) is a yes-instance, then for every solution \(F\subseteq E(G')\) it holds that \(\{\{y,y'\},\{y,z\},\{z,x\}\}\cup \{\{y',v_e\}\mid e\in E(G)\}\subseteq F\).

Lemma 17

Let \(\mathscr {I}=(G,k)\) be an instance of Vertex Cover. Consider the instance \(\mathscr {I}'=(G',\{V_1\},k')\) obtained from \(\mathscr {I}\) using Construction 6. If \(\mathscr {I}'\) is a yes-instance, then there is a solution \(F\subseteq E(G')\) such that \(|N_{G'[F]}(v_e)\cap V_G|=1\) for all \(e\in E(G)\).

Proof

Note that in every solution, clearly we have \(|N_{G'[F]}(v_e)\cap V_G|\ge 1\). Suppose there is a minimal solution F such that there is at least one \(e=\{i,j\}\in E\) such that \(|N_{G'[F]}(v_e)\cap V_G|=2\). Let F be a solution with a minimum number of edges incident to vertices in \(V_E\).

Since \({{\,\textrm{dist}\,}}_{G'[F]}(v_e,x)= 2\), at least one of the edges \(\{v_i,x_i\}\) or \(\{v_j,x_j\}\) are in F. If both are present then we can remove one of the edges \(\{v_e,v_i\}\) or \(\{v_e,v_j\}\) incident with \(v_e\) to obtain a solution of smaller size. This yields a contradiction.

Otherwise, assume there is exactly one edge, say \(\{v_e,v_i\}\), contained in F. Then exchanging \(\{v_e,v_j\}\) with \(\{v_j,x\}\) yields a solution with a lower number of edges incident to vertices in \(V_E\). A contradiction. \(\square \)

Lemma 18

Let \(\mathscr {I}=(G,k)\) be an instance of Vertex Cover. Consider the instance \(\mathscr {I}'=(G',\{V_1\},k')\) obtained from \(\mathscr {I}\) using Construction 6. Then \(\mathscr {I}\) is a yes-instance if and only if \(\mathscr {I}'\) is a yes-instance.

Proof

\((\Rightarrow )\quad \) Let \(W\subseteq V\) be a vertex cover of size at most k in G. We construct a solution \(F\subseteq E'\) as follows. Let \(F'\) denote the set of all edges required due to Construction 16. Let \(F_V:= \{\{v_i,x\}\mid i\in W\}\). We define the auxiliary function \(g:E\rightarrow V'\) with \(g(\{i,j\})=v_{\min (\{i,j\}\cap W)}\). Let \(F_E:= \bigcup _{e=\{i,j\}\in E} \{v_e,g(e)\}\). Let \(F:= F'\cup F_V\cup F_E\). Note that \(|F|=|F'|+|F_V|+|F_E|\le |E|+3+|E|+k = k'\). Moreover, every \(v_e\in V'\) is connected to x via a path \((v_e,v_i,z)\), for some \(i\in (e\cap W)\), of length two. Thus all vertex pairs in \(V_1\) are at distance at most two.

\((\Leftarrow )\quad \) Let \(\mathscr {I}'\) be a yes-instance. Due to Construction 17, there is a solution \(F\subseteq E'\) such that \(\deg _{G'[F]}(v_e)=1\) for all \(e\in E\). Let \(W:= \{i\in V\mid \{v_i,x\}\in F\}\). We claim that W is a vertex cover. Suppose not, that is, there is an edge \(e\in E\) such that \(e\cap W=\emptyset \). That means that the unique neighbor of \(v_e\), say \(v_i\), is not adjacent with x in \(G'[F]\). Then, \(v_e\) is not connected with x in \(G'[F]^2\), and hence F is no solution, a contradiction. \(\square \)

We next show fixed-parameter tractability when parameterizing by k. All the reduction rules that worked for 2-Reach GBP also work for 2-Closed GBP. It thus follows that 2-Closed GBP admits a problem kernel of size exponentially in k. As with 2-Reach GBP, the problem kernel presumably cannot be much improved. This can be shown by combining the constructions of Proposition 7 and 11.

Corollary 1

2-Closed GBP admits a problem kernel of size exponentially in k and, unless \({\text {NP}}\subseteq {\text {coNP}}/{\text {poly}}\), none of size polynomial in k, even if \(r=1\).

4.4 When Reaching Each Part is a Voyage (\(d\ge 3\))

For \(d\ge 3\), the problem is \({\text {W[1]}}\)-hard regarding the number k of green bridges, even for one habitat. The reduction is similar to the one for Proposition 9.

Proposition 12

d -Closed GBP with \(d\ge 3\) is \({\text {NP}}\)-complete and \({\text {W[1]}}\)-hard when parameterized by the number k, even if \(r=1\).

Proof

Let \(\mathscr {I}=(G)\) with \(G=(U^1,\dots ,U^k,E)\) be an instance of Multicolored Clique. Apply Construction 5 to obtain instance \(\mathscr {I}''=(G',\{V_1,\dots ,V_{\left( {\begin{array}{c}k\\ 2\end{array}}\right) }\},k')\) (recall that \(k'=\frac{d-1}{2}k+\left( {\begin{array}{c}k\\ 2\end{array}}\right) \)). Let \(\mathscr {I}'=(G',\{V_1'\},k')\) with \(V_1':= \bigcup _{i=1}^{\left( {\begin{array}{c}k\\ 2\end{array}}\right) } V_i=\{v_1,\dots ,v_k\}\) be the finally obtained instance of d -Closed GBP. We claim that \(\mathscr {I}\) is a yes-instance if and only if \(\mathscr {I}'\) is a yes-instance.

\((\Rightarrow )\quad \) Let C be a multicolored clique in G. Let \(z_i:= V(C)\cap U^i\). We claim that F, consisting of the edges of each shortest path from \(v_i\) to \(z_i\) and the edge set E(C), is a solution to \(\mathscr {I}'\). Note that \(|F|=k'\). Moreover, for any two \(i,j\in \{1,\ldots ,k\}\), we have that \(v_i\) and \(v_j\) are of distance \(2\frac{d-1}{2}+1=d\). Hence, F is a solution.

\((\Leftarrow )\quad \) Let F be a solution to \(\mathscr {I}\). Since F must contain a path from \(v_i\) to some \(z_i\in U^i\) for every \(i\in \{1,\ldots ,k\}\), there are at most \(\left( {\begin{array}{c}k\\ 2\end{array}}\right) \) edges left to connect. Let \(Z:= \{z_1,\dots ,z_k\}\) be the vertices such that \(v_i\) is connected with \(z_i\) in \(G[F][U^i]\). As

$$\begin{aligned} d\ge {{\,\textrm{dist}\,}}_{G'[F]}(v_i,v_j) = {{\,\textrm{dist}\,}}_{G'[F]}(v_i,z_i)+{{\,\textrm{dist}\,}}_{G'[F]}(z_i,z_j)+{{\,\textrm{dist}\,}}_{G'[F]}(z_j,v_j) \end{aligned}$$

and \(d-1={{\,\textrm{dist}\,}}_{G'[F]}(v_i,z_i)+{{\,\textrm{dist}\,}}_{G'[F]}(z_j,v_j)\), it follows that \({{\,\textrm{dist}\,}}_{G'[F]}(z_i,z_j)=1\). Thus, G[Z] forms a multicolored clique. \(\square \)

5 Connecting Habitats at Small Diameter

Lastly, we consider requiring short pairwise reachability in 1-Reach GBP.

Problem 7

Input:An undirected graph \(G=(V,E)\), a set \(\mathscr {H}=\{V_1,\dots ,V_r\}\) of habitats where \(V_i\subseteq V\) for all \(i\in \{1,\ldots , r\}\), and an integer \(k\in \mathbb {N}_0\).

Question:Is there a subset \(F\subseteq E\) with \(|F|\le k\) such that for every \(i\in \{1,\ldots , r\}\) it holds that \(V_i\subseteq V(G[F])\) and \(G[F][V_i]\) has diameter d?

In particular, \(G[F][V_i]\) is required to be connected. Note that 1-Reach GBP reduces to Diam GBP (where d is part of the input and then set to the number of vertices in the input instance’s graph). We have the following.

Theorem 3

d -Diam GBP is,

  1. (i)

    if \(d=1\), solvable in linear time;

  2. (ii)

    if \(d=2\), \({\text {NP}}\)-hard even if \(r=1\).

Moreover, d -Diam GBP admits a problem kernel with at most 2k vertices and at most \(2^{2k}\) habitats.

1-Diam GBP is equivalent to 1-Closed GBP, which is linear-time solvable by Observation 15. Thus, Theorem 3() follows. Applying Reduction Rule 2 and 5 and deleting all non-habitat vertices yields the problem kernel. At the end of this section we show that 2-Diam GBP most likely does not admit a polynomial kernel with respect to k. We now show that 2-Diam GBP is \({\text {NP}}\)-hard even if there is only one habitat.

Proposition 13

2-Diam GBP is \({\text {NP}}\)-hard even if \(r=1\).

Fig. 8
figure 8

Illustration for 2-Diam GBP with \(r=1\)

Construction 7

Let \(\mathscr {I}=(G,k)\) with \(G=(V,E)\) be an instance of Vertex Cover and assume without loss of generality that \(V=\{1,\dots ,n\}\) and \(E=\{e_1,\dots ,e_m\}\). Construct an instance \(\mathscr {I}':= (G',\{V_1\},k')\) with \(k':=3m+2n+12+k\) as follows (see Fig. 8 for an illustration). Add the vertex sets \(V_E:= \{v_e\mid e\in E\}\) and \(V_G=\{v_i\mid i\in V\}\), as well as the vertex set \(V_A:= \{x\}\cup \{y_i\mid i\in \{1,2,3\}\}\cup \{z_i\mid i\in \{1,\dots ,4\}\}\). Add all vertices to \(V_1\). Next, for each \(e=\{i,j\}\in E\), connect \(v_e\) with \(v_i\), \(v_j\), \(y_1\), and \(z_3\). For each \(i\in V\), connect \(v_i\) with x, \(y_1\), and \(y_3\). Lastly, add the edge set

$$\begin{aligned} E^*:= & {} \big \{\{y_1,y_2\},\{y_2,y_3\},\{y_1,z_1\},\{y_1,z_2\},\{y_3,z_3\},\{y_3,z_4\},\{y_3,x\}, \\{} & {} \{z_1,z_4\},\{z_1,z_2\},\{z_2,z_3\},\{z_2,x\},\{z_3,z_4\}\big \} \end{aligned}$$

to \(E'\). Let \(E_V^1 := \{\{y_1,v_i\} \mid i \in V\}\), \(E_V^3 := \{\{y_3,v_i\} \mid i \in V\}\), \(E_{E}^1:=\{\{y_1,v_e\} \mid e \in E\}\), and \(E_{E}^3:=\{\{z_3,v_e\} \mid e \in E\}\). \(\diamond \)

Observation 19

Let \(\mathscr {I}'\) be the instance obtained from some instance \(\mathscr {I}\) using Construction 7. If \(\mathscr {I}'\) is a yes-instance, then every solution F for \(\mathscr {I}'\) contains the edge set \(F':= E^*\cup E_V^1\cup E_V^3\cup E_E^1\cup E_E^3\).

Proof

Let \(\mathscr {I}'\) be a yes-instance and let F be a solution. Note that in \(G'-\{y_1\}\), there is no path of length at most two from any vertex in \(V_E\cup V_G\) to \(z_1\). Hence, \(E_V^1\cup E_E^1\subseteq F\). In \(G'-\{y_3\}\), there is no path of length at most two from any vertex in \(V_G\cup \{x\}\) to \(z_4\). Hence, \(E_V^3\subseteq F\). In \(G'-\{z_3\}\), there is no path of length at most two from any vertex in \(V_E\) to \(z_4\). Hence, \(E_E^3\subseteq F\). In \(G'-\{z_2\}\), there is no path of length at most two from x to \(z_1\). Lastly, it is not difficult to see that every edge in \(E^*\) must be in F. \(\square \)

We are set to prove the correctness of Construction 7.

Lemma 20

Let \(\mathscr {I}'\) be the instance obtained from some instance \(\mathscr {I}\) using Construction 7. Then, \(\mathscr {I}\) is a yes-instance if and only if \(\mathscr {I}'\) is a yes-instance.

Proof

\((\Rightarrow )\quad \) Let \(S\subseteq V\) be a vertex cover of size k. Let \(F'\) denote the set of all edges required to be in a solution due to Observation 19. Let \(F_V:= \{\{v_i,x\}\mid i\in S\}\). We define the auxiliary function \(g:E\rightarrow V_G\) with \(g(\{i,j\})=v_{\min (\{i,j\}\cap S)}\). Let \(F_E:= \bigcup _{e\in E} \{\{v_e,g(e)\}\}\). Let \(F:= F'\cup F_V\cup F_E\). Note that \(|F|=|F'|+|F_V|+|F_E|\le (2m+2n+12)+k+m = k'\). Next consider \(G'[F][V_1]\). Observe that \({{\,\textrm{dist}\,}}_{G'[F][V_1]}(v,w)\le 2\) for every vertices \(v\in V_G\cup V_E\cup V_A\) and \(w\in V_A\setminus \{x\}\), for every vertices \(v,w\in V_G\), for every vertices \(v,w\in V_E\), and for every vertices \(v\in V_G\) and \(w=\{x\}\). We claim that for all \(e \in E\), \({{\,\textrm{dist}\,}}_{G'[F][V_1]}(x,v_e)=2\). By construction, \({{\,\textrm{dist}\,}}_{G'[F][V_1]}(x,v_e)>1\). Suppose that there is \(v_e\) with \(e=\{i,j\}\) and \({{\,\textrm{dist}\,}}_{G'[F][V_1]}(x,v_e)>2\). Then there is no path \((x,v,v_e)\) with \(v\in \{v_i,v_j\}\). Then \(\{i,j\}\cap S=\emptyset \), contradicting the fact that S is a vertex cover.

\((\Leftarrow )\quad \) Let F be a solution to \(\mathscr {I}'\). Let \(F'\) be the set of edges mentioned in Observation 19; so \(F' \subseteq F\). Note that \(|F'| = 2m + 2n + 12\). Observe that in \(G'-V_G\), the distance of x to any \(v_e\in V_E\) is larger than two. Hence, for each \(v_e\), there is a path \((v_e,v,x)\) in \(G'[F][V_1]\) with \(v\in V_G\). We claim that \(S:= \{i\in V\mid \{v_i,x\}\in F\}\) is a vertex cover for G of size at most k. Suppose not, that is, there is an edge \(e=\{i,j\}\) with \(e\cap S=\emptyset \). This contradicts the fact that there is a path \((v_e,v,x)\) in \(G'[F][V_1]\) with \(v\in V_G\). It remains to show that \(|S|\le k\). As F contains an edge \(\{v_e,v\}\) with \(v \in V_G\) for every \(e \in E\), \(|S| = |F\cap \{\{v_i,x\} \mid i\in V\}| \le k'-(|F'|+m) = k\), and the claim follows. \(\square \)

Additionally, we have the following kernelization lower bound for 2-Diam GBP.

Proposition 14

Unless \({\text {NP}}\subseteq {\text {coNP}}/{\text {poly}}\), 2-Diam GBP admits no problem kernel of size polynomial in k.

Fig. 9
figure 9

Illustration for 2-Diam GBP. Here, \(V^q\) denotes all sets \(V_{\{q,\cdot \}}\)

Construction 8

Let \(\mathscr {I}=(U,\mathscr {F},k)\) with \(U=\{u_1,\dots ,u_n\}\) and \(\mathscr {F}=\{F_1,\dots ,F_m\}\) be an instance of Hitting Set. Construct an instance \(\mathscr {I}':= (G',\mathscr {H},k')\) with \(k'=n+\left( {\begin{array}{c}n\\ 2\end{array}}\right) +k\) as follows (see Fig. 9 for an illustration).

Let \(V:= V_\mathscr {F} \cup V_U\cup \{x\}\), where \(V_F:= \{v_F\mid F\in \mathscr {F}\}\) and \(V_U:= \{v_i\mid u_i\in U\}\). Add the edge sets \(E':= \{\{v_i,v_{F_j}\}\mid u_i\in F_j\}\), \(E_U:= \{\{v_i,v_j\}\mid \{i,j\}\in \left( {\begin{array}{c}n\\ 2\end{array}}\right) \}\), and \(E_x:= \{\{x,v_i\}\mid i\in \{1,\ldots ,n\}\). The habitats \(\mathscr {H}=\mathscr {H}_\mathscr {F}\cup \mathscr {H}_U\) are defined as follows. For each \(F\in \mathscr {F}\), there is the habitat \(V_F\in \mathscr {H}_\mathscr {F}\) with \(V_F:= \{x,v_F\}\cup \{v_i\mid u_i\in F\}\). For each \(\{i,j\}\in \left( {\begin{array}{c}n\\ 2\end{array}}\right) \), there is the habitat \(V_{\{i,j\}}\in \mathscr {H}_U\) with \(V_{\{i,j\}}:= \{v_i,v_j\}\). Finally, let \(k':= n+\left( {\begin{array}{c}n\\ 2\end{array}}\right) +k\). \(\diamond \)

Due to \(\mathscr {H}_U\), we know that every solution needs to contain every edge in the clique induced by \(V_U\).

Observation 21

Let \(\mathscr {I}'\) be the instance obtained from some instance \(\mathscr {I}\) using Construction 8. If \(\mathscr {I}'\) is a yes-instance, then every solution F for \(\mathscr {I}'\) contains the edge set \(E_U\).

Lemma 22

Let \(\mathscr {I}'\) be the instance obtained from some instance \(\mathscr {I}\) using Construction 8. Then, \(\mathscr {I}\) is a yes-instance if and only if \(\mathscr {I}'\) is a yes-instance.

Proof

\((\Rightarrow )\quad \) Let \(S\subseteq U\) be a hitting set of size k. We define the auxiliary function \(g:\mathscr {F}\rightarrow V_U\) with \(g(F)=v_{\min \{i\mid u_i\in S\cap F\}}\). Let \(X_\mathscr {F}:= \bigcup _{F\in \mathscr {F}} \{\{v_F,g(F)\}\}\). Then \(X=E_U\cup X_\mathscr {F}\cup \{\{x,v_i\}\mid u_i\in S\}\) is a solution, as for every \(F \in \mathscr {F}\), \(G[X][V_F]\) contains as a subgraph a star with center g(F) and leaves x and \(V_U \setminus \{ g(F) \}\), thus it is of diameter at most two.

\((\Leftarrow )\quad \) Let X be a solution to \(I'\). Due to Observation 21, we know that \(E_U\subseteq X\). Moreover, every vertex in \(V_\mathscr {F}\) has a neighbor in \(V_U\). We claim that \(S:= \{u_i\mid \{x,v_i\}\in X\}\) is a solution to I. Suppose not. Then there exists a set \(F \in \mathscr {F}\) with \(S\cap F = \emptyset \). As \({{\,\textrm{diam}\,}}(G[X][V_F]) \le 2\), we have that the distance between \(v_F\) and x is at most two. But then X must contain both \(\{v_F, v_i\}\) and \(\{v_i, x\}\) for some \(i \in \{1, \dots , n\}\). But then, by construction of \(E'\), we have \(u_i \in S \cap F\), a contradiction. \(\square \)

6 Conclusion, Discussion, and Outlook

We modeled the problem of placing wildlife crossings with three different problem families: d -Reach GBP, d -Closed GBP, and d -Diam GBP. We studied the practically desired cases \(d=1\) and \(d=2\), as well as the cases \(d\ge 3\). For all three problems, we settled the classic as well as the parameterized complexity (regarding the number k of wildlife crossings and the number r of habitats). All three problems become \({\text {NP}}\)-hard already for \(d=2\), and d -Reach GBP even for \(d=1\), in most of the cases on restricted input graphs and only few habitats. However, all three variants are fixed-parameter tractable regarding k in the case of \(d=2\), whereas, for \(d \ge 3\), d -Reach GBP and d -Closed GBP turn out to be intractable (yet in \({\text {XP}}\)) for this parameter. Thus, the less desired cases \(d\ge 3\) are also algorithmically rather impractical. Moreover, d -Closed GBP and d -Diam GBP are tractable if the number r of habitats and the maximum degree \(\Delta \) of the graph are small, which is expected to be likely in real-world applications.

Discussion

We derived an intriguing interrelation of connection requirements, data quality, and computational and parameterized complexity. While each problem admits its individual complexity fingerprint, each of them depends highly on the value of d, the level of the respective connectivity constraint. This value can reflect the quality of the given data, since naturally we assume that habitats are connected. The worse the data, the stronger are the relaxations according to the connectivity of habitats, and thus the larger is the value of d. Our results show that having very small (\(d=2\)) data gaps already leads to the problems becoming \({\text {NP}}\)-hard, and that even larger gaps (\(d\ge 3\)) yield \({\text {W[1]}}\)-hardness (when parameterized by k). Hence, knowledge about habitats, connections, and data quality decide which problem models can be applied, thus influencing the computation power required to determine an optimal placement of wildlife crossings. For instance, for larger networks, we recommend to ensure data quality such that one of our proposed problems for \(d\le 2\) becomes applicable. This in turn emphasizes the importance of careful habitat recognition.

In our models, we neglected that different positions possibly lead to different costs of building bridges (i.e., edge costs). This neglect is justified when differentiating between types of bridges (and thus their costs) is not necessary (e.g., if the habitat’s species share preferred types of green bridges, and the underlying human-made transportation lines are homogeneous). In other scenarios, additionally considering these costs may be beneficial for decision-making.

Outlook and Open Problems

As for algorithmic questions to the established problems, there are a few immediate questions that are unanswered in our work. While 1-Reach GBP is \({\text {NP}}\)-hard even if \(r \ge 7\) but polynomial-time solvable if \(r \le 2\), its complexity for \(2< r < 7\) remains open. Note that we obtained an \(O(rd)\)-approximation for d-Reach GBP, which possibly leaves room for improvement and does not directly transfer to the other two problem variants. It may be attractive to find out whether the problems admit FPT approximation algorithms as well. For \(d \le 2\), all our problems allow for problem kernels where the number of vertices only depends on k, but it is presumed impossible to have a polynomial dependence on k. If however the underlying street network is planar, then the input graphs to our problems can be seen as their planar dual. Therefore, it is likely that the input graphs are planar in real-world applications. In a follow-up work [23] we studied 1-Reach GBP with habitats that induce cycles and planar input graphs and analyzed the algorithms (among them the approximation algorithm from Proposition 1) on real-world graphs with synthetic habitats.

We conclude our work with some suggestions for extending our models. Interesting directions here include, for instance, distinguishing types of green bridges to place, taking into account possible movement directions within habitats (connectivity in directed graphs), identifying real-world driven problem parameters leading to tractability, or the problem of maintaining and servicing green bridges over time under a possible seasonal change of wildlife habitats (temporal graph modeling could fit well).