Editing to a Planar Graph of Given Degrees

We consider the following graph modification problem. Let the input consist of a graph $G=(V,E)$, a weight function $w\colon V\cup E\rightarrow \mathbb{N}$, a cost function $c\colon V\cup E\rightarrow \mathbb{N}$ and a degree function $\delta\colon V\rightarrow \mathbb{N}_0$, together with three integers $k_v, k_e$ and $C$. The question is whether we can delete a set of vertices of total weight at most $k_v$ and a set of edges of total weight at most $k_e$ so that the total cost of the deleted elements is at most $C$ and every non-deleted vertex $v$ has degree $\delta(v)$ in the resulting graph $G'$. We also consider the variant in which $G'$ must be connected. Both problems are known to be NP-complete and W[1]-hard when parameterized by $k_v+k_e$. We prove that, when restricted to planar graphs, they stay NP-complete but have polynomial kernels when parameterized by $k_v+k_e$.


Introduction
Graph modification problems capture a variety of graph-theoretic problems and are well studied in algorithmic graph theory. The aim is to modify some given graph G into some other graph H that satisfies a certain property by applying a bounded number of operations from a set S of prespecified graph operations. Well-known graph operations are the edge addition, edge deletion and vertex deletion, denoted by ea, ed and vd, respectively. For example, if S = {vd} and H ⋆ An extended abstract of this paper appeared in the proceedings of CSR 2015 [11].
The first and fourth author were supported by EPSRC Grant EP/K025090/1. must be a clique or independent set then we obtain the basic problems Clique and Independent Set, respectively. To give a few more examples, if H must be a forest and S = {ed} or S = {vd} then we obtain the problems Feedback Edge Set and Feedback Vertex Set, respectively. As discussed in detail later, it is also common to consider sets S consisting of more than one graph operation.
A property is hereditary if it holds for any induced subgraph of a graph that satisfies it, and a property is non-trivial if it is both true for infinitely many graphs and false for infinitely many graphs. A classic result of Lewis and Yannakakis [25] is that a vertex deletion problem is NP-hard for any property that is hereditary and non-trivial. In an earlier paper Yannakakis [31] also showed that the edge deletion problem is NP-complete for several properties, such as being planar or outer-planar. Natanzon, Shamir and Sharan [28] and Burzyn, Bonomo and Durán [6] proved that the graph modification problem is NP-complete when S = {ea, ed} and the desired property is to belong to some hereditary graph class for a variety of such graph classes.
When a problem turns out to be NP-hard, a possible next step might be to consider it in the more refined framework offered by parameterized complexity. This is certainly an appropriate direction to follow for graph modification problems, because the bound on the total number of permitted operations is a natural parameter k. Cai [7] proved that for this parameter the graph modification problem is FPT if S = {ea, ed, vd} and the desired property is to belong to any fixed graph class characterized by a finite set of forbidden induced subgraphs. Khot and Raman [22] determined all non-trivial hereditary properties for which the vertex deletion problem is FPT on n-vertex graphs with parameter n − k and proved that for all other such properties the problem is W[1]-hard (when parameterized by n − k).
From the aforementioned results we conclude that the graph modification problem has been thoroughly studied for hereditary properties. However, for other types of properties, much less is known. Dabrowski et al. [10] combined previous results [5,8,9] with new results to classify the (parameterized) complexity of the problem of modifying the input graph into a connected graph where each vertex has some prescribed degree parity for all S ⊆ {ea, ed, vd}.
In this paper we consider the case when the vertices of the resulting graph must satisfy some prespecified degree constraints (note that such properties are non-hereditary, so the results of Lewis and Yannakakis do not apply to this case). Before presenting our results, we briefly discuss the known results and the general framework they fall under.
Moser and Thilikos in [27] and Mathieson and Szeider [26] initiated an investigation into the parameterized complexity of such graph modification problems. In particular, Mathieson and Szeider [26] introduced the following general problem.

Deletion to a Planar Graph of Given Degrees (DPGGD)
Instance: A planar graph G = (V, E), integers k v , k e , C and functions δ : V → N 0 , w : V ∪ E → N, c : V ∪ E → N 0 . Question: Can G be modified into a graph G ′ by deleting a set U ⊆ V with w(U ) ≤ k v and a set D ⊆ E with w(D) ≤ k e such that c(U ∪ D) ≤ C and d G ′ (v) = δ(v) for v ∈ V (G ′ )?
In the above problem, w is the weight and c is the cost function. The question is whether it is possible to delete vertices and edges of total weight at most k v and k e , respectively, so that the total cost of the deleted elements is at most C and the obtained graph satisfies the degree restrictions prescribed by the given function δ.
The second problem we consider is the variant of DPGGD, in which the desired graph G ′ must be connected. We call this variant the Deletion to a Connected Planar Graph of Given Degrees problem (DCPGGD).
Our Results. We note that DPGGD is NP-complete even if δ ≡ 3, w ≡ 1, c ≡ 0 and k v = |V (G)| − 1, and DCPGGD is NP-complete even if δ ≡ 2, w ≡ 1, c ≡ 0 and k v = 0. These observations follow directly from the respective facts that both testing whether a planar graph of degree at most 7 has a non-trivial cubic subgraph [30] is NP-complete and testing whether a cubic planar graph has a Hamiltonian cycle [16] is NP-complete. In contrast to the aforementioned W[1]hardness results for general graphs, our two main results are that both DPGGD and DCPGGD have polynomial kernels when parameterized by k v + k e . Note that the integer C is neither a constant nor a parameter but part of the input. In order to obtain our results we first show that both problems are polynomial-time solvable for any graph class of bounded treewidth. We then use the protrusion decomposition/replacement techniques introduced by Bodlaender at al. [3] (see [4] for the full text). These techniques were successfully used for various problems on sparse graphs [14,17,18,23]. We stress that DPGGD and DCPGGD do not fit in the meta-kernelization framework of Bodlaender at al. [3]. Hence our approach is, unavoidably, problem-specific.

