Induced Disjoint Paths and Connected Subgraphs for $H$-Free Graphs

Paths $P_1,\ldots, P_k$ in a graph $G=(V,E)$ are mutually induced if any two distinct $P_i$ and $P_j$ have neither common vertices nor adjacent vertices. The Induced Disjoint Paths problem is to decide if a graph $G$ with $k$ pairs of specified vertices $(s_i,t_i)$ contains $k$ mutually induced paths $P_i$ such that each $P_i$ starts from $s_i$ and ends at $t_i$. This is a classical graph problem that is NP-complete even for $k=2$. We introduce a natural generalization, Induced Disjoint Connected Subgraphs: instead of connecting pairs of terminals, we must connect sets of terminals. We give almost-complete dichotomies of the computational complexity of both problems for H-free graphs, that is, graphs that do not contain some fixed graph H as an induced subgraph. Finally, we give a complete classification of the complexity of the second problem if the number k of terminal sets is fixed, that is, not part of the input.


Introduction
The well-known Disjoint Paths problem is one of the problems in Karp's list of NPcomplete problems. It is to decide if a graph has pairwise vertex-disjoint paths P 1 , . . . , P k where each P i connects two pre-specified vertices s i and t i . Its generalization, Disjoint Connected Subgraphs, plays a crucial role in the graph minor theory of Robertson and Seymour. This problem asks for connected subgraphs D 1 , . . . , D k , where each D i connects a pre-specified set of vertices Z i . In a recent paper [18] we classified, subject to a small number of open cases, the complexity of both these problems for H-free graphs, that is, for graphs that do not contain some fixed graph H as an induced subgraph.
Just as for the classical problems [18], we perform a systematic study and focus on H-free graphs. As it turns out, for the restriction to H-free graphs, the induced variants actually become computationally easier for an infinite family of graphs H. We first give some definitions.
Terminology. For a subset S ⊆ V in a graph G = (V, E), let G[S] denote the induced subgraph of G by S, that is, G[S] is the graph obtained from G after removing every vertex not in S. Let G 1 + G 2 be the disjoint union of two vertex-disjoint graphs G 1 and G 2 . We say that paths P 1 , . . . , P k , for some k ≥ 1, are mutually induced paths of G if there exists a set S ⊆ V such that G[S] = P 1 + . . . + P k ; note that every P i is an induced path and that there is no edge between two vertices from different paths P i and P j . A path P is an s-t-path (or t-s-path) if the end-vertices of P are s and t.
A terminal pair (s, t) is an unordered pair of two distinct vertices s and t in a graph G, which we call terminals. A set T = {(s 1 , t 1 ), . . . , (s k , t k )} of terminal pairs of G is a terminal pair collection if the terminals pairs are pairwise disjoint, so, apart from s i = t i for i ∈ {1, . . . , k}, we also have {s i , t i } ∩ {s j , t j } = ∅ for every 1 ≤ i < j ≤ k. We now define the following decision problem:

Induced Disjoint Paths
Instance: a graph G and terminal pair collection T = {(s 1 , t 1 ) . . . , (s k , t k )}. Question: does G have a set of mutually induced paths P 1 ,. . . ,P k such that P i is an s i -t i path for i ∈ {1, . . . , k}?
Note that as every path between two vertices s and t contains an induced path between s and t, the condition that every P i must be induced is not strictly needed in the above problem definition. We say that the paths P 1 , . . . , P k , if they exist, form a solution of Induced Disjoint Paths. We now generalize the above notions from pairs and paths to sets and connected subgraphs. Subgraphs D 1 , . . . , D k of a graph G = (V, E) are mutually induced subgraphs of G if there exists a set S ⊆ V such that G[S] = D 1 +. . .+D k . A connected subgraph D of G is a Z-subgraph if Z ⊆ V (D). A terminal set Z is an unordered set of distinct vertices, which we again call terminals. A set Z = {Z 1 , . . . , Z k } is a terminal set collection if Z 1 , . . . , Z k are pairwise disjoint terminal sets. We now introduce the generalization: time solvable for circular-arc graphs [10]; polynomial-time solvable for chordal graphs [1], AT-free graphs [11], graph classes of bounded mim-width [15]; and NP-complete for clawfree graphs [6], line graphs of triangle-free chordless graphs [29] and thus for (theta,wheel)free graphs, and for planar graphs; the last result follows from a result of Lynch [23] (see [11]). Moreover, Induced Disjoint Paths is XP with parameter k for (theta,wheel)free graphs [29] and even FPT with parameter k for claw-free graphs [9] and planar graphs [17]; the latter can be extended to graph classes of bounded genus [20].

Our Results
Let P r be the path on r vertices. A linear forest is the disjoint union of one or more paths. We write F ⊆ i G if F is an induced subgraph of G and sG for the disjoint union of s copies of G. We can now present our first two results: the first one includes our dichotomy for Induced Disjoint Paths (take = 2). Theorem 2. For a graph H such that H = sP 1 + P 6 for some s ≥ 0, Induced Disjoint Connected Subgraphs on H-free graphs is polynomial-time solvable for H-free graphs if H ⊆ i sP 1 + P 3 + P 4 or H ⊆ i sP 1 + P 5 for some s ≥ 0, and it is NP-complete otherwise.
Note the complexity jumps if we no longer fix . We will show that all open cases in Theorem 2 are equivalent to exactly one open case, namely H = P 6 .
Comparison. The Disjoint Connected Subgraphs problem restricted to H-free graphs is polynomial-time solvable if H ⊆ i P 4 and else it is NP-complete, even if the maximum size of the terminal sets is = 2, except for the three unknown cases H ∈ {3P 1 , 2P 1 + P 2 , P 1 + P 3 } [18]. Perhaps somewhat surprisingly, Theorems 1 and 2 show the induced variant is computationally easier for an infinite number of linear forests H (if P = NP).
Fixing k. If the number k of terminal sets is fixed, we write k-Induced Disjoint Connected Subgraphs and prove the following complete dichotomy.
Theorem 3. Let k ≥ 2. For a graph H, k-Induced Disjoint Connected Subgraphs on H-free graphs is polynomial-time solvable for H-free graphs if H ⊆ i sP 1 + 2P 4 or H ⊆ i sP 1 + P 6 for some s ≥ 0, and it is NP-complete otherwise.
Comparison. We note a complexity jump between Theorems 2 and 3 when H = sP 1 +2P 4 for some s ≥ 0.
Paper Outline. Section 2 contains terminology, known results and auxiliary results that we will use as lemmas. Hardness results for Theorem 1 transfer to Theorem 2, whereas the reverse holds for polynomial results. As such, we show all our polynomial-time algorithms in Section 3 and all our hardness reductions in Section 4. The cases H = sP 3 + P 6 in Theorem 1 and H = sP 1 + P 5 in Theorem 2 are proven by a reduction to Independent Set via so-called blob graphs, just as the quasipolynomial-time result if H is a linear forest. Hence, we also include the proof of the latter result in Section 3. In Section 5 we combine the results from the previous two sections to prove Theorems 1-3.
In our theorems we have infinite families of polynomial cases related to nearly H-free graphs. For a graph H, a graph G is nearly H-free if G is (P 1 + H)-free. It is easy to see (cf [3]) that Independent Set is polynomial-time solvable on nearly H-free graphs if it is so on H-free graphs. However, for many other graph problems, this might either not be true or less easy to prove (see, for example, [16]). In Section 3 we show that it holds for the relevant cases in Theorem 2, in particular for the case H = P 6 (see Lemma 7). The latter result yields no algorithm but shows that essentially H = P 6 is the only one open case left in Theorem 2 (see also Remark 1).
In Section 6 we briefly discuss the more general problem definition of Induced Disjoint Paths used in the literature. We show that the complexity dichotomy for this problem differs from the one in Theorem 1 (for = 2).
In Section 7 we consider a number of directions for future work. In particular we consider the restriction k-Disjoint Connected -Subgraphs where both k and are fixed and discuss some open problems.

