1 Introduction

It is commonly believed that no NP-complete problem is solvable in polynomial time. However, while all NP-complete problems are equivalent with respect to polynomial time reductions, they appear to be very different with respect to the best exponential time exact solutions. In particular, a number of NP-complete problems can be solved much faster than the obvious algorithm that enumerates all possible solutions; examples are Independent Set [12], Dominating Set [12, 21], Chromatic Number [3] and Bandwidth [6]. The race for the fastest exact algorithm inspired several very interesting tools and techniques such as Fast Subset Convolution [2] and Measure&Conquer [12] (for an overview of the field we refer the reader to a recent book by Fomin and Kratsch [11]).

For several problems, including TSP, Chromatic Number, Permanent, Set Cover, #Hamiltonian Cycles and SAT, the currently best known time complexity is of the form O(2n n O(1)), which is a result of applying dynamic programming over subsets, the inclusion-exclusion principle or a brute force search. The question remains, however, which of those problems are inherently so hard that it is not possible to break the 2n barrier and which are just waiting for new tools and techniques still to be discovered. In particular, the hardness of the k-SAT problem is the starting point for the Strong Exponential Time Hypothesis of Impagliazzo and Paturi [5, 15], which is used as an argument that other problems are hard [7, 9, 16, 17]. Recently, on the positive side, O(c n) time algorithms for a constant c<2 have been developed for Sched [8], Maximum Induced Planar Subgraph [13] and (a major breakthrough in the field) for the undirected version of the Hamiltonian Cycle problem [1]. In most cases breaking the 2n-barrier gives an O(c n)-time algorithm with c significantly smaller than 2.

In this paper we study the 2-Disjoint Connected Subgraphs problem:

figure a

We call vertices from Z 1Z 2 terminals and all other vertices non-terminals. A general version of this problem (that is when we consider arbitrary number of sets) was used as one of tools in the celebrated result of Robertson and Seymour [19], that the Minor Containment problem can be solved in polynomial time for every fixed pattern graph H. In literature, the solution (A 1,A 2) is sometimes required to be a partition of V. Note that this does not simplify the problem: in our setting, if G is connected, the superfluous vertices can always be attached to one of the sets A 1 or A 2, while otherwise the instance is trivial.

Previous Work

Gray et al. [14] show that the 2-Disjoint Connected Subgraphs problem is NP-complete even for the class of planar graphs. The motivation for this variant comes from an application in computational geometry, namely finding a realization of an imprecise terrain that minimizes the total number of local minima and local maxima. Furthermore, van ’t Hof et al. [22] proved that the problem remains NP-complete even if |Z 1|=2.

From the exact exponential time algorithms perspective the authors in [22] show that one can solve 2-Disjoint Connected Subgraphs in O((2−ε())n) time for any n-vertex P -free graph. This line of research was continued by Paulusma and van Rooij [18], where the authors present an algorithm with O(1.2051n) running time complexity for P 6-free graphs and split graphs.

Our Results

In [18] Paulusma and van Rooij ask whether it is possible to solve the 2-Disjoint Connected Subgraphs problem in general graphs faster than using the trivial O(2n n O(1)) algorithm. In this paper we answer this question affirmatively and present an O(1.933n) time and polynomial space algorithm. Our approach is based on the branch and reduce technique and a combinatorial study of the case when the number of terminal vertices is small.

Theorem 1

One can solve the 2-Disjoint Connected Subgraphs problem in O(1.933n) running time and polynomial space.

To break the 2n barrier we heavily use the fact that in the instance size n we count not only non-terminals but also terminal vertices. Observe that the naive brute-force algorithm, which for every partition of V∖(Z 1Z 2) checks whether A 1Z 1,A 2Z 2 can be found within its sides, runs in O(2k n O(1)) time, where k is the number of non-terminals. Therefore, it is natural to ask whether it is possible to obtain also an O((2−ε)k n O(1)) algorithm. Using a recent hardness result (under the Strong Exponential Time Hypothesis; see Sect. 2 for an exact statement) of Cygan et al. [9] for the Set Splitting problem, we show that this is not the case: breaking the 2k barrier is hard.