Preliminaries
All graphs in this paper are finite, undirected and without loops or multiple edges. The vertex set of a graph G is denoted by V (G) and the edge set is denoted by E(G). For a set X ⊆ V (G), we let G[X] denote the subgraph of G induced by X. We write G − X = G[V (G) \ X]; we allow the case where X ⊆ V (G). If X = {x}, we may write G − x instead. For a set L ⊆ E(G), we let G − L be the graph obtained from G by deleting all edges of L. If L = {e} then we may Let G be a graph. For a vertex v, we let N G (v) denote its (open) neighbourhood, that is, the set of vertices adjacent to v. The degree of a vertex v is denoted by is the set of vertices at distance at most r from v; note that N 0 . For a set X ⊆ V (G) and a pos- A tree decomposition of a graph G is a pair (X , T ) where T is a tree and The treewidth of a graph G (denoted tw(G)) is the minimum width over all tree decompositions of G. A tree decomposition (X , T ) of a graph G is nice, if T is a rooted binary tree such that the nodes of T are of four types: and (iv) a join node i has two children i ′ and i ′′ with X i = X i ′ = X i ′′ , and, moreover, the root r is a forget node with X r = ∅. Kloks [24] proved that every tree decomposition of a graph can be converted in linear time to a nice tree decomposition of the same width such that the size of the obtained tree is linear in the size of the original tree.
We need the following known observation, which is valid for every planar bipartite graph G in which the vertices of one partition class V 2 have degree at least 3 (in order to prove this, note that as G is bipartite and planar). Lemma 1. Let V 1 and V 2 be bipartition classes of a planar bipartite graph G such that d G (v) ≥ 3 for every v ∈ V 2 and V 2 is non-empty. Then |V 2 | ≤ 2|V 1 |−4.
Protrusion decompositions. For a graph G and a positive integer r, a set X ⊆ V (G) is an r-protrusion of G if |∂ G (X)| ≤ r and tw(G[X]) ≤ r. For positive integers s and s ′ , an (s, s ′ )-protrusion decomposition of a graph G is a partition Π = {R 0 , . . . , R p } of V (G) such that Originally, condition (iii) only demanded that N G (R i ) ⊆ R 0 holds for each i ∈ {1, . . . , p}. However, we can move every vertex in N G (R i ) \ ∂ G [R + i ] to R i without affecting any of the other properties. Hence we assume without loss of generality that such vertices do not exist and may indeed state condition (iii) as above (which is convenient for our purposes). The sets R + 1 , . . . , R + p are called the protrusions of Π.
The following statement is implicit in [4] (see Lemmas 6.1 and 6.2).

Lemma 2 ([4]
). Let r and k be positive integers and let G be a planar graph that has an r-dominating set of size at most k. Then G has an (O(kr), O(r))protrusion decomposition, which can be constructed in polynomial time.
Parameterized Complexity. Parameterized complexity is a two dimensional framework for studying the computational complexity of a problem. One dimension is the input size n and the other is a parameter k. A problem is said to be fixed parameter tractable (or FPT) if it can be solved in time f (k) · n O(1) for some function f . A kernelization for a parameterized problem is a polynomial algorithm that maps each instance (x, k) with input x and parameter k to an instance (x ′ , k ′ ) such that (i) (x, k) is a yes-instance if and only if (x ′ , k ′ ) is a yes-instance, and (ii) the size of x ′ and k ′ is bounded by f (k) for a computable function f .
The output (x ′ , k ′ ) is called a kernel. The function f is said to be the size of the kernel. A kernel is polynomial if f is polynomial. We refer to the books of Downey and Fellows [12], Flum and Grohe [13], and Niedermeier [29] for detailed introductions to parameterized complexity.

