Modifying a Graph Using Vertex Elimination

Vertex elimination is a graph operation that turns the neighborhood of a vertex into a clique and removes the vertex itself. It has widely known applications within sparse matrix computations. We define the Elimination problem as follows: given two graphs G and H, decide whether H can be obtained from G by |V(G)|−|V(H)| vertex eliminations. We show that Elimination is $\mathsf {W[1]} $ -hard when parameterized by |V(H)|, even if both input graphs are split graphs, and $\mathsf {W[2]} $ -hard when parameterized by |V(G)|−|V(H)|, even if H is a complete graph. On the positive side, we show that Elimination admits a kernel with at most 5|V(H)| vertices in the case when G is connected and H is a complete graph, which is in sharp contrast to the $\mathsf {W[1]} $ -hardness of the related Clique problem. We also study the case when either G or H is tree. The computational complexity of the problem depends on which graph is assumed to be a tree: we show that Elimination can be solved in polynomial time when H is a tree, whereas it remains NP-complete when G is a tree.


Introduction
Consider the problem of choosing a set S of resilient communication hubs in a network, such that if any subset of the hubs should stop functioning then all the remaining hubs in S can still communicate.Such a set is attractive if the probability of a hub failure is high, or if the network is dynamic and hubs can leave the network.We can formulate this as a graph problem in the following way: Given a graph G and an integer k, is there a set S of k vertices, such that if any subset of S is removed from G, then every pair of remaining vertices in S are still connected via paths in the modified graph?Obviously, choosing S to be a clique of size k would solve the problem, but only allowing for cliques is overly restrictive.A necessary and sufficient condition on S is that for each pair u, v ∈ S, either u and v are adjacent or there is a path between u and v in G not containing any vertex of S except for u and v. Thus we can view the described problem as a relaxation of the well-known CLIQUE problem.
The above problem can be restated using a well-known graph operation related to Gaussian elimination: vertex elimination [17].The elimination of a vertex v from a graph G is the operation that adds edges to G such that the neighbors of v form a clique, and then removes v from the resulting graph.With this operation, the above problem can be defined as follows: find a set S of size k such that eliminating all vertices of V (G) \ S leaves S as a clique.In fact, we state a more general problem: the ELIMINATION problem takes as input two graphs G and H , and asks whether a graph isomorphic to H can be obtained by the elimination of |V (G)| − |V (H )| vertices from G. If this is possible, then we say that H is an elimination of G.
The vertex elimination operation described above has long known applications within linear algebra, and it simulates in graphs the elimination of a variable from subsequent rows during Gaussian elimination of symmetric matrices [17].The resulting Elimination Game [17] is an algorithm that takes as input a graph G and an ordering α of its vertices, and eliminates the vertices of G one by one, in the order defined by α, until the graph becomes empty.Finding an ordering α that minimizes the amount of edges added during this process, called the fill-in, is crucial for sparse matrix computations, and a vast amount of results have appeared on this subject during the last 40 years [7,9,17,20].Our problem ELIMINATION is equivalent to stopping Elimination Game after |V (G)| − |V (H )| steps to see whether the resulting graph at that point is isomorphic to H .A crucial aspect of Elimination Game is the order in which the vertices are chosen, as this influences the fill-in.Note however that, for our problem, only the set of |V (G)| − |V (H )| vertices chosen to be eliminated is important, and not the order in which they are eliminated.
Graph modification problems resulting from operations like vertex deletion, edge deletion, edge contraction, and local complementation are well studied, especially within parameterized complexity [2, 5, 10, 12, 14-16, 18, 23, 24].Given the wide use of the vertex elimination operation, we find it surprising that this operation has not been studied in the context of graph modification problems before.The only related study we are aware of is by Samdal [21], who generated all eliminations of the n × n grids for n ≤ 7.

Our Contribution
In this paper we study the computational complexity of ELIMI-NATION.In particular, we show that ELIMINATION is W [1]-hard when parameterized by |V (H )| even when both input graphs are split graphs, and W [2]-hard when parameterized by |V (G)| − |V (H )| even when H is a complete graph.On the positive side, for the case when H is complete, we show that ELIMINATION is fixed-parameter tractable when parameterized by |V (H )|, and admits a kernel with at most 5|V (H )| vertices on connected graphs, which contrasts the hardness of the related CLIQUE problem.We also study the cases when one of the input graphs is a tree.It turns out that the complexity of the problem changes completely depending on which input graph is a tree; we show that if G is a tree then the problem remains NP-complete, whereas if H is a tree then it can be solved in polynomial time.The mentioned kernel result is obtained by proving a combinatorial theorem (Theorem 4) on the maximum number of leaves in a spanning tree of a graph, similar to a proof by Kleitman and West [13].This result might be of independent interest.

Notation and Terminology
All graphs in this paper are undirected, finite, and simple.Let G = (V , E) be a graph.In case V and E are not specified, we use V (G) and E(G) to denote the vertex set and edge set of a graph G, respectively.The neighborhood of a vertex v ∈ V is the set of its neighbors N G (v) = {w ∈ V | vw ∈ E}, and the closed neighborhood of v is the set

, G \ H = G[V (G) \ V (H )].
A clique is a set of vertices that are pairwise adjacent.
is a clique.The complete graph on k vertices is denoted by K k .An independent set is a set of vertices that are pairwise non-adjacent.If G is a bipartite graph, where (A, B) is a partition of V into two independent sets, then we denote it as G = (A, B, E) and we call (A, B) a bipartition of G.A graph is a split graph it its vertex set can be partitioned into a clique and an independent set.
A tree is a connected graph without cycles.A connected subgraph of a tree T is called a subtree of T .For a tree T with at least two vertices, we denote by L(T ) the set of leaves of T .The remaining set of vertices is denoted by I (T ) = V (T ) \ L(T ), and the vertices in I (T ) are called the inner vertices of T .A vertex is a cut-vertex if the removal of the vertex leaves the graph with more connected components than before.For a graph G, by C(G) we denote the set of cut-vertices of G.A connected graph is 2-connected if it does not contain a cut-vertex.A maximal 2-connected subgraph of G is called a biconnected component (bicomp for short), and we denote by B(G) the set of bicomps of G. Consider the bipartite graph T G with the vertex set C(G) ∪ B(G), where (C(G), B(G)) is the bipartition, such that c ∈ C(G) and B ∈ B(G) are adjacent if and only if c ∈ V (B).This graph T G is a tree if G is connected, and is called the bicomp-tree of G.
A parameterized problem Q belongs to the class XP if each instance (I, k) can be solved in |I | g (k) time for some function g that depends only on the parameter k, and |I | denotes the size of I .If a problem belongs to XP, then it can be solved in polynomial time for every fixed k.If a parameterized problem can be solved by an algorithm with running time f (k) |I | O (1) , then we say the problem is fixedparameter tractable.The class of all fixed-parameter tractable problems is denoted by FPT.Between FPT and XP is a hierarchy of parameterized complexity classes where hardness for one of the W-classes is considered to be strong evidence for the problem not being contained in FPT.Two instances (I, k) and (I , k ) of a parameterized problem are equivalent if they are either both yes-instances or both no-instances.A parameterized problem is said to admit a kernel if there is a polynomial-time algorithm (called a kernelization algorithm) that transforms each instance (I, k) of the problem into an equivalent instance (I , k ) of the same problem such that k ≤ k and |I | ≤ h(k) for some function h.If h is a polynomial or a linear function in k, then we say that the problem admits a polynomial kernel or a linear kernel, respectively.We refer to the textbook by Downey and Fellows [5] for formal background on parameterized complexity.