Theorem 2

There does not exist an epsilon ε>0 and an algorithm running in O((2−ε)k|V|O(1)) time for the 2-Disjoint Connected Subgraphs problem unless the Strong Exponential Time Hypothesis is false.

We should note that the Strong Exponential Time Hypothesis is a very strong assumption, and not widely believed, as it is the case of its weaker cousin, the Exponential Time Hypothesis (which is still much stronger than the statement PNP). However, as noted in [16], SETH-based lower bounds still make sense: one should probably wait with trying to break a SETH-hard barrier until a faster SAT algorithm is discovered.

Since the naive O(2k n O(1)) time algorithm for 2-Disjoint Connected Subgraphs shows that the problem is fixed-parameter tractable, a usual next step is to investigate the kernelization possibilities for the problem (see Sect. 2 for respective definitions). Using the kernelization hardness result of Dom et al. [10] for the Colour Hitting Set problem parameterized by the size of the universe we show that 2-Disjoint Connected Subgraphs parameterized by the number of non-terminal vertices is unlikely to admit a polynomial kernel.

Theorem 3

The 2-Disjoint Connected Subgraphs problem parameterized by the number of non-terminals does not admit a polynomial kernel unless NPcoNP/poly.

As a byproduct we prove a kernelization hardness result for Set Splitting parameterized by the size of the universe, which is of independent interest.

figure b

Theorem 4

The Set Splitting problem parameterized by the universe size does not admit a polynomial kernel unless NPcoNP/poly.

Organization of the Paper

In Sect. 2 we provide the reader with the necessary definitions. Section 3 is devoted to the details of the O(1.933n) algorithm for 2-Disjoint Connected Subgraphs, while in Sect. 4 we present the negative results for the parameterization by the number of non-terminals. Concluding remarks are gathered in Sect. 5.

2 Preliminaries

Notation

For an undirected graph G=(V,E) and a subset of vertices XV by G[X] we denote the subgraph induced by X. An articulation point in G is a vertex, whose removal increases the number of connected components of G.

For a universe U and two subsets X,YU we say that X splits Y if YX≠∅ and Y∩(UX)≠∅.

Parameterized Complexity

In the parameterized complexity setting, an instance comes with an integer parameter k—formally, a parameterized problem Q is a subset of \(\varSigma^{*} \times \mathbb{N}\) for some finite alphabet Σ. We say that the problem is fixed parameter tractable (FPT) if there exists an algorithm solving any instance (x,k) in time f(k)poly(|x|) for some (usually exponential) computable function f. It is known that a problem is FPT iff it is kernelizable: a kernelization algorithm for a problem Q takes an instance (x,k) and in time polynomial in |x|+k produces an equivalent instance (x′,k′) (i.e., (x,k)∈Q iff (x′,k′)∈Q) such that |x′|+k′≤g(k) for some computable function g. The function g is the size of the kernel, and if it is polynomial, we say that Q admits a polynomial kernel.

The hardness of kernelization can be obtained in a reduction-like manner by polynomial-time transformations from problems known to be hard to kernelize.

Definition 1

[4]

Let P and Q be parameterized problems. We say that P is polynomial parameter reducible to Q, written P p Q, if there exists a polynomial time computable function \(f:\varSigma^{*}\times { \mathbb {N} }\to\varSigma^{*} \times { \mathbb {N} }\) and a polynomial p, such that for all \((x,k) \in\varSigma^{*} \times { \mathbb {N} }\) the following holds: (x,k)∈P iff (x′,k′)=f(x,k)∈Q and k′≤p(k). The function f is called a polynomial parameter transformation.

Theorem 5

[4]

Let P and Q be parameterized problems and \(\tilde{P}\) and \(\tilde {Q}\) be the unparameterized versions of P and Q respectively. Suppose that \(\tilde{P}\) is NP-hard and \(\tilde{Q}\) is in NP. Assume there is a polynomial parameter transformation from P to Q. Then if Q admits a polynomial kernel, so does P.

