ON THE COMPUTATIONAL DIFFICULTY OF THE TERMINAL CONNECTION PROBLEM

. A connection tree of a graph G for a terminal set W is a tree subgraph T of G such that leaves( T ) ⊆ W ⊆ V ( T ). A non-terminal vertex is called linker if its degree in T is exactly 2, and it is called router if its degree in T is at least 3. The Terminal connection problem (TCP) asks whether G admits a connection tree for W with at most (cid:96) linkers and at most r routers, while the Steiner tree problem asks whether G admits a connection tree for W with at most k non-terminal vertices. We prove that, if r ≥ 1 is ﬁxed, then TCP is polynomial-time solvable when restricted to split graphs. This result separates the complexity of TCP from the complexity of Steiner tree , which is known to be NP -complete on split graphs. Additionally, we prove that TCP is NP -complete on strongly chordal graphs, even if r ≥ 0 is ﬁxed, whereas Steiner tree is known to be polynomial-time solvable. We also prove that, when parameterized by clique-width, TCP is W [1]-hard, whereas Steiner tree is known to be in FPT . On the other hand, agreeing with the complexity of Steiner tree , we prove that TCP is linear-time solvable when restricted to cographs ( i.e. graphs of clique-width 2). Finally, we prove that, even if either (cid:96) ≥ 0 or r ≥ 0 is ﬁxed, TCP remains NP -complete on graphs of maximum degree 3.


Introduction
Steiner tree is one of the most fundamental network design problems, proved to be NP-complete by Karp in his seminal paper [20]. Besides being related to several real-world applications, Steiner tree is of great theoretical interest, and it has been extensively studied from the perspective of graph theory [4,9,16,29,33] and computational complexity [2,8,12,30]. The Steiner tree problem has as input a connected graph G, a non-empty terminal set W ⊆ V (G), and a non-negative integer k, and it asks whether there exists a connected subgraph T of G such that W ⊆ V (T ) and |V (T ) \ W | ≤ k. Such a connected subgraph T admits a spanning tree with at most k non-terminal vertices. In this paper, we analyse the computational complexity of a network design problem closely related to Steiner tree, called Terminal connection.
TCP was introduced by Dourado et al. [11], having as motivation applications in information security and network routing, and it was proved to be polynomial-time solvable when the parameters and r are both fixed [11]. Nevertheless, it was proved to be NP-complete even if either ≥ 0 or r ≥ 0 is fixed [11]. In particular, the problem was proved to be NP-complete even if ≥ 0 is fixed and the input graph has constant maximum degree [10].
There is a straightforward Turing reduction from Steiner tree to TCP, namely: (G, W, k) is a yes-instance of Steiner tree if and only if (G, W, , r) is a yes-instance of TCP for some pair , r ∈ {0, . . . , k} such that + r = k. An interesting aspect of this Turing reduction is the fact that it preserves the structure of the input graph. Consequently, if TCP is polynomial-time solvable on some graph class G, then so is Steiner tree. Analogously, if Steiner tree is NP-complete on some graph class G, then TCP cannot be solved in polynomial-time on G, unless P=NP. Nevertheless, if either ≥ 0 or r ≥ 0 is fixed, then possibly TCP is polynomial-time solvable on a graph class G, while Steiner tree remains NP-complete on G. In addition, there might exist a graph class G on which Steiner tree is polynomial-time solvable whereas TCP remains NP-complete.
In this work, we confirm the existence of such complexity separating classes. In Section 2, we prove that, on split graphs, TCP is polynomial-time solvable if r ≥ 1 is fixed, whereas Steiner tree is known to be NPcomplete [33]. Besides, we prove that, on strongly chordal graphs, TCP remains NP-complete even if r ≥ 0 is fixed, whereas Steiner tree is known to be polynomial-time solvable [33]. Also, we prove in Section 3.1 that, parameterized by clique-width, TCP is W[1]-hard, whereas Steiner tree is known to be in FPT [1].
On the other hand, in Section 3.2, we prove that TCP can be solved in linear-time on cographs (i.e. graphs of clique-width 2), agreeing with the computational complexity of Steiner tree [4]. Additionally, in Section 4, we prove that TCP remains NP-complete on graphs of maximum degree 3 even if either ≥ 0 or r ≥ 0 is fixed. It is worth mentioning that, although Steiner tree is known to be NP-complete on graphs of maximum degree 3 [22], our NP-completeness results of TCP with either ≥ 0 or r ≥ 0 fixed do not immediately follow from the NP-completeness of Steiner tree. Table 1 summarises the mentioned results.