Preliminaries and Hardness of the Elimination Problem
We start this section with an observation that provides a characterization of graphs that have some fixed graph H as an elimination.Our proofs heavily rely on this observation.
Observation 1 [20] Let G and H be two graphs, where V (H ) = {u 1 , . . ., u h }.Then H is an elimination of G if and only if there exists a set S = {v 1 , . . ., v h } of h vertices in G that satisfies the following: For two input graphs G and H that form an instance of ELIMINATION, we let n denote the number of vertices in G.If G and H form a yes-instance, we say that a subset X ⊆ V (G) is a solution if H is the resulting graph when all vertices in X are eliminated.By Observation 1, the vertices in X can be eliminated in any order.A vertex which is not eliminated is said to be saved.The set S = V (G) \ X of saved vertices is called a witness.
Since we can check in polynomial time whether a set S ⊆ V (G) of |V (H )| vertices is a witness, Observation 1 immediately implies the following result.Proof We give a reduction from the CLIQUE problem, which takes as input a graph G and an integer k, and asks whether G contains a clique on at least k vertices.This problem is known to be W [1]-complete when parameterized by k [5].We assume that G is a connected graph on at least four vertices, and that k ≥ 4. From an instance (G, k) of CLIQUE, where G = (V , E), we construct an instance (G * , H ) of ELIMINATION as follows.
We construct a new set of vertices V E = {v uw | uw ∈ E}.Our new graph G * has vertex set V ∪ V E , where each vertex v uw in V E is made adjacent to exactly two vertices in V : u and w.After this, we make V into a clique by adding all possible edges between the vertices of V .This completes the construction of G * , which is a split graph.Observe that every vertex v uw in V E has degree 2, and that these are the only vertices of degree 2 in G * , since we assumed that |V | ≥ 4. Let H be the split graph with vertex set C H ∪ I H , where C H = {x 1 , . . ., x k } is a clique and I H = {y ij | 1 ≤ i < j ≤ k} is an independent set, and where every vertex y ij is (only) adjacent to x i and x j .We claim that H is an elimination of G * if and only if G has a clique of size at least k.
Suppose G has a clique C ⊆ V of size at least k.Let E ⊆ E be the set of edges in G[C], and let V E = {v uw | uw ∈ E } be the corresponding subset of V E .Note that, in G * , the vertices of V E have no neighbor in V \ C. Hence the vertices of C, together with the |C|(|C| − 1)/2 vertices in V E , induce a subgraph in G * that is isomorphic to H .In order to obtain H from G * , we first eliminate all the vertices in V E \ V E in arbitrary order, and then eliminate all the vertices in V \ C in arbitrary order.Note that during this procedure we only eliminate vertices that are simplicial in the current graph, which is equivalent to deleting those vertices from the graph.Hence we can obtain H from G * by eliminating all the vertices in V (G * ) \ (C ∪ V E ), which means that H is an elimination of G * .
For the reverse direction, suppose H is an elimination of G * , and let X ⊆ V (G) be a solution.We consider how the graph under consideration changes each time we eliminate a vertex of X.By Observation 1, we may eliminate the vertices of X in arbitrary order, so let us first eliminate the vertices of X ∩ V E before eliminating the vertices of X ∩ V .Then eliminating a vertex x ∈ X ∩ V E is equivalent to deleting x from the graph.After we have eliminated all the vertices in X ∩ V E , we have obtained a graph G .Note that G is a split graph, that some vertices in the maximum clique of G might be simplicial, and that every vertex of V E that had degree 2 in G * still has degree 2 in G .Every time a vertex x ∈ X ∩ V is eliminated, one of two cases can occur.If x is simplicial, then x is simply deleted from the graph, and the size of the maximum clique decreases by 1. Otherwise, the neighbors of x in V E become adjacent to all the remaining vertices in V ; since we assumed that k ≥ 4, this means they will get degree at least 3 in the final graph.By assumption, we obtain the graph H after eliminating all vertices in X.Note that the vertices of V that were not eliminated have exactly the same two neighbors in H as they had in G * .Let C be this set of neighbors.By the construction of H , we conclude that the vertices of C form a clique of size k in G.
Since ELIMINATION is unlikely to be FPT in general as a result of Theorem 1, it is natural to ask whether certain restrictions on G or H make the problem tractable.In Sect.3, we restrict H to be a complete graph; note that due to Theorem 1, restricting H to be a split graph does not suffice to guarantee tractability.In Sect.4, we study the variant where either G or H is a tree.
Another possible way of achieving tractability is to investigate a different parameterization of the problem.For instance, instead of choosing the size of the witness as the parameter, we can parameterize ELIMINATION by the size of the solution, i.e., the number of eliminated vertices.The next theorem shows that the problem remains intractable with this parameter.
Proof We reduce from the COLORFUL RED-BLUE DOMINATING SET problem.This problem takes as input a bipartite graph G = (R, B, E) with partition classes R and B, an integer k, and a coloring function c : R → {1, . . ., k}.For 1 ≤ i ≤ k, let R i denote the subset of vertices of R with color i.The task is to decide if there exists a set D ⊆ R of k distinctly colored vertices such that D dominates B, i.e., such that B ⊆ N G [D].This problem is known to be W [2]-hard when parameterized by k (Lemma 39 in [4]).From the reduction in [4] it is clear that we may assume, without loss of generality, that none of the sets R i is empty and hence |R| ≥ k; we make this assumption below.Given an instance (G, k, c) of COLORFUL RED-BLUE DOM-INATING SET, where G = (R, B, E), we create an instance (G * , K |V (G * )|−k−1 ) of ELIMINATION as follows.
To construct G * , we start with a copy of G.For each R i , we add two vertices x i , y i and make each of them adjacent to all the vertices in R i .We also add a vertex z and make it adjacent to all the vertices in R, as well as a vertex z that is made adjacent to z only.This finishes the construction of G * ; see also Fig. 1.We claim that Suppose there exists a set D ⊆ R of k distinctly colored vertices such that D is a dominating set of B. For 1 ≤ i ≤ k, let d i be the vertex in D with color i.Graph G * can be transformed into a complete graph by eliminating the following k + 1 vertices.We first eliminate z.This turns the vertices of R ∪ {z } into a big clique.We then eliminate the vertices of D one by one.Each time we eliminate a vertex d i , the vertices x i and y i both become adjacent to each other, and to all the (remaining) vertices of the big clique.The same holds for all the vertices of B that are adjacent to d i .Since D dominates B, the resulting graph is complete.
For the reverse direction, suppose there is a subset X ⊆ V (G * ) of k + 1 vertices in G * whose elimination results in a complete graph.In order to ensure that the vertices of (R i ∪{x i , y i })\X are pairwise adjacent in the final complete graph, X must contain at least one vertex from each of the sets R i ∪ {x i , y i }.Since none of the k sets R i is empty and |X| = k + 1, this means that X contains at most one vertex from B ∪{z, z }.In order to ensure that z is adjacent to all other vertices in the final graph, X must contain either z or z .If X contains neither z nor z , or if X ∩ (B ∪ {z, z }) = {z }, then there will not be any edge between any two distinct sets R i and R j in the final graph.Hence we must have z ∈ X. Eliminating z turns R ∪ {z } into a big clique.In order to ensure that all the vertices x i and y i are adjacent to the vertices of B in the final graph, X contains exactly one vertex, say d i , from each of the sets R i .We claim that the set D = {d 1 , . . ., d k } dominates B. For contradiction, suppose there is a vertex b ∈ B that is not adjacent to any vertex in D. Then b will not be adjacent to any of the vertices x i , y i in the final graph.This contradiction proves that D dominates B, and thus (G, k, c) is a yes-instance of COLORFUL RED-BLUE DOMINATING SET.
We point out that the reductions used in the proofs of Theorems 1 and 2 immediately imply that the unparameterized version of ELIMINATION is NP-complete, even if both G and H are split graphs, or if H is a complete graph.

