Parameterized complexity of three edge contraction problems with degree constraints

For any graph class $$\mathcal{H}$$ H , the $$\mathcal{H}$$ H -Contraction problem takes as input a graph $$G$$ G and an integer $$k$$ k , and asks whether there exists a graph $$H\in \mathcal{H}$$ H ∈ H such that $$G$$ G can be modified into $$H$$ H using at most $$k$$ k edge contractions. We study the parameterized complexity of $$\mathcal{H}$$ H -Contraction for three different classes $$\mathcal{H}$$ H : the class $$\mathcal{H}_{\le d}$$ H ≤ d of graphs with maximum degree at most  $$d$$ d , the class $$\mathcal{H}_{=d}$$ H = d of $$d$$ d -regular graphs, and the class of $$d$$ d -degenerate graphs. We completely classify the parameterized complexity of all three problems with respect to the parameters $$k$$ k , $$d$$ d , and $$d+k$$ d + k . Moreover, we show that $$\mathcal{H}$$ H -Contraction admits an $$O(k)$$ O ( k ) vertex kernel on connected graphs when $$\mathcal{H}\in \{\mathcal{H}_{\le 2},\mathcal{H}_{=2}\}$$ H ∈ { H ≤ 2 , H = 2 } , while the problem is $$\mathsf{W}[2]$$ W [ 2 ] -hard when $$\mathcal{H}$$ H is the class of $$2$$ 2 -degenerate graphs and hence is expected not to admit a kernel at all. In particular, our results imply that $$\mathcal{H}$$ H -Contraction admits a linear vertex kernel when $$\mathcal{H}$$ H is the class of cycles.


Introduction
Graph modification problems play an important role in algorithmic graph theory due to the fact that they naturally appear in numerous practical and theoretical settings.Typically, a graph modification problem takes as input a graph G and an integer k, and the task is to decide whether a graph with certain desirable structural properties can be obtained from G by applying at most k prescribed graph operations, such as vertex deletions, edge deletions, edge additions, or a combination of these.The problems Vertex Cover, Feedback Vertex Set, Minimum Fill-In, and Cluster Editing are just a few famous examples of problems that fall into this framework.Graph modification problems have received a huge amount of interest in the literature for many decades, and due to the fact that the vast majority of such problems turn out to be NP-hard [23,35], the area has also been intensively studied from a parameterized complexity point of view.In particular, several groups of authors have studied graph modification problems where the target graph has to satisfy certain degree constraints.Since these results formed the motivation for our work, we survey some of them below.
The Max-Degree Vertex Deletion problem takes as input a graph G and two integers k and d, and the task is to decide whether it is possible to obtain a graph with maximum degree at most d by deleting at most k vertices from G. Nishimura, Ragde and Thilikos [31] showed that the Max-Degree Vertex Deletion problem is fixed-parameter tractable when parameterized by d + k [31].On the negative side, Fellows, Guo, Moser and Niedermeier [12] showed the problem to be W [2]-complete when parameterized by k [12].Fellows et al. [12] also studied the kernelization complexity of the problem, parameterized by k, for different fixed values of d: they proved that the problem admits an O(k) vertex kernel for every fixed d ≤ 1 and, for every > 0, an O(k 1+ ) vertex kernel for every fixed d ≥ 2.
Moser and Thilikos [29] studied the problem of deciding, given a graph G and two integers k and r , whether there is a subset of at most k vertices in G whose deletion yields an r -regular graph.They showed that this problem admits a kernel with O(kr(k + r ) 2 ) vertices and is therefore fixed-parameter tractable when parameterized by k + r .On the other hand, they showed that the problem becomes W [1]-hard for every fixed r ≥ 0 with respect to the dual parameter |V (G)| − k.Mathieson and Szeider [28] improved the kernelization result of Moser and Thilikos by presenting a kernel with O(kr(k + r )) vertices.They also proved the problem to be W [1]-hard when parameterized by k only.These results are particular cases of much more general results that can be found in the same paper [28] on graph modification problems where the target graph has to satisfy certain degree constraints, and the allowed editing operations are vertex deletion, edge deletion, edge addition, or any combination of these operations.We give more details on the work by Mathieson and Szeider in Sect.5, where we also explain how our results fit into their framework.
Mathieson [27] considered the problem of modifying a given graph G into an r -degenerate graph using at most k operations of a prespecified type, where r again is a fixed constant.In particular, he examined the parameterized complexity of three natural variants of this problem, namely the variants where only vertex deletions, only edge deletions, or a combination of both are allowed.Mathieson observed that when r = 1, known results on Vertex Cover and Feedback Vertex Set imply that all three variants are fixed-parameter tractable when parameterized by k.He then went on to prove that for every fixed r ≥ 2, all three variants of the problem are W[P]-complete when parameterized by k, even when restricted to (r + 1)degenerate input graphs.
Motivated by the aforementioned results, we study the parameterized complexity of three graph modification problems involving degree constraints when edge contraction is the only allowed operation.The parameterized study of graph modification problems with respect to this operation has only recently been initiated, but has already proved to be very fruitful [7,8,[16][17][18][19][20][21]24].In general, for every graph class H, the H-Contraction problem takes as input a graph G and an integer k, and asks whether there exists a graph H ∈ H such that G is k-contractible to H , i.e. such that H can be obtained from G by contracting at most k edges.A general result by Asano and Hirata [1] shows that this problem is NP-complete for many natural graph classes H. On the positive side, when parameterized by k, the problem is known to be fixed-parameter tractable when H is the class of paths [19], trees [19], bipartite graphs [18,21,26], planar graphs [16], or split graphs [8].Very recently, two groups of authors independently showed that H-Contraction is W [2]-hard with respect to the same parameter when H is the class of chordal graphs [7,24], whereas the problem is still open for interval graphs.Interestingly, the problem admits a linear vertex kernel when H is the class of paths, but does not admit a polynomial kernel when H is the class of trees, unless NP ⊆ coNP/poly [19].
We would like to point out that edge contraction problems tend to be more difficult than vertex deletion problems from a parameterized complexity and kernelization point of view.For example, when H is the class of chordal graphs, H-Vertex Deletion is fixed-parameter tractable when parameterized by k [25], contrasting the aforementioned W [2]-hardness result for the edge contraction variant [7,24].Also, when H is the class of forests, H-Vertex Deletion admits a polynomial kernel with at most 4k 2 vertices [34], whereas the edge contraction variant does not admit a polynomial kernel, unless NP ⊆ coNP/poly [19].
Before we formally define the three problems studied in this paper and state our results, let us mention one more recent paper that formed a direct motivation for this paper.For any integer d ≥ 1, let H ≥d denote the class of graphs with minimum degree at least d.Golovach et al. [17] studied the Min-Degree Contraction problem, which takes as input a graph G and two integers d and k, and asks whether there exists a graph H ∈ H ≥d such that G is k-contractible to H .As shown in Table 1, they proved that this problem is fixed-parameter tractable when parameterized jointly by d and k, but becomes W [1]-hard when only k is the parameter.They also showed that the problem is para-NP-complete when parameterized by d by proving the problem to be NP-complete for every fixed value of d ≥ 14.These results raise the question what happens to the complexity of the problem when the objective is not to increase the minimum degree of the input graph, but to decrease the maximum degree instead.
Our Contribution.For any integer d ≥ 0, let H ≤d denote the class of graphs that have maximum degree at most d, and let H =d denote the class of d-regular graphs.In this paper, we study the complexity of different parameterizations of the following three decision problems:

Max-Degree Contraction
Instance: A graph G and two integers d and k.Question: Is there a graph H ∈ H ≤d such that G is k-contractible to H ?

Regular Contraction
Instance: A graph G and two integers d and k.Question: Is there a graph H ∈ H =d such that G is k-contractible to H ?