Exponential Time Hypothesis [5, 15]

Let c k be the infimum of a set of reals c for which there exists an algorithm solving the k-CNF-SAT problem in time O(c n), where n is the number of variables in the input formula. The Exponential Time Hypothesis (ETH) asserts that c 3>1, whereas the Strong Exponential Time Hypothesis (SETH) asserts that lim k→∞ c k =2. In particular, SETH implies that satisfiability of an arbitrary boolean formula cannot be checked significantly faster than by trying all possible assignments.

3 Algorithm

In this section we provide an algorithm solving the 2-Disjoint Connected Subgraphs problem in O(1.933n) time, where n is the total number of vertices in the input graph. Recall that in the 2-Disjoint Connected Subgraphs problem the vertices were divided into three groups—A 1 , A 2 and V∖(A 1A 2). The algorithm will be simpler to present if we merge A 2 with V∖(A 1A 2). This means that we drop the condition that A 2 is connected, requiring instead that all vertices from Z 2 are in the same connected component of G[A 2]. Formally, we consider the following problem:

figure c

First notice that if we fix A 1, then checking the correctness of a partition is a polynomial-time operation.

Let ε=0.0493. If |Z 1|+|Z 2|≥ε|V|, we can simply iterate over all possible choices of A 1Z 1—this is a subset of V∖(Z 1Z 2), so we have an \(O(2^{|V| - |{ Z_{1} }| - |{ Z_{2} }|}n^{O(1)}) \subseteq O(2^{(1-\varepsilon )n}n^{O(1)}) \subseteq O( 1.933 ^{n})\) algorithm solving the problem. From now on we assume |Z 1|+|Z 2|<εn. Additionally we assume that |Z 1|≤|Z 2|, which means |Z 1|<εn/2.

We will be looking for a set A 1 which is minimal with respect to inclusion. Let us fix one such set. Let G′=G[A 1]. Notice that any vertex rA 1Z 1 has to be an articulation point in G′, otherwise we could move it from A 1 to A 2 and still have a valid solution. We will prove the following lemma:

Lemma 1

Let H be any graph with at least 2 vertices. Let k be the number of vertices of H that are not articulation points, and let l be the number of articulation points of degree at least three. Then 3k−6≥l.

The proof has been postponed to Sect. 3.2.

Let us call all the vertices of Z 1 and those vertices of A 1 with degree larger than 2 in G′ jointly branching points. As |Z 1|≤εn/2, by Lemma 1 applied to G′ we have that G′ contains at most 2εn−6 branching points.

Notice that we can assume that no vertex in A 1Z 1 is of degree 0 or 1 in G[A 1] (because, again, we could remove it to achieve a smaller solution)—thus all the vertices that are not branching points have to be of degree two in G[A 1].

We now pursue a branch and reduce algorithm. A state of our algorithm is an instance (G=(V,E),Z 1,Z 2) of the Modified 2-Disjoint Connected Subgraphs problem, plus a set A 2Z 2 of vertices that we have already chosen to be in A 2 . The running time of our algorithm depends on two numbers:

  • N=|VA 2|—the number of vertices of the graph not yet chosen to A 2;

  • K—the upper limit on the number of branching points in the graph.

Formally, we describe a procedure solve(G,Z 1,Z 2,A 2,K) that either:

  1. 1.

    reports a valid solution (A 1′,A 2′) to the Modified 2-Disjoint Connected Subgraphs problem, such that A 2A 2′, or

  2. 2.

    reports NO, correctly claiming that the Modified 2-Disjoint Connected Subgraphs instance (G,Z 1,Z 2) has no solution (A 1′,A 2′), such that A 2A 2′ and A 1′ has at most K branching points.

Note that the outcomes above are not exclusive: if the input Modified 2-Disjoint Connected Subgraphs instance has a solution, but only with more than K branching points, the algorithm can report any of the answers.