Eliminating to a Complete Graph
In this section, we consider a special case of the ELIMINATION problem when H is a complete graph.This corresponds exactly to the problem described in the first paragraph of Sect. 1.We define the problem CLIQUE ELIMINATION, which takes as input a graph G on n vertices and a positive integer k, and asks whether the complete graph K k is an elimination of G. Recall that CLIQUE ELIMINATION is W[2]-hard when parameterized by |V (G)| − k due to Theorem 2. In this section, we study the parameterized complexity of CLIQUE ELIMINATION when we choose k as the parameter.
If G contains a tree T with k leaves as a subgraph, then K k is an elimination of G, as the leaves of T can serve as a witness.It is easy to observe that G contains a tree with k leaves as a subgraph if and only if G contains K 1,k , i.e., a star with k leaves, as a minor.Moreover, by Observation 1, for any fixed graph H , the property that H is an elimination of a graph G can be expressed in monadic second-order logic.Since graphs that exclude K 1,k as a minor have bounded treewidth [19], Courcelle's Theorem [3] implies that CLIQUE ELIMINATION fixed-parameter tractable when parameterized by k.
Even though fixed-parameter tractability of CLIQUE ELIMINATION is already established, two interesting questions remain.Does the problem admit a polynomial kernel?Does there exist an algorithm for the problem with single-exponential dependence on k?We provide an affirmative answer to both questions below.In particular, we prove the following result.
Theorem 3 CLIQUE ELIMINATION on connected graphs admits a kernel with at most 5k vertices that can be computed in O(n 3 ) time.
We would like to remark that the assumption that the input graph is connected is probably necessary: CLIQUE ELIMINATION on general graphs admits a simple composition algorithm that takes the disjoint union of instances, so the existence of a polynomial kernel in the general setting would imply that NP ⊆ coNP/poly.We refer an interested reader to the work of Bodlaender et al. [1] for an introduction to the methods of proving implausibility of polynomial kernelization algorithms.
As a result of Theorem 3, we can obtain an algorithm with single-exponential dependence on k, thus outperforming the algorithm obtained from the aforementioned combination of meta-theorems.for each subset S ⊆ V (G) such that |S| = k, we test whether eliminating all vertices in V (G) \ S yields the graph K k .The latter test can be performed in time O(n 2 ) by using an algorithm due to Tarjan and Yannakakis [22].
Let (G, k) be an instance of CLIQUE ELIMINATION.The pair (G, k) is a yesinstance if and only if there is a connected component G i of G such that (G i , k) is a yes-instance due to the fact that for any witness S, all the vertices of S must belong to a single connected component of G. Hence we may assume that G is connected.We apply the O(n 3 )-time kernelization algorithm of Theorem 3 to obtain an equivalent instance (G , k ) such that k ≤ k and G is a connected graph on at most 5k vertices.We then solve the problem on this instance in time using the brute-force approach described above.It follows from Sterling's formula that The remainder of this section is devoted to the proof of Theorem 3. Before presenting the formal proof, we give some intuition behind our approach.Our kernelization algorithm is based on the observation that the max-leaf number of a graph, i.e., the maximum number of leaves a spanning tree of the graph can have, is a lower bound on the size of a complete graph that can be obtained as an elimination.Kleitman and West [13] showed that a connected graph G with minimum degree at least 3 admits a spanning tree with at least |V (G)|/4 + 2 leaves.Their result immediately leads to a linear kernel for CLIQUE ELIMINATION provided that the input graph G has minimum degree at least 3. Unfortunately, we are unable to get rid of all vertices of degree at most 2 in our setting.However, we can modify our input graph in polynomial time such that we either can solve the problem directly, or obtain a new graph G * with no vertices of degree 1 and with no edge between any two vertices of degree 2. We then prove a modified version of the aforementioned result by Kleitman and West [13], namely that such graphs G * admit a spanning tree with at least |V (G * )|/5 + 2 leaves.This leads to Theorem 3.
We now proceed with the formal proof of Theorem 3. Following Observation 1, we will be looking for a set S that is a witness of cardinality k, i.e., every two nonadjacent vertices of S can be connected by a path of which all internal vertices are outside S.
We start by providing four reduction rules, i.e., polynomial-time algorithms that, given an instance (G, k) of CLIQUE ELIMINATION, output an instance (G , k ) of the same problem.A reduction rule is safe if the instances (G, k) and (G , k ) are equivalent.Since Theorem 3 states that CLIQUE ELIMINATION admits a linear kernel for connected graphs, we assume the graph G in every input instance (G, k) to be connected.Moreover, since we only eliminate vertices in each of the reduction rules and the vertex elimination operation preserves connectivity, the graph G in every output instance (G , k ) is also connected.Proof Reduction Rule 1 is trivially safe in case k ≤ 2. Suppose k = 3.If G contains a vertex u of degree at least 3, then K 3 is an elimination of G, as three neighbors of u can serve as a witness.Recall that G is a connected graph.If G contains no vertex of degree at least 3, then G is either a cycle or a path.If G is a cycle, then eliminating all but three vertices of G yields K 3 , showing that K 3 is also an elimination of G in this case.If G is a path, then K 3 is not an elimination of G, since eliminating any vertex in a path results in a shorter path.