Related works
Motivated by applications in optical networks and bandwidth consumption minimization, another variant of Steiner tree that has been investigated is the one in which the number of branching nodes in the sought tree T , i.e. vertices (which not necessarily are non-terminal) of degree at least 3 in T , is bounded. In [17,31,32], the authors addressed the undirected and directed cases of this variant, for which they devised approximation and parameterized tractable algorithms, apart from obtaining some intractability results.
In addition, Dourado et al. introduced in [10] the strict variant of TCP, called Strict terminal connection problem (S-TCP), which has the same input of TCP but further requires that the sought connection tree T NP-c [22] satisfies leaves(T ) = W ⊆ V (T ). It is worth mentioning that, just as TCP can be seen as a generalization of Steiner tree, S-TCP can be seen as a generalization of Full Steiner tree, which is a widely studied variant of Steiner tree [18,21,23]. Similarly to TCP, it was proved that S-TCP is polynomial-time solvable when the parameters ≥ 0 and r ≥ 0 are both fixed [10], and that the problem is still NP-complete if ≥ 0 is fixed [10]. Nevertheless, except for the case r ∈ {0, 1}, which was shown to be polynomial-time solvable [24], the complexity of S-TCP for fixed r ≥ 2 has remained open. Motivated by this question, S-TCP was also investigated in [25,27]. In particular, in [25], S-TCP was proved to be NP-complete (and W[2]-hard when parameterized by r), even if ≥ 0 is constant and the input graph is restricted to split graphs. An interesting fact of this proof is that it can be easily adapted to TCP. Consequently, we obtain that TCP is also NP-complete (and W[2]-hard when parameterized by r) on split graphs even if ≥ 0 is constant. Besides this result, it was analysed in [25] the complexity of S-TCP when restricted to graphs of bounded maximum degree, and it was also proved that S-TCP is polynomial-time solvable on cographs.
A previous version of this work appeared as an extended abstract at SOFSEM 2021 conference [26]. Besides the full proofs omitted in [26], the present paper contains further contributions, such as the tractability of TCP on split graphs and the W[1]-hardness of TCP parameterized by clique-width.

Graph notation
Now, we present some basic notation and terminologies of graph theory that are used throughout this paper. For any missing definition or terminology, we refer to [3].
In this work, all graphs are finite, simple and undirected. Let G be a graph. We let V (G) and E(G) denote the vertex set and the edge set of G, respectively. For every vertex u ∈ V (G), we let N G (u) and N G [u] = N G (u) ∪ {u} denote the (open) neighbourhood and the closed neighbourhood of u in G, respectively; and we let d G (u) = |N G (u)| denote the degree of u in G. Two distinct vertices u, v ∈ V (G) are said to be false twins (resp. ). The length of a path P is defined as the number of edges of P . The distance between two vertices u, v ∈ V (G) is the length of a path of G between u and v of minimum length. For every non-empty subset S ⊆ V (G), we let G[S] denote the subgraph of G induced by S.

Separating classes: Split and strongly chordal
In this section, we present the main results of this work. First, we prove that, when restricted to split graphs, TCP is polynomial-time solvable if r ≥ 1 is fixed. Second, we prove that, when restricted to strongly chordal graphs, TCP is NP-complete even if r ≥ 0 is fixed. Such results separate the complexity of TCP from the complexity of Steiner tree, since Steiner tree is known to be NP-complete on split graphs [33] and polynomial-time solvable on strongly chordal graphs [33].