Preliminaries
For a graph G = (V, E) and a subset S ⊆ U , we write The contraction of an edge e = uv in a graph G replaces the vertices u and v by a new vertex w that is adjacent to every vertex previously adjacent to u or v; note that the resulting graph G/e is still simple, that is, G/e contains no multi-edges or self-loops. The following lemma is easy to see (see, for example, [19]). Lemma 1. For a linear forest H, let G be an H-free graph. Then G/e is H-free for every e ∈ E(G).
In a solution (D 1 , . . . , D k ) for an instance (G, Z) of Induced Disjoint Connected Subgraphs, if D i is minimal and X i is a minimum connected dominating set of D i , then X i ∪ Z i = D i or, equivalently, D i \ X i ⊆ Z i . This will be relevant in our proofs, where we use the following result of Camby and Schaudt, in particular for the case r = 6 (alternatively, we could use the slightly weaker characterization of P 6 -free graphs in [13] but the below characterization gives a faster algorithm).

Theorem 4 ([4]
). Let r ≥ 4 and G be a connected P r -free graph. Let X be any minimum connected dominating set of G. Then G[X] is either P r−2 -free or isomorphic to P r−2 .
Let G = (V, E) be a graph. Two sets X 1 , X 2 ⊆ V are adjacent if X 1 ∩ X 2 = ∅ or there exists an edge with one end-vertex in X 1 and the other in X 2 . The blob graph G • of G has vertex set {X ⊆ V (G) | X is connected} and edge set {X 1 X 2 | X 1 and X 2 are adjacent}. Note that blob graphs may have exponential size, but in our proofs we will only construct parts of blob graphs that have polynomial size. We need the following known lemma that generalizes a result of Gartland et al. [8] for paths.
The Independent Set problem is to decide if a graph G has an independent set (set of pairwise non-adjacent vertices) of size at least k for some given integer k.
We need the following two known results for Independent Set. The first one is due to Grzesik, Klimosová, Pilipczuk and Pilipczuk [12]. The second one is due to Pilipczuk, Pilipczuk and Rzążewski [28], who improved the previous quasipolynomial-time algorithm for Independent Set on P t -free graphs, due to Gartland and Lokshtanov [7] (whose algorithm runs in n O(log 3 n) time).
Theorem 6 ( [7]). For every r ≥ 1, Independent Set can be solved in n O(log 2 n) time for P r -free graphs.
Two instances of some decision problem are equivalent if one is a yes-instance if and only if the other one is. We make frequently use of the following observation. 1. |Z | ≥ 2; 2. every Z i ∈ Z has size at least 2; and 3. the union of the sets in Z is an independent set. Moreover, if G is H-free for some linear forest H, then G is also H-free.
Proof. Let (G, Z) be an instance of Induced Disjoint Connected Subgraphs, where Z = {Z 1 , . . . , Z k } for some integer k ≥ 1. If two adjacent vertices will always appear in the same set of every solution (D 1 , . . . , D k ), then we can safely contract the edge between them at the start of any algorithm. This property holds for every pair of adjacent vertices of every Z i . Hence, we contract every edge between two vertices that belong to the same set Z i . This takes linear time.
Let (G * , Z * ) be the resulting instance. Note that every Z ∈ Z * is an independent set. If a set Z ∈ Z * has size 1, say Z = {z}, then we remove z and all its neighbours from G * to obtain an equivalent instance. After doing this for all singleton sets in Z * , we obtain our desired instance (G , Z ) in linear time.
If G is H-free for some linear forest H, then G is also H-free, as H-freeness is preserved by edge contraction (Lemma 1) and by vertex deletion (by definition). If it turns out that two vertices from different sets in Z are adjacent, then (G, Z) is a no-instance. Else we find that the union of the sets in Z is an independent set. If |Z | = 1, then the problem is trivial to solve, so we may assume that |Z | ≥ 2.
We also use the next lemma frequently. Proof. Consider a solution (D 1 , . . . , D k ). As G is H-free and H is a linear forest, G is also P t -free where t = 2|V (H)| − 1. For every D i , fix a vertex u in it. As D i is connected and G is P t -free, there exists a path from every vertex of Z i to u that has length at most t − 1. Let A i be the subgraph of D i induced by the union of the vertex sets of these paths of D i . Note that the number of vertices of each A i is at most t|Z i |. As each A i is connected,

Algorithms
In this section we show all the polynomial-time and quasipolynomial-time results needed to prove our main theorems.

Using the Blob Graph Approach
We start with the following result, which holds for every fixed integer ≥ 2. In the proof of this result and the next one we use the blob graph approach.
Proof. Let (G, Z) be an instance of the Induced Disjoint Connected -Subgraphs problem, where G is an (sP 3 + P 6 )-free graph for some s ≥ 0. By Lemma 3, we may assume that the union of the sets in Z = {Z 1 , . . . , Z k } is an independent set.
First suppose that k ≤ s. By Lemma 4 we may assume that each D i in a solution (D 1 , . . . , D k ) has size at most t = (6s + 11) . So |D 1 | + . . . + |D k | has size at most kt ≤ st. Hence, we can consider all O(n st ) options of choosing a solution. As s and t are constants, this takes polynomial time in total. Now suppose that k ≥ s + 1. We consider all O(n (s−1)t ) options of choosing the first s subgraphs D i , discarding those with an edge between distinct D i or between some D i and Z j for some j ≥ s + 1. For each remaining option, let Let F be the subgraph of the blob graph G • induced by all connected subsets X in G that have size at most 11 , such that X contains all vertices of one set from Z and no vertices from any other set of Z . Then F has polynomial size, as it has O(n 11 ) vertices, so we can construct F in polynomial time. By Lemma 2, F is P 6 -free.
We claim that (G , Z ) has a solution if and only if F has an independent set of size k − s.
First suppose that (G , Z ) has a solution. Then, by Lemma 4, it has a solution (D s+1 , . . . , D k ), where each D i has size at most 11 . Such a solution corresponds to an independent set of size k − s in F . For the reverse implication, two vertices in F that each contain vertices of the same set Z i are adjacent. Hence, an independent set of size k − s in F is a solution for (G , Z ).
Due to the above, it remains to apply Theorem 5 to find in polynomial time whether G • has an independent set of size k − s.
By replacing Theorem 5 by Theorem 6 in the above proof and repeating the arguments of the second part we obtain the following result. Lemma 6. Let ≥ 2. For every r ≥ 1, Induced Disjoint Connected -Subgraphs is quasipolynomial-time solvable for P r -free graphs.