Reduction Rule 2 If k > 3 and G contains a vertex v of degree 1, then eliminate its sole neighbor v to obtain a graph G . Output the instance (G , k).
Lemma 2 Reduction Rule 2 is safe.
Proof We need to argue that if we can find a witness S, then we can also find a witness S of the same size that does not contain v .If v / ∈ S, then we set S = S.If v ∈ S, then we claim that v / ∈ S. For contradiction, suppose v ∈ S. Since v is adjacent only to v and all the vertices of S form a clique in the graph obtained by eliminating all the vertices in V (G) \ S, we must have k ≤ 2. This contradicts the assumption that k > 3. We now set S = (S \ {v }) ∪ {v} to obtain a witness set of the same cardinality that does not contain v .
Proof Again, we need to argue that if we can find a witness S, then we can also find a witness S of the same size that does not contain v .If v / ∈ S, then we set S = S. Suppose that v ∈ S. Since k > 3, neither v 1 nor v 2 belongs to S. We set S = (S \ {v }) ∪ {v 1 } to obtain a witness set of the same cardinality that does not contain v .Proof We need to argue that if we can find a witness S, then we can also find a witness S of the same size that does not contain v 0 .If v 0 / ∈ S, then we set S = S. Suppose that v 0 ∈ S. Since k > 3, the set S contains at most one vertex from the set {v 1 , v 2 , v 3 }, as otherwise one of them could be connected to at most two other vertices from S via paths avoiding other vertices from S.
It is easy to check that S defined in this manner is a witness of the same cardinality that does not contain v 0 .
We are now ready to describe our kernelization algorithm in detail and argue why it runs in time O(n 3 ).Let (G, k) be an instance of CLIQUE ELIMINATION that is given as input to our kernelization algorithm.If k ≤ 3, then the algorithm applies Reduction Rule 1 and terminates.If k > 3, then we exhaustively apply Reduction Rules 2, 3 and 4 as follows; note that the parameter does not change during the execution of any of these three rules.First, we check in linear time whether G has a vertex of degree 1, and apply Reduction Rule 2 if this is the case.If G has no vertex of degree 1, then we check, again in linear time, whether G has two adjacent vertices v 1 , v 2 of degree 2.
If so, then we apply Reduction Rule 3 if v 1 and v 2 have a common neighbor v , and we apply Reduction Rule 4 otherwise.Suppose G has no vertices of degree 1 and no edge between any two vertices of degree 2. If G has at most 5k − 11 vertices, then we output the current instance (G, k) as the obtained kernel.Otherwise, i.e., if G has at least 5k − 10 vertices, then we can safely return a trivial yes-instance due to Theorem 4 below, which is our modified version of the aforementioned result by Kleitman and West [13].
From the description of the algorithm it is clear that deciding which reduction rule to apply can be done in linear time.Applying any of the reduction rules takes O(n 2 ) time, which is the time it takes to eliminate a vertex.Since the number of vertices strictly decreases at every step, the kernelization algorithm has an overall running time of O(n 3 ).This concludes the proof of Theorem 3.
The proof of Theorem 4 below closely follows the proof of the aforementioned result by Kleitman and West [13], but requires a more extensive case analysis when picking the initial tree T that is grown into a spanning tree with the required number of leaves, and we add a fourth "growing rule" to the three rules that were used by Kleitman and West.Note that we cannot drop the condition that no two vertices of degree 2 are adjacent in the theorem below, as no cycle admits a spanning tree with more than two leaves.
Theorem 4 Let G be a connected graph with minimum degree at least 2 such that no two vertices of degree 2 are adjacent.Then G admits a spanning tree with at least |V (G)|/5 + 2 leaves, and this bound is best possible.
Proof We gradually grow a tree T in G keeping track of three parameters: n, the number of vertices in T ; l, the number of leaves in T ; m, the number of dead leaves in T , i.e., leaves of T that have no neighbor in G \ T .The tree will be grown via a number of operations called expansions: by an expansion of a vertex x ∈ V (T ) we mean the adding of all the vertices v ∈ V (G) \ V (T ) with xv ∈ E(G) and all the edges xv ∈ E(G) with v / ∈ V (T ) to the tree T .We start with a tree T such that only leaves of T have neighbors in G \ T .Therefore, if we only use expansions to grow the tree, at each step of the growth process only the leaves of T are adjacent to G \ T .A leaf that is not dead, is called alive.
For a tree T , we consider the potential φ(T ) defined as φ(T ) = 4l + m − n.The goal is to: (a) find a starting tree T with φ(T ) ≥ 9; (b) provide a set of growing rules, such that there is always a rule applicable unless T is a spanning tree, and φ(T ) does not decrease during the application of any rule; (c) prove that during the whole process the potential increases by at least 1.Goal (a) can be achieved by a careful case study, the full description of which we give at the end of the proof.

If goals
Having chosen the starting tree T , we can proceed with the growing rules.In order to grow the tree we always choose the rule that has the lowest number among the applicable ones, i.e., when applying a rule, we can always assume that the ones with lower numbers are not applicable.The four growing rules are illustrated in Fig. 2. We would like to point out that the first three rules were already used in the original proof of Kleitman and West [13].Growing Rule 2 If some vertex v ∈ V (G \ T ) is adjacent to at least two leaves of T , expand one of these leaves.Observe that, as Rule 1 was not applicable and only leaves of T are adjacent to G \ T , this expansion results in adding only v to T .Moreover, all the remaining leaves adjacent to v were alive but become dead, so the potential φ(T ) increases by at least 1 − 1 = 0.

Growing Rule 3
If there is a vertex v ∈ V (G \ T ) of degree at least 3 in G that is adjacent to a leaf x of T , expand x (which results in adding only v to T , as Rule 1 was not applicable) and then expand v.The potential increases by at least 4 where d ≥ 3 is the degree of v, as all the other neighbors of v are added to T as leaves, due to Rule 2 not being applicable.

Growing Rule 4
If there is a vertex v ∈ V (G \ T ) of degree 2 in G that is adjacent to a leaf x of T , expand x (which results only in adding v as a leaf, as Rule 1 was not applicable), then expand v, and then expand the second neighbor v of v that Fig. 3 The trees T chosen to start the growing process, for each of the cases became a leaf in T during the previous expansion.Note that v could not be already in T , as otherwise Rule 2 would be triggered on vertex v. Since we assumed that no vertices of degree 2 are adjacent in G, the degree of v is at least 3 and, as Rule 3 was not applicable, none of the neighbors of v was in T .Denote by d the degree of v ; therefore, we have added to the tree T exactly d + 1 vertices (v, v and d − 1 other neighbors of v ) and increased the number of leaves by exactly d − 2. Hence, the increase of the potential is 4 Let us now argue why goal (c) is achieved.It is clear that if Growing Rule 1 or 3 is applied at least once, then the potential increases by at least 1.Suppose only Growing Rules 2 and 4 are applied during the whole process.Let x be a vertex of G that was added to T as a leaf during the very last rule application.Then x is a dead leaf.Since this was not taken into account when we determined a lower bound of 0 on the increase of the potential, the potential increases by at least 1.Thus, from the previously described analysis we conclude that using the presented method we are able to grow a tree with at least |V (G)|/5 + 2 leaves.
We now show that goal (a) can be achieved, i.e., that we can always find a starting tree T in G such that φ(T ) ≥ 9. Recall that G is a connected graph with minimum degree at least 2 such that no two vertices of degree 2 are adjacent.This implies that the maximum degree of G is at least 3.We distinguish several cases below, and argue how we can find a starting tree T with φ(T ) ≥ 9 in each of these cases (see Fig. 3 for guidance along the proof): 1.If the maximum degree of G is at least 4, we start with T being a star consisting of a vertex v of degree at least 4 as the center and all its neighbors attached as pendants.The potential of this tree T is equal to at least 4d where d ≥ 4 is the degree of v. From now on, we assume that the maximum degree of G is equal to 3. 2. Assume that no vertices of degree 3 are adjacent in G. Take any vertex w of degree 2 and let s, t be his neighbors.Note that both s and t have degree 3. denote them by u, v.
3.1.Assume that u and v have no common neighbors.Then we take as T the tree on 6 vertices consisting of the edge uv and all neighbors of u, v attached to either u or v as leaves.This tree has 4 leaves, so its the potential is equal to at least 4 • 4 − 6 = 10 ≥ 9. 3.2.Assume that u and v have exactly two common neighbors s and t.Observe that then N(u) = {v, s, t} and N(v) = {u, s, t}.Take as T the star having u as the center and v, s, t as three leaves.Observe that the potential of this tree is at least 4 • 3 + 1 − 4 = 9, as v is a dead leaf.3.3.Finally, assume that u and v have exactly one common neighbor w.Observe that if u and w had any common neighbor apart from v, or v and w had any common neighbor apart from u, then we would be able to proceed with the pair (u, w) or with the pair (v, w) as in Case 3.2.Therefore, assume that N(u) ∩ N(w) = {v} and N(v) ∩ N(w) = {u}.Let u be the remaining neighbor of u and v be the remaining neighbor of v.By what we assumed so far, we know that u = v and neither u nor v is adjacent to w.If any of them had degree at least 3, then we would be able to apply Case 3.1 with the pair (u, u ) or with the pair (v, v ).Therefore, assume that both u and v have degree 2. Then u and v are not adjacent, since we assumed that no vertices of degree 2 are adjacent in G. Denote their second neighbors, different from u and v, by u and v , respectively.As the maximum degree in G is equal to 3, at least one of them is not adjacent to w; assume without loss of generality that u is not adjacent to w.Of course, u is also not adjacent to v, as u / ∈ {u, w, v } and has degree 3. Therefore, we can use the same reasoning as in Case 2.1, starting with the vertex u as the degree-2 vertex.
It remains to show that the bound |V (G)|/5 + 2 in Theorem 4 is best possible.An infinite family of graphs G satisfying the premises of the theorem and having a spanning tree with exactly |V (G)|/5 + 2 leaves can be obtained by connecting a number of diamonds in the way as shown in Fig. 4.This completes the proof of Theorem 4.