Let δ=(|Z 1|+|Z 2|)/|V|, recall we assume δε. The starting value of N is no larger than (1−δ/2)|V|. Lemma 1 ensures us that solve(G,Z 1,Z 2,Z 2,2δ|V|−6) reports a solution if and only if the Modified 2-Disjoint Connected Subgraphs instance (G,Z 1,Z 2) is a YES-instance.

Let T(N,K) be the worst-case cost of executing our algorithm for given values of N and K. We need to prove that T((1−δ/2)n,2δn−6)≤1.933n for any 0≤δε.

We will also describe a similar procedure solve (G,Z 1,Z 2,A 2,K,w), where in addition to the input graph as in the original problem, we have a single vertex w, adjacent to some tZ 1, and we already decided that wA 1 (we did not decide whether w is a branching point or not). Let T (N,K) denote the worst-case complexity of executing our algorithm for given values of N and K in this case. We will simultaneously prove the following two inequalities:

It is easy to check this suffices to prove Theorem 1. As all the inequalities presented further are not tight within very small constants, the obtained bound on the running time is in fact slightly better; therefore, we can suppress all the polynomial factors using this error.

3.1 Reduction Rules

We provide a set of reduction rules. The algorithm at each point finds the lowest-number reduction rule applicable and applies it. Finding and applying a single reduction rule will trivially be a polynomial-time operation.

During the algorithm we will assign vertices both to A 1 and A 2. A feature of our algorithm is that a vertex v can be assigned to A 1 only if there is some wZ 1 adjacent to it. When we assign v to A 1, we will represent this by contracting the edge vw. Note that the resultant instance is fully equivalent to the original—if (A 1,A 2) is a valid solution in the reduced graph, then (A 1∪{v},A 2) is a valid solution in the original graph, and conversely if (A 1,A 2) is a valid solution in the original graph, and vA 1, then (A 1v,A 2) is a valid solution in the reduced graph.

If we find a solution in any of the branches, we return it as the witness of the positive answer for the problem. If we find no solution, we return NO.

3.1.1 Reduction Rules for solve(G,Z 1,Z 2,A 2,K)

Reduction Rule 1

If there are two vertices from Z 1 in different components of G[VA 2], return NO from this branch.

Reduction Rule 2

If |Z 1|=1, we check whether all the vertices of Z 2 lie in the same connected component of G[VZ 1]. If yes, we report a solution (Z 1,VZ 1). If no, we return NO from this branch.

Reduction Rule 3

If K<|Z 1|, we return NO from this branch.

Reduction Rule 4

If there are two adjacent vertices t,t′∈Z 1, contract the edge ttand reduce K by one.

Reduction Rule 5

If there is a vertex w adjacent to some tZ 1 (necessarily wZ 1), we branch. We will either put it in A 2 in the solution, or choose it to be a part of A 1 and proceed to the second variant of the problem.

To check the complexity assumptions in this case, we verify that the running time after applying the reduction rule is at most the claimed bound on T(N,K):

The correctness of all the above rules is trivial.

3.1.2 Reduction Rules for solve (G,Z 1,Z 2,A 2,K,w)

Recall that now we have a vertex w which we already know to be in A 1, and which is adjacent to some tZ 1.

Reduction Rule 6

If w is adjacent to some vertex t′∈Z 1 other than t, we contract the edges tw and tw, and decrease K by one.

Notice that as we contracted two vertices from Z 1 into a single vertex in this case, we have at least one branching point less in the reduced graph than in the original. To check the complexity assumptions in this case, we verify that the running time after applying the reduction rule is at most the claimed bound on T (N,K):

$$T(N-2, K-1) \leq 1.5901 ^{N-2} 8.109 ^{K-1} \leq 0.3711 \cdot 1.5901 ^N 8.109 ^K. $$

Reduction Rule 7

If w has no neighbours outside Z 1A 2, return NO from this branch.

This can be justified as follows: for any solution A 1 containing w, the set A 1w is also a valid solution, and we are looking only for inclusion-minimal sets A 1.

Reduction Rule 8

If w has only a single neighbour woutside Z 1A 2, contract the edge tw and proceed treating was the new w.

The justification of this is that again, if w′ were not to be a part of the solution, we could also remove w from the solution.