Split graphs
A split graph is a graph whose vertex set can be partitioned into a clique and a stable set. In what follows, we prove the following theorem. To prove Theorem 2.1, we propose a polynomial-time reduction from TCP, with r ≥ 1, to its strict variant S-TCP, in which the terminal vertices are further required to coincide with the leaf set of the sought tree. S-TCP was shown to admit an n O(r) -time algorithm on split graphs [25]. In a nutshell, the algorithm presented in [25] enumerates each possible candidate router set R ⊆ V (G) \ W , with |R| ≤ r, and then decides through matching techniques whether the input graph G admits a connection tree T for the terminal set W , such that |L(T )| ≤ , R(T ) = R and leaves(T ) = W . Thus, combining our polynomial-time reduction with this algorithm, we obtain that TCP can be solved in time n O(r) on split graphs for r ≥ 1.
It is worth mentioning that this result is optimum, i.e. the n O(r) -time complexity cannot be considerably improved. Indeed, the following theorem immediately comes from a trivial adaptation of a parameterized polynomial-time reduction from the Set cover problem to S-TCP presented in [25] (see Theorem 7 of [25]). In what follows, we write G K, S to refer a split graph G and explicitly denote that K ∪ S is a partition of the vertex set of G into a clique K and a stable set S. Lemma 2.3. Let G K, S be a split graph and W ⊆ V (G). If |W | ≥ 3, W ∩ K = ∅ and there exists a connection tree T of G for W such that R(T ) = ∅, then there exists a connection tree T of G for W such that L(T ) ⊆ |L(T )| and |R(T )| = 1.
Proof. Since |W | ≥ 3 and R(T ) = ∅, there exists a terminal vertex w ∈ W whose degree in T is at least 2. Then, let u and u be two distinct neighbours of w in T . Since W ∩ K = ∅, u, u ∈ L(T ) ∩ K. Let T be the graph obtained from T by removing the edge wu and adding the edge uu . Clearly, T is a connection tree of G for   Clearly, T is a connection tree of G for W such that L(T ) ⊆ K and R(T ) ⊆ K. Moreover, note that (2) Suppose that W ∩ S = ∅ and that there exists a vertex u ∈ (R(T ) ∪ W ) ∩ K. Note that, in this case, every vertex w ∈ W ∩ S has at least one neighbour, say α(w), in T . Then, let T be the graph obtained from T as follows: For each w ∈ W ∩ S, remove all edges of T that are incident to w except for wα(w); additionally, for each v ∈ N T (w), add the edge uv.
Clearly, T is a connection tree of G for W such that every vertex in W ∩ S is a leaf of T . Furthermore, one can verify that L(T ) = L(T ) and R(T ) = R(T ).
Next, we present our polynomial-time reduction to S-TCP.
Construction 1 (Reduction from TCP to S-TCP on split graphs). Let G K, S be a split graph and I = (G, W, , r) be an instance of TCP. If W ∩ K = ∅, then we define our reduction instance of S-TCP as simply g(I) = I. Otherwise, let ρ ∈ W ∩ K and consider the graph G obtained from G as follows (see Fig. 1): Add all vertices and all edges of G; For each u ∈ W ∩ S ∩ N G (W ∩ K) \ N G (ρ), add the edge ρu; Add three new vertices w 1 , w 2 and w 3 , and make them adjacent to ρ.
Note that G is a split graph, and that K ∪ S is a partition of V (G ) into a clique and a stable set, where S = S ∪ {w 1 , w 2 , w 3 }. We then define our reduction instance of S-TCP as g(I) = (G , W , , r + 1), where The following lemma concludes the proof of Theorem 2.1.
Lemma 2.5. Let G K, S be a split graph and I = (G, W, , r) be an instance of TCP such that |W | ≥ 3. Also, let g(I) be the instance of S-TCP obtained from I, as described in Construction 1. If r ≥ 1 or W ∩ K = ∅, then I is a yes-instance of TCP if and only if g(I) is a yes-instance of S-TCP.
Proof. First, suppose that I is a yes-instance of TCP. Then, there exists a connection tree T of G for W such that |L(T )| ≤ and |R(T )| ≤ r. By Lemma 2.3, we can assume that R(T ) = ∅ or W ∩ K = ∅. Furthermore, by Lemma 2.4, we can assume that every vertex in W ∩ S is a leaf of T . This implies W \ leaves(T ) ⊆ K. If W ∩ K = ∅, then leaves(T ) = W and, therefore, we immediately obtain that g(I) = I is a yes-instance of S-TCP. Thus, suppose that W ∩ K = ∅. Additionally, by Lemma 2.4, assume that L(T ) ⊆ K and R(T ) ⊆ K. Note that every vertex in V (T ) ∩ S is a leaf of T . Since T is a tree and ρ ∈ V (T ), for each vertex w ∈ W ∩ K \ {ρ}, there exists a single path between ρ and w in T and a single vertex in this path, say α(w), that belongs to N T (w) ∩ K. Thus, let T be the graph obtained from T as follows: For each w ∈ W ∩ K \ {ρ} and each w ∈ N T (w) \ {α(w)}, remove the edge ww and add the edge ρw ; For each i ∈ {1, 2, 3}, add the vertex w i and the edge ρw i .
One can verify that T is a connection tree of G for W , such that leaves(T ) = W , L(T ) = L(T ) and R(T ) = R(T ) ∪ {ρ}.
Conversely, suppose that g(I) is a yes-instance of S-TCP. If W ∩ K = ∅, then g(I) = I and, therefore, I is a yes-instance of TCP. Thus, suppose that W ∩ K = ∅, and let T be a connection tree of G for W , such that leaves(T ) = W , |L(T )| ≤ and |R(T )| ≤ r + 1. Since the only neighbour of the terminal vertices w 1 , w 2 and w 3 in G is the vertex ρ, we have that ρ necessarily belongs to T and, besides that, is a router of T . Moreover, by construction of G , if a vertex w is a neighbour of ρ in T but is not a neighbour of ρ in G, then w ∈ W ∩ S and there exists a vertex in W ∩ K, say β(w), which is a neighbour of w in G. Then, let T be the graph obtained from T as follows: Remove the vertices w 1 , w 2 and w 3 and their incident edges; For each w ∈ N T (ρ) \ N G (ρ), remove the edge ρw and add the edge β(w)w.
One can verify that T is a connection tree of G for W , such that L(T ) = L(T ) and R(T ) = R(T ) \ {ρ}.