Degenerate Contraction
Instance: A graph G and two integers d and k.Question: Is there a d-degenerate graph H such that G is k-contractible to H ? In Sects.3.1, 3.2 and 3.3, respectively, we completely characterize the parameterized complexity for the above three problems with respect to the parameters k, d, and d + k.We also show that when d = 2, the first two problems admit O(k) vertex kernels on connected We argue in Sect.3.2 why the same holds for Regular Contraction.This implies that these two problems are fixed-parameter tractable when parameterized jointly by d and k (or, equivalently, when parameterized by d + k), and that both problems are in XP when parameterized by k only.This naturally raises the following two questions about our first two problems: 1. Are these two problems fixed-parameter tractable when parameterized by k? 2. Are these two problems in XP when parameterized by d?
In Sects.3.1 and 3.2, we provide strong evidence that the answer to both these questions is "no".In Sect.3.2, we prove that Regular Contraction is W[1]-hard when parameterized by k, while we prove in Sect.3.1 that Max-Degree Contraction is W[2]-hard with the same parameter, even when restricted to the class of split graphs.This provides a negative answer to question 1 above under the assumption that FPT = W [1] and FPT = W [2], respectively.The negative answer to question 2, this time under the assumption that P = NP, follows from Theorems 3 and 5, where we prove that both problems are NP-complete for every fixed value of d ≥ 2, and hence para-NP-complete when parameterized by d.Note that both problems are trivially solvable in polynomial time when d ≤ 1.
In Sect.3.3, we show that when d = 2, the Degenerate Contraction problem is NPcomplete as well as W[2]-hard when parameterized by k.We also show that, for every fixed value of d ≥ 3, the problem is NP-complete and W[P]-complete when parameterized by k.This implies that, unlike our first two problems, the Degenerate Contraction problem is not even fixed-parameter tractable when parameterized by d + k, unless FPT = W[P].
Since all three problems are NP-complete for any fixed value of d ≥ 2, it makes sense to investigate for which fixed values of d the problems admit polynomial kernels.In Sect.4, we initiate this investigation by considering the case where d = 2.The aforementioned W[2]hardness result for Degenerate Contraction implies that this problem does not admit any kernel when d = 2, assuming FPT = W [2]. On the positive side, we prove that the other two problems admit linear vertex kernels on connected graphs (and hence quadratic vertex kernels on general graphs) when d = 2.In other words, we prove that the H-Contraction problem admits a linear vertex kernel when H is the class of cycles or when H is the class of paths and cycles.This complements the aforementioned known results stating that H- Contraction admits a linear vertex kernel when H is the class of paths, but admits no polynomial kernel when H is the class of trees, unless NP ⊆ coNP/poly [19].

Preliminaries
All graphs considered in this paper are finite, undirected and simple.We refer to the textbook by Diestel [10] for graph terminology and notation not defined below.For a thorough background on parameterized complexity, we refer to the monographs by Downey and Fellows [11], Flum and Grohe [14], and Niedermeier [30].
Throughout the paper, we will use n and m to denote the number of vertices and edges, respectively, of the input graph G for any of the problems we study.We write C , K , P to denote the cycle, complete graph and the path on vertices, respectively.We let K r,s denote the complete bipartite graph with partition classes of size r and s, respectively.
Let G = (V, E) be a graph.We say that two disjoint subsets U ⊆ V and W ⊆ V are adjacent if there exist two vertices u ∈ U and w ∈ W such that uw ∈ E. We denote the open and closed neighborhoods of a vertex u The degree of a vertex u is its number of neighbors |N G (u)|.The maximum degree of G is denoted by Δ.We say that G is regular (or d-regular) if all its vertices are of the same degree (equal to d).The graph G is d-degenerate for some integer d if every subgraph of G has a vertex of degree at most d.
Similarly, for any edge e ∈ E, the graph obtained from G by deleting the edge e is denoted by G − e.
The contraction of edge uv in a graph G removes u and v from G, and replaces them by a new vertex made adjacent to precisely those vertices that were adjacent to u or v in G. Instead of speaking of the contraction of edge uv, we sometimes say that a vertex u is contracted onto v, in which case we use v to denote the new vertex resulting from the contraction.For a set S ⊆ E, we write G/S to denote the graph obtained from G by repeatedly contracting an edge from S until no such edge remains; if S = {e}, we simply write G/e.Note that, by definition, edge contractions create neither self-loops nor multiple edges.Contracting a vertex u with degree p onto a neighbor v that has degree q and that has r common neighbors with u changes the degree of v into p + q − r − 2. Hence, unlike vertex deletions and edge deletions, edge contractions may increase the maximum degree of a graph.Moreover, since p + q − r − 2 ≥ q − 1, where equality holds if and only if , the degree of v may decrease by at most 1 when u is contracted onto v.
Let H be a graph.We say that H is a contraction of G (or G contains H as a contraction) if H can be obtained from G by a sequence of edge contractions.We say that G is kcontractible to H if H can be obtained from G by at most k edge contractions.An H -witness structure W is a partition of V (G) into |V (H )| nonempty sets W (x), one for each x ∈ V (H ), called H -witness sets, such that each W (x) induces a connected subgraph of G, and for all x, y ∈ V (H ) with x = y, the sets W (x) and W (y) are adjacent in G if and only if x and y are adjacent in H . Then H is a contraction of G if and only if G has an H -witness structure.It is well known (cf.[3]) and easy to see that H is a contraction of G if and only if G has an H -witness structure; H can be obtained by contracting each witness set into a single vertex.Also observe that G may have more than one H -witness structure.

Three parameterized complexity classifications
In Sects.3.1, 3.2, and 3.3, we classify the parameterized complexity of Max-Degree Contraction, Regular Contraction and Degenerate Contraction, respectively, with respect to the parameters k, d, and d + k.

Parameterized complexity of Max-Degree Contraction
We start by observing that the Max-Degree Contraction problem is fixed-parameter tractable when parameterized by d + k.

Proposition 1 The Max-Degree Contraction problem can be solved in time O
Proof Let (G, d, k) be an instance of Max-Degree Contraction.We first check if G has a vertex of degree at least d + k + 1.If so, then (G, d, k) is a trivial no-instance, since the contraction of any edge in G cannot decrease the degree of a vertex in G by more than 1.Hence we output "no" in this case.Suppose every vertex in G has degree at most d + k, but G has a vertex v such that d G (v) ≥ d + 1.In order to contract G to a graph of maximum degree at most d, we must either contract v onto one of its neighbors, or contract all the edges of a path between two of the neighbors of v.In either case, we must contract an edge e incident with a neighbor of v. Since Δ(G) ≤ d + k, there are at most (d + k) 2 such edges e.We branch on each of them, calling our algorithm recursively for G = G/e with parameter k = k − 1.Since the parameter decreases by 1 at every step, this branching algorithm runs in time We now prove that when only k is chosen as the parameter, then Max-Degree Contraction becomes W[2]-hard, even when restricted to split graphs.This result will follow from the following lemma.

Lemma 1
The problem of deciding whether the maximum degree of a split graph can be reduced by at least 1 using at most k edge contractions is NP-complete as well as W[2]-hard when parameterized by k.
Proof The problem is clearly in NP.To prove that the problem is NP-hard as well as W[2]hard with respect to parameter k, we give a polynomial-time parameterized reduction from the Set Cover problem.This problem takes as input a ground set X = {x 1 , . . ., x n }, a family S = {S 1 , . . ., S p } of subsets of X , and an integer k, and asks whether there is a subset S ⊆ S of size at most k that covers X , i.e. a subset S ⊆ S with |S | ≤ k such that every element of X is contained in at least one set in S .This problem is well-known to be NP-complete [15] as well as W[2]-complete when parameterized by k [11,32].
Let (X, S, k) be an instance of Set Cover.We assume that each element of X is included in at least one set of S, as otherwise we have a trivial no-instance.For j ∈ {1, . . ., n}, let d j be the number of sets in S that contain x j .We create a split graph G as follows: -construct a clique with the vertex set X = {x 1 , . . ., x n }; -construct an independent set of vertices S = {S 1 , . . ., S p }; -for each i ∈ {1, . . ., p} and j ∈ {1, . . ., n}, make S i adjacent to vertex x j if and only if x j ∈ S i ; -for each j ∈ {1, . . ., n}, construct 2 p + n − d j + k + 1 new vertices and make them adjacent to x j ; denote by Y the set of all vertices of degree 1 that were added to G this way.
Clearly, G is a split graph, since its vertex set can be partitioned into the clique X and the independent set S ∪Y .Observe that each x j has degree Δ := n−1+d j +2 p+n−d j +k+1 = 2 p + 2n + k and each vertex of S has degree at most n < Δ.We claim that X can be covered by a subset S ⊆ S of size at most k if and only if G can be contracted to a split graph of maximum degree at most Δ − 1 using at most k edge contractions.
First, suppose there exists a subset S ⊆ S of size at most k that covers X .For every S i ∈ S , we choose an arbitrary neighbor x j of S i in X and contract S i onto x j .Note that contracting S i onto x j is equivalent to deleting S i from the graph, because and X is a clique.Since every element of X is included in at least one set from S , each vertex of X is adjacent to at least one vertex of S and, therefore, these |S | ≤ k edge contractions decrease the degree of every vertex in X by at least 1.Since the degree of each vertex in S ∪ Y in G was already at most n ≤ Δ − 1, the obtained graph has maximum degree at most Δ − 1.
For the reverse direction, suppose there exists a set R ⊆ E(G) of at most k edges such that G/R has maximum degree at most Δ − 1.We claim that R does not contain any edge whose endpoints both belong to X .This can be seen as follows.Suppose we contract the edge x i x j .We may assume without loss of generality that this is the first contraction we performed.Then, already by counting only the pendant neighbors in Y , we find that the new vertex has degree at least The degree of such a vertex cannot be decreased to Δ − 1 by contracting at most k − 1 other edges.Consequently, every edge in R has exactly one endpoint in X and the other one in S ∪ Y .Let R denote the set of vertices in S ∪ Y that are endpoints of edges in R. Observe that |R | ≤ |R| ≤ k.Because contracting an edge x y with x ∈ X and y ∈ S ∪ Y is equivalent to removing y, we find that G − R is isomorphic to G/R, and therefore has maximum degree at most Δ − 1. Suppose that x ∈ X has no neighbors in R ∩ S. Because x has degree Δ in G and degree at most Δ − 1 in G − R , we find that x must have a neighbor y ∈ R ∩ Y .Let S ∈ S be an arbitrary neighbor of x (which exists by assumption), and let R = (R \ {y}) ∪ {S}.
Because N G (y) ⊆ N G (S), we find that the maximum degree of G − R is also Δ − 1.By this argument, we may assume without loss of generality that every x ∈ X has a neighbor in R ∩ S. Because |R | ≤ k, we conclude that X is covered by a subset of S of size at most k.
Since an instance (G, k) of the problem defined in Lemma 1 is a yes-instance if and only if (G, Δ(G) − 1, k) is a yes-instance of Max-Degree Contraction, we immediately obtain the following result.

