Editing to Connected f-Degree Graph ∗

In the Edge Editing to Connected f-Degree Graph problem we are given a graph G, an integer k and a function f assigning integers to vertices of G. The task is to decide whether there is a connected graph F on the same vertex set as G, such that for every vertex v, its degree in F is f(v) and the number of edges in E(G)4E(F ), the symmetric difference of E(G) and E(F ), is at most k. We show that Edge Editing to Connected f-Degree Graph is fixed-parameter tractable (FPT) by providing an algorithm solving the problem on an n-vertex graph in time 2O(k)nO(1). Our FPT algorithm is based on a non-trivial combination of colorcoding and fast computations of representative families over direct sum matroid of `-elongation of co-graphic matroid associated with G and uniform matroid over E(G), the set of non-edges of G. We believe that this combination could be useful in designing parameterized algorithms for other edge editing problems. 1998 ACM Subject Classification F.2.2 Nonnumerical Algorithms and Problems


Introduction
A subgraph F of a graph G is a factor of G, if F is a spanning subgraph of G.When a factor F is described in terms of its degrees, it is called a degree-factor.For example, one of the most fundamental notions in Graph Theory is 1-factor (or a perfect matching), the case when a factor F has all of its degrees equal to 1. Another example is r-factor, a regular spanning subgraph of degree r.More generally, for a function f : , the degree of v in F is exactly equal to f (v).The study of degree factors is one of the mainstays of combinatorics with a long history dating back to 1847 to the works of Kirkman [10], and Petersen [18].We refer to surveys [1,19], as well as the book of Lovász and Plummer [13] for an extensive overview of degree factors.
Another broad set of degree-factor problems is obtained by requesting the factor to be connected.The most famous examples are another old classical Graph Theory notion, the Theorem 1. EECG is solvable in time 2 O(k) n O (1) deterministically.
The proof of our theorem is based on (i) color-coding and (ii) fast computation of representative family over a linear matroid.While using graphic matroids to resolve different types of connectivity issues has become a popular theme in algorithms, our proof requires the usage of some non-standard matroids.In particular, we use fast representative family computations over the direct sum matroid of -elongation of the co-graphic matroid associated with G and a uniform matroid over E(G), the set of non-edges of G.We believe that this combination could be useful for designing parameterized algorithms for other edge editing problems.To the best of our knowledge this is the first uses of elongation of matroids in designing of parameterized algorithms.
One of the nice properties of using (graphic) matroids is that often they allow us to lift solutions from unweighted problems to problems with costs.It would be natural to suggest that the nice properties of matroids would help us with the "weighted" version of EECG as well.However, in spite of our attempts, we could not extend Theorem 1 to the weighted version of EECG.We proved that the weighted version of EECG when parameterized by k + d is W [1]-hard and its proof is deferred to the full version of the paper due to paucity of space.Also, proofs of lemmata marked with a are deferred to the full version of the paper.[15] that the problem of deleting k vertices to transform an input graph into an r-regular graph, where r ≥ 3 is W [1]hard parameterized by k.For edge-modification problems to a graph with certain degrees, Mathieson and Szeider have shown in [15] that Edge Editing to f -Degree Graph, the case when the requirement that the resulting graph F is connected is omitted, is solvable in polynomial time.As with the f -factor problem, the situation changes drastically when one adds the requirement that the resulting graph F is connected.A simple reduction from Hamiltonian cycle shows that in this case deciding if a graph can be edited into a connected 2-degree graph, i.e. a cycle, by changing at most k adjacencies, is NP-complete [8].

Previous work. It was shown by Mathieson and Szeider
Golovach in [8] has shown that when parameterized by the maximum vertex degree d in the resulting graph plus the number of editing operations k, the problem Edge Editing to Connected f -Degree Graph is FPT.In the same paper, it was shown that the variant when the resulting graph F is regular, the problem is FPT parameterized by k.However, prior to our work the complexity status of Edge Editing to Connected f -Degree Graph parameterized by k remained open.Thus Theorem 1 resolves the problem in affirmative.However, we still do not know the kernelization status of this problem and leave it as an interesting open problem.
Our Approach.Each solution to our problem is of the form D ∪ A where D ⊆ E(G) and A ⊆ E(G).The sets D and A are called a deletion set and an addition set, respectively, corresponding to the solution D ∪ A. We start by characterizing our solution in terms of deletion set D, called nice deletion set.Nice deletion sets satisfy certain properties and have an accompanying map ψ.This map together with other properties of nice deletion sets allows us to recover the addition set A in polynomial time.Thus, our whole effort is in finding a nice deletion set D with map ψ.This viewpoint allows us to concentrate on finding a nice deletion set with an accompanying map ψ.However, this is not useful for designing the dynamic programming (DP) algorithm.To achieve this we view the solution D ∪ A as a system of "alternating walks and alternating even closed walks".Alternating (closed) walks are essentially normal (closed) walks with edges from D ∪ A such that they do not have consecutive edges from either D or A, and no edge from D ∪ A is repeated in the walk.We take this view point to construct the dynamic programming algorithm as this allows us to proceed between the states of the program by using one edge (either of an addition set or of a deletion set).The number of states can be upper bounded by 2 O(k) .However, the number of sets D ∪ A that could satisfy the prerequisite of being in a particular table entry could be as large as n O(k) and thus this would not lead to an FPT algorithm.However, we follow this template for our algorithm and use some more structural properties to prune the family of partial solutions stored at a DP table entry.
Our pruning is based on the proof that D ∪ A is an independent set in some linear matroid.The first observation towards an FPT algorithm is that after we delete the edges in D from the input graph G, the number of connected components can at most be k − |D| + 1.This allows us to show that in fact we can think of D being an independent set in the matroid M G ( ).That is, -elongation of the co-graphic matroid, M G , associated with G, where = |E(G)| − |V (G)| + k − |D| + 1 (we refer to preliminaries for the definition).Next we show that for addition set A, all we need to store is some form of disjointness and that can be captured using uniform matroid over the universe E(G).Let U m ,k−k be a uniform matroid This ensures that any solution D ∪ A is an independent S TA C S 2 0 1 6

36:4
Editing to Connected f -Degree Graph set in M .By viewing any solution of the problem as an independent set in the matroid M (which is linear), we can use fast computation of q-representative families to prune the table.However, we still need to take care of a technical requirement in the definition of a nice deletion set.Towards this, we show that for every deletion set D there exists a set of edges W D , disjoint from D, of size at most 6k such that if these edges are not selected then we can satisfy that technical requirement.To achieve this we apply color coding technique and this can be derandomized using a standard application of universal sets.

Preliminaries
Throughout the paper we use ω to denote the exponent in the running time of matrix multiplication, the current best known bound for which ω < 2.373 [20].We use [n] to denote the set {1, 2, . . ., n}.
For any multiset A and an element x, by A(x) we denote the number occurrences of x in A. For any W ⊆ U × N, where U is a set, W (u) = |{(u, i) ∈ W | i ∈ N}|.We use "graph" to denote simple graphs without self-loops, directions, or labels.We use standard terminology from the book of Diestel [5] for those graph-related terms which we do not explicitly define.In general we use G to denote a graph.We use V (G) and E(G), respectively, to denote the vertex and edge sets of a graph G.For a graph G, we use E(G) to denote the simple non-edge set to denote the set of edges incident on v. Now we give definitions related to matroids.A pair M = (E, I), where E is a ground set and I is a family of subsets (called independent sets) of E, is a matroid if it satisfies the following conditions: (i) ∅ ∈ I, (ii) if A ⊆ A and A ∈ I then A ∈ I; and (iii) if A, B ∈ I and |A| < |B|, then there is e ∈ (B \ A) such that A ∪ {e} ∈ I.An inclusion wise maximal set of I is called a basis of the matroid.This size is called the rank of the matroid M , and is denoted by rank(M ).The rank function of a matroid M = (E, I) is a function r M : 2 E → N + ∪ {0} which is defined as follows: r M (S) for any S ⊆ E is the cardinality of the maximum sized independent set contained in S. For a broader overview on matroids, including linear representations of matroids, we refer to [17].
Direct Sum of Matroids.Let M 1 = (E 1 , I 1 ), . . ., M t = (E t , I t ) be t matroids with Proposition 2 ([14, Proposition 3.4]).Given representations of matroids M 1 , . . ., M t over the same field F, a representation of their direct sum can be found in polynomial time.

Uniform Matroids.
A pair M = (E, I) over an n-element ground set E, is called a uniform matroid if the family of independent sets is given by where k is some constant.This matroid is also denoted as U n,k .Every uniform matroid is linear and can be represented over a finite field of size ≥ n + 1 by a k × n matrix A M where A M [i, j] = e i−1 j , and e 1 , . . ., e n are distinct non-zero elements from the field.
Co-graphic Matroids.Given a graph G with r connected components, the co-graphic matroid associated with G, denoted by M G , is defined as (U, I), where U = E(G) and I = {S ⊆ E(G) : G − S has exactly r connected components}.Co-graphic matroids are representable over any field of size at least 2 [17].
Elongation of a Matroid.The -elongation of a matroid M , where ≥ rank(M ) is defined as a matriod M = (E, I ) such that S ⊆ E is a basis in M if and only if, r M (S) = r M (E) and |S| = .We use M ( ) to denote the -elongation of a matroid M .Theorem 3 ([12]).Given a representation of a matroid M and ≥rank(M ), there is a deterministic polynomial time algorithm to compute a representation of -elongation of M .Definition 4 (q-Representative Family [14]).Given a matroid M = (E, I) and a family S of subsets of E, we say that a subfamily S ⊆ S is q-representative for S if the following holds: for every set Y ⊆ E of size at most q, if there is a set Theorem 5 ([12]).Let M = (E, I) be a linear matroid of rank n and let S = {S 1 , . . ., S t } be a family of independent sets, each of size b.Let A be an n × |E| matrix representing M over a field F, where F = F p or F is Q.Then there is deterministic algorithm which computes a representative set S ⊆ q rep S of size at most nb b+q b , using 1) operations over the field F.

An FPT Algorithm for EECG
Let (G, f, k) be an instance of EECG.Our algorithm finds a solution of size exactly k (if one such solution exists) and outputs No otherwise.Any solution to our problem is of the form where D ⊆ E(G) and A ⊆ E(G).The sets D and A are called a deletion set and an addition set, respectively, corresponding to the solution D ∪ A.

Characterizing the solution.
The starting point of our algorithm is a characterization of solution in terms of a deletion set D satisfying certain properties (such deletion sets are called nice deletion sets).This, allows us to focus on finding nice deletion sets.To describe the main steps and ideas involved in our algorithm we first give a definition of a nice deletion set.Towards this we need definitions of following two sets .
The second set specifies for every vertex v ∈ def(G, f ) how many edges in addition set must be adjacent to v.
In general we will have proper deficiency map over the domain S(G, f ) or some set related to this.Finally, a set Our main structural lemma is the following.

36:6
Editing to Connected f -Degree Graph Lemma 6.Let (G, f, k) be an instance of EECG and let D ⊆ E(G).Then there exists that there are exactly i − 1 edges from {e 1 , . . ., e −1 } are incident on u and there are exactly j − 1 edges from {e 1 , . . ., e −1 } are incident on v.That is, we traverse the edges e 1 , . . ., e r from left to right and find the i th edge incident to u, say e = (u, v), and then we assign it v(j), if there are exactly j − 1 edges incident to v present among {e 1 , . . ., e −1 }.
, and so ψ is an involution.Since G − D + A is a simple graph, for any u ∈ V (G), (u, u) / ∈ E ψ .Now we need to show that E ψ is not a multiset.Suppose not, then there exists u, v ∈ V (G) such that ψ(u(i 1 )) = v(j 1 ) and ψ(u(i 2 )) = v(j 2 ) for some i 1 = i 2 and j 1 = j 2 .This implies that there exist e i , e j ∈ A, i = j such that e i = e j = (u, v).This contradicts the fact that (⇐) Let D ⊆ E(G) be a nice deletion set.We need to show that we can find Due to the property (v) in the definition of nice deletion set, we know that there exists a proper deficiency map ψ : is a solution to EECG.Thus, we assume that G 1 is not connected.In what follows we give an iterative procedure that finds the desired A. Suppose we are in i th iteration and we have a set A i such that G − D + A i satisfies all degree constraints but G − D + A i is not connected.Then in the next iteration we find another addition set of size k − |D|, say A i+1 , such that G − D + A i+1 satisfies all degree constraints and G − D + A i+1 has strictly less number of connected components than in G − D + A i .The procedure is started with Observe that when the procedure stops we would have found the desired A.
Given a nice deletion set D, we can find the desired A using the iterative procedure described in the reverse direction of the proof.Clearly, this procedure can be implemented in polynomial time.This completes the proof of the lemma.
Thus, our problem reduces to finding a nice deletion set D ⊆ E(G) and an accompanying proper deficiency map ψ on S(G − D, f ), if it exists, using dynamic programming (DP).
Towards the states of dynamic programming algorithm.So how to find a nice deletion set D? Throughout this section we will work with a hypothetical deletion set D. We partition the vertices of G into Green and Red in the following way.We color because in this case any solution to EECG requires more than k edge edits (addition/deletion operations).Now we guess the size Since D is our hypothetical deletion set, we have that for any v ∈ Green, the number of edges in D which are incident with v is at least d G (v) − f (v).Now we guess the number k 1 of edges in D which are incident with only green vertices and the number k 2 of edges in D which are incident with at least one vertex in Red.Note that k 1 + k 2 = k .Also note that the number of ways we can guess (k , k 1 , k 2 ) is at most k 2 .Now for every v ∈ Green, we guess the number of edges in D which are incident with v.In particular, we guess a function Φ : Green → N such that for all v ∈ Green we have that Φ The number of possible such functions Φ is upper bounded by O(4 k k).From now onwards we will assume that we are given function Φ.In other words we have guessed the function Φ corresponding to the hypothetical solution D.
We start with an intuitive explanation of the structure of the solution that is helpful in designing partial solution for the DP algorithm.Given D ∪ A, we first define a notion of an alternating walk.An alternating walk is a sequence of vertices u 1 , u 2 , . . ., u such that consecutive pairs of vertices ((u i , u i+1 ), (u i+1 , u i+2 )) either belong to D × A or A × D and {(u i , u i+1 ) | 1 ≤ i < } is a set (not a multiset).That is, an edge from D is followed by an edge from A or vice-versa.In an alternating even length closed walk, u 1 = u and is even.One might wonder about the definition of alternating odd length closed walk.For our purposes we will think of them as alternating walks that start and end at the same vertex.Essentially, these will be alternating walks that start and end with the same vertex and the first and the last edge either both belong to D or both belong to A. From now onwards whenever we say an alternating closed walk, we mean an alternating even length closed walk.For every intermediate, i.e. not the endpoint, vertex in an alternating walk or in an alternating closed walk, one of the edges incident with it belongs to D and while the second edge belongs to A. Thus the degree of any vertex is not disturbed by an alternating walk where this vertex is intermediate.We define alternating walks for the following reason.Let D ∪ A be a solution of EECG that satisfies Φ.We can think of edges in D ∪ A forming a family P of edge disjoint alternating walks and alternating closed walks with the following properties.

36:8 Editing to Connected f -Degree Graph
For every vertex v ∈ V (G) and a set Z ∈ {D, A}, we define apdeg(P, Z, v) as the number of edges from Z that are incident with v and appear as (i) the first edge in alternating walks from P that start with v; and (ii) the last edge in alternating walks from P that end in v.Note that, if there is an alternating walk that both starts and ends in v and the start edge as well as the last edge belong to Z then this walk contributes two to apdeg(P, Z, v).For every vertex v ∈ Green, apdeg(P, D, v) = d G (v) − f (v) and apdeg(P, A, v) = 0. Furthermore, for every vertex v ∈ Red, apdeg(P, D, v) = 0 and apdeg(P, A, v) = f (v) − d G (v).When the number of edges in D which are incident with v ∈ Green is greater than d G (v) − f (v), then the number of times v appear as intermediate vertices in alternating (closed) walks is exactly equal to the number of excess edges and these excess edges will not contribute to apdeg(P, D, v).Every vertex v ∈ Green, appears as an intermediate vertex in an alternating (closed) walk of For any solution P = {P 1 , P 2 , . . ., P α }, without loss of generality we assume that there is η such that P 1 , . . ., P η are alternating walks and P η+1 , . . ., P α are alternating closed walks.This walk system view allows us to make a dynamic programming algorithm where we can move from one state to another using one edge addition or deletion.In particular, the algorithm works by constructing all alternating walks P 1 , . . ., P η first and then construct alternating closed walks P η+1 , . . ., P α .Given a partially constructed walk system we try to append an edge to the current walk we are constructing by adding an edge from V (G) 2 to it; or declaring that we are finished with the current walk and move to construct a new walk.During this process we also keep a partial proper deficiency map ψ such that E ψ are addition edges in the current partial solution.Thus, a state in the DP algorithm is given by our current guesses and a subset of domain of partial proper deficiency map.For a formal description of our DP table we need the following sets: (a) a multiset set We also need to keep two sets X -a multiset and a set Y to take care of local deficiencies that occur while constructing our walk system.Let X be a multiset of size 2. Then for all u ∈ X and Now we formally define a notion of partial solutions.Given an instance (G, f, k) we define T m , T g and T r as described earlier.Also, recall that we have k 1 , k 2 and Φ.For any ∈ T r for all j. 3.If u(j) ∈ T g then for all 0 < j < j, u(j ) ∈ T g .

For any
For the correctness of the algorithm, it is enough to focus on partial solutions defined over valid tuples.Now we prove that in fact is a solution to EECG, then outputs Yes, otherwise outputs No.In fact one can show the following simple lemma which bounds the number of DP table entries:

Lemma 9 ( ). The number of valid tuples
However, the size of family stored at (one table entry) D[T m , T g , T r , k 1 , k 2 , i, X, Y ] can potentially be n O(i) , thus this algorithm takes time n O(k) .Next we observe that we can prune each table entry to 2 O(k) n O (1) and thus this leads to an FPT algorithm.
Pruning the DP table entry and an FPT algorithm.We need to prune the DP table in a way that we do not change the answer to the given instance (G, f, k).Towards this we show that if some subset we have stored in a DP table entry could lead to a nice deletion set then we do have at least one such set after the pruning operation.Our guessing of k 1 , k 2 and Φ allows us to satisfy the properties (i) and (ii) of a nice deletion set.Property (iii) of nice deletion sets implies that D is an independent set in the matroid M G ( ), the -elongation of the co-graphic matroid M G associated with G, where = |E(G)| − |V (G)| + k − |D| + 1.Thus by only considering those D which are independent sets in M G ( ) we ensure that property (iii) of nice deletion sets is satisfied.Now consider the property (v) of the nice deletion set, i.e, there exists a proper deficiency map ψ : S(G − D, f ) → S(G − D, f ).Our objective is to get a set D ∪ A such that there is a proper deficiency map ψ over S(G − D, f ) with the property that E ψ = A, along with other properties as well.Let D 1 ∪ A 1 , D 2 ∪ A 2 be two partial solutions belonging to the same equivalence class where To take care of the disjointness property between the current addition set and the future addition set while doing the DP, we view the addition set A of the solution as an independent set in a uniform matroid over the universe E(G).
This ensures that any solution D ∪ A is an independent set in M .By viewing any solution of the problem as an independent set in a matroid M (which is linear by Proposition 2), we can use the q-representative families, Theorem 5, to prune the table size to 2 O(k) n O (1) .
However, we still need to ensure that property (iv) of nice deletion set is satisfied.In what follows we explain how we achieve this.The following lemma helps us to satisfy property (iv) partially.

Lemma 10 ( ). Let F be a connected component in the graph G[Red] and D ⊆ E(G). If at least one edge in
Now we explain how Lemma 10 is useful in satisfying property (iv) partially.Let C be the set of connected components in G such that for each vertex v in the component, Let D 1 and D 2 be deletion sets corresponding to two partial solutions such that for all containing only red vertices will have a deficient vertex.Essentially due to Lemma 10, if we partition our partial solutions based on how these partial solutions hit the edges from C and keep at least one from each equivalence class property (iv) of nice deletion set will be satisfied partially.But this only allows us to take care of connected components containing only red vertices.Now we explain how we can ensure property (iv) for the connected components containing vertices from Green as well.
To achieve this we will prove that corresponding to every deletion set D of a solution, there is a "witness" of O(k) sized subset of edges whose disjointness from D will ensure property (iv) of nice deletion sets.That is, these witnesses depend on solutions; the witness for solution D could be different from the witness for solution D * .Even then, these witnesses allow us to satisfy property (iv).In order to avoid this witness being picked in a deletion set D, that is to keep this witness non deletable, we use color coding in our algorithm on top of representative family based pruning of table entries.Towards that we define a weight function w on E(G) as follows.
For any subset S ⊆ E(G), w(S) = e∈S w(e).The next lemma is crucial for our approach as this not only defines the witness but also gives an upper bound on its size.
Then there exist paths P 1 , . . ., P η such that for all i, P i is a path in G − D from v i to a vertex in def(G − D, f ), and w( i E(P i )) ≤ 6k where i E(P i ) is the set of edges in the paths P 1 , . . .P η .
Proof.We construct P 1 , . . ., P η with the required property.Pick an arbitrary vertex u 1 ∈ def(G − D, f ) such that v 1 and u 1 are in the same connected component in G − D. Let P 1 be a smallest weight path according to weight function w, from v 1 to u 1 in G − D. Now we explain how to construct P i , given that we have already constructed paths P 1 , . . ., P i−1 .Pick an arbitrary vertex u i ∈ def(G − D, f ) such that v i and u i are in the same connected component in G − D. Let P be a smallest weight path from v i to u i in G − D. If P is vertex disjoint from P 1 , . . ., P i−1 , then we set P i = P .Otherwise, let x be the first vertex in P such that x ∈ V (P 1 ) ∪ . . .∪ V (P i−1 ).Let x ∈ P j where j < i.Let P = P P such that P ends in x and P starts at x. Let P j = P j P j such that P j ends in x and P j starts at x. Now we set P i = P P j .Note that P i is a path in G − D from v i to a vertex in def(G − D, f ).Now we claim that w( η i=1 E(P i )) ≤ 6k.Towards the proof we need to count that |( η i=1 E(P i )) ∩ w −1 (1)| ≤ 6k.We assign each vertex v in η i=1 V (P i ) to the smallest indexed path P j such that v ∈ V (P j ).That is, v is assigned to P j , if v ∈ V (P j ) and v / ∈ ( j−1 i=1 V (P i ).Note that each vertex in η i=1 V (P i ) is assigned to a unique path.Consider the edge set A * ⊆ ( η i=1 E(P i )) ∩ w −1 (1) as follows.An edge e = (u, v) belongs to A * if w(e) = 1, e ∈ E(P j ), and vertices u and v are assigned to path P j for some j.Observe that each edge e ∈ A * has at least one end point in Green.Since each vertex is assigned to exactly one path, each vertex in a path has degree at most 2 and |Green| ≤ 2k, we have that |A * | ≤ 4k.Now we show that there exists sets ∅ = B 1 ⊆ B 2 ⊆ . . .B η such that ( j i=1 E(P i )) ∩ w −1 (1) ⊆ A * ∪ B j and |B j | ≤ j.We prove the statement using induction on j.For j = 1, we know that ( j i=1 E(P i )) ∩ w −1 (1) ⊆ A * .Thus the statement is true.Now suppose the statement is true for j − 1.Consider any path P j .If the vertices in P j are disjoint from j−1 i V (P i ), then all the weight one edges in E(P j ) are counted in A * .So we can set B j = B j−1 and the statement is true.Otherwise by the construction of P j , we have that P j = P j P j and there exists r < j such that P r = P r P j .Let (u 1 , u 2 ) be the last edge in P j .Note that all the weight one edges in E(P j ) are counted in A * ∪ B j−1 and all the weight one edges in E(P j ) \ {(u 1 , u 2 )} are counted in A * .In this case we set B j = B j−1 if w((u 1 , u 2 ) = 0) and B j = B j−1 ∪ {(u 1 , u 2 )} otherwise.This implies that |( η i=1 E(P i )) ∩ w −1 (1)| ≤ 6k.This concludes the proof.
Recall that E r = E(G [Red]) and E g = E(G) \ E r .Note that in Lemma 11, the weight of each edge in E g is 1 and the weight of each edge in E r is 0. By Lemma 11, we have that if D is a nice deletion set, then there exists E ⊆ E g of cardinality at most 6k such that E witnesses that each connected component of G − D containing at least one vertex from Green, will also contain a vertex from def(G − D, f ).We call such an edge set E as certificate of D. Now we explain how Lemma 11 helps us to satisfy property (iv) of nice deletion sets for components containing at least one vertex from Green.Let Green = {v 1 , . . ., v η } and D 1 ∪ D be a deletion set corresponding to a solution.By Lemma 11 we know that there are paths P 1 , . . ., P η such that the total number of edges from E g among these paths is bounded by 6k, and each path P i is from v i to a vertex in def(G − (D 1 ∪ D ), f ).Suppose we color the edges in E g with black and orange such that the coloring guarantees that all the edges in E g ∩ ( η i=1 E(P i )) are colored black and all the edges in E g ∩ (D 1 ∪ D ) are colored orange.Assume that we are going to find a nice deletion set which does not contains black color edges.Let D 2 be a deletion set corresponding to a partial solution.Also for a vertex v i ∈ Green, there is path from v i to a vertex in def(G − D 1 , f ) in the graph G − D 1 which does not contain any orange colored edge if and only if there is path from v i to a vertex in def(G − D 2 , f ) in the graph G − D 2 which does not contain any orange colored edge.We can show that any connected component in G − (D 2 ∪ D ) containing a vertex from Green will contain a vertex from def(G − (D 2 ∪ D ), f ).Essentially by Lemma 11 we get the following.Suppose we take all partial solutions corresponding to a DP table entry (or a subset of it) and now we partition these partial solutions based on which all green vertices have found S TA C S 2 0 1 6

36:12
Editing to Connected f -Degree Graph their deficient vertex currently (there are 2 |Green| such partitions), then it is enough to keep a partial solution from each class.Furthermore, suppose A corresponds to partial solutions with respect to one particular subset of Green and we have kept a set D 1 in A and deleted rest of the partial solutions from A (say one of the partial solution we threw out was D 2 ).Then, if there is D such that D 2 ∪ D is a solution, then all the connected components in G − (D 1 ∪ D ) containing at least one green vertex will have a deficient vertex.Just a word of caution that in our actual algorithm in fact we keep a subset of A of size 2 O(k) n O(1) so that we can also take care of all other properties of a nice deletion set.
We have explained how we will ensure each of the individual properties of a nice deletion set.Now we design a randomized FPT algorithm for the problem.Later we derandomize the algorithm.The algorithm is a DP algorithm in which we have DP table entries indexed exactly in the same way as in the case of the XP algorithm.But instead of keeping D[T m , T g , T r , k 1 , k 2 , i, X, Y ], we store a small representative family of D[T m , T g , T r , k 1 , k 2 , i, X, Y ] which is enough to maintain the correctness of the algorithm.The algorithm uses both color coding and representative family techniques.We have explained that we use color coding to separate the proposed deletion set from its certificate mentioned in Lemma 11.Now our algorithm works with the edge colored graph (edges in E g are colored black or orange) and output a nice deletion set D, with the property that D ∩ E g ⊆ E o , if there exists such a deletion set.Note that the edges in E r is uncolored.
Recall that C is the set of connected components in G such that for each vertex v in the component, d G (v) = f (v).Now we define a family J of functions as, J = {g : Green ∪ C → {0, 1}}.For each valid tuple (T m , T g , T r , k 1 , k 2 , i, X, Y ) we compute a representative partial solutions for D[T m , T g , T r , k 1 , k 2 , i, X, Y ] in the increasing order of i and store it instead of D[T m , T g , T r , k 1 , k 2 , i, X, Y ].Now we explain how to compute it.First we compute a subfamily S[T m , T g , T r , k 1 , k 2 , i, X, Y ] of D[T m , T g , T r , k 1 , k 2 , i, X, Y ] using the DP table entries computed for value i − 1 and deleting all partial solutions which contain edges from E b .Now we partition S[T m , T g , T r , k 1 , k 2 , i, X, Y ] according to the refinement of each function in J .That is S[T m , T g , T r , k 1 , k 2 , i, X, Y ] = g∈J A g where A g is defined as follows.For each g ∈ J and S ∪ R ∈ S[T m , T g , T r , k 1 , k 2 , i, X, Y ] where S ∈ E(G) and R ∈ E(G), S ∪ R ∈ A g if the following happens.and store it instead of D[T m , T g , T r , k 1 , k 2 , i, X, Y ].We can show the correctness of algorithm even after pruning the DP table entries and our algorithm runs in time 2 O(k) n O (1) with success probability at least (1 − 1 e ).Our algorithm can be derandomized using (n, 7k)-universal sets [16].
with ground set E(G), where m = |E(G)| and k = |D|.From the definition of U m ,k−k , any set A of size at most k − k is independent in U m ,k−k .We have already explained that we view the deletion set D as an independent set in M G ( ) where = |E(G)| − |V (G)| + k − k +1.Thus, to see the solution set D ∪ A as an independent set in a single matroid, we consider direct sum of M G ( ) and U Finally, we show that D satisfies the last property.Let A = {e 1 , e 2 , . . ., e r } ⊆ E(G) where r = k − |D|.Since D ∪ A is a solution to EECG, we have that for any vertex v, there are exactly f (v) − d G−D (v) edges in A which are incident to v. Now we define a bijection ψ : S Let U m ,k−k be a uniform matroid with ground set E(G), where m = |E(G)|.From the definition of U m ,k−k , every set A of size at most k − k is independent in U m ,k−k .We have already explained that we view the S TA C S 2 f -Degree Graph deletion set D as an independent set in M G ( ) where = |E(G)| − |V (G)| + k − k + 1.To view the solution set D ∪ A as an independent set in a matroid, we consider the direct sum M = M G ( ) ⊕ U m ,k−k of two matroids.In M , a set I is an independent set if and only if Now we explain how to reduce the size of D[Tg , T r , k 1 , k 2 , i, X, Y ].We say a partial solution B ∈ D[T g , T r , k 1 , k 2 , i, X, Y ] is properly colored, if B ∩ E b = ∅.Sinceour objective is to find out a nice deletion set disjoint from E b , we delete all partial solutions which contains an edge from E b .That is, if B ∈ D[T g , T r , k 1 , k 2 , i, X, Y ] and B ∩ E b = ∅, then we delete B from D[T g , T r , k 1 , k 2 , i, X, Y ].So now onwards we assume that for each B ∈ D[T g , T r , k 1 , k 2 , i, X, Y ], B ∩ E b = ∅.Further pruning of the DP table entry D[T g , T r , k 1 , k 2 , i, X, Y ] is discussed below.

(i)F
For any v ∈ Green, g(v) = 1 if and only if there exists a path from v to a vertex in def(G − S, f ) in G[E b ∪ (E r \ S)] (checking whether there is a witness path that do not use edges inE o ).(ii) For any C ∈ C, g(C) = 1 if and only if S ∩ E(C) = ∅.Recall that any set S ∪ R ∈ S[T m , T g , T r , k 1 , k 2 , i, X, Y ] is an independent set of size i in M .Now we compute A g ⊆ k−i rep A g using Theorem 5. Then we set D[T m , T g , T r , k 1 , k 2 , i, X, Y ] = g∈J A g