Nearly H-Free Graphs
In this section we prove a crucial lemma on nearly H-free graphs.
Lemma 7. For k ≥ 2, r ≤ 6 and s ≥ 1, if (k-)Induced Disjoint Connected Subgraphs is polynomial-time solvable for P r -free, graphs, then it is so for (sP 1 + P r )-free graphs.
Proof. First let r = 6 and k be part of the input. Let (G, Z) be an instance of Induced Disjoint Connected Subgraphs, where G is an (sP 1 + P 6 )-free graph for some integer s ≥ 1 and Z = {Z 1 , . . . , Z k }. We may assume without loss of generality that |Z 1 | ≥ |Z 2 | ≥ · · · ≥ |Z k |. By Lemma 3, we may assume that k ≥ 2; every Z i ∈ Z has size at least 2; and the union of the sets in Z is an independent set. We assume that Induced Disjoint Connected Subgraphs is polynomial-time solvable for P 6 -free graphs.
Let D 1 , . . . , D k be a solution for (G, Z) (assuming it exists). By Lemma 4, we may assume without loss of generality that for i ≥ 2, the number of vertices of D i is at most (2s + 11)|Z i | ≤ (2s + 11)(s − 1).
First assume k ≤ s. Then V (D 2 ) ∪ · · · ∪ V (D k ) has size at most t, where t = (s − 1)(2s + 11)(s − 1) is a constant. Hence, we can do as follows. We consider all O(n t ) options for choosing the subgraphs D 2 , . . . , D k . For each choice we check in polynomial time if D 2 , . . . , D k are mutually induced and connected, and if each D i contains Z i . We then check in polynomial time if the graph G − N [(V (D 2 ) ∪ · · · V (D k )] has a connected component containing Z 1 . As the number of choices is polynomial, the total running time is polynomial. Now assume k ≥ s + 1. We consider all O(n s(2s+11)(s−1) ) options of choosing the s subgraphs D 2 , . . . , D s+1 . We discard an option if for some i ∈ {1, . . . , s}, the graph D i is disconnected. We also discard an option if there is an edge between two vertices from two different subgraphs D h and D i for some 2 ≤ h < i ≤ s + 1, or if there is an edge between a vertex from some subgraph D h (2 ≤ h ≤ s) and a vertex from some set Z i (i = 1 or i ≥ s + 2). If we did not discard the option, then we solve Induced The latter takes polynomial time as G− s+1 i=2 N [D i ] is P 6 -free. As the number of branches is polynomial as well, the total running time is polynomial. Case 2. |Z 2 | ≥ s (and thus also |Z 1 | ≥ s). Let D 1 , . . . , D k be a solution for (G, Z) (assuming it exists). As |Z 1 | ≥ s, we find that for every i ≥ 2, D i is P 6 -free. As |Z 2 | ≥ s, we also find that D 1 is P 6 -free. Then, by setting r = 6 in Theorem 4, every D i (i ∈ {1, . . . , k}) has a connected dominating set X i such that G[X i ] is either P 4 -free or isomorphic to P 4 . We may assume without loss of generality that every X i is inclusion-wise minimal (as otherwise we could just replace X i by a smaller connected dominating set of D i ).
Case 2a. There exist some X i with size at least 7s + 2. As s ≥ 1, we have that G[X i ] is P 4 -free. We now set r = 4 in Theorem 4 and find that G[X i ] has a connected dominating set Y i of size at most 2. Hence, G[X i ] contains a set R of 7s vertices that are not cut-vertices of G[X i ]. As X i is minimal, this means that in D i , each r ∈ R has at least one neighbour z ∈ Z i that is not adjacent to any vertex of X i \ {r}. We say that z is a private neighbour of r. We now partition R into sets R 1 , . . . , R 7 , each of exactly s vertices.
. This is contradiction, as every induced P 6 only has six vertices. Hence, there exists We exploit the above structural claim algorithmically as follows. We consider all k = O(n) options that one of the sets X i has size at least 7s + 2. For each choice of index i we do as follows. We consider all O(n 2s ) options of choosing a set Q h of s vertices from the independent set Z i together with a set R h of s vertices from N (Q h ). We discard the option if a vertex of Q h has more than one neighbour in As G is P 6 -free, the latter takes polynomial time by our initial assumption. Hence, as the total number of branches is O(n 2s+1 ) the total running time of this check takes polynomial time.
Case 2b. Every X i has size at most 7s + 1. First assume k ≤ s. We consider all O(n s(7s+1) ) options of choosing the sets X 1 , . . . , X k . For each option we check if (X 1 ∪ Z 1 , . . . , X k ∪ Z k ) is a solution for (G, Z). As the latter takes polynomial time and the total number of branches is polynomial, this takes polynomial time. Now assume k ≥ s + 1. We consider all O(n s(7s+1) ) options of choosing the first s sets X 1 , . . . , X s . We discard an option if for some i ∈ {1, . . . , s}, the set X i ∪ Z i is disconnected. We also discard an option if there is an edge between two vertices from two different sets X h ∪ Z h and X i ∪ Z i for some 1 ≤ h < i ≤ s, or if there is an edge between a vertex from some set X h ∪ Z h (h ≤ s) and a vertex from some set Z i (i ≥ s + 1). If we did not discard the option, then we solve Induced Disjoint Connected Subgraphs As the number of branches is polynomial as well, the total running time is polynomial.
From the above case analysis we conclude that the running time of our algorithm is polynomial. If r ≤ 5 and/or k is fixed we use exactly the same arguments.
Remark 1. Due to Lemma 7, the missing cases H = sP 1 + P 6 in Theorem 2 are all equivalent to the case H = P 6 .

Two Applications of Lemma 7
We will first use Lemma 7 for the case where r = 5. In the proof of the next result, we also make use of the blob approach again.
Proof. Due to Lemma 7 it suffices to prove the statement for P 5 -free graphs only. Let (G, Z) be an instance of Induced Disjoint Connected Subgraphs, where G is a P 5free graph and Z = {Z 1 , . . . , Z k }. By Lemma 3, we may assume that k ≥ 2; every Z i ∈ Z has size at least 2; and the union of the sets in Z is an independent set. We may also delete every vertex from G that is not in a terminal set from Z but that is adjacent to two terminals in different sets Z h and Z i (such a vertex cannot be used in any subgraph of a solution). We now make a structural observation that gives us a procedure for safely contracting edges; recall that edge contraction preserves P 5 -freeness by Lemma 1.
Consider a solution (D 1 . . . D k ) that is maximal in the sense that any vertex v outside V (D 1 ) ∪ · · · ∪ V (D k ) must have a neighbour in at least two distinct subgraphs D i and D j . Since G is P 5 -free, v must be adjacent to all vertices of at least one of D i and D j .
Since v does not have neighbours in both Z i ⊆ V (D i ) and Z j ⊆ V (D j ), we find that v is adjacent to all vertices of exactly one of D i and D j .
The above gives rise to the following algorithm. Let v be a vertex that is adjacent to at least one vertex z ∈ Z i but not to all vertices of Z i . As v is adjacent to z and z is in Z i , it hold that v does not belong to any D h with h = i for every (not necessarily maximal) solution (D 1 , . . . , D k ). The observation from the previous paragraph tells us that if v is not in any D h and (D 1 , . . . , D k ) is a maximal solution, then v must be adjacent to all vertices of some D j . As v is adjacent to z ∈ Z i , it holds by construction that v is not adjacent to any vertex of any Z h ⊆ V (D h ) with h = i. Hence, i = j must hold. However, this is not possible, as we assumed that v is not adjacent to all vertices of Z i ⊆ V (D i ). Hence, we may assume without loss of generality that v belongs to D i (should a solution exist). This means that we can safely contract the edge vz and put the resulting vertex in Z i . Then we apply Lemma 3 again and also remove all common neighbours of vertices from Z i and vertices from other sets Z j . This takes polynomial time and the resulting graph has one vertex less. Hence, by applying this procedure exhaustively we have, in polynomial time, either solved the problem or obtained an equivalent but smaller instance.
Suppose we have an equivalent instance. For simplicity we denote the obtained instance by (G, Z) again, where G is a P 5 -free graph and Z = {Z 1 , . . . , Z k } with k ≥ 2. Due to our procedure, every Z i ∈ Z has size at least 2; the union of the sets in Z is an independent set. Moreover, every non-terminal vertex is adjacent either to no terminal vertex or is adjacent to all terminals of exactly one terminal set. We let S be the set of vertices of the latter type. Observe that it follows from the preceding that only vertices of S need to be used for a solution.
We now construct the subgraph F of the blob graph G • that is induced by all connected subsets X of the form X = Z i ∪ {s} for some 1 ≤ i ≤ k and s ∈ S. Note that F has O(kn) vertices. Hence, constructing F takes polynomial time. Moreover, F is P 5 -free due to Lemma 2. As in the proof of Lemma 5, we observe that (G, Z) has a solution if and only if F has an independent set of size k. It now remains to apply (in polynomial time) Theorem 5.
We now show a stronger result when k is fixed instead of part of the input. Again we will use Lemma 7.
Proof. Due to Lemma 7 it suffices to prove the statement for P 6 -free graphs only. Let (G, Z) be an instance of k-Induced Disjoint Connected Subgraphs, where G is a P 6 -free graph and Z = {Z 1 , . . . , Z k }. By Lemma 3, we may assume that every Z i ∈ Z has size at least 2 and that the union of the sets in Z is an independent set. We start by deleting from G, Consider a solution (D 1 , . . . , D k ) (if it exists). As G is P 6 -free, each D i is P 6 -free. By Theorem 4 (take r = 6), this means that every D i has a connected dominating set X i such that G[X i ] is either P 4 -free or isomorphic to P 4 . In the former case we say that D i is difficult and in the latter we say that D i is easy.
We consider all options of choosing which of the subgraphs D i is easy and consider all options of choosing the corresponding dominating P 4 s. This leads to 2 k O(n 4k ) branches, which is polynomial as k is fixed. We discard those options that do not result in mutually induced connected subgraphs D i with Z i ⊆ V (D i ) and also those with an edge between a vertex of some guessed D i and some Z j that will correspond to a difficult subgraph D j .
For each remaining branch, we delete the vertices of each easy D i and all their neighbours from G. We also remove the corresponding sets Z i from Z. For simplicity we denote the new instance by (G, Z) again, and we let |Z| = k. If k ≤ 1, then we can solve the problem in a trivial way. Suppose that k ≥ 2. We note that G is still P 6 -free; every Z i ∈ Z still has size at least 2 and that the union of the sets in Z is an independent set such that no two vertices from different Z i and Z j have a common neighbour. Moreover, if (G, Z) has a solution, then every connected subgraph in it is difficult.
Consider a solution (D 1 , . . . , D k ) (if it exists). As each D i is difficult, it contains (by definition) a connected dominating set X i such that G[X i ] is P 4 -free. By Theorem 4 (take r = 4), every G[X i ] has a connected dominating set Y i of size at most 2. We consider all options of choosing the connected sets Y i . For every chosen Y i of size 2, we contract the edge between the two vertices of Y i . The resulting graph is still P 6 -free by Lemma 1. Note that the number of branches is O(n 2k ), which is polynomial as k is fixed. In each branch, we may now assume that Y i = {y i } for i ∈ {1, . . . , k} and thus y i will dominate G[X i ]. We discard an option if {y 1 , . . . , y k } is not an independent set, or if some y i is adjacent to a vertex of some Z j with i = j. For every other branch we continue as follows. From G we first delete (ii) for every i ∈ {1, . . . , k}, every neighbour of y i adjacent to a vertex of Z j ∪ {y j } for some j = i.
This takes polynomial time and we may do this, as these common neighbours cannot belong to any subgraph in a solution (D 1 , . . . , D k ) with y i ∈ V (D i ) for i ∈ {1, . . . , k}.
We may assume without loss of generality that in the solution (D 1 , . . . , D k ) we are looking for the subgraphs are minimal. That is, we cannot replace a subgraph D i with some subgraph is either a vertex of Z i or has a neighbour z i in Z i that is not adjacent to any vertex of X i \ {x i }; in the latter case we say that z i is a private neighbour of x i . For every i ∈ {1, . . . , k}, at least one such pair (x i , z i ) exists, as otherwise y i dominates D i , and thus D i would not be difficult.
We now consider for i ∈ {1, . . . , k}, all options of choosing the pairs (x i , z i ) where x i is a neighbour of y i that is not from Z i , whilst z i is taken from Z i . We discard those options where x i and z i are not adjacent or where z i is adjacent to y i ; in both cases z i will not be a private neighbour of x i . We also discard every option where the graphs G[{y i , x i , z i }] are not mutually induced. Note that the number of branches is O(n 2k ) (so polynomial). For each branch that we have not discarded we continue by first deleting from G, the following sets of vertices: (iii) for i ∈ {1, . . . , k}, every neighbour of z i not equal to x i ; (iv) for i ∈ {1, . . . , k}, every neighbour of x i that is adjacent to a vertex of Z j ∪ {x j , y j } for some j = i; This takes polynomial time. Moreover, we are allowed to delete all these vertices, as none of them can be used in the solution that we are trying to construct. In particular, every z i will be a private neighbour of x i , so every z i has only one neighbour in V (D 1 )∪· · ·∪V (D k ).
We now use the fact that (i)-(iv) hold to prove the following claim: A solution for this branch exists if and only if N G [y i ] dominates Z i for every i ∈ {1, . . . , k}.
First suppose that (G, Z) has a solution (D 1 , . . . , D k ) such that for every i ∈ {1, . . . , k} it holds that First note that each D i is connected (as N G [y i ] dominates Z i ) and contains Z i . Hence, it remains to show that D 1 , . . . , D k are mutually induced.
For a contradiction, let u i ∈ V (D i ) and u j ∈ V (D j ) be adjacent for some i = j. Due to (i)-(iv), we find that u i belongs to N G [y i ] \ {x i } and u j belongs to N G [y j ] \ {x j }. First suppose that u i is not adjacent to x i or u j is not adjacent to x j , say u i is not adjacent to x i . Now, {z i , x i , y i , u i , u j , y j } induces a P 6 , a contradiction. Hence, u i must be adjacent to x i and u j must be adjacent to x j . However, now {z i , x i , u i , u j , x j , z j } induces a P 6 , another contradiction. Hence, we have proven the claim.
We can check in polynomial time whether N G [y i ] dominates Z i for every i ∈ {1, . . . , k}. By the above claim, this means that we can check in polynomial time if a certain branch leads to a solution. As the total number of branches is polynomial, the running time of our algorithm is polynomial. The correctness of our algorithm follows from its description; note that we examined all possible situations.

Two More Algorithmic Results
In this section we present our final two polynomial-time algorithms. The first result holds for fixed k. The second result is for a smaller graph class but holds even when k and are both part of the input. To prove the second result, we will use the algorithm of the first result as a subroutine.
Proof. Let s ≥ 0. Let (G, Z) be an instance of k-Induced Disjoint Connected Subgraphs, where G is an (sP 1 + 2P 4 )-free graph and Z = {Z 1 , . . . , Z k }. By Lemma 3, we may assume that every Z i ∈ Z has size at least 2 and that the union of the sets in Z is an independent set.
By Lemma 4 we may assume without loss of generality that for a solution (D 1 , . . . , D k ) it holds that every D i has size at most (2s If Z i is small, then D i has size at most t where t = (2s + 15)(s − 1). Let Z be the subset of Z that contains the small sets of Z. We consider all O(n kt ) options of choosing the corresponding connected subgraphs D i . We check in polynomial time if there are no forbidden edges between these subgraphs or between such a subgraph and a large set, and we also check if each such D i contains Z i . If one of the conditions is violated, we discard the choice. Otherwise, we delete the vertices of N [V (D i )] from G for each small Z i and we also delete the small sets from Z. Note that the resulting graph is still (sP 1 + 2P 4 )-free. For simplicity, we denote the resulting instance by (G, Z) again. If |Z| = k ≤ 1, we solve the instance directly in a trivial way. Keep all created instances with more than one set in Z. Note that we created O(n kt ) branches in this way and the instance of each branch that we kept has no small sets and k ≥ 2.
We say that a subgraph D i in a solution is easy if D i is P 4 -free; otherwise D i is difficult. As each Z i in Z is now large, each D i contains an induced sP 1 . As G is (sP 1 + 2P 4 )-free, this means that at least k − 2 subgraphs of any solution are easy. We consider all O(k 2 ) options of choosing the easy subgraphs. By Theorem 4 (take r = 4) we find that each easy D i has a connected dominating set X i of size at most 2. We consider all O(n 2(k−2) ) options of choosing the vertices of the sets X i corresponding to the easy subgraphs D i . Again, we discard a choice if some guessed D i = G[X i ∪ Z i ] is not connected or a vertex of some guessed D i is adjacent to a vertex of another guessed D h or to a vertex of a set Z j that will be contained in a D j that is difficult. Otherwise, we obtained, in polynomial time, a new instance after deleting the vertices of N [V (D i )] from G for each easy D i and deleting the corresponding sets from Z. For simplicity, we denote the resulting instance by (G, Z) again. Observe that G is still (sP 1 + 2P 4 )-free, and in particular that Z has size k ≤ 2. If k ≤ 1, the problem has become trivial to solve. Assume that k = 2. Then, for simplicity, we write Z = {Z 1 , Z 2 }; note both Z 1 and Z 2 are large, as these sets were large at the start of the initial branch.
So, to summarize, we have created in polynomial time O(k 2 n 2(k−2) ) branches and for each branch we have an instance (G, Z) of 2-Induced Disjoint Connected Subgraphs where G is (sP 1 + 2P 4 )-free and Z = {Z 1 , Z 2 }. Moreover, if an instance has a solution (D 1 , D 2 ) then both D 1 and D 2 are difficult. It remains to show how we can solve this problem in polynomial time for each created instance (G, Z). We do this below.
Consider a created instance (G, Z). Let (D 1 , D 2 ) be a solution for it. As D 1 is difficult, D 1 has an induced P 4 by definition. As G is (sP 1 + 2P 4 )-free, this means that D 2 is (sP 1 + P 4 )-free. As D 2 is difficult, D 2 has an induced P 4 as well, say on vertices a, b, c, d. As D 2 is (sP 1 + P 4 )-free and Z 2 is an independent set, the set {a, b, c, d} must dominate all but at most s − 1 vertices of Z 2 . Let Z * 2 be the subset of Z 2 that consists of vertices not adjacent to any vertex of {a, b, c, d}; so, Z * 2 has size at most s − 1. Fix a vertex u of D 2 . As D 2 is (sP 1 + P 4 )-free and thus P 2s+3 -free, there exists a path P i of length at most 2s + 1 from each z i ∈ Z * 2 to u. For the same reason we can also choose a path P d from d to u of length at most 2s + 3. Then replacing D 2 by the subgraph F 2 of D 2 that is induced by the union of {a, b, c, d, u} ∪ Z 2 and the inner vertices of all these paths leads to an alternative solution (D 1 , F 2 ), where F 2 − Z 2 has size at most t , for t = (2s + 2)(s + 1).
It now remains to consider all O(n t ) options of choosing the vertices of F 2 − Z 2 . For each option we check if F 2 is connected and contains Z 2 and if G − N [F 2 ] contains a connected component that contains Z 1 . This can be done in polynomial time.
Correctness of our algorithm follows from the above description. As the number of branches is polynomial and each branch can be processed in polynomial time, the running time of our algorithm is polynomial.
As mentioned, we use the algorithm of Lemma 10 as a subroutine in our next result, which holds even when k and are part of the input. In addition, we also use the algorithm of of Lemma 8 as a subroutine.
Proof. Let (G, Z) be an instance of Induced Disjoint Connected Subgraphs, where G is an (sP 1 + P 3 + P 4 )-free graph for some integer s ≥ 0 and Z = {Z 1 , . . . , Z k }. We assume without loss of generality that |Z 1 | ≥ |Z 2 | ≥ · · · ≥ |Z k |. By Lemma 3, we may assume that k ≥ 2; every Z i ∈ Z has size at least 2; and the union of the sets in Z is an independent set.
By Lemma 4 we may assume without loss of generality that for a solution (D 1 , . . . , D k ), we have |V (D k )| ≤ t, where t = (2s+13)(s−1). We consider all O(n t ) options of choosing the subgraph D k . For each choice we check in polynomial time if D k is connected, contains Z k and that no vertex of D k is adjacent to any vertex of Z 1 ∪ . . . ∪ Z k−1 . If one of these conditions does not hold, then we discard the choice. Otherwise, we solve Induced Disjoint Connected Subgraphs on instance (G − N [V (D k )], Z \ {Z k }). This can be done in polynomial time. Namely, the graph D k contains an induced P 3 , as Z k is an independent set of size at least 2. Thus, G − N [D k ] is (sP 1 + P 4 )-free (and hence, (sP 1 + P 5 )-free) and we can apply Lemma 8. As the number of branches is polynomial as well, the running time for processing Case 1 is polynomial.
Case 2. |Z k | ≥ s (and hence |Z i | ≥ s for every i). We need to make a distinction into two more subcases (recall that k ≥ 2).
As G is (sP 1 + P 3 + P 4 )-free, G is also (sP 1 + 2P 4 )-free and we can use Lemma 10 to process Case 2a in polynomial time.
Case 2b. k ≥ 3. Let (D 1 , . . . , D k ) be a solution (assuming it exists). As Z 2 and Z 3 are independent sets of size at least s, both D 2 and D 3 contain an induced sP 1 and an induced P 3 . Hence, D 1 is P 4 -free. By Theorem 4 (take r = 4), we find that D 1 has a connected dominating set X 1 of size at most 2. We consider all O(n 2 ) options of choosing X 1 . We discard a choice if is not connected or a vertex of D 1 is adjacent to a vertex of Z 2 ∪ · · · ∪ Z k . For each non-discarded choice, we solve Induced Disjoint Connected Subgraphs on instance (G − N [V (D 1 )], Z \ {Z 1 }). The latter takes polynomial time, as we can apply Lemma 8: as D 1 has an induced P 3 , the graph G − N [V (D 1 )] is (sP 1 + P 4 )-free and thus (sP 1 + P 5 )-free. As the number of branches is polynomial as well, the running time for processing Case 2b is polynomial.
The correctness of our algorithm follows from the case descriptions. As each of the cases can be done in polynomial time, the total running time of our algorithm is polynomial.

NP-Completeness Results
In this section we show a number of NP-completeness results that we need for proving our main theorems. Some of these results hold even for more restricted graph classes. If = 2, we write Induced Disjoint Paths instead of Induced Disjoint Connected -Subgraphs.

High Girth
The girth of a graph G that is not a forest is the length of a shortest cycle of G. We prove two results for graphs of high girth. Lemma 12. For every g ≥ 3, Induced Disjoint Paths is NP-complete for the class of graphs of girth at least g.
Proof. We reduce from Disjoint Paths, which is known to be NP-complete for graphs of girth at least g for every g ≥ 3 [18, Lemma 9]. We observe that the reduction of [18] is from Disjoint Paths on arbitrary graphs by subdividing all edges an appropriate number of times, say g/3 ≥ 1 times. We note that for Disjoint Paths, the reduction of Lynch [23] has the property that the terminals are on disjoint vertices. Then the construction of [18] guarantees that the terminals in the constructed graph are disjoint. Consider such an instance of Disjoint Paths on a graph G and terminal pairs (s 1 , t 1 ), . . . , (s k , t k ). By the previous, s 1 , . . . , s k , t 1 , . . . , t k are disjoint. Since the construction subdivides each edge at least once, we obtain an equivalent instance of Induced Disjoint Paths on a graph of girth at least g.
For some of our other results we prove NP-hardness by reducing from the 2-Disjoint Connected Subgraphs problem. Recall that this problem asks if a given graph has two vertex-disjoint connected subgraphs containing pre-specified sets of vertices Z 1 and Z 2 , respectively. Lemma 13. For every g ≥ 3, 2-Induced Disjoint Connected Subgraphs is NPcomplete for the class of graphs of girth at least g.
Proof. We reduce from 2-Disjoint Connected Subgraphs, which is known to be NPcomplete for graphs of girth at least g for every g ≥ 3 [18, Lemma 6]. Again, the reduction of [18] subdivides the edges of an instance of 2-Disjoint Connected Subgraphs on general graphs, and we may assume that it does so at least once. Then we obtain an equivalent instance of 2-Induced Disjoint Connected Subgraphs on a graph of girth at least g.

Line Graphs
The line graph L(G) of a graph G has vertex set {v e | e ∈ E(G)} and an edge between v e and v f if and only if e and f are incident on the same vertex in G.
The following two lemmas show NP-completeness for line graphs. Lemma 14 is due to Fiala et al. [6]. They consider a more general variant of Induced Disjoint Paths, but their reduction holds in our setting as well. Lemma 15 can be derived from the NPcompleteness of 2-Disjoint Connected Subgraphs [14]. Lemma 14 ([6]). Induced Disjoint Paths is NP-complete for the class of line graphs.
Proof. Fiala et al. [6,Theorem 24] prove that Induced Disjoint Paths is NP-complete for line graphs by reducing from Disjoint Paths on general graphs. However, in the paper, they consider a more flexible variant where (among others) terminals can be adjacent. Fortunately, this extra freedom is not used in the reduction. We note that for Disjoint Paths, the reduction of Lynch [23] guarantees that the terminals are on disjoint vertices. Then the construction of [6] guarantees that the terminals in the constructed graph form an independent set and hardness for our variant follows. Proof. We reduce from 2-Disjoint Connected Subgraphs, which is known to be NPcomplete [14]. We describe a reduction that is similar to Fiala et al. [6,Theorem 24] for Induced Disjoint Paths.
Let (G, Z 1 , Z 2 ) be an instance of 2-Disjoint Connected Subgraphs. For each vertex z ∈ Z 1 ∪ Z 2 , create a new vertex v z and connect it by an edge e z to z. Let G denote the new graph. Note that (G, Z 1 , Z 2 ) is a yes-instance of 2-Disjoint Connected

Subgraphs if and only if
corresponding to e z . Then it can be readily seen that (G,

Forbidding Some Linear Forest
Finally, we show two lemmas for graphs without certain induced linear forests. Lemma 16 shows that 2-Induced Disjoint Connected Subgraphs is NP-complete for (3P 2 , P 7 )free graphs. It is readily seen that the gadget constructed in the hardness reduction is not 2P 4 -free. Note that this is in line with Theorem 3. However, Lemma 17 shows that NP-completeness does hold for 2P 4 -free graphs when the number k of terminal sets is part of the input. That is, Induced Disjoint Connected Subgraphs is NP-complete for 2P 4 -free graphs.
Proof. We reduce from Not-All-Equal-3-Sat, known to be NP-complete [31]. Let (X , C) be an instance of Not-All-Equal-3-Sat containing n variables x 1 , . . . , x n and m clauses C 1 , . . . , C m . We construct a graph G as follows. Let X be a clique of size n on vertices v 1 , . . . , v n . Introduce a copy v i of each v i in X. Call the new set X and make it a clique. Add the edges v i v i for each v i in X. Let C be an independent set of size m on vertices c 1 , . . . , c m . Introduce a copy c j of each vertex c j in C. Call the new set C (and keep it an independent set). Now for all 1 ≤ i ≤ n and 1 ≤ j ≤ m, add an edge v i c j and an edge v i c j if clause C j contains variable x i . Set Z 1 = C and Z 2 = C . Then, (G, Z 1 , Z 2 ) is an instance of 2-Induced Disjoint Connected Subgraphs. See Figure 1.
Observe that G is P 7 -free. Indeed, let P be any longest induced path in G. Then P can contain at most two vertices from X and at most two vertices from X . If P contains at most one vertex from C and at most one vertex from C , then P has length at most 2 + 2 + 1 + 1 = 6. On the other hand, if P contains two vertices from C or two vertices from C , then P has length at most 3.
We also observe that G is 3P 2 -free, as any P 2 must contain at least one vertex from X or from X , and X and X are cliques. So we are done after proving the following claim: (X , C) is a yes-instance of Not-All-Equal-3-Sat if and only if (G, Z 1 , Z 2 ) is a yes-instance of 2-Induced Disjoint Connected Subgraphs.
In the forward direction, let τ be a satisfying truth assignment. We put in A every vertex of X for which the corresponding variable is set to true. We put in A every vertex of X for which the corresponding variable is set to false. As each clause C j contains at least one true variable, c j is adjacent to a vertex in A. Similarly, each clause C j contains at least one false variable, so each c j is adjacent to a vertex in A . As X and X are cliques, A and A are cliques. Hence, G[C ∪ A] and G[C ∪ A ] are connected. Now suppose there is an edge between a vertex of C ∪ A and a vertex of C ∪ A . Then, by construction, this edge must be equal to some v i v i , which means that v i is in A and v i is in A , so x i must be true and false at the same time, a contradiction. Hence, there exists no edge between a vertex from C ∪ A and a vertex from C ∪ A . We conclude that In the backwards direction, let (C ∪ A, C ∪ A ) be a solution. Then, by definition, there is no edge between C ∪ A and C ∪ A , which means that there is no edge between A and A . Then A ⊆ X and A ⊆ X , since X and X are cliques and A (A ) needs to contain at least one vertex of X (X ). Also, there is no variable x i such that v i is in A and v i is in A . This means we can define a truth assignment τ by setting all variables corresponding to vertices in A to be true, all variables corresponding to vertices in A to be false, and all remaining vertices in X to be true (or false, it does not matter).
As C is an independent set and C ∪ A is connected, each c j has a neighbour in A. So each C j contains a true literal. As C is an independent set and C ∪ A is connected, each c j has a neighbour in A . So each C j contains a false literal. Hence, τ is a satisfying truth assignment. This completes the proof.
Lemma 17. Induced Disjoint Connected Subgraphs is NP-complete for the class of 2P 4 -free graphs.
-Add a clique, with one vertex v i for each variable. -Add edges from each literal vertex n i,j , 1 ≤ j ≤ 3 to the corresponding variable vertex.
-Let Z 1 consist of each positive clause vertex p i together with the vertex x.
-Let Z i consist of the two vertices n i−1,4 and n i−1,5 for 2 ≤ i ≤ m + 1.
We first show that G is 2P 4 -free. Note that at most one of the two paths in an induced 2P 4 contains any variable vertex. Since every neighbour of the vertices {p 1 . . . p l , x} is a variable vertex, none of these vertices is contained in an induced P 4 which excludes variable vertices. As the complete bipartite graph K 2,3 is P 4 -free, this implies that G is 2P 4 -free.
Next we show that G is a yes-instance of Induced Disjoint Connected Subgraphs if and only if Φ is a yes-instance of Monotone 3-satisfiability. Given a satisfying assignment of Φ, let S 1 = Z 1 ∪ T where T is the set of variable vertices corresponding to true variables. For 2 ≤ i ≤ m + 1, let S i = Z i ∪ F i where F i is the set of literal vertices n i−1,j adjacent to variable vertices appearing in N i−1 which are assigned to be false. Note that no subgraph S i , 2 ≤ i ≤ m + 1 contains a variable vertex. S 1 is connected since at least one variable appearing in each positive clause must be true in any satisfying assignment. Similarly each S i is connected for 2 ≤ i ≤ m + 1 since any negative clause must contain at least one variable which is assigned to be false. Any edge between S i and S j for i = j must contain a variable vertex since the remaining edges are those contained in copies of K 2,3 and hence either have two endpoints in the same subgraph S i or one endpoint contained in no subgraph S i . Therefore we may assume that i = 1. If a variable vertex v i is contained in S 1 and has a neighbour in a second subgraph S j it must be both true and false in a satisfying assignment, a contradiction.
If (G, Z 1 . . . Z m+1 ) is a yes-instance of Induced Disjoint Connected Subgraphs, consider any solution (S 1 , . . . , S m+1 ) such that Z i ⊆ S i for 1 ≤ i ≤ m + 1. Note that {n i−1,1 , n i−1,2 , n i−1,3 | 2 ≤ i ≤ m + 1} ⊆ N (Z 2 ∪ · · · ∪ Z m+1 ), and thus S 1 ⊆ Z 1 ∪ {v 1 , . . . , v n }. Since the variable vertices form a clique and S 1 will need to contain at least one variable vertex, (S 2 ∪ · · · ∪ S m+1 ) ∩ {v 1 , . . . , v n } = ∅. Set each variable whose corresponding vertex is contained in S 1 to true and each remaining variable to false. We claim this yields a satisfying assignment for Φ. For a positive clause P i , note that S 1 must connect p i to x, which is only possible if a variable vertex adjacent to p i is in S 1 . This variable is contained in the clause and set to true, and will thus satisfy the clause. For a negative clause N i−1 with 2 ≤ i ≤ m + 1, we note that Z i = {n i−1,4 , n i−1,5 } is connected by S i , which is only possible if one of n i−1,1 , n i−1,2 , n i−1,3 is in S i , say n i−1,1 . But then the variable vertex corresponding to the first literal of the clause cannot be in S 1 , and thus is set to false and satisfies the clause.

The Proofs of Theorems 1-3
We are now ready to prove Theorems 1-3, which we restate below. Proof. We prove the theorem for = 2; extending the proof to ≥ 3 is trivial. If H contains a cycle C s , then we use Lemma 12 by setting the girth to g = s + 1. Suppose that H contains no cycle, that is, H is a forest. If H contains a vertex of degree at least 3, then we use Lemma 14, as in that case the class of H-free graphs contains the class of K 1,3 -free graphs, which in turn contains the class of line graphs. In the remaining cases, H is a linear forest. If H ⊆ i sP 3 + P 6 for some s ≥ 0 we use Lemma 5. Else we use Lemma 6.
Theorem 2 (restated). For a graph H such that H = sP 1 +P 6 for some s ≥ 0, Induced Disjoint Connected Subgraphs on H-free graphs is polynomial-time solvable for Hfree graphs if H ⊆ i sP 1 + P 3 + P 4 or H ⊆ i sP 1 + P 5 for some s ≥ 0, and it is NP-complete otherwise.
Proof. If H is not a linear forest, we use Theorem 1. Suppose H is a linear forest. If H ⊆ i sP 1 + P 5 for some s ≥ 0 we use Lemma 8. If H ⊆ i sP 1 + P 3 + P 4 for some s ≥ 0 we use Lemma 11. If 3P 2 ⊆ i H or P 7 ⊆ i H we use Lemma 16. Otherwise 2P 4 ⊆ i H and we use Lemma 17.
Theorem 3 (restated). Let k ≥ 2. For a graph H, k-Induced Disjoint Connected Subgraphs on H-free graphs is polynomial-time solvable for H-free graphs if H ⊆ i sP 1 + 2P 4 or H ⊆ i sP 1 + P 6 for some s ≥ 0, and it is NP-complete otherwise.
Proof. If H contains a cycle C s , then we use Lemma 13 by setting the girth to g = s + 1.
Suppose that H contains no cycle, that is, H is a forest. If H contains a vertex of degree at least 3, then we use Lemma 15, as in that case the class of H-free graphs contains the class of K 1,3 -free graphs, which in turn contains the class of line graphs. In the remaining cases, H is a linear forest. If H ⊆ i sP 1 + P 6 for some s ≥ 0 we use Lemma 9. If H ⊆ i sP 1 + 2P 4 for some s ≥ 0 we use Lemma 10. Otherwise we have that 3P 2 ⊆ i H or P 7 ⊆ i H and we use Lemma 16.

A Slight Problem Generalization
In this section we consider a more general variant of the problem. So far, we required that the terminals must all form an independent set. This condition has been relaxed in some papers in the literature, such as [21] (see also Section 1). Given a graph G, we say that vertex-disjoint paths P 1 , . . . , P k , for some integer k ≥ 1, with set R of endpoints are flexibly mutually induced paths of G if there exists a set S ⊆ V \ R such that G[S ∪ R] = (P 1 + . . . + P k ) ∪ G[R]. So, there is no edge between two vertices from different paths P i and P j except possibly between the endpoints of the paths. We can now define the following decision problem:

Flexibly Induced Disjoint Paths
Instance: a graph G and terminal pair collection T = {(s 1 , t 1 ) . . . , (s k , t k )}. Question: does G have a set of flexibly mutually induced paths P 1 , . . . , P k such that P i is an s i -t i path for i ∈ {1, . . . , k}?
Requiring terminals to form an independent set is crucial for our quasipolynomial results. Namely, Theorem 1 is unlikely to hold in the relaxed setting, as shown below. can argue that P c j goes from l c j to a vertex m j for some literal in c j , and then continues to r c j . If is the negation of v i , then m j is adjacent to m t i . Hence, m t i is not in P v i and thus the clause is satisfied by σ. Otherwise, if is v i , then m j is adjacent to m f i . Hence, m f i is not in P v i and thus the clause is satisfied by σ. It follows that each clause is satisfied by σ and thus Φ is satisfiable. Now suppose that Φ is satisfiable. Let σ be a truth assignment that satisfies every clause of Φ. For each variable i, let P v i be the path from l v i to r v i that goes via m t i if σ(i) is set to true and goes via m f i otherwise. For each clause 1 ≤ j ≤ p, let P c j be the path from l c i to r c i that goes via m j , where is any literal in c j that is satisfied by σ. Observe that when is satisfied, then if is the negation of v i , then m j is adjacent to m t i but m t i is not in P v i . Similarly, if is v i , then m j is adjacent to m f i but m f i is not in P v i . It follows that P v 1 , . . . , P v n , P c 1 , . . . , P c p is a set of flexibly mutually induced paths. Hence, (G, T ) is a yes-instance.
It remains to argue that G is P 14 -free. Consider a longest induced path P in G. Since both L and R are cliques, P contains at most two vertices of L and at most two vertices of R, and if P contains two vertices of L (or R), then these must appear consecutively. We also note that the vertices in M corresponding to literals have degree 3, and thus when P contains such a vertex m , the next or previous vertex on P must be in L or R, or m is an endpoint of P . The vertices in M corresponding to variables can have large degree; however, when P contains such a vertex m , the next or previous vertex on P must be in L or R or must be a vertex in M corresponding to a literal, or P has length 0. Hence, at most three vertices in M can lie consecutively on P before (or after) a vertex of L or R must appear or an endpoint of P is reached: the m-vertex for a literal, a variable, and a literal consecutively. Therefore, in the worst case, P contains three vertices of M , followed by two of L or R, followed by three of M , followed by two of L or R, followed by three of M . Hence, P has at most 13 vertices and thus, G is P 14 -free.

Future Work
We proved a number of new complexity results on induced paths and subgraphs connecting terminals. These results naturally lead to some open problems. First of all, can we find polynomial-time algorithms for the quasipolynomial cases in Theorem 1? This is a challenging task that is also open for Independent Set; note that we reduce to the latter problem in our proof for the case where H = sP 1 + P 6 for some s ≥ 0. Interesting open cases are when H ∈ {2P 4 , P 7 }.
We also recall that the case H = P 6 is essentially the only remaining open case left in Theorem 2, which is for the setting where k and are both part of the input. As shown in Theorems 1 and 3, respectively, we have a positive answer for the settings where is fixed (and k is part of the input) and where k is fixed (and is part of the input), respectively. However, it seems challenging to combine the techniques used for proving these results for H = P 6 when both k and are part of the input.
We did not yet discuss the k-Induced Disjoint Connected -Subgraphs problem, which is the variant where both k and are fixed; note that if = 2, then we obtain the k-Induced Disjoint Paths problem. The latter problem restricted to k = 2 is closely related to the problem of deciding if a graph contains a cycle passing through two specified vertices and has been studied for hereditary graph classes as well; see [21]. Recently, we made some more progress on k-Induced Disjoint Paths, as we discuss below.
A subdivided claw is obtained from a claw after subdividing each edge zero or more times. In particular, the chair is the graph obtained from the claw by subdividing one of its edges exactly once. The set S consists of all graphs with the property that each of their connected components is either a path or a subdivided claw. We proved in [24] that for every integer k ≥ 2 and graph H, k-Induced Disjoint Paths is polynomial-time solvable if H is a subgraph of the disjoint union of a linear forest and a chair, and it is NP-complete if H is not in S.
From the above it follows in particular that k-Induced Disjoint Paths is polynomialtime solvable for claw-free graphs (just like Independent Set [26,32]). This is in contrast to the three problems in this paper, which are NP-complete for claw-free graphs (see Theorems 1-3). We leave completing the classification of k-Induced Disjoint Paths as future work and refer to [24] for a more in-depth discussion.
We also leave classifying Flexibly Induced Disjoint Paths to future research; recall that Theorem 1 is unlikely to hold for this problem.