Theorem 1 The Max-Degree Contraction problem is NP-complete as well as W[2]hard when parameterized by k, even when restricted to split graphs.
To conclude this subsection, we consider the complexity of the Max-Degree Contraction problem when we take only d to be the parameter.Note that the problem can trivially be solved in polynomial time when d ≤ 1.We will show that for any fixed d ≥ 2, the problem becomes NP-complete.
Before we prove this result in Theorem 3 below, let us remark that Asano and Hirata [1] showed that the H-Contraction problem is NP-complete for any nontrivial graph class H that is closed under contractions, and that satisfies the property that a graph belongs to H if and only if each of its connected components does.Since the class of graphs with maximum degree at most d does not satisfy the first property, NP-completeness of Max-Degree Contraction does not follow from their result.Instead, we base our hardness reduction on the reduction used by Brouwer and Veldman [3] to prove the following result.
Theorem 2 ([3]) Let H be a triangle-free graph.If H has no universal vertex, then the problem of deciding whether H is a contraction of a given graph G is NP-complete.
The hardness reduction of Brouwer and Veldman is from the Hypergraph 2-Colorability problem.This problem, which is well-known to be NP-complete [15], takes as input a hypergraph H = (Q, S), where Q = {q 1 , . . ., q m } is a set of m elements and ∈ S and S n = Q, then we call H welldefined.Brouwer and Veldman [3] observed that Hypergraph 2-Colorability remains NP-complete when restricted to well-defined hypergraphs.
From a well-defined hypergraph H = (Q, S), Brouwer and Veldman [3] construct a graph G H as follows.Each element q i ∈ Q corresponds to a vertex in G H , which we also denote by q i .Each set S j ∈ S corresponds to two vertices in G H , which we denote by S j and S j .Let S = {S 1 , . . ., S n }.Add edges q i S j and q i S j if and only if q i is contained in S j .We also make every vertex of S adjacent to every vertex of S , and we add all possible edges between vertices in Q.Finally, we add two new vertices s and t with edges sS j and t S j for every j ∈ {1, . . ., n}.This finishes the construction of the graph G H .
Let r ≥ 0 be an integer.Then we let G r H denote the graph obtained from G H as follows.First, we add the edge st.We then take a complete bipartite graph K r,r with partition classes A = {a 1 , . . ., a r } and B = {b 1 , . . ., b r }, and we add an edge between each a i and each S j , and an edge between each b i and each S j .We also add an edge between s and each a i , as well as an edge between t and each b i .
We are now ready to formulate the lemma needed in the proof of Theorem 3 below.We will also use this lemma in the proof of Theorem 5 in the next subsection.

Lemma 2 ([3]
) Let H be a well-defined hypergraph and r a non-negative integer.Then the following three statements are equivalent: We are now ready to prove the last result of this subsection.

Theorem 3
The Max-Degree Contraction problem is NP-complete for any fixed d ≥ 2.
Proof Because Max-Degree Contraction is readily seen to be in NP, we only have to prove NP-hardness.We reduce from the Hypergraph 2-Colorability problem restricted to well-defined hypergraphs.Recall that this problem is NP-complete.Let H = (Q, S) be a well-defined hypergraph, where Q = {q 1 , . . ., q m } and S = {S 1 , . . ., S n } such that ∅ / ∈ S and S n = Q.
First consider the case d = 2.We construct in polynomial time the graph G 0 H . Let p denote the number of vertices of G H (which is the same as the number of vertices of G 0 H ). We claim that G 0 H can be modified to a graph of maximum degree at most 2 using at most k = p − 4 edge contractions if and only if G 0 H contains C 4 as a contraction.One direction is trivial.For the other direction, suppose that G 0 H can be modified to a graph F of maximum degree at most 2 by using at most k edge contractions.Because G 0 H is connected, G 0 H cannot be contracted to a disconnected graph.This implies that F is a path or a cycle.Observe that the diameter of G 0 H is 2 (this has been explicitly shown in [22]).Then G 0 H cannot be contracted to P r for any r ≥ 4. Contracting G 0 H to P r for r ≤ 3 requires at least p Because any cycle can be contracted to a smaller cycle and k = p − 4, we may assume without loss of generality that r = 4.This proves the claim.We now apply Lemma 2 to complete our NP-hardness reduction for d = 2. Now consider the case d ≥ 3. Recall that p is the number of vertices of G H .We say that we add a pendant p-path P to a vertex u of graph G if we add |V (P)| new vertices c 1 , . . ., c p to G and an edge c i c i+1 for every i ∈ {1, . . ., p − 1} as well as the edge c p u.We call c 1 the pendant end-vertex of P. We let Gd H denote the graph obtained from G H as follows.We modify G H by adding d − 1 pendant p-paths to s and d − 1 pendant p-paths to t.We also add d − 2 pendant p-paths to S 1 and d − 2 pendant p-paths to S 1 .This completes the construction of Gd H .Note that Gd H has p + 2(d − 1) p + 2(d − 2) p vertices and can be constructed in polynomial time.We define k = p − 4. We claim that Gd H can be modified to a graph of maximum degree at most d using at most k = p − 4 edge contractions if and only if G H contains P 4 as a contraction.
First suppose that G H contains P 4 as a contraction.This requires p − 4 = k edge contractions.Then we can use these k edge contractions to contract Gd H to the tree F that is obtained from Gd H by removing all vertices in (S \ {S 1 }) ∪ (S \ {S 1 }) ∪ Q.Note that every vertex in F has degree at most d, as required.Now suppose that Gd H can be modified to a graph F of maximum degree at most d using at most k edge contractions.Let W be an F-witness structure for Gd H . Claim 1 Let u ∈ {s, t, S 1 , S 1 } and x ∈ V (H ) with u ∈ W (x). Every pendant p-path P to u in Gd H corresponds to a unique pendant p -path P to x in F for some 1 ≤ p ≤ p, such that W (y) ⊆ V (P) for all y ∈ V (P ).
We prove Claim 1 as follows.Let u ∈ {s, t, S 1 , S 1 }.Let v be the pendant end-vertex of a pendant p-path P of u.Suppose, for contradiction, that u and v are in the same witness set W (x) of W.Then, because u and v are at distance p − 1 in Gd H , we need at least p − 1 > p − 4 = k edge contractions to contract the vertices in W (x) into the single vertex x.Hence u and v must be in different sets of W. Then Claim 1 follows after recalling that each set in W is connected and observing that u separates all vertices from P from the other vertices in Gd H .We use Claim 1 in the remainder of the proof.Suppose that s and t are in the same witness set W (x) of W. Then Claim 1 tells us that x has degree at least d −1+d −1 = 2d −2 ≥ d +1, as d ≥ 3.This is not possible, because F has maximum degree at most d.Hence, s and t are in two different witness sets of W.
Suppose that s and S 1 are in the same witness set W (x) of W. Then x has degree at least d −1+d −2 = 2d −3 due to Claim 1.Because F has maximum degree at most d, we find that d = 3 and that all vertices not on a pendant p-path of s or S 1 are in W (x).However, then F contains at most 2 p+ p+1 = 3 p+1 vertices, whereas Gd H has p+2(d−1) p+2(d−2) p = 7 p vertices.Consequently, we need at least 7 p−(3 p+1) = 4 p−1 > p−4 = k edge contractions to modify Gd H into F.This is not possible.Hence, s and S 1 are in two different witness sets of W. Similarly, s and S 1 are in two different witness sets of W, and moreover, t and S 1 are in two different witness sets of W, and t and S 1 are in two different sets of W.
Suppose that S 1 and S 1 are in the same witness set W (y) of W. Recall that s and t are in two distinct witness sets not equal to W (y).This together with Claim 1 implies that y has degree at least d − 2 . This is not possible.Hence, S 1 and S 1 are in two different witness sets of W.
From the above we conclude that W contains four distinct witness sets W (x 1 ), W (x 2 ), W (x 3 ), W (x 4 ) containing s, S 1 , S 1 , t, respectively.Note that x 1 x 2 x 3 x 4 is a subgraph of F, due to the path sS 1 S 1 t in G * .We apply Claim 1 and find that the degrees of x 1 and x 4 are at least d − 1 + 1 = d, and that the degrees of x 2 and x 3 are also at least d − 2 + 2 = d.Because F has maximum degree at most d, we then find that the 4-vertex path x 1 x 2 x 3 x 4 is an induced subgraph of F, and moreover, that every W (y) with y / ∈ {x 1 , . . ., x 4 } only contains vertices from pendant p-paths in Gd H .We remove all vertices that belong to any pendant p-path in Gd H from the witness sets of W. This neither destroys the connectivity of the sets W (x i ) for i = 1, . . ., 4 nor does it destroy any of the existing adjacencies between these four sets.Hence, we have obtained a P 4 -witness structure of G H , as desired.We now apply Lemma 2 to complete our NP-hardness reduction for d ≥ 3.