The Polynomial Kernels
In this section we construct polynomial kernels for DPGGD and DCPGGD. We say that a pair (U, Notice that it can happen that U = V (G) for a solution (U, D).
In order to prove our main results, we first need to introduce some additional terminology and prove some structural results. We say that a solution (U, D) for an instance of DPGGD or DCPGGD is efficient if D has no edges incident to the vertices of U . We say that a solution (U, D) is of minimum cost if c(Û ,D) ≥ c(U, D) for every solution (Û ,D). We make two observations. Observation 1 Any yes-instance of DPGGD or DCPGGD has an efficient solution of minimum cost.
Observation 2 Let (G, k v , k e , C, δ, w, c) be instance of DPGGD or DCPGGD that has an efficient solution (U, D). If d G (v) = δ(v) for some v ∈ V (G) then v is not incident to an edge of D.
We say that an instance (G, k v , k e , C, δ, w, c) of DPGGD (DCPGGD respectively) is normalized if There is a polynomial-time algorithm that for each instance of DPGGD or DCPGGD either solves the problem or returns an equivalent normalized instance.
Proof. Let (G, k v , k e , C, δ, w, c) be an instance of DPGGD. To simplify notation, we keep the same notation for the functions δ, w, c if we delete vertices or edges and do not modify the values of the functions for the remaining elements if this does not create confusion. We say that a reduction rule is safe if by applying the rule we either solve the problem or obtain an equivalent instance. It is straightforward to see that the following reduction rules are safe.
Yes-instance rule. If S = V (G) then (∅, ∅) is a solution, return a yesanswer and stop.
If k v < 0 or C < 0, then stop and return a no-answer.
Observe that by the exhaustive application of the vertex deletion rule and applying the yes-instance rule whenever possible, we either solve the problem or we obtain an instance which satisfies (i) of the definition of normalized instances, but where S = V (G). Notice that, in particular, the yes-instance rule is applied if the set of vertices becomes empty. To ensure (ii), we apply the following two rules.
-Contract uv. Denote the obtained graph G ′ = G/uv and let z be the vertex obtained from u and v.
Let (U, D) be an efficient solution for (G, k v , k e , C, δ, w, c). By Observation 2, D has no edges incident to u or v. Also either u, v ∈ U or u, v / ∈ U , because u and v are adjacent and We exhaustively apply the above rule. Assume that it cannot be applied for (G, k v , k e , C, δ, w, c). Then we have that this instance satisfies (i) and the following holds: for any v ∈ S = V (G), either v is adjacent to a vertex in S or v is an isolated vertex. It remains to deal with isolated vertices.
Isolates removal rule. If G has an isolated vertex v, then delete v.
To see that above rule is safe, notice that, because the considered instance satisfies (i), it follows that δ(v) ≤ d G (v) = 0, so v ∈ S. Clearly, by the exhaustive application of the isolates removal rule, we either solve the problem or obtain an instance that satisfies (i) and (ii). Now consider an instance (G, k v , k e , C, δ, w, c) of DCPGGD. We replace the yes-instance rule by the following variant.
Yes-instance rule (connected). If S = V (G) and G is connected, then (∅, ∅) is a solution, return a yes-answer and stop.
It is straightforward to verify that the vertex deletion rule and the contraction rule are safe for this problem. By applying these rules and by the application of the connected variant of the yes-instance rule whenever possible, we either solve the problem or obtain an equivalent instance that satisfies (i) and has the property that for any v ∈ S, either v is adjacent to a vertex in S or v is an isolated vertex. Suppose that (G, k v , k e , C, δ, w, c) satisfies these properties.
Therefore, it is safe to apply the following variant of the isolates removal rule.
if k v < 0 or C < 0, then stop and return a no-answer.
It is easy to see that if the input graph was planar then the graph formed after applying the rules above will also be planar.
⊓ ⊔ Lemma 4. If (G, k v , k e , C, δ, w, c) is a normalized yes-instance of DPGGD ( DCPGGD respectively) then G has a 2-dominating set of size at most k v +2k e .
Proof. We prove the lemma for DPGGD; the proof for DCPGGD is the same. Let (G, k v , k e , C, δ, w, c) be a normalized yes-instance of the problem. Let (U, D) be a solution and W = U ∪ V (D). Clearly, |W | ≤ k v + 2k e , because the weights are positive integers. We show that W is a 2-dominating set of G.
The following is a direct consequence of Lemmas 2 and 4.

Lemma 5.
There is a fixed constant α such that, if (G, k v , k e , C, δ, w, c) is a normalized yes-instance of DPGGD ( DCPGGD respectively), then G has an (α(k v + 2k e ), α)-protrusion decomposition. Moreover, if there is such a decomposition, one can be constructed in polynomial time.
The next lemma states that, for both DPGGD and DCPGGD, an optimal solution can be found in polynomial time on graphs of bounded treewidth. The proof is based on the standard techniques for dynamic programming over tree decompositions.
Lemma 6. DPGGD ( DCPGGD respectively) can be solved, and an efficient solution (U, D) of minimum cost can be obtained in Proof. We use more or less standard approach for construction of dynamic programming algorithms for graphs of bounded treewidth.
We first of all assume that a nice tree decomposition (X , T ) of G with width t = O(q) is given. To simplify later arguments, we may assume t ≥ 2. For this, we may use the algorithm of [2] to obtain an decomposition whose width is at most five times the optimal in 2 O(q) · n steps and then convert it to a nice tree decomposition using the aforementioned results of Kloks [24].
Let r denote the root of T . For any node i ∈ V (T ), let T i denote the subtree of T induced by i and its descendants and let G i = G[ j∈V (Ti) X j ]. We apply a dynamic programming algorithm over (X , T ).
First, we describe the tables that are constructed for the nodes of T . Let i ∈ V (T ). We define table i as a partial function whose inputs are quintuples The value of table i is a minimum cost pair (U, D) ∈ 2 V (Gi) × 2 E(Gi) with the following properties: (i) for any v ∈ U and any e ∈ D, v and e are not incident, and, if no such pair (U, D) exists, then Moreover, in such a case, the value of table r (∅, ∅, ∅, k v , k e ) is a minimum-cost solution for this instance.
Now we explain how we construct have table i void in all other cases. Hence, it remains to give the construction for introduce, forget, and join nodes. Let i ∈ V (T ) be a node of one of these types. Assume inductively that the function table i ′ for every child i ′ of i has already been constructed.
In what follows we write table i (X, Y, γ, h v , h e ) (U, D) to refer to the following procedure: Construction for an introduce node. Let i ′ be the child of i and we do the following: Construction for a forget node. Let i ′ be the child of i and we do the following.
Construction for a join node. Let i ′ and i ′′ be the children of i. We start with table i empty. For each pair ((X, Using standard arguments, it is straightforward to verify the correctness of the algorithm. To evaluate the running time, recall that table i receives a quintuple (X, Y, γ, h v , h e ) as input. There are at most 2 t+1 possible choices for X, 2 3(t+1)−6 = 2 3t−3 choices of Y (because of the planarity of G), (k v + k e + 1) t+1 choices of γ, k v + 1 possible values of h v and k e + 1 possible values for h e . We therefore have that each table i has has (k v + k e ) O(t) entries. This implies that the running time of the dynamic programming algorithm is (k v + k e ) O(t) · n.
Now we consider DCPGGD. The difference is that we have to keep track of components of a partial solution as is standard for dynamic programming algorithms for graphs of bounded treewidth with a connectivity condition such as, e.g. the Steiner Tree problem. Let (G, k v , k e , C, δ, w, c) be an instance of Without loss of generality we assume that a nice tree decomposition (X , T ) of G with treewidth at most t is given and apply a dynamic programming algorithm over (X , T ). Let i ∈ V (T ).
We define table c i as a partial function whose inputs are quintuples The value of table c i is a minimum cost pair (U, D) ∈ 2 V (Gi) × 2 E(Gi) with the following properties: (i) for any v ∈ U and any e ∈ D, v and e are not incident, The partial function table c i is constructed for every i ∈ V (T ) similarly to the construction of table i for DPGGD. Because there are at most (t + 1) t+1 partitions P of each X i , we have that each table contains (t(k v + k e )) O(t) entries. Therefore, the running time of the dynamic programming algorithm is (t(k v + k e )) O(t) n.

⊓ ⊔
We are now ready to present our two main results, starting with the one for DPGGD. Theorem 1. DPGGD has a polynomial kernel when parameterized by k v + k e .
Proof. Let (G, k v , k e , C, δ, w, c) be an instance of DPGGD. By Lemma 3, we may assume that this instance is normalized. By Lemma 4, if (G, k v , k e , C, δ, w, c) is a yes-instance, then G has a 2-dominating set of size at most k v +2k e . By Lemma 5, there is a fixed constant α such that G has an (α(k v +2k e ), α)-protrusion decomposition, and such a decomposition, if it exists, can be constructed in polynomial time. To simplify later arguments, we may assume α ≥ 3. Clearly, if we fail to obtain such a decomposition, we return a no-answer and stop. Hence, from now on we assume that an (α(k v + 2k e ), α)-protrusion decomposition Π = {R 0 , . . . , R p } of G is given. As before, we keep the same notation δ, w, c for the restrictions of these functions. Again, we will introduce new reduction rules. We will keep the notation for G and for the parameters unchanged where this is well-defined. We also assume that if we consider sets of vertices or edges associated with the considered instance and delete vertices or edges from the graph, then we also delete these elements from the associated sets.
For each i ∈ {1, . . . , p}, we construct W i ⊆ R i and L i ⊆ E G (R i ). To do this, we consider the set Q of all possible quintuples q = (h v , h e , X, Y, δ ′ ) such that Observe that there are at most 2 α sets X, at most 2 3α−6 sets Y , at most (k v + 1)(k e + 1) pairs h v , h e , and for each X, there are at most (k v + k e + 1) α possibilities for δ ′ . Therefore |Q| ≤ 2 α 2 3α−6 (k v + 1)(k e + 1)(k v + k e + 1) α = (k v + k e ) O(α) .
Claim A. If (G, k v , k e , C, δ, w, c) is a yes-instance of DPGGD, then it has an efficient solution (U, D) of minimum cost such that U ⊆ W and D ⊆ L.
We prove Claim A as follows. Let (U, D) be an efficient solution for (G, k v , k e , C, δ, w, c) of minimum cost such that s = |U \ W | + |D \ L| is minimum. If s = 0, then the claim is fulfilled. Suppose, for contradiction, that s > 0. This means that there is an i ∈ {1, . . . , p} such that ( Then (U ′ , D ′ ) is a solution for the instance I q and, therefore I q is a yesinstance. In particular, this means that there is a solution (U ′′ , D ′′ ) for I q = (F, h v , h e , C, δ ′ , w ′ , c) that was constructed by the aforementioned procedure for the construction of W i and L i . Clearly, U ′′ ⊆ W i ⊆ W and D ′′ ⊆ L i ⊆ L. Because our algorithm for graphs of bounded treewidth finds a solution of minimum cost, it follows that c(U ′′ ∪ D ′′ ) ≤ c(U ′ ∪ D ′ ). It remains to observe that (Û ,D), whereÛ = (U \ U ′ ) ∪ U ′′ andD = (D \ D ′ ) ∪ D ′′ , is a solution for (G, k v , k e , C, δ, w, c) with c(Û ∪D) ≤ c(U ∪ D), but this contradicts the choice of (U, D) because |Û \ W | + |D \ L| < s. This completes the proof of Claim A.
because the instance we consider is normalized, these sets form a partition of V (G) \ W (note that these sets may be empty). If v ∈ S, then for any efficient solution (U, D) such that U ⊆ W and D ⊆ L, v is not adjacent to any vertex of U and not incident to any edge of L. This implies that it is safe to exhaustively apply the following rule without destroying the statement of Claim A.

Set adjustment rule.
If there is a vertex v ∈ S that is adjacent to a vertex u ∈ W , then set W = W \{u} and set S = S ∪{u} if d G (u) = δ(u) and set T = T ∪ {u} if d G (u) > δ(u). If v ∈ S, remove any edge incident to v from L.
By Claim A, it is safe to modify the weights as follows.
Weight adjustment rule. Set w(v) = k v + 1 for v ∈ V (G) \ W and set w(e) = k e + 1 for e ∈ E(G) \ L.
After the exhaustive application of the set adjustment rule, we have that N G (S) ⊆ T . Now it is safe to remove S.
S-reduction rule. If v ∈ S, then remove v and set δ(u) = δ(u) − 1 for u ∈ N G (v). If δ(u) < 0 for some u ∈ N G (v), then return a no-answer and stop.
To show that the above rule is safe, let G ′ = G − S and let δ ′ be the function obtained from δ by the application of the rule. Suppose that (G, k v , k e , C, δ, w, c) is a yes-instance. Then, by Claim A, we have a solution (U, D) such that U ⊆ W and D ⊆ L. Because N G (S) ⊆ T , T ∩ W = ∅ and the vertices of S are not incident to edges of L, it follows that we do not stop and (U, D) is a solution for (G ′ , k v , k e , C, δ ′ , w, c). Now let (U, D) be a solution for (G ′ , k v , k e , C, δ ′ , w, c). Because of the application of the weight adjustment rule, U ⊆ W and D ⊆ L. Because N G (S) ⊆ T , T ∩ W = ∅ and the vertices of S are not incident to edges of L, we have that (U, D) is a solution for (G, k v , k e , C, δ, w, c). This completes the proof that the S-reduction rule is safe. Let Using similar arguments to those for the S-reduction rule, the following rule is also safe.
After the exhaustive application of the above rule, T ′ is an independent set in the obtained graph G. Some of the vertices of this independent set may have the same neighbourhoods. We deal with them using the next rule.
To prove that the above rule is safe, consider a pair of vertices u, v ∈ T ′ with N G (u) = N G (v) and δ(u) = δ(v). Let G ′ = G − v and let δ ′ denote the function obtained from δ by the rule. Suppose that (G, k v , k e , C, δ, w, c) is a yes-instance. Then we have a solution (U, D) such that U ⊆ W and D ⊆ L. Notice that T ′ ∩ U = ∅ and the vertices of T ′ are not incident to the edges of L. Note that u, v / ∈ U and if x ∈ N G (u) then ux, vx / ∈ D. We have that U contains exactly d G (u) − δ(u) vertices that are adjacent to u. Therefore, (U, D) is a solution for (G ′ , k v , k e , C, δ ′ , w, c). Now assume that (U, D) is a solution for (G ′ , k v , k e , C, δ ′ , w, c). By the same arguments, U contains exactly d G ′ (u) − δ ′ (u) vertices that are adjacent to u. Also if x ∈ N G (u) and δ ′ (x) = 0, then x ∈ U , because u / ∈ U and ux / ∈ D. Because N G (u) = N G (v), δ(u) = δ(v) and T ′ is an independent set, U contains d G (u) − δ(u) vertices that are adjacent to u and d G (v) − δ(v) vertices that are adjacent to v. It follows that (U, D) is a solution for (G, k v , k e , C, δ, w, c). Now consider the case when N G (u) = N G (v) and δ(u) = δ(v). Suppose, for contradiction that there is a solution (U, D). By the above arguments, U contains exactly d G (u) − δ(u) vertices that are adjacent to u and d G (v) − δ(v) vertices that are adjacent to v. Since N G (u) = N G (v) and δ(u) = δ(v), this is a contradiction, so there cannot be such a solution.
After the exhaustive application of the above rule for any two vertices denote the sets of vertices in T ′ that are of degree 0, 1, 2 and at least 3 respectively. Observe form a partition of T ′ (note that these sets may be empty). By the twin reduc- vertices, we obtain that the obtained graph G has size k O (1) where k = k v + k e , i.e. we have a polynomial kernel for DPGGD.
To complete the proof, it remains to observe that the construction of the normalized instance can be done in polynomial time by Lemma 3, the construction of W and L can be done in polynomial time by Lemma 6, and all the subsequent reduction rules can be applied in polynomial time.
⊓ ⊔ The proof of our second main result is based on the same approach as the proof of Theorem 1, but it is more technically involved because we have to ensure connectivity of the graph obtained by the editing. Proof. Let (G, k v , k e , C, δ, w, c) be an instance of DCPGGD. By Lemma 3, we may assume that this instance is normalized. By Lemma 4, if (G, k v , k e , C, δ, w, c) is a yes-instance, then G has a 2-dominating set of size at most k v + 2k e . By Lemma 5, there is a fixed constant α such that G has an (α(k v + 2k e ), α)protrusion decomposition, and such a decomposition, if it exists, can be constructed in polynomial time. To simplify later arguments, we may assume α ≥ 3. Clearly, if we fail to obtain such a decomposition, we return a no-answer and stop. Hence, from now on we assume that an (α(k v + 2k e ), α)-protrusion decomposition Π = {R 0 , . . . , R p } of G is given. As before, we keep the same notation δ, w, c for the restrictions of these functions. Again, we will introduce new reduction rules. We will keep the notation for G and for the parameters unchanged where this is well-defined. We also assume that if we consider sets of vertices or edges associated with the considered instance and delete vertices or edges from the graph, then we also delete these elements from the associated sets.
For each i ∈ {1, . . . , p}, we construct W i ⊆ R i and L i ⊆ E G (R i ). To do this, we consider the set Q of all possible sextuples q = (h v , h e , X, Y, P, δ ′ ) such that Observe that there are at most 2 α sets X, at most 2 3α−6 sets Y , at most (k v + 1)(k e + 1) pairs h v , h e , and for each X, there are at most 2 α 2 possible set covers P and at most (k v + k e + 1) α possibilities for δ ′ . Therefore |Q| ≤ 2 α 2 3α−6 (k v + 1)(k e + 1)2 For each q = (h v , h e , X, Y, P, δ ′ ) ∈ Q, we construct an instance I q = (F P , h v , h e , C, δ ′′ , w ′ , c ′ ) of DCPGGD such that -F P is the graph obtained from F by adding a set of s new vertices Z = {z 1 , . . . , z s } and making z i adjacent to all the vertices of P i . If P = ∅, which means that N G (R + i ) = X, then we simply have that Z = ∅ and F P = F .
for all other edges of F P .
e ∈ E FP (Z) and c ′ (e) = c(e) for all other edges in F P .
Since |Z| ≤ |N G (R i )| ≤ α, it follows that |Z| ≤ α and therefore tw(F P ) ≤ tw(F ) + α ≤ 2α. We can check in linear time whether F P is planar [21]. If it is not, then I q is not a valid instance of DCPGGD and we set (U q , D q ) = (∅, ∅). Otherwise, by Lemma 6, we can solve DCPGGD for I q in (α(k v + k e )) O(α) · poly(n) time and find a solution of minimum cost. Let (U q , D q ) be the obtained solution of minimum cost and let U q = D q = ∅ if no solution exists. Notice that Z ∩ U q = ∅, because the vertices of Z have weight k v + 1, and D q has no edges incident to the vertices of Z, because these edges have weight k e + 1. Let Because each U q has at most k v vertices and each D q has at most k e edges, we obtain that |W i | ≤ |Q|k v ≤ (k v + 1)(k e + 1) · 2 α · 2 3α−6 · 2 α 2 · (k v + k e + 1) α · k v and |L i | ≤ |Q|k e ≤ (k v + 1)(k e + 1) · 2 α · 2 3α−6 · 2 α 2 · (k v + k e + 1) α · k e . Hence, the size of W i and L i is . We prove the following claim.
Claim A. If (G, k v , k e , C, δ, w, c) is a yes-instance of DCPGGD, then it has an efficient solution (U, D) of minimum cost such that U ⊆ W and D ⊆ L.
We prove Claim A as follows. Let (U, D) be an efficient solution for (G, k v , k e , C, δ, w, c) of minimum cost such that s = |U \ W | + |D \ L| is minimum. If s = 0, then the claim is fulfilled. Suppose, for contradiction, that s > 0.
This means that there is an i ∈ {1, . . . , p} such that If there is a vertex z j ∈ Z such that removing it from H ′′ does not increase the number of components in H ′′ and every vertex in N G (R i ) \ X has a neighbour in Z \ {z j } then we remove z j from H ′′ and from Z. Doing this exhaustively, we obtain a graph with |Z| ≤ |N G (R i ) \ X| ≤ α. Call this graph F P . Without loss of generality assume Z = {z 1 , . . . , z t }. Let P j = N H ′′ (z j ) for j ∈ {1, . . . , t}. Then P = {P 1 , . . . , P t } is a set cover of N G (R i ) \ X containing at most α sets. If X = N G (R i ), then set P = ∅ and F P = F . Now F P is precisely the graph constructed from F and P earlier. Note that F P is planar since it is obtained from G by contractions, vertex deletions and edge deletions.
for other vertices of F P . Set w ′ , c ′ and δ ′′ as before.
Clearly, I q = (F P , h v , h e , C, δ ′ , w ′ , c ′ ) is an instance of DCPGGD when q = (h v , h e , X, Y, P, δ ′ ). Let U ′ = U ∩ V (F ) and D ′ = D ∩ E(F ). Then (U ′ , D ′ ) is a solution for the instance I q and, therefore I q is a yes-instance.
In particular, this means that there is a solution (U ′′ , D ′′ ) for I q = (F P , h v , h e , C, δ ′′ , w ′ , c ′ ) that was constructed by the aforementioned procedure for the construction of W i and L i . Clearly, U ′′ ⊆ W i ⊆ W and D ′′ ⊆ L i ⊆ L. Because our algorithm for graphs of bounded treewidth finds a solution of minimum cost, it follows that c(U ′′ ∪ D ′′ ) ≤ c(U ′ ∪ D ′ ). It remains to observe that (Û ,D), whereÛ = (U \ U ′ ) ∪ U ′′ andD = (D \ D ′ ) ∪ D ′′ , is a solution for (G, k v , k e , C, δ, w, c) with c(Û ∪D) ≤ c(U ∪ D), but this contradicts the choice of (U, D) because |Û \ W | + |D \ L| < s. This completes the proof of Claim A.
If v ∈ W = V (G) \ W and d G (v) = δ(v), then for any efficient solution (U, D) such that U ⊆ W and D ⊆ L, v is not adjacent to a vertex of U . Moreover, E G (v) ∩ D = ∅, by Observation 2. This implies that it is safe to apply the following rule without destroying the statement of Claim A.
The sets W and L give us the following possibility to remove some vertices when there is the unique possibility to satisfy degree restrictions.
, then return a no-answer and stop; then return a no-answer and stop.
We exhaustively apply the above two rules until they can no longer be further applied.
It is easy to see that the following rule is safe.
S-neighbour rule. If v has k neighbours in S, and δ(v) < k then return a no-answer and stop.
We apply the S-neighbour rule exhaustively. Next, we contract the edges of G[S].
S-contraction rule 1. If G has two adjacent vertices u, v ∈ S, then we do as follows.
We now show that the S-contraction rule 1 is safe. To do this, let (G ′ , k v , k e , C, δ ′ , w ′ , c ′ ) denote the instance obtained by an application of the rule. Let (U, D) be an efficient solution for (G, k v , k e , C, δ, w, c) such that U ⊆ W and D ⊆ L. By Observation 2, D has no edges incident to u or v. Also u, v / ∈ U , because u, v ∈ S. Notice that δ(x) ≥ 2 by the S-neighbour rule. If (U ′ , D ′ ) is an efficient solution for (G ′ , k v , k e , C, δ ′ , w ′ , c ′ ), then D ′ has no edges e incident to z, because w ′ (e) > k e . Similarly, z / ∈ U ′ because w ′ (z) > k v . Also note that δ ′ (x) ≥ 1 because of the S-neighbour rule. We obtain that (U ′ , D ′ ) is a solution for the original instance.
We exhaustively apply S-contraction rule 1. Note that S is an independent set in the obtained instance.
Stopping rule. If G has two components that contain vertices of W , then return a no-answer and stop. Suppose W contains a vertex v which is isolated in G. In this case if w(V (G)\{v}) ≤ k v and c(V (G)\{v}) ≤ C, then return a (V (G) \ {v}, ∅) as a solution and stop, otherwise, return a no-answer and stop.
Clearly, if G has two components that contain vertices of W , then one of these components should be deleted. By Claim A, we know that if there is a solution then there must be a minimal cost solution that does not delete any vertices of W . This contradiction means that there is no solution. If v ∈ W is an isolated vertex of G, then because d G (v) ≥ δ(v), it follows that δ(v) = d G (v) and we conclude that (V (G) \ {v}, ∅) must be a solution. Therefore, the stopping rule is safe.
Assume that we do not stop at this stage. Then we obtain the instance (G, k v , k e , C, δ, w, c) of the problem and sets W, L such that the sets partition of W (note that these sets may be empty), S is an independent set, no vertex of W is isolated in G, and L ∩ E(S) = ∅. Also for any v ∈ S, N G (v) ⊆ T , by the set adjustment rule.
By Claim A, it is safe to modify the weights as follows.
Weight adjustment rule. Set w(v) = k v + 1 for v ∈ V (G) \ W and set w(e) = k e + 1 for e ∈ E(G) \ L.
Our next aim is to bound the size of S. In the proof of Theorem 1 we simply deleted the vertices of S and adjusted δ appropriately. Here we need to preserve connectivity. Hence, we delete vertices only if this does not destroy connectivity and we use contractions otherwise.
S-deletion rule. If, for a vertex v ∈ S, one of the following is fulfilled S-contraction rule 2. If v ∈ S, then let u ∈ N G (v) and let ∆ = d G (u)−δ(u). For every vx ∈ E(v)\{vu} such that ux ∈ E(G), delete vx, add a vertex z adjacent to v and x, set δ(z) = 2, w(z) = k v + 1, w(zx) = w(zv) = k e + 1 and c(z) = c(zx) = c(zv) = 0 and add z to S. Then contract uv in the obtained graph and set δ(y) = d G (y)+∆, w(y) = k v +1 and c(y) = 0 for the vertex y obtained from u and v.
The above two rules are safe, because N G (v) ⊆ T and the vertices of T are not included in any solutions.
We apply these rules exhaustively. First we apply the S-deletion rule whenever it is possible. Then we apply the S-contraction rule 2. Notice that the S-contraction rule creates new vertices that are obtained by subdividing the edges of E(v) and they are placed in S. Therefore, it may happen that we can again apply the S-deletion rule, and in this case we do so. Finally, we get the graph G with the following properties: (i) for any v ∈ S, d G (v) = 2 and for {x, y} = N G (v), x, y ∈ V (L), and (ii) for any distinct u, v ∈ S, N G (u) = N G (v) (by the S-deletion rule). In particular, this means that |S| ≤ (2|L|) 2 .
Let W ′ = W ∪V (L)∪S and T ′ = T \V (L). Clearly, W ′ and T ′ form a partition of V (G) (one of the sets could be empty). Notice that |W ′ | ≤ |W | + 3|L| = (k v + k e ) O(α 2 ) . Now our aim is to bound the size of T ′ .
To see that the T ′ -deletion rule is safe, it is sufficient to recall that δ(v) = d G (v) because we already applied the vertex deletion rule. Hence, , so in any solution u and v have common adjacent vertices that are not deleted. Because E(v) ∩ L = ∅ and E(u) ∩ L = ∅, the edges of E(u) and E(v) cannot be deleted. Therefore, we maintain connectivity by the T ′deletion rule. It is straightforward to verify that the T ′ -deletion rule is safe with respect to degree restrictions. -For each vx ∈ E(v) such that x / ∈ T ′ , delete vx and set δ(x) = max{0, δ(x) − 1}.
To show that the T ′ -contraction rule is safe, again recall that δ(v) = |N G (v) ∩ W ′ | because we already applied the vertex deletion rule. Hence, in any solution, u and v have common adjacent vertices in W ′ that are not deleted. Because E(T ′ ) ∩ L = ∅, the edges of E(T ′ ) cannot be deleted. Therefore, we do not destroy connectivity by the T ′ -contraction rule. It is straightforward to verify that the T ′ -contraction rule is safe with respect to degree restrictions.
We exhaustively apply the above two rules. First, we apply the T ′ -deletion rule if possible. Then we apply the T ′ -contraction rule and if after the application of this rule we again can again apply the T ′ -deletion rule, we do so.
To complete the proof, it remains to observe that the construction of the normalized instance can be done in polynomial time by Lemma 3, the construction of W and L can be done in polynomial time by Lemma 6, and all the subsequent reduction rules can be applied in polynomial time.

Conclusions
We proved that DPGGD and DCPGGD are NP-complete but allow polynomial kernels when parameterized by k v + k e . These problems generalize the Degree Constrained Editing(S) problem and its connected variant for S = {ed, vd}; this can be seen, for instance, by testing all possible pairs k v , k e with k v + k e = k or by a slight adjustment of our algorithms. Note that by setting k v = 0 or k e = 0 we obtain the same results for S = {ed} and S = {vd}, respectively (recall though that for S = {ed} this is not so surprising, as the less general problem Degree Constrained Editing({ed}) is polynomial-time solvable for general graphs). Several open problems remain. We note that graph modification problems that permit edge additions are less natural to consider for planar graphs, because the class of planar graphs is not closed under edge addition. However, we could allow other, more appropriate, operations such as edge contractions and vertex dissolutions when considering planar graphs. Belmonte et al. [1] considered the setting in which only edge contractions are allowed and obtained initial results for general graphs that extend the work of Mathieson and Szeider [26] on Degree Constrained Editing(S) in this direction.