The Elimination Problem on Trees
In this section, we study ELIMINATION when G or H is a tree.When H is a tree, we show in Sect.4.1 that the problem can be solved in polynomial time.We then show in Sect.4.2 that when G is a tree, the problem is NP-complete.

Eliminating to a Tree in Polynomial Time
In this subsection, we present a polynomial-time algorithm for solving ELIMINA-TION on input pairs (G, H ) where H is a tree.We first prove a sequence of lemmas that show that if a graph G contains a tree H as an elimination, then there exists a witness that satisfies some nice structural properties.These properties will then be exploited in the proof of Theorem 5, where our algorithm uses a dynamic programming approach on the bicomp-tree of G to find a witness with the aforementioned nice properties, or to conclude that H is not an elimination of G.
Let (G, H ) be an instance of ELIMINATION where G is a connected graph and H is a tree on at least 3 vertices.This implies in particular that L(H ) = ∅ and I (H ) = ∅; recall that L(H ) and I (H ) denote the sets of leaves and inner vertices of H , respectively.Also recall that C(G) and B(G) denote the sets of cut-vertices and bicomps of G, respectively, and that T G is the bicomp-tree of G.
Throughout this subsection, up to the statement of Theorem 5, we assume that (G, H ) is a yes-instance, i.e., that H is an elimination of G. Let S = {v x | x ∈ V (H )} be a witness, where v x is the vertex of G that corresponds to the vertex x of H , and let X = V (G) \ S be the corresponding solution yielding H .The witness S satisfies the structural properties given in the two following lemmas.

Lemma 5 For any bicomp B ∈ B(G) it holds that |V (B) ∩ S| ≤ 2, and if v x , v y ∈ V (B) ∩ S for x = y, then xy ∈ E(H ).
Proof To obtain a contradiction, assume that there is a bicomp B ∈ B(G) that contains three vertices v x , v y , v z ∈ S. Since any bicomp with at least three vertices is a 2-connected graph, B has two vertex-disjoint v x , v y -paths.Suppose, for contradiction, that at least one internal vertex v q of one of these paths belongs to S, i.e., is not eliminated.Then x, y and q belong to a cycle of length at least 3 in H , contradicting the assumption that H is a tree.Hence, all internal vertices of these two v x , v y -paths are eliminated, and consequently v x and v y are adjacent in the graph obtained from G by the elimination of X.By the same arguments, we conclude that v x , v z and v y , v z are adjacent in this graph, i.e., it has a triangle; a contradiction.To prove the second claim of the lemma, it is sufficient to observe that V (B) ∩ S = {v x , v y } and, therefore, B contains a v x , v y -path that avoids other vertices of S. Hence, v x and v y are adjacent in the graph obtained from G by the elimination of the vertices of X, and xy ∈ E(H ).

Lemma 6 For any x ∈ I (H ), v x ∈ C(G).
Proof To obtain a contradiction, assume that there is a vertex x ∈ I (H ) such that v x is not a cut-vertex of G. Let B be the bicomp of G that contains v x .Since x is an inner vertex of H , x is adjacent to at least two vertices y 1 , y 2 .For i = 1, 2, G has a v x , v y ipath P i that avoids the vertices of S \ {v x , v y i }.Let u 1 and u 2 be the vertices adjacent to v x in P 1 and P 2 respectively.Observe that u 1 , u 2 ∈ V (B), because v x is not a cutvertex.The 2-connected graph B contains a u 1 , u 2 -path P that avoids v x .Suppose that some vertex v z ∈ S is an inner vertex of P .By Lemma 5, v z is the unique vertex of S in P .By concatenating the v z , u i -subpath of P and the u i , v y i -subpath of P i , we obtain a v z , v y i -walk in G that avoids other vertices of S for i = 1, 2. It follows that z is adjacent to y 1 and y 2 , which would imply a cycle with vertices z, y 1 , x, y 2 in H ; a contradiction.Therefore, the set of inner vertices of P does not include any vertex of S. Then the concatenation of the v y 1 u 1 -subpath of P 1 , P , and the u 2 , v y 2 -subpath of P 2 gives a v y 1 , v y 2 -walk in G that avoids S \ {v y 1 , v y 2 }.This means that y 1 and y 2 are adjacent in H , yielding the desired contradiction.
Lemmas 5 and 6 exhibit some properties of the witness S, and these properties hold for any witness.In particular, Lemma 6 shows that for every inner vertex x of H , the corresponding vertex v x in S is a cut-vertex in G. Lemmas 7 and 8 below imply that there exists a witness S such that a similar property holds for the leaves of H .To be more precise, Lemma 8 implies that there exists a witness S such that for every leaf x of H , the corresponding vertex v x in S is either a cut-vertex of G, or a vertex of a bicomp B of G that contains exactly one cut-vertex of G. Lemma 7 shows that in the latter case, replacing v x in S by any other vertex of V (B) \ C(G) yields another witness.

Lemma 7 Let x ∈ L(H ) and suppose that v x ∈ V (B) \ C(G) for a bicomp B. Let v x be an arbitrary vertex of V (B) \ C(G) and S = (S \ {v
x }) ∪ {v x }.Then the graph obtained from G by the elimination of X = V (G) \ S is isomorphic to H , where the isomorphism maps any vertex y ∈ V (H ) \ {x} to v y and maps x to v x .
Proof Since the lemma trivially holds when v x = x x , we assume that v x = v x .First, we observe that v x / ∈ S. Otherwise, v x = v z for some leaf z of T , since v z ∈ C(G) for any inner vertex z due to Lemma 6.Then by Lemma 5, the leaves z and x are adjacent in H ; a contradiction.
Let y be the unique inner vertex in H that is adjacent to x.The graph G has a v x , v y -path P that avoids the vertices of S \ {v x , v y }.By Lemma 6, v y ∈ C(G).The bicomp B contains a v x , v x -path P .If P has a vertex v z ∈ S distinct from v x , then by Lemma 5, z is adjacent to x in H . Hence, z = y and the v x , v y -subpath of P avoids other vertices of S .If P has no vertices from S except v x , then the v x , v ywalk obtained by the concatenation of P and P avoids other vertices of S .In both cases we conclude that v x and v y are adjacent in the graph obtained from G by the elimination of X .Now suppose that there is a v x , v z -path P in G that avoids the vertices of S \ {v x , v z } for a vertex z ∈ V (H ) such that z = y.If P contains a vertex u ∈ S \{v z }, then u = v x , since all other vertices of S are also vertices of S. Then the v x , v z -subpath of P avoids the vertices of S \ {v x , v z }.This implies that v x and v z are adjacent in the graph obtained from G by eliminating X; a contradiction, as v x is only adjacent to v y in this graph.Hence, P avoids the vertices of S \ {v z }.The 2-connected graph B has a v x , v x -path P that avoids v y .Since P is a path in B, P cannot contain any vertex of S except v x .Then the v x , v z -walk obtained by the concatenation of the path P and P avoids the vertices of S \ {v x , v z }; a contradiction.
We conclude that there is a v x , v z -path in G that avoids S \ {v x , v z } if and only if z = y.
It remains to prove that replacing x by x in the witness S does not influence the adjacencies between any other vertices in H . Assume that for two vertices and it follows that v x is adjacent to v z 1 and v z 2 in the graph obtained from G by eliminating X; a contradiction.Finally, suppose that for two vertices z 1 , z 2 ∈ V (H ) \ {x}, there is a v z 1 , v z 2 -path P in G that avoids the vertices of S \ {v z 1 , v z 2 } but includes a vertex from S \ {v z 1 , v z 2 }.Then P contains v x , and the v x , v z 1 -and v x , v z 2 -subpaths of P avoid the vertices of S \ {v x , v z 1 } and of S \ {v x , v z 2 }, respectively.Hence, y = z 1 = z 2 ; a contradiction.