Strongly chordal graphs
A chord of a cycle C is an edge between any two non-consecutive vertices of C. A graph G is called chordal if every cycle of G of length at least 4 has a chord. In other words, a graph G is chordal if every induced cycle of G has length 3. An even cycle is a cycle of even length. A chord uv of an even cycle C is called an odd chord if the distance between u and v in C is odd. A graph G is called strongly chordal if it is chordal and every even cycle of G of length at least 6 has an odd chord.
A vertex u of a graph G is called a simple vertex if, for any two vertices | v ∈ N G (u)} can be linearly ordered by set inclusion. Farber [13] proved that a graph G is strongly chordal if and only if there exists a linear ordering (u 1 , . . . , u n ) of the vertices of G, called simple elimination ordering, such that u i is a simple vertex of G[{u i , . . . , u n }] for each i ∈ {1, . . . , n}.
We prove that TCP remains NP-complete on strongly chordal graphs: Theorem 2.6. For each r ≥ 0, TCP remains NP-complete when restricted to strongly chordal graphs.
In order to prove Theorem 2.6, we provide a polynomial-time reduction from the Hamiltonian path problem, which was shown to be NP-complete on strongly chordal graphs by Müller [28]. The Hamiltonian path problem has as input a graph G and asks whether G admits a Hamiltonian path, i.e. a path that contains all vertices of G.
The next lemma presents some important properties of the class of strongly chordal graphs, which are used in our reduction. (1) Let H be the graph obtained from G by adding a true twin v of u i , for some i ∈ {1, . . . , n}. We claim that , then u i ∈ N Gj (y) and, thus, On the other hand, if u i ∈ N G (x), then (2) Let H be the graph obtained from G by adding a new vertex w and adding the edges vw and v w, where v and v are true twins of G.
is a simple elimination ordering of H, and therefore, H is strongly chordal.
[th]  Construction 2 (Gadget H r and Terminal Set W r ). Let r be a positive integer. We define the gadget H r as the graph such that (see Fig. 2) Construction 3 (Reduction from Hamiltonian path to TCP). Let G be a graph, with vertex set V (G) = {u 1 , . . . , u n }, and r be a non-negative integer. We let G be the graph obtained from G and r as follows (see Fig. 3): Add all vertices and all edges of G to G ; , add a new vertex w i and add the edges u i w i and u i w i , where u i denotes the true twin of u i added in the last step; If r ≥ 1, create the gadget H r and define the terminal set W r as described in Construction 2, besides adding the edge ρ r w 1 ; otherwise, if r = 0, define W r = ∅.
We remark that, the graph G described in Construction 3 is similar to the one constructed in [11] to prove the NP-completeness of TCP on general graphs for fixed r ≥ 0. The main difference is the fact that, in the graph constructed in [11], for each u i ∈ V (G), it is added a false twin, instead of a true twin, of u i . However, this makes the original graph not be strongly chordal, even if the input graph is strongly chordal; for instance, a cycle C 3 of length 3 is strongly chordal, but the graph resulting from adding a false twin for each vertex of C 3 is not strongly chordal, since it contains an induced cycle of length 4. The next lemma, which states that, whenever the input graph is strongly chordal, our constructed graph is strongly chordal as well, immediately follows from Lemma 2.7 and from the fact that the vertices of H r are not contained in any cycle of G .
Lemma 2.8. Let G be a graph and r be a non-negative integer. Also, let G be the graph of the instance g(G, r) of TCP obtained from G and r, as described in Construction 3. If G is strongly chordal, then so is G . Lemma 2.9. Let G be a graph and r be a non-negative integer. Also, let g(G, r) be the instance of TCP obtained from G and r, as described in Construction 3. Then, G admits a Hamiltonian path if and only if g(G, r) is a yes-instance of TCP.
Proof. Assume that V (G) = {u 1 , . . . , u n } and that g(G, r) = (G , W, , r). Additionally, for simplicity, consider First, suppose that there exists in G a Hamiltonian path (u j1 , . . . , u jn ). Then, let T be the graph with vertex set where u ji denotes the true twin of u ji added in the construction of G . Note that T is a connection tree of Conversely, suppose that g(G, r) is a yes-instance of TCP. Let T be a connection tree of G for W such that |L(T )| ≤ 2n − 2 and |R(T )| ≤ r. We remark that ρ 1 is the only neighbour of the terminal vertices x 1 1 , x 2 1 ∈ W r and, for each i ∈ {2, . . . , r}, ρ i is the only neighbour of the terminal vertex x i ∈ W r . As a result, T must contain all the vertices ρ 1 , . . . , ρ r . More specifically, such vertices must be routers of T . This implies that T = T − H r cannot contain any router, and all non-terminal vertices of T must be linkers. Hence, T is a path, since, by construction of G , w i has degree at most 2 in T for every i ∈ {1, . . . , n}. Then, let P = (w j1 , . . . , w jn ) be a sequence of distinct vertices such that, for each i ∈ {1, . . . , n − 1}, the path in T between w ji and w ji+1 does not contain any other terminal vertex. Note that, since |L(T )| ≤ = 2n − 2, every path in T between any two consecutive vertices w ji and w ji+1 in P must be of one of the forms: (w ji , u ji , u ji+1 , w ji+1 ), (w ji , u ji , u ji+1 , w ji+1 ), (w ji , u ji , u ji+1 , w ji+1 ), or (w ji , u ji , u ji+1 , w ji+1 ). As a result, it follows from the construction of G that, for each i ∈ {1, . . . , n − 1}, u ji and u ji+1 are adjacent in G. Therefore, (u j1 , . . . , u jn ) is a Hamiltonian path of G.

Graphs of bounded clique-width
In this section, we prove that TCP parameterized by the clique-width of the input graph is W[1]-hard. Similarly to the results presented in Section 2, this contrasts with the complexity Steiner tree, since Steiner tree is known to be in FPTwhen parameterized by clique-width [1]. On the other hand, agreeing with the complexity of Steiner tree, we prove that TCP is linear-time solvable on cographs, which are precisely the graphs of clique-width 2.
The notion of clique-width was introduced by Courcelle et al. [7], and it is one of the most studied graph parameters. Next, we present the definition of this notion cf. [14,15].
Let k be a positive integer. A graph is called a k-graph if its vertices are labelled with integers in {1, . . . , k}. An initial k-graph is a k-labelled graph on a single vertex. The clique-width of a graph G, denoted by cwd(G), is the smallest positive integer k such that G can be constructed by repeated application of the following four operations: 1. introducing (denoted by int(u, i)): construction of an initial k-graph, whose single vertex u is labelled by an integer i ∈ {1, . . . , k} and has not been introduced yet; 2. disjoint union (here, denoted by ⊕); 3. relabelling (denoted by rel i,j ): changing all labels i to j, for i, j ∈ {1, . . . , k}; 4. join (denoted by η i,j ): connecting all vertices labelled by i with all vertices labelled by j, for i, j ∈ {1, . . . , k}, i = j.
A construction of a graph G using the operations (1)-(4) described above can be represented by an algebraic term, called cwd-expression defining G, composed of int, ⊕, rel i,j , and η i,j cf. [14], where i and j are distinct positive integers. Note that cwd-expressions define a tree language, where each expression can be represented by a rooted tree T cf. [15], where each int(u, i) of the expression is associated with a leaf of T , and each vertex of G is introduced exactly once. A k-expression is a cwd-expression that contains at most k distinct labels cf. [14]. Thus, one can verify that, a graph G has clique-width at most k if and only if there exists a k-expression defining G.