Reduction Rule 9

If w has more than one neighbour outside Z 1A 2, we branch. We either decide w is a branching point (in which case we contract tw, reduce the limit on the number of branching points by one, and return to the original problem), or that it is not. In the latter case, exactly one of the neighbours of w is in the solution—thus we branch on which one is it, contract the edge tw, put the remaining neighbours of w in A 2 and proceed treating the selected neighbour as the new w.

To check the complexity assumptions we verify that for any d≥3 the running time after applying the reduction rule is at most the claimed bound on T (N,K):

As d/(d−1)≤1.5<1.5901 for d≥3, the above inequality may be verified only for d=3.

3.2 Proof of Lemma 1

Lemma 2

(Lemma 1, Restated)

Let H be any graph with at least 2 vertices. Let k be the number of vertices of H that are not articulation points, and let l be the number of articulation points of degree at least three. Then 3k−6≥l.

Proof

Let us denote m=3kl, our goal is to prove that for any graph H we have m≥6. Let us assume the contrary: there exist graphs for which m<6. Let H 0 be the one with minimum number of vertices, a minimal counterexample. We now examine the structure of H 0 in order to find a contradiction.

We first claim that H 0 is connected. If H 0 is edgeless, k≥2, l=0 and 3kl≥6. If H 0 contains an isolated vertex v, H 0 has at least three vertices, and by deleting v we obtain a smaller counterexample, as we decrease k and keep the value of l. Otherwise, we note that m is additive with respect to connected components, so in case of disconnectedness one of its components would be a smaller counterexample with at least two vertices.

Observe that H 0 cannot have an articulation point of degree 2. In such a situation we could contract one of the incident edges; this operation changes neither k nor l, so m stays the same and we obtain a smaller counterexample.

Now assume that H 0 contains an articulation point v, such that we can partition the connected components of H 0[V∖{v}] into two parts with vertex sets V 1,V 2, for which |V 1|,|V 2|>1. Note that H 0[V 1∪{v}] and H 0[V 2∪{v}] are connected. As the degree of v is at least 3, let us assume without losing generality that the degree of v in H 0[V 1∪{v}] is at least 2. Consider two graphs:

  • H 1, being H 0[V 1∪{v}] with a pendant (a degree-1 vertex) attached to v;

  • H 2:=H 0[V 2∪{v}].

Both H 1 and H 2 have less vertices than H 0, so if for i=1,2 we denote by k i ,l i the numbers of non-articulation points and articulation points of degree at least 3 in H i respectively, then m i :=3k i l i ≥6.

Observe that kk 1+k 2−2, as every vertex from V∖{v} that was a non-articulation point in a corresponding H i is also a non-articulation point in H 0, while v is an articulation point in H 1. Moreover, ll 1+l 2, as every articulation point of degree at least 3 in H 0 is also an articulation point of degree at least 3 in either H 1 or H 2. Hence,

$$m=3k-l\geq3(k_1+k_2-2)-(l_1+l_2)=m_1+m_2-6\geq6, $$

a contradiction with H 0 being a counterexample.

Take any articulation point v in H 0. As the partition described above is not possible, removing v from the graph results in H 0 being split into exactly two connected components: one of size |V(H)|−2 and one of size 1. Therefore, every articulation point in H 0 has a neighbour of degree 1, which obviously is not an articulation point. Hence, lk and, consequently, 6>3kl≥2k, which leads to lk≤2. Now observe that

  • if l=0, then k≥2 as H 0 has at least two vertices, so m≥6, a contradiction;

  • if l=1, then the only articulation point must have at least three neighbours, so k≥3, a contradiction;

  • otherwise l=2 and the graph is isomorphic to P 4, a contradiction as well.

In each case we obtained a contradiction, which finishes the proof. □

Remark 1

One might wonder whether the constants obtained in the proof are optimal, and whether we could strengthen the bound to achieve a better complexity of the algorithm. In fact, this is not the case: there exists an infinite family of graphs with unbounded k,l, for which the inequality from Lemma 1 is tight. An example of such a graph is one constructed from a set of disjoint triangles by connecting them in a tree-like manner by bridges, and by adding a degree-1 neighbours to some of the vertices of the triangles, such that each vertex of the triangles has degree exactly three.