Lemma 8 Let x ∈ L(H ) and suppose that
Then there is a vertex v x ∈ V (B) ∩ C(G) such that the graph obtained from G by the elimination of X = V (G) \ S , where S = (S \ {v x }) ∪ {v x }, is isomorphic to H , where the isomorphism maps any vertex y ∈ V (H ) \ {x} to v y and maps x to v x .
Proof For a cut-vertex c ∈ V (B) ∩ C(G), denote by G c the subgraph of G obtained by the removal of the vertices of the connected components of G − c that do not contain the vertex v x .We claim that if To prove the claim, assume for contradiction that for each c ∈ as follows.By Lemma 5, B contains at most two vertices of S, and if The 2-connected graph B has a v x , c 1 -path P 1 and a v x , c 2 -path P 2 that avoid c 2 and c 1 respectively.By our assumption, for each i ∈ {1, 2}, there is a vertex Then there is a c i , v z i -path P i for each i ∈ {1, 2}.Let v y i be the first vertex from S \ {v x } on the path Q i obtained by the concatenation of P i and P i , if we are looking from v x .Then the v x , v y i -subpath of Q i avoids the vertices of S \ {v x , v y i } for each i ∈ {1, 2}.It means that v x is adjacent to v y 1 and v y 2 in the graph obtained from G by the elimination of X, contradicting the assumption that x is a leaf of H .
We now use this claim as follows.Let c ∈ V (B) ∩ C(G) be a cut-vertex such that S ⊆ V (G c ), and let Y = V (G) \ V (G c ).By our claim, Y ⊆ X, and the elimination of X can be seen as the consecutive elimination of Y and X \ Y .Observe that the graph obtained from G by the elimination of Y is the graph G c , and c is not a cut-vertex of G c .By Lemma 7, we can replace v x by c in S.
Lemmas 6, 7 and 8 together imply that there exists a witness S that is a subset of The existence of such a witness S will be used in the proof of Theorem 5, where our algorithm for ELIMINATION will use a dynamic programming approach to find such a witness S , or to conclude that no such witness, and hence no witness at all, exists.In order to be able to explain this in more detail, we need to introduce some additional terminology and prove two more lemmas.
We choose an arbitrary inner vertex z of H and say that it is the root of H .The root defines the parent-child relation between any two adjacent vertices of H .For any two vertices x, y ∈ V (H ), we say that y is a descendant of x if x lies on the unique path in H from y to the root z.If y is a descendant of x and xy ∈ E(H ), then y is a child of x, and x is the parent of y.By definition, every vertex x ∈ V (H ) is a descendant of itself.For a vertex x ∈ V (H ), H x denotes the subtree of H induced by the descendants of x, and for a vertex x ∈ V (H ) with a child y, H xy is the subtree of H induced by x and the descendants of y.
Consider r = v z ∈ V (G).We choose r to be the root of the bicomp-tree T G of G.By Lemma 6, r is a cut-vertex in G.The root r defines the parent-child relation on T G .Each bicomp B is a child of some inner vertex c in T G , and we say that the vertices of B are children For a cut-vertex c, we write G c to denote the subgraph of G induced by the descendants of c.For a cut-vertex c and a bicomp B such that B is a child of c in T G , G cB is the subgraph of G induced by the vertices of B and the descendants of all cut-vertices c ∈ V (B) \ {c}.Now consider two vertices p and q in H , such that neither is a descendant of the other, and let x be their lowest common ancestor.A crucial observation in our algorithm is that v p and v q are descendants of v x in G, and there are exactly two bicomps B and B such that B and B are children of v x and such that v p belongs to G v x B and v q belongs to G v x B .In particular, there does not exist a single bicomp B such that B is a child of v x and both v p and v q belong to the graph G v x B .The following lemma formalizes and generalizes this idea.
We need one more lemma in the correctness proof of our dynamic programming algorithm in the proof of Theorem 5. Recall that H is an elimination of G with witness S = {v x | x ∈ V (H )}, and that we have rooted H at vertex z and the bicomp-tree T G at vertex r = v z .Let H x be a subtree of H for some x ∈ V (H ).Informally speaking, the following lemma shows that H x is an elimination not only of the subgraph G v x , i.e., of the subgraph of G corresponding to the subtree of T G rooted at v x , but also of any subgraph of G corresponding to a subtree of T G rooted at a vertex c ∈ C(G) appearing "higher" in T G than v x , i.e., a vertex c ∈ C(G) such that v x is a descendant of c in T G .

Lemma 10 For any inner vertex x ∈ V (H ) and any cut-vertex
and there is a c, v x -path in G c that avoids S x \ {v x }.Moreover, for any inner vertex x ∈ V (H ) with a child y, any cut-vertex c ∈ V (G) such that v x is a descendant of c, and any bicomp B such that B is a child of c in T G and v y ∈ V (G cB ), H xy is an elimination of G cB with witness S xy = {v y | y ∈ V (H xy )}, and there is a c, v x -path in G cB that avoids S xy \ {v x }.
Proof First observe that, by Lemma 9, for any p ∈ V (H ) \ {x}, p is a descendant of x in H if and only if v p is a descendant of v x in G. Hence, to prove the lemma it is sufficient to observe that for any two vertices The second claim is proved by the same arguments.
We now present a polynomial-time algorithm for deciding whether a given tree H is an elimination of a given graph G.
Theorem 5 ELIMINATION can be solved in time O(n 9/2 ) when H is a tree.
Proof Let G and H be an instance of ELIMINATION where H is a tree.Since H is a connected graph, the graph G can be eliminated to H if and only if at least one connected component of G can be eliminated to this graph.Hence, we assume without loss of generality that G is connected.Since any graph with at least one vertex can be eliminated to K 1 , and K 2 is an elimination of any graph that contains at least one edge, we may also assume that H has at least three vertices.Since we made exactly the same assumptions at the start of Sect.4.1, we may now apply all the lemmas that were proved in the subsection.
Clearly, if |V (H )| > n, then we have a no-instance of the problem.Hence, we assume that |V (H )| ≤ n.For the tree H , we choose an arbitrary inner vertex z and make it the root of H .For the graph G, we find the set of cut-vertices C(G) and the set of bicomps B, and construct the bicomp-tree T G .We then construct a set U ⊆ V (G) as follows: for each bicomp B that is a leaf of T G , we choose an arbitrary vertex u ∈ V (B) \ C(G) and include it in U .As we already pointed out just below Lemma 8, it follows immediately from Lemmas 6, 7 and 8 that H is an elimination of G if only if G can be eliminated to H with a witness S ⊆ C(G) ∪ U .solutions where u is not saved.The correctness of Step 1 follows from Lemma 10.We use Step 2 to find all elements of R u that correspond to the partial solutions where u is a saved vertex.The correctness of this step follows from Lemmas 9 and 10.
Finally, we analyze the running time.It is well-known that for a connected graph G, the set of cut-vertices C(G) and the set of bicomps B can be found and the bicomp-tree can be constructed in linear time.There are at most n cut-vertices that can be chosen as the root of G.For each choice, we run our dynamic programming algorithm.The initial assignment of R u for each u ∈ U can be done in O(n) time, and we have at most n vertices in U .For each u ∈ C(G), Step 1 can be done in O(n • |D u |) time.For Step 2, for each x ∈ V (H ) we use the Hopcroft-Karp algorithm [11] to check existence of a system of distinct representatives y 1 , . . ., y l from the sets T 1 , . . ., T k .Observe that we can omit running the algorithm if l > k; thus we can assume that l ≤ k ≤ |D As function f (t) = t 5/2 is increasing and convex, we infer that u∈C(G) |D u | 5/2 ≤ n 5/2 .Therefore, the whole dynamic programming routine runs in O(n 7/2 ) time.Since we run the dynamic programming algorithm for O(n) choices of the root r, it follows that the total running time is O(n 9/2 ).