Parameterization by clique-width
Now, we prove the following theorem. More specifically, we show that, if a graph G has clique-width at most k for some k ≥ 2, then the graph G obtained from G as described in Construction 3 has clique-width at most k + 1. This, along with Lemma 2.9 and the fact that Hamiltonian path is W[1]-hard parameterized by clique-width [15], implies the W[1]-hardness of TCP.
The following lemma is a well-known fact, and it can be immediately verified by an inductive argument on the number of vertices of the tree.  Proof. Assume that V (G) = {u 1 , . . . , u n } and cwd(G) ≤ k. Then, let γ G be a k-expression defining G. Also, let H be the subgraph of G induced by V (H r ) ∪ {w 1 }. Note that H is a tree. Thus, by Lemma 3.2, there exists a construction (3-expression) of a vertex-labelled copy of H (for short γ H ) in which all vertices but w 1 have the same label. Assume, without loss of generality, that w 1 is labelled by 1 at the root of γ H , and that all the other vertices of γ H are labelled by 2. In what follows, we show that we can obtain from γ G and γ H a (k + 1)-expression γ G defining our constructed graph G . We recall that each vertex u i ∈ V (G) has a true twin u i in G , and that N G −Hr (w i ) = {u i , u i }. Consider b = k + 1. We define γ G as the cwd-expression obtained from γ G as follows: Let int(u 1 , i) be the leaf term of u 1 in γ G , for i ∈ {2, . . . , k}. Replace the occurrence of int(u 1 , i) in γ G with For i = 1, it is similar (just replace the occurrences of 1 by 2 and vice versa). For each u j ∈ V (G) \ {u 1 }, if int(u j , i) is the leaf term of u j in γ G , replace the occurrence of int(u j , i) with We recall that, besides being represented by leaves, each vertex is introduced exactly once in a expression tree. Moreover, we note that the operations described above consists in local replacements in the corresponding leaves of the expression tree associated to γ G . Thus, one can verify that γ G defines G . In addition, it is straightforward that γ G is a (k + 1)-expression, whenever k ≥ 2. Therefore, cwd(G ) ≤ k + 1.