Parameterized complexity of Regular Contraction
In this section, we show that the parameterized complexity of Regular Contraction strongly resembles that of Max-Degree Contraction.We start by proving that, just like Max-Degree Contraction, the Regular Contraction problem is fixed-parameter tractable when parameterized by d + k.

Proposition 2 The Regular Contraction problem can be solved in time O((d
Proof Recall the branching algorithm for Max-Degree Contraction that was given in the proof of Proposition 1.We can obtain an algorithm for Regular Contraction with the same time complexity by replacing the branching rule with the following one: if there is a vertex v with d G (v) = d, then we branch over all the edges e that are incident with a vertex in N G (v).For each branch, we contract the edge e and decrease k by 1.The correctness of this branching rule follows from the observation that if we contract any edge e that is not incident with a neighbor of v, then the degree of v before and after the contraction is the same.
We now show that Regular Contraction becomes W[1]-hard when only k is chosen as the parameter.In the proof of Theorem 4 below, we will reduce from the following problem:

Regular Multicolored Clique
Instance: A regular graph G, an integer k, and a partition of V (G) into k independent sets X 1 , . . ., X k of size p each.Question: Does G have a clique K such that |K ∩ X i | = 1 for all i ∈ {1, . . ., k}?
We will need the following lemma, which is folklore (but we give a short proof for completeness).

Lemma 3 The Regular Multicolored Clique problem is W[1]-hard when parameterized by k for d-regular graphs when k < d < p.
Proof It is well-known that the Clique problem, asking whether a given graph has a clique of size k, is W[1]-hard when parameterized by k [11].Cai [4] proved that this remains true on regular graphs.Using this fact and the standard parameterized reduction from Clique to Multicolored Clique due to Pietrzak [33] (also see [13]) we find that Regular Multicolored Clique, parameterized by k, is W -construct a copy of G with the corresponding partition X 1 , . . ., X k of the vertex set; -for each i ∈ {1, . . ., k}, construct a vertex x i and then make the set X i ∪ {x i } into a clique by adding edges; -make the set {x 1 , . . ., x k } into a clique by adding edges.
Let G denote the obtained graph, and let d = d + p − 1.We claim that G has a clique K such that |K ∩ X i | = 1 for all i ∈ {1, . . ., k} if and only if (G , d , k) is a yes-instance of Regular Contraction.
First suppose that G has a clique K = {y 1 , . . ., y k } such that y i ∈ X i for i ∈ {1, . . ., k}.It is straightforward to verify that contracting the edges x i y i for i ∈ {1, . . ., k} in G results in a d -regular graph.Now suppose that (G , d , k) is a yes-instance of Regular Contraction, i.e. there is a set R of at most k edges such that G /R is a d -regular graph.Notice that each x i in G has degree p + k − 1 < p + d − 1 = d .Therefore, for each i ∈ {1, . . ., k}, R contains at least one edge incident with x i .Suppose, for contradiction, that R contains an edge x i x j for some indices i, j with 1 ≤ i < j ≤ k.We may assume without loss of generality that x i x j is the first edge that is contracted.Since both x i and x j have degree p + k − 1 and they have k − 2 common neighbors, the contraction of x i x j results in a vertex of degree However, after contracting each of the at most k − 1 edges in R \ {x i x j }, the degree of this vertex will be at least d + 1.This contradicts the assumption that G /R is d -regular.Consequently, we find that for each i ∈ {1, . . ., k}, R contains an edge x i y i for some y i ∈ X i .Because |R| ≤ k, this means that R = {x 1 y 1 , . . ., x k y k }.
We claim that {y 1 , . . ., y k } is a clique in G.For contradiction, assume that y i and y j are not adjacent in G for some 1 ≤ i < j ≤ k.Then y i and y j are not adjacent in G either.Observe that in G , vertex y i has exactly p − 1 neighbors in X i and exactly d neighbors in V (G )\(X i ∪{y j }).After contracting x i onto y i and x j onto y j , the vertices y i and y j become adjacent.This means that the degree of This contradicts the assumption that G /R is d -regular.We conclude that {y 1 , . . ., y k } is a clique in G.
To conclude this subsection, we prove that Regular Contraction is NP-complete for every fixed d ≥ 2. Note that the problem can trivially be solved in polynomial time when d ≤ 1.The proof of Theorem 5 resembles the proof of Theorem 3, and in particular uses Lemma 2.

Theorem 5
The Regular Contraction problem is NP-complete for any fixed d ≥ 2.
Proof Because Regular Contraction is readily seen to be in NP, we only have to prove NP-hardness.We reduce from the Hypergraph 2-Colorability problem restricted to well-defined hypergraphs.Recall that this problem is NP-complete.Let H = (Q, S) be a well-defined hypergraph, where Q = {q 1 , . . ., q m } and S = {S 1 , . . ., S n } such that ∅ / ∈ S and S n = Q.
We Suppose that s is not the only vertex in its witness set.Let W (x) be the witness set of s.Let y 1 , . . ., y q be the non-neighbors of H , we find that W (x) must contain a vertex from A ∪ S ∪ {t} Hence, each of the witness sets W (y 1 ), . . ., W (y q ) only contains vertices from Q. Let S n belong to witness set W (z), and let S n belong to witness set W (z ).Then x, z, z are three different vertices of F, as shown already.Moreover, note that {z, z } ∩ {y 1 , . . ., y q } = ∅.Because every vertex has at least d − 1 non-neighbors, q ≥ d − 1.Because S n is adjacent to all vertices of Q and also to s and S n , we find that z is adjacent to every y i and also to x and z .Hence, z has degree at least 1 Hence s is the only vertex in its witness set.By the same arguments we find that the witness set that contains t has no other vertices.
Let W (x 1 ), . . ., W (x 4 ) be the witness sets of s, t, S n , S n , respectively.Note that x 1 , . . ., x 4 are four different vertices and that W (x 1 ) = {s} and W (x 2 ) = {t}.Then the 4-vertex cycle x 1 x 2 x 3 x 4 x 1 is a subgraph of F. Let y 1 , . . ., y q be the non-neighbors of x 1 .Recall that q ≥ d − 1.Because S n is adjacent to every non-neighbor of s, we find that x 4 is adjacent to y i for i = 1, . . ., q.Because F is d-regular and x 4 is adjacent to x 1 and x 3 , we find that q = d − 1 and that x 3 is a non-neighbor of x 1 , say x 3 = y d−1 .In particular, F has exactly 2d vertices.
Let z 1 , . . ., z d−2 denote the d − 2 neighbors of x 1 that are equal neither to x 2 nor to x 4 .Because x 4 has degree d and is adjacent to the d vertices x 1 , x 3 , y 1 , . . ., y d−2 , we find that x 4 cannot be adjacent to any of x 2 , z 1 , . . ., z d−2 .Because S n ∈ W (x 4 ), this means in particular that each W (z i ) contains no vertices from Q ∪ S ∪ B. Because witness sets must induce connected subgraphs, we then find that each W (z i ) consists of a single vertex, which must be from A ∪ S.This means that z 1 , . . ., z d−2 form an independent set.As W (x 2 ) only contains t, we find that x 2 is not adjacent to any z i .We already deduced that the same holds for x 4 , and that x 2 x 4 is not an edge.Hence, the neighbors of x 1 form an independent set of size d in F. By symmetry, the neighbors of x 2 form an independent set of size d in F as well.Because F is d-regular, we conclude that F is isomorphic to K d,d , as required.We now apply Lemma 2 to complete our NP-hardness reduction.

Parameterized complexity of Degenerate Contraction
Similar to the previous two subsections, we start by asking the question whether the Degenerate Contraction problem is fixed-parameter tractable when parameterized by d + k.Unlike in the previous to subsections, this turns out not to be the case here, assuming Recall the following result of Mathieson [27], which we will use later on.

Theorem 6 ([27]) For any d ≥ 2, the d-Degenerate Vertex Deletion problem is W[P]-complete when parameterized by k, even when restricted to (d + 1)-degenerate input graphs.
Our aim is to obtain a similar result for d-Degenerate Contraction.This problem is trivial when d = 0. Since a graph is 1-degenerate if and only if it is a forest, the 1-Degenerate Contraction problem is equivalent to H-Contraction when H is the class of forests.When parameterized by k, this problem is fixed-parameter tractable, but does not admit a polynomial kernel unless NP ⊆ coNP/poly [19].We now prove that the d-Degenerate Contraction problem, parameterized by k, is W[2]-hard on 3-degenerate graphs when d = 2, before proving that the problem is W[P]-complete on (d + 1)-degenerate input graphs for any d ≥ 3.

Theorem 7
The 2-Degenerate Contraction problem is NP-complete as well as W[2]hard when parameterized by k, even when restricted to 3-degenerate input graphs.
Fig. 1 The set gadget for the set S i Fig. 2 A schematic illustration of the graph G constructed from an instance (X, S, k) of Set Cover where X = {x 1 , . . ., x 5 }, and where S i and S j are two sets in S with S i = {x 1 , x 3 , x 4 } and S j = {x 3 , x 5 }.The set gadgets for the other sets of S have not been drawn Proof Observe that 2-Degenerate Contraction trivially belongs to NP.To show NPhardness and W[2]-hardness, we give a polynomial-time parameterized reduction from Set Cover.As mentioned in the proof of Lemma 1, this problem is NP-complete as well as W[2]-hard when parameterized by k, even when every element is included in at least one set; as we may duplicate sets, we may also assume that every element is even included in at least three sets.Let X = {x 1 , . . ., x n } and S = {S 1 , . . ., S p } together with a non-negative integer k form an instance of Set Cover as defined above.We build an instance (G, k) of 2-Degenerate Contraction as follows.We first create, for every element x i ∈ X , a cycle C i whose length equals the number of sets of S containing x i ; note that this number is at least 3 by assumption.We call the cycle C i the element gadget for x i .Moreover, for every set S i ∈ S, we create six vertices a i , b i , c i , d i , e i , f i as well as i , and connect these 6 + |S i | vertices to each other in the way depicted in Fig. 1.The subgraph induced by these 6 + |S i | vertices is called the set gadget for S i .Finally, for every set S i , we make the vertices g 1 i , . . ., g in the set gadget for S i adjacent to the element gadgets as follows: we add an edge between a vertex g j i and a cycle C if and only if the jth element in the set S i is x .We do this for all the set gadgets in such a way that in the resulting graph, every vertex in each element gadget has degree exactly 3; see Fig. 2 for a schematic illustration of the graph G.
We claim that the graph G is 3-degenerate.In order to see this, it suffices to show that we can repeatedly find a vertex of degree at most 3 and delete it from the graph, until no vertices remain.Observe that all the vertices in the element gadgets have degree 3.After deleting these vertices from the graph, we are left with the disjoint union of the set gadgets.For each i ∈ {1, . . ., p}, if we delete the vertices of the set gadget for S i in the order g 1 i , g 2 i , . . ., g , then each vertex has degree at most 2 at the time it is deleted.Hence G is 3-degenerate.
To complete the proof of the theorem, it remains to show that G is k-contractible to a 2-degenerate graph if and only if (X, S, k) is a yes-instance of Set Cover.
First suppose that (X, S, k) is a yes-instance of Set Cover.Let S ⊆ S be a set of size at most k that covers X .For every set S i ∈ S , we contract the edge e i f i in the set gadget of S i .Let G be the resulting graph.We will show that G is 2-degenerate.For every S i ∈ S , the vertices g 1 i , . . ., g all have degree 2 in G .Hence we may delete these vertices from G for every S i ∈ S .Afterward, there is a vertex of degree 2 in each of the element gadgets, because S covers X .Consequently, we can repeatedly delete a vertex of degree at most 2 until all vertices of the element gadgets are gone.Moreover, the vertices in G that correspond to the set gadgets form a disjoint union of 5-vertex graphs, in which we can repeatedly delete a vertex of degree at most 2 as well.Hence, G is 2-degenerate.Because G was obtained from G by contracting |S | ≤ k edges, we infer that (G, k) is a yes-instance of 2-Degenerate Contraction.
Now suppose that there is a set R ⊆ E(G) with |R| ≤ k such that the graph G = G/R is 2-degenerate.Let S ⊆ S consist of exactly those sets S i ∈ S for which R contains an edge incident with at least one vertex of the set gadget for S i .For every cycle C j such that R contains an edge of C j , we arbitrarily choose a set gadget that is adjacent to C j and add the corresponding set to S .Note that |S | ≤ |R| ≤ k.
We claim that S covers X .For contradiction, suppose that there is an element x i ∈ X such that no set in S contains x i .Let S i 1 , . . ., S i q be the sets in S that contain x i .Recall that x i appears in at least three sets by assumption, so q ≥ 3. Let G i be the induced subgraph of G induced by the vertices of the cycle C i and the set gadgets for S i 1 , . . ., S i q .By the definition of S and x i , the set R contains no edge of G i .Hence, the graph G contains an induced subgraph isomorphic to G i .Since G i has minimum degree 3, this contradicts the assumption that G is 2-degenerate.Hence S covers X , and we conclude that (X, S, k) is a yes-instance of Set Cover.First suppose that there exists a subset for every s ∈ S, contracting an edge sz is equivalent to deleting the vertex s.Consequently, the graph G * /E S is isomorphic to the graph G * − S, which in turn is isomorphic to the graph obtained from G − S by adding a universal vertex.Since G − S is (d − 1)-degenerate, we find that Now suppose that there exists a set R ⊆ E(G * ) of at most k edges such that G * /R is d-degenerate.For each edge in R, we select one of its endpoints but never choose z.Let S be the set of selected endpoints.Then G * − S is a spanning subgraph of the d-degenerate graph G * /R, since for any two adjacent vertices u and v, contracting u onto v is equivalent to deleting u and possibly adding some edges incident with v. Since degeneracy is closed under vertex deletion, this means that G * − S is d-degenerate.Recall that z / ∈ S by definition, so S ⊆ V (G).The graph G − S is isomorphic to the graph obtained from G * − S by deleting the universal vertex z.Since deleting a universal vertex decreases the degeneracy by exactly 1 and Because d-Degenerate Contraction is readily seen to be in NP, it remains to show that the problem belongs to the class W[P] when parameterized by k.We use the "guessthen-check" computation model introduced by Cai and Chen [5].Using this model, Cai, Chen, Downey and Fellows [6] showed that for every parameterized problem Q whose unparameterized version is in NP, it holds that Q ∈ W[P] if and only if it can be solved by a polynomial-time algorithm that is allowed to guess a string of length f (k) log n for some function f that does not depend on the input length n (see also Theorem 3 in [9]).We refer to the papers by Cai and Chen [5] and Cai et al. [6] for more details on the "guess-and-check" model and this characterization of W[P], and point out that Mathieson [27] used the same approach to show that d-Degenerate Vertex Deletion is in W[P] for every d ≥ 0. We can solve d-Degenerate Contraction by first non-deterministically guessing a set of at most k edges to contract, and then using a greedy algorithm to decide in polynomial time if the graph obtained after contracting these edges is d-degenerate.Since the guessed set of at most k edges can be represented using f (k) log n bits for some function f , we conclude that d-Degenerate Contraction is in W[P].

Two linear vertex kernels
In this section, we show that both Regular Contraction and Max-Degree Contraction admit linear vertex kernels on connected graphs when d = 2. Throughout the section, we take k to be the parameter in each of the problems.Observe that a connected graph is 2-regular if and only if it is a cycle, and that a connected graph has maximum degree at most 2 if and only if it is a path or a cycle.Hence, by considering connected graphs we can denote these two problems by:

A linear vertex kernel for Cycle Contraction
We begin this subsection by introducing some additional terminology.Let G and H be two graphs, and suppose that there exists an H -witness structure W of G.If a witness set of W contains more than one vertex of G, then we call it a big witness set; a witness set consisting of a single vertex of G is called small.

Lemma 4 If a graph G is k-contractible to a graph H , then for any H -witness structure W of G and for any collection W 1 , . . . , W r of big witness sets in
Proof In order to contract G to H , we need to perform |W | − 1 contractions for every big witness set W ∈ W. Since G is k-contractible to H and W 1 , . . ., W r are big witness sets in W, it holds that r i=1 This lemma implies the following observation, which has been stated before by Heggernes et al. [19].

Observation 1 ([19]) If a graph G is k-contractible to a graph H , then any H -witness structure W of G satisfies the following three properties:
-every witness set of W contains at most k + 1 vertices; -W has at most k big witness sets; -all the big witness sets of W together contain at most 2k vertices.
Let G be a graph.A cycle C is optimal for G if G can be contracted to C but not to any cycle longer than C. Note that if G is a connected graph that is not a tree, then an optimal cycle for G always exists.The following structural lemma will be used in the correctness proof of our kernelization algorithm for Cycle Contraction.

Lemma 5 Let (G, k) be a yes-instance of Cycle Contraction, let C be an optimal cycle for G, and let W be a C-witness structure of G. If G is 2-connected and G contains two vertices u and
and G − {u, v} has exactly two connected components G 1 and G 2 , then the following three statements hold: (i) either {u} and {v} are small witness sets of W, or u and v belong to the same big witness set of W; (ii) if u and v belong to the same big witness set W ∈ W, then W contains all the vertices of G 1 or all the vertices of G 2 ; (iii) if G 1 and G 2 contain at least k + 1 vertices each, then {u} and {v} are small witness sets of W.
Proof Suppose G is a 2-connected graph that contains two vertices u and v such that d G (u) = d G (v) = 2 and G − {u, v} has exactly two connected components G 1 and G 2 .Note that u and v are not adjacent.Let p and q denote the two neighbors of u, and let x and y denote the two neighbors of v; Without loss of generality, suppose p, x ∈ V (G 1 ) and q, y ∈ V (G 2 ); note that we may have p = x and q = y.
To prove statement (i), suppose, for contradiction, that u belongs to a big witness set . Since u has degree 2 in G and G[W ] is connected by the definition of a witness set, the graphs G[W 1 ] and G[W 2 ] are connected.Moreover, by the definition of G 1 and G 2 , there is no edge between W 1 and W 2 in G. Let W be the C -witness structure of G obtained from W by replacing W with the sets W 1 , {u}, and W 2 .Then C is a cycle that has two more vertices than C.This contradicts the assumption that C is an optimal cycle for G.
We now prove statement (ii).Suppose u and v both belong to the same witness set W ∈ W. Note that V (G) \ W induces a connected subgraph of G, and assume, without loss of generality, that Suppose, for contradiction, that u and v belong to the same big witness set of W. Then W contains all the vertices of either G 1 or G 2 by statement (ii).This implies that W contains at least k + 3 vertices, contradicting the fact that every big witness set of W contains at most k + 1 vertices due to Observation 1.
Let G be a graph.A maximal connected subgraph of G without a cut-vertex is called a block of G.Note that a block of G is either a maximal 2-connected subgraph, or a bridge, or an isolated vertex.Also note that two blocks of G have at most one common vertex, which must be a cut-vertex of G.The following result is due to Brouwer and Veldman [3].

Proposition 3 ([3]) A graph G contains a 2-connected graph H as a contraction if and only if G is connected and some block of G contains H as a contraction.
In order to prove the correctness of some of our reduction rules below, we need a slightly stronger result.

Lemma 6
Let G be a graph that contains a 2-connected graph H as a contraction.Then for any H -witness structure W of G, there is a block B of G such that W (x) ∩ V (B) = ∅ for each x ∈ V (H ), and for each connected component D of G − V (B), there exists a vertex y ∈ V (H ) such that D ⊂ W (y).
Proof By the definition of 2-connectivity, H has at least three vertices.We assume that G has at least two blocks.Let W be an H -witness structure of G. Let x y ∈ E(H ).Then there exist two adjacent vertices u and v of G such that u ∈ W (x) and v ∈ W (y).Because u and v are adjacent, there is a block B of G that contains both u and v.
We claim that every witness set of W contains a vertex of B. For contradiction, suppose there exists a witness set W (z) that contains no vertex of B. Let z be a neighbor of z in H . Then there exist two adjacent vertices w and w of G such that w ∈ W (z) and w ∈ W (z ).Because H is 2-connected, H has a cycle C that contains the edges x y and zz .Hence there exists a cycle D in G that passes through the witness sets of W corresponding to the vertices of C and that contains the edges uv and ww .In particular, this implies that w belongs to B, contradicting the assumption that W (z) ∩ V (B) = ∅.
Because every witness set induces a connected subgraph of G and W (z) ∩ V (B) = ∅ for all z ∈ V (H ), we conclude that for each connected component D of G − V (B), there exists a vertex y ∈ V (H ) such that D ⊂ W (y).
Block B in the statement of Lemma 6 is called an H -block of G; note that G might have more than one H -block.
We now describe four reduction rules that will be used in our kernelization algorithm for Cycle Contraction.Each of these rules takes as input an instance (G, k) of Cycle Contraction and outputs a reduced instance (G , k ) of the same problem.A rule is said to be safe if the instances (G, k) and (G, k ) are equivalent, that is, if the two instances (G, k) and (G , k ) are either both yes-instances or both no-instances.Proof For contradiction, suppose G is k-contractible to a cycle C.Let W be a C-witness structure.Observe that C has at least four vertices because |V (G)| ≥ 2k + 3. Then W has at most two small witness sets, as otherwise we have two small witness sets {u} and {v} such that u and v are non-adjacent and the graph G − {u, v} is disconnected, contradicting the assumption that G is 3-connected.Since all the big witness sets of W contain at most 2k vertices in total due to Observation 1, this implies that |V (G)| ≤ 2k + 2; a contradiction.
Proof For any cycle C that is a contraction of G and any C-witness structure W of G, we find that B is the only C-block of G and each connected component of G − V (B) is contained in exactly one witness set, as a result of Observation 1 and Lemma 6.
First suppose For contradiction, assume that G is k-contractible to a cycle C.Let W be a C-witness structure of G. Let W 1 , . . ., W r be all the big witness sets of W that contain at least one vertex from V (G) \ V (B).Note that each of these sets contains at least one vertex of B as well.Hence, by Lemma 4, we find that k Then, because for any cycle C, any connected component of G − V (B) is contained in exactly one witness set of any C-witness structure W of G, we must exhaustively contract an edge of E(G) \ E(B).

Lemma 9 Rule 3 is safe.
Proof For any cycle C that is a contraction of G and any C-witness structure W of G, we find that B is not a C-block of G and is therefore contained in exactly one witness set, as a result of Observation 1 and Lemma 6. Hence we must exhaustively contract an edge of E(B).123 Proof Let (G, k) be an instance of Cycle Contraction on which Rule 4 can be applied.Without loss of generality, assume that G/up is the graph obtained from G by contracting u onto p; in particular, G/up still contains vertex p but not vertex u.
First suppose that (G, k) is a yes-instance.Let C be an optimal cycle for G, and let W be a C-witness structure of G. Due to statement (iii) in Lemma 5, {u} and {v} are small witness sets of W. Then W = W \ {u} is a C -witness structure of G/up, where C is a cycle containing one less vertex than C. Since the big witness sets of W and W coincide, G/up is k-contractible to C .Hence (G/up, k) is a yes-instance of Cycle Contraction.
Now suppose that (G/up, k) is a yes-instance.Let C be an optimal cycle for G/up, and let W be a C -witness structure of G/up.In G/up we consider the vertices v and p.Note that d G/up ( p) = d G/up (v) = 2, and that (G/up)−{ p, v} has exactly two connected components G 1 and G 2 that contain at least k + 1 vertices each.Hence { p} and {v} are small witness sets of W due to statement (iii) in Lemma 5.For similar reasons, considering the pair (q, v) instead of ( p, v), we find that {q} is a small witness set of W .In particular, p and q are in separate small witness sets of W . Now let W be the partition of V (G) obtained from W by adding the set {u}.Then W is a C-witness structure of G, where C is a cycle that has one more vertex than C .Since the big witness sets of W and W coincide, we conclude that G is k-contractible to C, and hence (G, k) is a yes-instance of Cycle Contraction.
Before presenting our first kernelization result, we prove one additional lemma.Suppose, for contradiction, that |V (G)| ≥ 6k + 7. Let C be an optimal cycle for G, and let W be a C-witness structure of G.By Observation 1, at most 2k vertices of G belong to big witness sets, which implies that at least 4k + 7 vertices of G belong to small witness sets.Since W has at most k big witness sets by Observation 1, there are at most 2k vertices in small witness sets that have degree more than 2 in G, namely the ones adjacent to big witness sets.Consequently, there are at least 2k + 7 vertices in small witness sets that have degree exactly 2, and there must be three small witness sets { p}, {u}, {q} such that d G ( p) = d G (u) = d G (q) = 2 and p and q are the two neighbors of u.Let {v} be a small witness set of W such that v / ∈ {p, u, q} and d G (v) = 2, and such that the two connected components G 1 and G 2 of the graph G − {u, v} contain at least k + 2 small witness sets of W each. Since, apart from the vertices p, u, q and v, there are at least 2k + 3 other vertices that have degree 2 in G and belong to small witness sets, such a set {v} exists.This implies that Rule 4 could have been applied on (G, k), yielding the desired contradiction.

Theorem 9
The Cycle Contraction problem admits a kernel with at most 6k +6 vertices.
Proof We describe a kernelization algorithm for Cycle Contraction.Given an instance (G, k) of Cycle Contraction, the algorithm exhaustively applies Rules 1-4; note that at most one reduction rule applies at any moment.Let (G , k ) be the obtained instance.Observe that the instances (G , k ) and (G, k) are equivalent due to Lemmas 7-10, and that k ≤ k.
If |V (G )| ≥ 6k + 7, then we return a trivial no-instance, which is safe due to Lemma 11.If |V (G )| ≤ 6k + 6 ≤ 6k + 6, then we return the instance (G , k ) as the desired kernel.Every reduction rule can be applied in polynomial time.During each application either the number of vertices in the graph or the parameter strictly decreases.This implies that we only apply the reduction rules a polynomial number of times, so the algorithm runs in polynomial time.

A linear vertex kernel for Path or Cycle Contraction
In Sect.4.1 we presented a linear vertex kernel for Cycle Contraction, which is equivalent to the H-Contraction problem when H is the class of cycles.A linear vertex kernel for the Path Contraction problem, that is, the H-Contraction problem when H is the class of paths, was proved by Heggernes et al. [19].Their kernelization algorithm consisted of a single reduction rule that reads as follows: Rule A ( [19]) Let (G, k) be an instance of Path Contraction.If G contains a bridge e such that the graph G − e has two connected components that contain at least k + 2 vertices each, then return the instance (G , k), where G = G/e is the graph obtained from G by contracting the edge e.The following lemma, due to Heggernes et al. [19], shows that Rule A is safe and that Path Contraction admits a kernel with at most 5k + 3 vertices.

Lemma 12 ([19]) Rule A is safe. If Rule A cannot be applied on a yes-instance (G, k) of
Path Contraction, then G has at most 5k + 3 vertices.
In order to obtain a linear vertex kernel for Path or Cycle Contraction, we will combine the four reduction rules from our kernelization algorithm for Cycle Contraction with the above rule for Path Contraction, but only apply these rules after performing some additional checks.Before making this concrete, we prove some structural lemmas.The first lemma follows from the observation that in order to contract a graph G to a cycle, every bridge in G must be contracted.

Lemma 13 Let G be a connected graph and k an integer. If G has more than k bridges, then G is not k-contractible to a cycle.
Let G be a connected graph.Recall that a block of G is either a maximal 2-connected subgraph, or a bridge, or an isolated vertex.The size of a block is the number of vertices in that block.A block is trivial if its size is at most 2; otherwise it is non-trivial.Let B 1 , . . ., B p be the non-trivial blocks of G.We write β(G) = p i=1 |V (B i )| to denote the sum of the sizes of all non-trivial blocks of G.Note that it is possible that β(G) > |V (G)|, as vertices may belong to more than one non-trivial block.

Lemma 14
Let G be a connected graph and k an integer.If β(G) > 4k, then G is not k-contractible to a path.Proof Let B 1 , . . ., B p be the non-trivial blocks of G, and let b i = |V (B i )| for every i ∈ {1, . . ., p}.We first prove that for every non-trivial block B i , we need at least (b i − 2)/2 edge contractions to contract B i to a path.For contradiction, suppose we can contract a non-trivial block B i to a path P by using k i < (b i − 2)/2 contractions.Consider a Pwitness structure W of B i .Observe that for every inner vertex u of P, the witness set W (u) is big, as otherwise u would be a cut-vertex of B i , contradicting the assumption that B i is a non-trivial block of G and hence 2-connected.Consequently, W contains at most two small witness sets.By Observation 1, all the big witness sets of W contain at most 2k i vertices in total.Hence b i ≤ 2k i + 2, or equivalently k i ≥ (b i − 2)/2.Then, because k i is an integer, k i ≥ (b i − 2)/2 ; a contradiction.
In order to contract G to a path, each of its non-trivial blocks must be contracted to a path as well.Suppose G is k-contractible to a path.For each i ∈ {1, . . ., p}, let k i be the smallest integer such that B i is k i -contractible to a path.Since the edge sets of any two non-trivial blocks are disjoint, it holds that k ≥ p i=1 k i .As we saw earlier, k i ≥ (b i − 2)/2 for every i ∈ {1, . . ., p}.This implies that k ≥ We assume G to have at least two vertices, as otherwise we can output a trivial yes-instance.Then, every vertex of G that is contained in a trivial block must be an endpoint of a bridge.This implies that if G has exactly b bridges, then at most 2b vertices of G are contained in trivial blocks.We now distinguish four cases.Then (G, k) is a no-instance of Path or Cycle Contraction due to Lemmas 13 and 14, so our algorithm returns a trivial no-instance.
Case 3. G has more than k bridges and β(G) ≤ 4k.By Lemma 13, G is not k-contractible to a cycle.We repeatedly apply Rule A, as long as applying this rule results in a graph with more than k bridges and hence a no-instance of Cycle Contraction; note that applying Rule A does not change the parameter.Let (G , k) be the instance obtained this way.Then (G , k) and (G, k) are equivalent instances of Path or Cycle Contraction as a result of Lemmas 12 and 13.If Rule A cannot be applied on (G , k) at all, regardless of the number of bridges in the resulting graph, then we output a trivial no-instance in case |V (G )| > 5k + 3 and output the instance (G , k) otherwise, which is safe due to Lemma 12.If Rule A could have been applied on (G , k) but would have yielded a graph with at most k bridges, then we simply return this instance as the kernel.To see why G has at most 6k + 6 vertices, observe that applying Rule A would have decreased the number of bridges in G by exactly 1, so G contains exactly k + 1 bridges.Since we only contracted bridges when transforming G into G , it holds that β(G ) = β(G) ≤ 4k.We conclude that |V (G )| ≤ 2(k + 1) + 4k = 6k + 2.  To see why the above algorithm runs in polynomial time, first observe that for any graph G, one can easily determine the value of β(G) as well as the number of bridges in G in polynomial time.Hence each reduction rule, including additional checks, can be performed in polynomial time.Since the number of vertices or the parameter strictly decreases at each step, the algorithm applies the reduction rules only a polynomial number of times.This completes the proof.

Concluding remarks
We start this final section by stating two results due to Mathieson and Szeider [28] that were already mentioned in the introduction.Although we only state these results for unweighted graphs, we would like to point out that Mathieson and Szeider proved weighted variants of both results below.We consider the editing operations vertex deletion (denoted v), edge deletion (denoted e), and edge addition (denoted a).For each non-empty subset S ⊆ {v, e, a}, the Degree Constraint Editing(S) problem, or DCE(S) for short, is defined as follows:

DCE(S)
Instance: A graph G = (V, E), two integers k and r , and a degree list function δ : V → 2 {0,...,r } .Question: Can we obtain from G a graph G = (V , E ) such that d G (v) ∈ δ (v) for every v ∈ V , using at most k editing operations from S?
We write DCE * (S) if all degree lists are singletons; if all singletons are {r }, then we write DCE r (S).Mathieson and Szeider [28]  Note that the two results by Mathieson and Szeider that were mentioned in the introduction of this paper are special cases of Theorems 11 and 12, respectively.If we denote the edge contraction operation by c, and define the DCE(S) problem for any non-empty subset S ⊆ {v, e, a, c}, then we can reformulate some of our results in the framework of Mathieson and Szeider.For example, our results immediately imply the following: Theorem 13 Let S = {c}.The problem DCE(S) is fixed-parameter tractable when parameterized by k + r if either all the degree lists are {0, . . ., r } or all the degree lists are {r }, and W[2]-hard, even on split graphs, when parameterized by k.The problem DCE r (S) is W[1]-hard when parameterized by k.
It would be very interesting to investigate whether Mathieson and Szeider's Classification Theorem can be generalized in such a way that it holds for every non-empty subset S ⊆ {v, e, a, c}.Theorem 13 can be seen as a first step in this direction.
Another interesting direction for future work is to investigate further the kernelization complexity of the Max-Degree Contraction and Regular Contraction problems.Do these problems admit polynomial kernels when parameterized by k + d?We showed that when d = 2, both Max-Degree Contraction and Regular Contraction admit linear vertex kernels on connected graphs when parameterized by k.Do these problems admit polynomial kernels for some, or all, fixed values of d ≥ 3? Recall that Fellows, Guo, Moser and Niedermeier [12] proved that Max-Degree Vertex Deletion admits an almost-linear vertex kernel for any fixed d ≥ 0. As mentioned in the introduction, edge contraction problems tend to be more difficult than vertex deletion problems.It therefore seems unlikely that we can obtain an analogue of the kernelization result by Fellows et al. [12] for Max-Degree Contraction and Regular Contraction that gives equally good kernels.Even answering the question whether or not Max-Degree Contraction and Regular Contraction admit polynomial kernels when d = 3 seems to be a challenging task.

Theorem 4
[1]-hard on regular graphs.Since Regular Multicolored Clique is trivial on d-regular graphs when d ≤ k, the problem remains W[1]-hard on d-regular graphs for d > k.Now let (G, k, X 1 , . . ., X k ) be an instance of Regular Multicolored Clique on d-regular graphs, where d > k, and let p = |X 1 | = • • • = |X k |.Let G be the disjoint union of d + 1 copies of G.For each i ∈ {1, . . ., k}, let X i denote the union of the sets X i in all these copies.It is readily seen that G is a d-regular graph, G has a clique of size k if and only if G has a clique of size k, and p = |X 1 | = . . .= |X k | = (d + 1) p > d.We use the above lemma to prove the first hardness result of this subsection.The Regular Contraction problem is W[1]-hard when parameterized by k.Proof We reduce from the restricted version of the Regular Multicolored Clique problem described in Lemma 3. Let (G, k, X 1 , . . ., X k ) be an instance of this problem where G is a d-regular graph, p = |X 1 | = • • • = |X k |, and k < d < p.We construct an instance (G , d , k) of Regular Contraction as follows: FPT = W[P].Before we prove this result, let us first define the following decision problem for any non-negative integer d: d-Degenerate Vertex Deletion Instance: A graph G and an integer k.Question: Is there a subset S ⊆ V (G) with |S| ≤ k such that G − S is d-degenerate?For convenience, we will use d-Degenerate Contraction to refer to the Degenerate Contraction problem where the (non-negative) integer d is fixed, that is, d is not part of the input.In other words we define the following problem: d-Degenerate Contraction Instance: A graph G and an integer k.Question: Is there a d-degenerate graph H such that G is k-contractible to H ?

Theorem 8
For any d ≥ 3, the d-Degenerate Contraction problem is NP-complete as well as W[P]-complete when parameterized by k, even when restricted to (d + 1)-degenerate input graphs.Proof Let d ≥ 3. We start by showing that d-Degenerate Contraction on (d + 1)degenerate graphs is NP-hard as well as W[P]-hard when parameterized by k.We do this by giving a polynomial-time parameterized reduction from (d − 1)-Degenerate Vertex Deletion on d-degenerate graphs, which is W[P]-complete by Theorem 6.Given an instance (G, k) of (d − 1)-Degenerate Vertex Deletion where G is d-degenerate, we build an instance (G * , k) of d-Degenerate Contraction, where G * is the graph obtained from G by adding a universal vertex z.Since adding a universal vertex increases the degeneracy of a graph by exactly 1, we find that G * is (d + 1)-degenerate.We claim that G can be made (d − 1)-degenerate by deleting at most k vertices if and only if G * is k-contractible to a d-degenerate graph.
Instance: A connected graph G and an integer k.Parameter: k.Question: Is G k-contractible to a cycle?Path or Cycle Contraction Instance: A connected graph G and an integer k.Parameter:k.Question: Is G k-contractible to a path or a cycle?We present linear vertex kernels for Cycle Contraction and Path or Cycle Contraction in Sects.4.1 and 4.2, respectively.This readily implies that Regular Contraction and Max-Degree Contraction admit quadratic vertex kernels on general graphs when d = 2.

Rule 4
If G is 2-connected and contains two vertices u and v such that d G (u) = d G (v) = 2, the two neighbors p and q of u both have degree 2 in G, and the graph G − {u, v} has exactly two connected components that contain at least k + 2 vertices each, then return the instance (G/up, k).Lemma 10 Rule 4 is safe.

Lemma 11
Let (G, k) be an instance of Cycle Contraction on which Rules1-4 cannot be applied.If (G, k) is a yes-instance, then G has at most 6k + 6 vertices.Proof Suppose (G, k) is a yes-instance of Cycle Contraction.If G is 3-connected, then |V (G)| ≤ 2k + 2 ≤ 6k + 6,as otherwise Rule 1 could be applied.Suppose G is not 3connected, and suppose G is not 2-connected either.As G is connected, G has at least two blocks.Let B be any block of G. Since Rule 2 cannot be applied, it holds that |V (B)| ≤ k +1.Moreover, |V (G)\V (B)| ≤ k as Rule 3 cannot be applied.Hence |V (G)| ≤ 2k +1 ≤ 6k +6.So, we may assume that G is 2-connected.
p i=1 (b i − 2)/2 ≥ p i=1 (b i − 2)/2 or equivalently p i=1 b i ≤ 2k + 2 p.In order to contract G to a path, we need to contract at least one edge in each of the p non-trivial blocks of G, which means that k ≥ p. Hence we conclude that β(G) = p i=1 b i ≤ 4k.Theorem 10 The Path or Cycle Contraction problem admits a kernel with at most 6k + 7 vertices.Proof We describe a kernelization algorithm for Path or Cycle Contraction.Let (G, k) be an instance of this problem.Let B 1 , . . ., B p be the non-trivial blocks of the connected graph G, and recall that β(G) = p i=1 |V (B i )|.

Case 4 .
G has at most k bridges and β(G) > 4k.Then (G, k) is a no-instance of Path Contraction due to Lemma 14.We repeatedly apply Rules 1-4 from the kernelization algorithm for Cycle Contraction from Sect.4.1 until either we can no longer apply such a rule on the instance under consideration, or applying any of the rules yields an instance (G , k ) such that β(G ) ≤ 4k .The latter condition prevents us from inadvertently transforming (G, k) into a yes-instance of Path Contraction.Recall that Rules 1-4 are safe due to Lemmas 7-10.Hence, if after applying a rule a trivial no-instance is returned, (G, k) is a noinstance of Cycle Contraction, and thus of Path or Cycle Contraction.Otherwise, let (G * , k * ) be the instance we eventually obtain.Because β(G * ) > 4k * and Rules 1-4 are safe, (G, k) and (G * , k * ) are equivalent instances of Path and Cycle Contraction.

First
suppose that none of Rules 1-4 can be applied on (G * , k * ).Then we return a trivial no-instance if |V (G * )| ≥ 6k * + 7 and we return (G * , k * ) as the desired kernel if |V (G * )| ≤ 6k * + 6 ≤ 6k + 6, which is safe due to Lemma 11 .Now suppose that we could have applied one of Rules 1-4 on (G * , k * ) but this would have resulted in an instance (G , k ) with β(G ) ≤ 4k .If G * has more than k * bridges, then we can safely output a trivial no-instance of Path or Cycle Contraction due to Lemma 13.Suppose G * has at most k * bridges.Since β(G * ) > 4k * and contracting a single edge cannot reduce the total sum of the sizes of all non-trivial blocks by more than 1, we have that β(G * ) = 4k * + 1, implying that |V (G * )| ≤ 2k * + (4k * + 1) ≤ 6k + 7. Hence, we return (G * , k * ) as the desired kernel.
managed to classify the parameterized complexity of the DCE(S) problem with respect to the parameters k and k + r for every non-empty subset S ⊆ {v, e, a}: Theorem 11 (Classification Theorem [28]) Let ∅ = S ⊆ {v, e, a}.The problem DCE(S) is fixed-parameter tractable when parameterized by k + r , and W[1]-hard when parameterized by k.If v ∈ S, then DCE r (S) is W[1]-hard when parameterized by k.They also obtained the following kernelization result: Theorem 12 ([28]) Let {v} ⊆ S ⊆ {v, e}.The problem DCE(S) admits a kernel with O(k 2 r k+1 + kr k+2 ) vertices, and the problem DCE * (S) admits a kernel with O(kr(k + r )) vertices.The problem DCE({e}) admits a kernel with O(kr k+1 ) vertices.

Table 1
[17]verview of the known results for Min-Degree Contraction[17](row 1) together with our new results that are presented in Sect. 3 (rows 2-4) the third problem is W[2]-hard when parameterized by k and hence is expected not to admit a kernel at all.Below, we give a more detailed overview of the results in this paper.For a summary of the results in Sect.3, we refer to Table1.In Sect.3.1, we observe that Max-Degree Contraction can be solved in time O construct in polynomial time the graph G d−2 H . Let p denote the number of vertices of G H . Then the number of vertices of G d−2 Consequently, the number of vertices of F would be d + 1 < 2d ≤ |V (F)| as d ≥ 2. Hence, F has diameter 2. Because F has at least 2d vertices and F is d-regular, every vertex in F has at least d − 1 ≥ 1 non-neighbors.By construction (in particular recall that S n = S n = Q), the sets {s, S n }, {t, S n } and {S n , S n } are dominating sets of G d−2 H .Because F has diameter 2, this means that s and S n are in different witness sets, and similarly, t and S n are in separate witness sets, and the same holds for S n and S n .
[22] p + d − 2 + d − 2 = p + 2d − 4. We claim that G d−2 H can be modified to a d-regular graph using at most k = p − 4 edge contractions if and only if G d−2 H contains K d,d as a contraction.The backwards implication is trivial.Suppose that G d−2 H can be modified to a d-regular graph F using at most k edge contractions.Let W be an F-witness structure for G d−2 H .Because G d−2 H has p + 2d − 4 vertices and F is obtained by at most k = p − 4 edge contractions, we find that F has at least p + 2d − 4 − ( p − 4) = 2d vertices.Observe that the diameter of G d−2H is 2 (also see[22]).Hence, F has diameter at most 2. If F has diameter 1, then F is isomorphic to K d+1 , as F is d-regular.