Eliminating from a Tree is NP-Complete
In this subsection, we consider the case when G is a tree and H is an arbitrary graph.First, we make the following observation.A connected graph is called a block graph if each of its bicomps is a complete graph.Observe that if G is a block graph, then elimination of any vertex v results in another block graph, because this operation unites all maximal cliques that contain v into a single clique and then removes v. Since trees are block graphs, it gives us the following proposition.

Proposition 1 If H is an elimination of a tree G, then H is a block graph.
Despite the fact that graphs that are eliminations of trees have relatively simple structure, it turns out that ELIMINATION remains NP-complete when G is assumed to be a tree.In order to prove this result (Theorem 6 below), we first prove three auxiliary results.
For a graph G, the distance dist G (u, v) between a pair of vertices u and v of G is the number of edges on a shortest path between them.The diameter of G is defined as diam Our first auxiliary result follows directly from Observation 1.

Lemma 11 Let H be a graph that is obtained by the elimination of a set of vertices X of a graph G, and let
Let G be a tree, let k ≥ 2 be an integer, and let Q = {v 1 , . . ., v k } be a subset of the vertices of G such that no v i is an inner vertex of a path between any two vertices in Q.Then G contains a (unique) maximal subtree, denoted by T Q , that contains all the vertices of Q as leaves.We point out that although the set of leaves of T Q contains the set Q by definition, T Q might have other leaves as well.To see this, note that if we take G to be a star with s ≥ 3 leaves and Q to be any subset of exactly s − 1 leaves, then the tree T Q = G has s > |Q| leaves.

Lemma 12
Let H be a graph on at least two vertices that is obtained from a tree G by the elimination of a subset X of vertices of G. Let Q = {v 1 , . . ., v k } be a maximal clique of H . Then k ≥ 2 and no vertex of Q is an inner vertex of a path in G between any two vertices of Q.Moreover, Proof Because H is a graph on at least two vertices that is obtained from a connected graph, namely the tree G, we find that H is connected.Hence, k ≥ 2. As Q forms a clique in H , for every two vertices v i , v j ∈ Q, the unique path between v i and v j in G does not contain other vertices from Q.This implies that the subtree T Q of G, as defined just above Lemma 12, exists.We now prove that For contradiction, suppose there is a vertex u ∈ V (T Q ) \ Q such that u / ∈ X.Let T be the unique subtree of T Q whose leaves are exactly the vertices of Q.Note that u is not a vertex of T , as otherwise Q would not form a clique in H . Also note that u is not adjacent to any of the vertices in Q.Now let u be the neighbor of u on the unique path in G from u to a vertex of T .We may assume that u ∈ X, as otherwise we can choose u instead of u.We first eliminate all vertices of T not equal to u .Afterward, Q is a clique and u is adjacent to all vertices of Q.Then eliminating u makes u adjacent to all vertices of Q.Because u / ∈ X, this implies that H contains a clique Q = Q ∪ {u}.This contradicts the maximality of Q. Hence V (T Q ) \ Q ⊆ X, and consequently Q is obtained by the elimination of V (T Q ) \ Q.This completes the proof of Lemma 12.
We now state the third auxiliary result that will be used in the proof of Theorem 6 below.