4 The 2-Disjoint Connected Subgraphs Problem Parameterized by the Number of Non-terminals

In this section we consider the 2-Disjoint Connected Subgraphs problem parameterized by the number of non-terminals and prove Theorems 2 and 3.

First we prove that the Set Splitting problem parameterized by the size of the universe does not admit a polynomial kernel unless NPcoNP/poly (that is, prove Theorem 4), which we later use for the kernelization hardness of 2-Disjoint Connected Subgraphs. As the starting point we use the following result of Dom et al. [10].

figure d

Theorem 6

[10]

The Colour Hitting Set problem parameterized by the size of the universe does not have a polynomial kernel unless NPcoNP/poly.

Lemma 3

There exists a polynomial time algorithm which given an instance \(I=({ \mathcal {F} },U)\) of Colour Hitting Set creates an instance \(I'=({ \mathcal {F} }',U')\) of Set Splitting, where |U′|=|U|+2, such that I is a YES-instance iff Iis a YES-instance.

Proof

Let \(I=({ \mathcal {F} },U,k,c)\) be an instance of Colour Hitting Set. We create the following instance \(I'=({ \mathcal {F} }',U')\) of Set Splitting. As the universe U′ we take U′=U∪{u in,u out}. As the family \({ \mathcal {F} }'\) we set \({ \mathcal {F} }'=\{\{u_{{\mathrm {out}}}\} \cup S\ :\ S \in { \mathcal {F} }\} \cup\{\{u_{{\mathrm {in}}}, u_{{\mathrm {out}}}\}\} \cup\{ \{u_{{\mathrm {in}}},u_{1},u_{2}\}\ :\ u_{1},u_{2}\in U \wedge u_{1}\neq u_{2} \wedge c(u_{1})=c(u_{2})\}\). We want to prove that I is a YES-instance of Colour Hitting Set iff I′ is a YES-instance of Set Splitting.

First assume that I is a YES-instance of Colour Hitting Set and let XU be any solution. We claim that X′=X∪{u in} is a solution to Set Splitting. Obviously we split the set {u in,u out}. Since each set in \({ \mathcal {F} }\) contains an element of X and u outX′ we infer that each set of \(\{\{u_{{\mathrm {out}}}\} \cup S\ :\ S \in { \mathcal {F} }\}\) is split by X′. Finally, X contains at most one element of each colour, therefore each set {u in,u 1,u 2} is split, because u inX′ and at least one element of {u 1,u 2} belongs to U′∖X′.

Now let us assume that I′ is a YES-instance of Set Splitting and let X′⊆U′ be any solution. Since by symmetry U′∖X′ is also a solution for I′, and there exists a set {u in,u out} in I′, w.l.o.g. we assume that u inX′ and u outX′. Let X=X′∖{u in}⊆U. We prove that X is a solution for the instance I. Since each set in \(\{\{u_{{\mathrm {out}}}\} \cup S\ :\ S \in { \mathcal {F} }\}\) is split by X′ and u outX′ we infer that X contains at least one vertex from each set in \({ \mathcal {F} }\). Moreover, since each set of the form {u in,u 1,u 2} is split and u inX′, we know that X contains at most one element of each colour and, consequently, I is a YES-instance. □

Theorem 4 follows from pipelining Theorems 5 and 6 and Lemma 3. Note that here we use the fact that Colour Hitting Set is NP-hard and Set Splitting is in NP. Now we show a reduction from Set Splitting to 2-Disjoint Connected Subgraphs.

Lemma 4

There exists a polynomial time algorithm which given an instance \(({ \mathcal {F} },U)\) of Set Splitting creates an instance (G=(V,E),Z 1,Z 2) of 2-Disjoint Connected Subgraphs, where |V|−|Z 1|−|Z 2|=|U|, such that \(({ \mathcal {F} },U)\) is a YES-instance iff (G,Z 1,Z 2) is a YES-instance.

Proof

Let \(({ \mathcal {F} },U)\) be an instance of the Set Splitting problem. We construct the following graph G=(V,E), where \(V=\{z_{1},z_{2}\}\cup U \cup\{v_{1}^{S},v_{2}^{S}\ :\ S\in { \mathcal {F} }\}\), that is as the vertex set we take two special vertices z 1,z 2, one vertex for each element of the universe U and two vertices for each set of the family \({ \mathcal {F} }\). We define the set of edges of the graph G as \(E=\{z_{1}u, z_{2}u\ :\ u \in U\} \cup\{v_{1}^{S}u,v_{2}^{S}u \ :\ S \in { \mathcal {F} }\wedge u\in S\}\). Finally we define \(Z_{1}=\{z_{1}\}\cup\{v_{1}^{S}\ :\ S\in { \mathcal {F} }\}\) and \(Z_{2}=\{ z_{2}\}\cup\{v_{2}^{S}\ :\ S\in { \mathcal {F} }\}\), hence the only non-terminal vertices in G are vertices of U.

Now we prove that \(({ \mathcal {F} },U)\) is a YES-instance of Set Splitting iff (G=(V,E),Z 1,Z 2) is a YES-instance of 2-Disjoint Connected Subgraphs. First assume that XU is a solution for \(({ \mathcal {F} },U)\). We set A 1=Z 1X and A 2=Z 2∪(UX). Since each set in \(S \in { \mathcal {F} }\) contains both an element of X and of UX, all the vertices from A 1 are connected to z 1 and all the vertices from A 2 are connected to z 2. Therefore, the subgraphs G[A 1] and G[A 2] are connected and, consequently, (G,Z 1,Z 2) is a YES-instance.

In the other direction assume that (G=(V,E),Z 1,Z 2) is a YES-instance and let (A 1,A 2) be a solution. We claim that X=A 1U is a solution to \(({ \mathcal {F} },U)\). Indeed, since both G[A 1] and G[A 2] are connected, we infer that each set \(S \in { \mathcal {F} }\) contains both an element of X and of UX; otherwise either vertices \(z_{1},v_{1}^{S}\) or \(z_{2},v_{2}^{S}\) would be disconnected in G[A 1] and G[A 2] respectively. □

Similarly as in the case of Theorem 4, also Theorem 3 follows from pipelining Theorems 5 and 6 and Lemmas 3 and 4. Again, we use here the fact that Colour Hitting Set is NP-hard and 2-Disjoint Connected Subgraphs is in NP. To prove Theorem 2 we pipeline Lemma 4 with the following recent result:

Theorem 7

[9]

There does not exist an epsilon ε>0 and an algorithm running in \((2-\varepsilon )^{|U|} (|U|+|{ \mathcal {F} }|)^{O(1)}\) time for the Set Splitting problem unless the Strong Exponential Time Hypothesis is false.

Remark 2

The proof of Theorem 7 in [9] reduces a κ-CNF-SAT instance (for any κ) to a Set Splitting instance with a number of sets linear in the number of clauses in the input. If we pipeline this reduction with Lemma 4, we obtain an instance with much more terminals than non-terminals: k non-terminals yields roughly k κ terminals. Therefore there is much space for improvement between the instances produced by this reduction and the ones where our O(1.933n)-time algorithm does not fall back to the brute-force solution.

5 Conclusions

In this paper we studied the general case of 2-Disjoint Connected Subgraphs problem and showed an algorithm achieving running time O(1.933n), thus breaking the 2n barrier. For the natural parameterization by the number of non-terminals we have shown a matching lower bound for the naive O(2k n O(1)) upper bound. Moreover, the existence of a polynomial kernel is unlikely.

Recently, Telle and Villanger announced an even faster exact algorithm for the 2-Disjoint Connected Subgraphs problem, with running time O(1.7804n) [20]. The work of Telle and Villanger uses a similar approach, and provides a deeper combinatorial study of the problem of connecting a set of terminals with a small number of vertices, considered from the perspective of exact algorithms.