Cographs
A cograph is a graph that does not contain a path of length 3 as an induced subgraph. Alternatively, cographs are characterized by the following recursive definition, given by Corneil et al. [5]: A graph on a single vertex is a cograph; If G 1 , . . . , G k are cographs, then so is their disjoint union G 1 ∪ · · · ∪ G k ; If G is a cograph, then so is its complement G.
We note that, if G is a connected cograph on more than one vertex, then there exist k ≥ 2 cographs G 1 , . . . , G k such that G is their join G 1 ∧ · · · ∧ G k . Moreover, it is straightforward that a graph is a cograph if and only if its clique-width is exactly 2.
A key algorithmic property of cographs is the fact that, up to isomorphism, each cograph G can be uniquely represented by a rooted tree T G , called cotree [5], which can be seen as a specialization of a 2-expression defining G. The leaves of T G correspond to the vertices of G, and each internal node u of T G represents either the disjoint union or the join operation of the respective cographs induced by the leaves of the subtrees of T G rooted at each child of u. Another important property is that, given a graph G, recognising G as a cograph, as well as obtaining its respective cotree (if any), can be performed in time linear in the number of vertices and the number of edges of G [6].
Let I = (G, W, , r) be an instance of TCP, where G is a cograph. Since TCP can be easily solved in linear-time if |W | < 3 or G[W ] is connected, we assume throughout this section that |W | ≥ 3 and G[W ] is not connected. Moreover, we assume that G is connected and, therefore, is the join of k ≥ 2 cographs G 1 , . . . , G k . Lemma 3.4. Let G be a cograph that is the join of k ≥ 2 cographs G 1 , . . . , G k , and let W ⊆ V (G) be a terminal set such that |W | ≥ 3 and G[W ] is not connected. There exists a unique i ∈ {1, . . . , k} such that V (G i ) ∩ W = ∅. Moreover, G admits a connection tree for W that contains exactly one router and no linker.
Proof. For the sake of contradiction, suppose that, for some i, j ∈ {1, . . . , k} with i = j, V (G i ) ∩ W = ∅ and V (G j ) ∩ W = ∅. Then, let u ∈ V (G i ) ∩ W , v ∈ V (G j ) ∩ W , and let T be the graph with vertex set V (T ) = W and edge set . Therefore, there exists a unique i ∈ {1, . . . , k} such that V (G i ) ∩ W = ∅. This implies that V (G j ) ∩ W = ∅ for some j ∈ {1, . . . , k} \ {i}. Then, let u ∈ V (G j ) and T be the graph with vertex set V (T ) = {u } ∪ W and edge set E(T ) = {u w | w ∈ W }. One can verify that T is a connection tree of G for W such that L(T ) = ∅ and R(T ) = {u }.
Considering the input graph G as the join of k ≥ 2 cographs G 1 , . . . , G k , it follows from Lemma 3.4 that TCP can be trivially solved if r ≥ 1, or V (G i ) ∩ W = ∅ and V (G j ) ∩ W = ∅ for some i, j ∈ {1, . . . , k}, with i = j. Thus, we dedicate the remainder of this section to resolve the case in which r = 0 and there exists a unique i ∈ {1, . . . , k} such that V (G i ) ∩ W = ∅. Lemma 3.5. Let G be a cograph and W ⊆ V (G) be a non-empty terminal set. If T is a connection tree of G for W such that R(T ) = ∅ and |L(T )| is minimum, then N T (u) ⊆ W for each u ∈ L(T ).
Proof. For the sake of contradiction, suppose that N T (u) ⊆ W for some linker u ∈ L(T ). Since R(T ) = ∅ and leaves(T ) ⊆ W , u belongs to a path P of T between two terminal vertices w, w ∈ W , such that (V (P ) \ {w, w }) ∩ W = ∅. Thus, it follows from the assumption N T (u) ⊆ W that |V (P )| ≥ 4. Since cographs do not contain paths of length 3 as induced subgraphs, there exists a path P of G between w and w such that |V (P )| ≤ 3 and V (P ) ⊆ V (P ). Then, let T be the graph with vertex set V (T ) = (V (T ) \ V (P )) ∪ V (P ) and edge set E(T ) = (E(T ) \ E(P )) ∪ E(P ). One can easily verify that T is a connection tree of G for W such that R(T ) = ∅ and L(T ) L(T ), which contradicts the minimality of |L(T )|.
For each graph G, we let cc(G) denote the set of connected components of G, and we let o(G) = |cc(G)| denote the number of connected components of G.
Corollary 3.6. Let G be a cograph, W ⊆ V (G) be a non-empty terminal set, and let T be a connection tree of On the other hand, it follows from Lemma 3.5 that, for each u ∈ L(T ), N T (u) ⊆ W . In addition, we note that, if u ∈ L(T ) and N T (u) = {w, w }, then w and w belong to distinct connected components of G[W ], otherwise the path (w, u, w ) of T could be replaced by a shortest path of G[W ] between w and w , yielding a connection tree T of G for W such that L(T ) L(T ). Therefore, A connection forest of a graph G for a non-empty terminal set W is a subgraph F of G such that F is a forest and T ∈cc( For each graph G and each non-empty terminal W ⊆ V (G), we let As a degenerate case, we define λ[G, ∅] = 0.
We note that λ[G, W ] = 1 if and only if G admits a connection tree of G for W such that R(T ) = ∅.
Proof. Since G is the disjoint union of G 1 , . . . , G k , there is no edge between the vertices of G i and the vertices of G j for any i, j ∈ {1, . . . , k}, On the other hand, for each i ∈ {1, . . . , k} with V (G i ) ∩ W = ∅, let F i be a routerless connection forests of G i for V (G i ) ∩ W with the minimum number of connected components. One can readily verify that F = F 1 ∪ · · · ∪ F k is a routerless connection forests of G for W . Therefore, On the other hand, let F i be a routerless connection forest of G i for W with the minimum number of connected We define F as the graph (see Fig. 4 One can verify that F is as routerless connection forest of G for W such that concluding the proof. Proof. Let I = (G, W, , r) be an instance of TCP, where G is a cograph on n vertices and m edges. Assume without loss of generality that |W | ≥ 3, G is connected but G[W ] is not connected. Moreover, based on Lemma 3.4 and on Corollary 3.6, assume that r = 0 and ≥ o(G[W ]), respectively. Then, compute λ[G, W ] following the rules described below: The correctness of the rules follows from Lemmas 3.7 and 3.8. Since G admits a routerless connection tree if and only if λ[G, W ] = 1, we have that I is a yes-instance of TCP if and only if λ[G, W ] = 1. Now, we analyse the time complexity of this algorithm. First, we note that λ[G, W ] can be computed in a bottom-up manner, according to the post-order traversal of the cotree T G associated with G, using a dynamic programming matrix indexed by the nodes of T G . Moreover, we recall that T G can be obtained in time O (n + m) cf. [6], and that, by definition, the number of nodes of T G is O (n). Additionally, we note that, before computing λ[G, W ], T G can be preprocessed in time O (n) so that each node u of T G is associated with a flag which informs whether or not V (G u ) ∩ W = ∅, where G u denotes the subgraph of G corresponding to the subtree T u G of T G rooted at u, i.e. G u is the subgraph of G induced by the leaves of T u G . Thus, one can verify that, for each node u of T G , the cell related to u of our dynamic programming matrix, which corresponds to Therefore, λ[G, W ] can be computed in linear time.

Graphs of bounded maximum degree
In this section, we analyse the complexity of TCP when restricted to graphs of bounded maximum degree. More specifically, we prove that TCP remains NP-complete on graphs of maximum degree 3 even if either the parameter ≥ 0 or the parameter r ≥ 0 is fixed. In particular, for fixed r ≥ 0, we show that TCP is NP-complete on graphs of maximum degree 3 that are planar.
It is worth mentioning that, if the input graph G is connected and has maximum degree at most 2, then G is either a path or a cycle, and consequently TCP can be trivially solved in polynomial-time, regardless of or r. Thus, we obtain that our results establish an NP-complete versus polynomial-time solvable dichotomy for TCP with respect to the maximum degree of the input graph.
Another interesting fact about our results is that they separate the complexity of TCP from the complexity of its strict variant, S-TCP. Indeed, while we prove that, for each fixed ≥ 0, TCP is NP-complete on graphs of maximum degree 3, S-TCP was proved to be polynomial-time solvable on graphs of maximum degree 3 even if ≥ 0 is fixed [25].

Fixed number of linkers
First, we consider the case in which the parameter ≥ 0 is fixed: Theorem 4.1. For each ≥ 0, TCP remains NP-complete when restricted to graphs of maximum degree 3.
To prove Theorem 4.1, we present a polynomial-time reduction from an NP-complete variant of 3-SAT called 3-SAT(3) cf. [28]. The 3-SAT(3) problem has as input a set X of boolean variables and a set C of clauses over X that satisfy the following conditions: Each clause in C has two or three distinct literals; Each variable in X appears exactly twice positive and once negative in the clauses belonging to C.
The problem then asks whether there exists a truth assignment α : X → {false, true} such that every clause in C has at least one true literal under α.
Construction 4 (Reduction from 3-SAT(3) to TCP on Graphs of Maximum Degree 3). Let I = (X, C) be an instance of 3-SAT(3), with variable set X = {x 1 , x 2 , . . . , x p } and clause set C = {C 1 , C 2 , . . . , C q }, and let be a non-negative integer. We let G be the graph obtained from I and as follows (see Fig. 5a): Create the vertices u 1 , u 2 , . . . , u and, for each i ∈ {1, 2, . . . , − 1}, add the edges u i u i+1 ; moreover, create the vertices w I and v I and add the edges w I u 1 and u v I , originating the path P I = (w I , u 1 , . . . , u , v I ); For each variable x i ∈ X, create the gadget G i such that Create a complete binary tree T I , rooted at v I , whose leaves are the vertices w 1 1 , . . . , w 1 p ; For each clause C j ∈ C, create the vertices v 1 j , v 2 j and v 3 j , and add the edges v 1 j v 2 j , v 2 j v 3 j and v 3 j v 1 j ; For each clause C j ∈ C, add the edge t a i v b j if the b-th literal belonging to C j corresponds to the a-th occurrence in I of the positive literal x i , for x i ∈ X, a ∈ {1, 2} and b ∈ {1, . . . , |C i |}; on the other hand, add the edge f i v b j if the b-th literal belonging to C j corresponds to the (single) occurrence in I of the negative literal x i , for x i ∈ X and b ∈ {1, . . . , |C j |}.
First, suppose that there exists a truth assignment α : X → {false, true} such that every clause belonging to C has at least one true literal under α. Then, let S be the vertex set defined as follows and let G[S] be the subgraph of G induced by S. We note that G[S] is connected but may contain cycles. Thus, let T be a spanning tree subgraph of G[S] that contains all edges of G[S] except for possibly not containing some edges between the vertices v 1 j , v 2 j and v 3 j , for C j ∈ C. In other words, T is a spanning tree subgraph of It is not hard to check that T is a connection tree of G for W with linker set L(T ) = {u 1 , . . . , u } and router set Therefore, g(I, ) is a yes-instance of TCP. Figure 5 depicts the instance g(I, ) = (G, W, , r) of TCP, obtained from an instance I = (X, C) of 3-SAT(3) and a non-negative integer . It also depicts a connection tree T of G for W , obtained from a truth assignment α : X → {false, true}.
Conversely, suppose that g(I, ) is a yes-instance of TCP, and let T be a connection tree of G for W such |L(T )| ≤ and |R(T )| ≤ 2p. We note that the path P I must be in T , since every path of G between the terminal vertex w I and any other terminal vertex w ∈ W \ {w I } contains all the vertices of P I . Consequently, the graph T = T − P I cannot contain any linker, and all non-terminal vertices of T must be routers. This, along with the fact that ∆(G) = 3, implies that . Then, we define a truth assignment α : X → {false, true} as follows: for each x i ∈ X, α(x i ) = false if and only if f i ∈ V (T ). We note that, for each C j ∈ C, every path of G between the terminal vertices v 1 j , v 2 j , v 3 j and any other terminal vertex w ∈ W \ {v 1 j , v 2 j , v 3 j } must contain one of the vertices t 1 Consequently, every clause in C has at least one true literal under α. Therefore, I is a yes-instance of 3-SAT(3).

Fixed number of routers
Now, we consider the case in which the parameter r ≥ 0 is fixed:   Proof. Itai et al. [19] proved that Hamiltonian cycle is NP-complete on planar graphs of maximum degree 3. Based on their proof (see Lemma 2.1 [19]), we can suppose without loss of generality that the input graph G has at least one vertex of degree 2. Thus, let u ∈ V (G) be such a vertex, and let e = uv be an edge that has u and v as endpoints, for some v ∈ V (G) \ {u}. Then, we define H as the graph obtained from G by subdividing e, i.e. by removing e, adding a new vertex u e and adding the edges uu e and u e v. We note that H is a graph of maximum degree 3 that has at least two adjacent vertices of degree 2 each, namely u and u e . Furthermore, it is immediate that G has a Hamiltonian cycle if and only if H has a Hamiltonian cycle. Proof. Let G be a planar graph of maximum degree 3. Based on Proposition 4.4, assume without loss of generality that G contains two vertices u, v ∈ V (G) such that uv ∈ E(G) and d G (u) = d G (v) = 2. Then, let H be the graph obtained from G by adding two new vertices s and t, and by adding the edges su and vt. We note that H is a graph of maximum degree 3 and that s and t have degree 1 in H each. Furthermore, it is straightforward that G has a Hamiltonian cycle if and only if H has a st-Hamiltonian path.
Below, we finally describe our polynomial-time reduction from st-Hamiltonian path to TCP. We note that this reduction is slightly similar to the one described in Construction 3 to prove the NP-completeness of TCP on strongly chordal graphs.
Construction 5 (Reduction from st-Hamiltonian path to TCP on Planar Graphs of Maximum Degree 3). Let G be a planar graph of maximum degree 3 and s, t ∈ V (G) be distinct vertices of G. Based on Proposition 4.5, assume without loss of generality that d G (s) = d G (t) = 1. Moreover, assume that every vertex of G different from s and t has degree at least 2, otherwise G would certainly not admit a st-Hamiltonian path, i.e. a Hamiltonian path between s and t. Also, assume that V (G) = {u 1 , . . . , u n }, for some positive integer n, where s = u 1 and t = u n . Let r be a non-negative integer. For each u i ∈ V (G) \ {s, t}, let α i : N G (u i ) → |N G (u i )| be the bijection such that, for each two distinct vertices u j1 , u j2 ∈ N G (u i ), we have that α i (u j1 ) < α i (u j2 ) if and only if j 1 < j 2 . We let G be the graph obtained from G, s, t and r as follows (see Fig. 7): Fig. 6a); For each vertex u i ∈ V (G) of degree 3 in G, add new vertices v 1 i , v 2 i , u 1 i , u 2 i , u 3 i and add the edges Fig. 6b) For each vertex u i ∈ V (G) and each vertex u j ∈ N G (u i ), add the edges u a i u b j , where a = α i (u j ) and b = α j (u i ); If r ≥ 1, create the gadget H r and the terminal set W r described in Construction 2, and add the edge ρ r s; otherwise, define W r = ∅.
For each u i ∈ V (G), let G i be the subgraph of G illustrated in Figure 6, i.e. the subgraph of G induced by Note that, H r and, for each u i ∈ V (G), G i are planar. Additionally, it is not hard to verify that the input graph G is isomorphic to the graph resulting from G − H r by identifying every subgraph G i into the vertex u i . Therefore, since G is planar, we have that G is planar as well. Furthermore, it straightforward that G is a graph of maximum degree 3. Then, we let g(G, s, t, r) = (G , W, , r) be the instance of TCP such that W = V (G) ∪ W r and = 4n − 4. Lemma 4.6. Let G be a graph of maximum degree 3 and s, t ∈ V (G) be two distinct vertices of G. Assume that s and t have degree 1 in G each. For each r ≥ 0, G admits a st-Hamiltonian path if and only if the instance g(G, s, t, r) described in Construction 5 is a yes-instance of TCP.
First, suppose that there exists in G a Hamiltonian path such that s = u j1 and t = u jn . Then, let S be the vertex set defined as follows: One can verify that T is a connection tree of G for W such that L(T ) = S \ (V (H r ) ∪ V (G)) and R(T ) = {ρ 1 , . . . , ρ r }. Therefore, g(G, s, t, r) is a yes-instance of TCP.
Consider the graph G depicted in Figure 7a and the graph G and the terminal set W depicted in Figure 7b, obtained from G and a non-negative integer r. Figure 8 illustrates a connection tree T of G for W obtained from the st-Hamiltonian path of G depicted in Figure 8a.
Conversely, suppose that g(G, s, t, r) is a yes-instance of TCP, and let T be a connection tree of G for W such that |L(T )| ≤ 4n − 4 and |R(T )| ≤ r. We note that R(T ) = {ρ 1 , . . . , ρ r }. Consequently, T = T − H r cannot contain any router, and all non-terminal vertices of T must be linkers. Moreover, by construction, s and t have degree 1 in T each. This implies that the vertices u 2 , . . . , u n−1 have degree exactly 2 in T each, otherwise T would not be connected or W ⊆ V (T ). Hence, T consists in a path P between s and t of the form P = (s, u a2 j2 , v c2 j2 , u j2 , v

Concluding remarks
We conclude this work by posing some open questions. First, we ask about the existence of a graph class G on which Steiner tree is polynomial-time solvable while TCP remains NP-complete for fixed . We have shown that, on strongly chordal graphs, TCP is NP-complete for each r ≥ 0, whereas Steiner tree is known to be polynomial-time solvable. However, the complexity of TCP on strongly chordal graphs for fixed has not been settled yet. Analogously, we ask whether there exists a graph class G on which TCP is polynomial-time solvable for fixed while Steiner tree remains NP-complete. We have shown that, on split graphs, TCP is polynomial-time solvable for fixed r ≥ 1, whereas Steiner tree is known to be NP-complete. However, up to our knowledge, for fixed , there is no known example of such a separating class.
In addition, it is worth mentioning that, in our tractability proof of TCP on split graphs, only the cases in which r ≥ 1 or W ∩ K = ∅ are considered. Such hypotheses are imperative in our argumentation so as to ensure the connectivity of the sought connection tree. Thus, we leave as an open question whether TCP can be solved in polynomial-time on split graphs when r = 0 and W ∩ K = ∅.
We also leave as an open question whether TCP parameterized by clique-width is in XP. Through a parameterized-reduction from Hamiltonian path, we have shown that TCP parameterized by clique-width is W[1]-hard. Nevertheless, the question whether TCP is in XP remains unsettled.
Finally, we ask about the complexity of TCP parameterized by the number of terminal vertices. Even though it is well-known that Steiner tree parameterized by the number of terminal vertices is in FPT [12], the complexity of the corresponding parameterization of TCP is widely open.