Lemma 13
Let H be a graph on at least two vertices that is obtained from a tree G by the elimination of a subset X of vertices of G.
Proof Because H is a graph on at least two vertices that is obtained from a connected graph, namely the tree G, we find that H is connected.Hence, each Q i contains at least two vertices.By Lemma 12, the trees T Q i exist, and the elimination of T Q i yields Q i for i = 1, . . ., r.This means that the sets V (T an edge incident with v and some other vertex v i , which is not contained in some Q h with h = i, because the cliques Q 1 , . . ., Q r are maximal.We conclude that v must have at least r neighbors. We are now ready to present the main result of this subsection.Theorem 6 ELIMINATION is NP-complete, even if G is restricted to be a tree.Fig. 5 The graph F i (u, v) with index vertex x Fig. 6 The graphs G and H Proof We reduce from EXACT 3-COVER, which is an NP-complete problem (cf.[6]).It has as input a finite set X with 3n elements and a collection C of subsets of X, each of which contains exactly three elements, and the goal is to test whether C contains an exact cover of X, i.e., a subcollection C ⊆ C such that each element of X occurs in exactly one subset in C .Clearly, |C | = n (if it exists).
First, we construct an auxiliary gadget F i (u, v) for i ∈ {1, . . ., k} as follows (see Fig. 5 for an illustration): • take two vertices u, v; • join u and v by a path v 0 • • • v k+3 of length k + 3, where u = v 0 and v = v k+3 ; • introduce a pendant vertex x and make it adjacent to v i .
We say that x is the index vertex of F i (u, v).Now, we construct a tree G as follows (see Fig. 6): • for all j ∈ {1, . . ., m}, if C j = {x p , x q , x s } then construct copies of F p (u (1) respectively, and introduce a vertex w j and make w j adjacent to u (1)  j , u (2)  j , u (3)  j ; • introduce a vertex r and make it adjacent to w 1 , . . ., w m ; • introduce a vertex r and join it with r by a path P of length k + 6.
Finally, we construct a graph H as follows (see Fig. 6): • for each i ∈ {1, . . ., k}, construct a copy of F i (a i , b i ); • for each j ∈ {1, . . ., m − n}, introduce a vertex c j as well as three vertices • introduce two vertices f, f and join them by a path of length k + 5; • join the vertices a 1 , . . ., a k , c 1 , . . ., c m−n , f by edges to form a clique; denote this clique by Q.
We claim that C contains an exact cover C of X if and only if H is an elimination of G. First suppose that C = {C j 1 , . . ., C j n } is exact cover of X.We eliminate the vertex r and the vertices w j 1 , . . ., w j n .Then for j ∈ {1, . . ., m} \ {j 1 , . . ., j n }, we eliminate the index vertices of T (p) j , T (q) j , T (s)  j .It is straightforward to check that the obtained graph is isomorphic to H . Hence, H is an elimination of G. Now suppose that H is an elimination of G. Denote by X the set of eliminated vertices, and let S = V (G) \ X.Let also h be an isomorphism between H and the graph obtained from G by the elimination of X.
Any subtree of G that does not contain r as an inner vertex has at most 7 leaves.The size of the clique Q is k + (m − n) + 1 > 7, because m > n ≥ 2. Hence, by Lemma 12, r ∈ X. Observe that the graph G obtained from G by the elimination of r has diameter 2k + 10 = diam(H ).By Lemma 11, V (P ) \ {r} ⊆ S, since the elimination of any vertex of V (P )\{r} results in a graph of diameter less that 2k +10.The vertex r is the unique vertex of G that has at least two vertices at distance 2k + 10, and f is the unique vertex of H with this property.By Lemma 11, we conclude that h maps f to r .
For j ∈ {1, . . ., m}, consider the unique shortest r , v (1)  j , r , v (2)  j and r , v (3)  j -paths in G .Observe that they have length 2k + 10, and that the set of the last two vertices of such paths is the set of all vertices that are at distance at least 2k + 9 from r in G .Also note that we have 3m such paths in total.Consider now the unique shortest f , b i -paths and f , d Only w 1 , . . ., w m and r have degrees at least four in G, and we already proved that r ∈ X.For each j ∈ {1, . . ., n − m}, the vertex c j is included in four maximal cliques of H .By Lemma 13, we then find that the isomorphism h maps the vertices c 1 , . . ., c m−n to the vertices from the set {w 1 , . . ., w m }.Hence, at least m − n vertices from {w 1 , . . ., w m } are in S.
Let K be the set of vertices in G that are mapped to the vertices of Q by h.By Lemma 12, the tree T K exists in G, and K is obtained by the elimination of V (T K ) \ K.By the definition of T K , we find that T K has at least |K| = |Q| = k + m − n + 1 = 2n + m + 1 leaves.We will use this lower bound on the number of leaves of T K in our reasoning below.
Because for each j ∈ {1, . . ., m}, at most one vertex of each shortest r , v (1) j -path, r , v (2) j -path and r , v (3) j -path in G is included in X and w j belongs to each of these three paths, we deduce that if w j ∈ X, then u (1)  j , u (2)  j , u (3)  j ∈ S. Hence, when we denote the number of vertices of {w 1 , . . ., w m } in X by , we find that T K has 3 + (m − ) + 1 leaves.We already deduced that T K has at least 2n + m + 1 leaves.This means that we have found that 2 + m + 1 ≥ 2n + m + 1, which is equivalent to ≥ n.Recall that at least m − n vertices from {w 1 , . . ., w m } are in S, which means that ≤ n.Hence, = n.Then exactly n vertices of {w 1 , . . ., w m } are included in X, and consequently, exactly m − n vertices of this set are in S. Let w j 1 , . . ., w j n be the n vertices from {w 1 , . . ., w m } that are in X.
We have now that X contains the vertex r, exactly n vertices w j 1 , . . ., w j n from the set {w 1 , . . ., w m }, as well as the index vertices of the gadgets T (p) j , T (q) j , T (s) j for every j ∈ {1, . . ., m} \ {j 1 , . . ., j n }.Because the graph obtained after eliminating X contains the same number of vertices as H , we find that X contains no other vertices.We set C = {C j 1 , . . ., C j m }.Because H and the graph obtained from G by the elimination of X are isomorphic, for each i ∈ {1, . . ., k}, the isomorphism h maps T i to exactly one gadget T (p) j , T (q) j , T (s) j for some j ∈ {j 1 , . . ., j n }.This means that C is an exact cover for X, and we have completed the proof.
For any subset A ⊆ V , we define N G [A] = a∈A N G [a], N G (A) = N G [A] \ A, and d G (A) = |N G (A)|.For any subset A ⊆ V , G[A] denotes the subgraph of G induced by A. For a subgraph H of G, we write G \ H to denote the graph obtained from G by deleting all the vertices of H from G, i.e.

Fig. 1
Fig.1The graph G * constructed in the proof of Theorem 2

Corollary 2
CLIQUE ELIMINATION can be solved in O(12.21 k + n 3 ) time and polynomial space.Proof We first observe that CLIQUE ELIMINATION can be solved by in time O( n k n 2 ) on any instance (G, k) with |V (G)| = n as follows:

Rule 1 Lemma 1
If k ≤ 3, then output a trivial yes-instance -if k = 1 and G contains at least one vertex, or -if k = 2 and G contains at least one edge, or -if k = 3 and either G contains a vertex of degree at least 3 or G is a cycle, and output a trivial no-instance otherwise.Reduction Rule 1 is safe.

Lemma 4
are of degree 2, then eliminate v 0 to obtain a graph G .Output the instance (G , k).Reduction Rule 4 is safe.
(a), (b) and (c) are accomplished, then we can grow T using the rules until it becomes a spanning tree; in this situation we have l = m and n = |V (G)|.As the potential increased by at least 1 during the whole process, we infer that 5l ≥ |V (G)| + 10, and hence l ≥ |V (G)|/5 + 2, as claimed.

Fig. 2
Fig. 2 An illustration of the four growing rules.Black vertices and bold edges belong to the tree T

Rule 1
If some leaf x of T has at least two neighbors from G\T , expand x.The potential φ(T ) increases by at least 4 • (d − 1) − d = 3d − 4 ≥ 2, where d ≥ 2 is the number of the aforementioned neighbors from G \ T .

Fig. 4 A
Fig.4 A graph on 30 vertices for which the maximum possible number of leaves in a spanning tree is exactly 30/5 + 2 = 8; the bold edges (blue in the online version) indicate a spanning tree with eight leaves.Generalizing this example yields an infinite family of graphs showing that the bound in Theorem 4 is tight u | and a single test runs in O(|D u | 5/2 ) time.Hence, for vertex u, Step 2 can be done in O(n • |D u | 5/2 ) time.In total, performing Step 1 and Step 2 takes O(n • |D u | 5/2 ) time for each u ∈ C(G).Observe that each vertex u ∈ C(G) ∪ U appears in the set D u for at most one u, so u∈C(G) |D u | ≤ n.
j , and join them with c j by paths of length k + 4; in H for i ∈ {1, . . ., k} and j ∈ {1, . . ., m − n}.They have length at least 2k + 9, and the union of the sets of the last vertices of the f , b i -paths and the set of the last two vertices of the f , d(1is the set of vertices at distance at least 2k + 9 from f in H .The total number of the paths is k + 3(m − n) = 3m.Hence, for each j ∈ {1, . . ., m}, at most one vertex of each shortest r , v(1) j -path, r , v(2) j -path and r , v(3) j -path in G is included in X, due toLemma 11.
j ∈ {1, . . ., m} \ {j 1 , . . ., j n } due to Lemma 11.Therefore, the index vertices of the gadgets T Corollary 1 naturally raises the question whether ELIMINATION is fixed-parameter tractable when parameterized by |V (H )|.The following theorem shows that this is highly unlikely.Theorem 1 ELIMINATION is W[1]-hard when parameterized by |V (H )|, even if both G and H are split graphs.
Corollary 1 ELIMINATION is in XP when parameterized by |V (H )|.
2.1.Assume that s and t have exactly one common neighbor, namely w.Denote the remaining two neighbors of s by s , s and the remaining two neighbors of t by t , t .Obviously, s , s , t , t , w are pairwise distinct.We now take as T the tree consisting of 7 vertices: s, s , s , t, t , t , w, obtained by attaching s , s , t , t to the path s − w − t as leaves.This tree T has potential at least 4 • 4 − 7 = 9. 2.2.Assume that s and t have exactly two common neighbors w and w .Let s be the remaining neighbor of s.Since we assumed that no vertices of degree 3 are adjacent, the degree of s is equal to 2. Observe that the neighbors of s can have only s as their common neighbor, because the remaining neighbors of s are already adjacent to t, which is distinct from the second neighbor of s .Thus, we can follow the same choice of T as in the Case 2.1, but starting with s instead of w. 2.3.Assume that s and t have exactly three common neighbors.Then, the whole graph G is just s and t connected via three internally vertex-disjoint paths of length 2. It is clear that Theorem 4 holds in this case.3. Now we can safely assume that G contains two adjacent vertices of degree 3;