Finding Even Subgraphs Even Faster

Problems of the following kind have been the focus of much recent research in the realm of parameterized complexity: Given an input graph (digraph) on $n$ vertices and a positive integer parameter $k$, find if there exist $k$ edges (arcs) whose deletion results in a graph that satisfies some specified parity constraints. In particular, when the objective is to obtain a connected graph in which all the vertices have even degrees---where the resulting graph is \emph{Eulerian}---the problem is called Undirected Eulerian Edge Deletion. The corresponding problem in digraphs where the resulting graph should be strongly connected and every vertex should have the same in-degree as its out-degree is called Directed Eulerian Edge Deletion. Cygan et al. [\emph{Algorithmica, 2014}] showed that these problems are fixed parameter tractable (FPT), and gave algorithms with the running time $2^{O(k \log k)}n^{O(1)}$. They also asked, as an open problem, whether there exist FPT algorithms which solve these problems in time $2^{O(k)}n^{O(1)}$. In this paper we answer their question in the affirmative: using the technique of computing \emph{representative families of co-graphic matroids} we design algorithms which solve these problems in time $2^{O(k)}n^{O(1)}$. The crucial insight we bring to these problems is to view the solution as an independent set of a co-graphic matroid. We believe that this view-point/approach will be useful in other problems where one of the constraints that need to be satisfied is that of connectivity.


Introduction
Many well-studied algorithmic problems on graphs can be phrased in the following way: Let F be a family of graphs or digraphs. Given as input a graph (digraph) G and a positive integer k, can we delete k vertices (or edges or arcs) from G such that the resulting graph (digraph) belongs to the class F ? Recent research in parameterized algorithms has focused on problems of this kind where the class F consists of all graphs/digraphs whose vertices satisfy certain parity constraints [2,3,6,7]. In this paper we obtain significantly faster parameterized algorithms for two such problems, improving the previous best bounds due to Cygan et al. [3]. We also settle the parameterized complexity of a third problem, disproving a conjecture of Cai and Yang [2] and solving an open problem posed by Fomin and Golovach [7]. We obtain our results using recently-developed techniques for the efficient computation of representative sets of matroids.
Our Problems. An undirected graph G is even (respectively, odd ) if every vertex of G has even (resp. odd) degree. A directed graph D is balanced if the in-degree of each vertex of D is equal to its out-degree. An undirected graph is Eulerian if it is connected and even; and a directed graph is Eulerian if it is strongly connected and balanced. Cai and Yang [2] initiated the systematic study of parameterized Eulerian subgraph problems. In this work we take up the following edge-deletion problems of this kind:

Undirected Eulerian Edge Deletion
Parameter: k Input: A connected undirected graph G and an integer k. Question: Does there exist a set S of at most k edges in G such that G \ S is Eulerian?

Undirected Connected Odd Edge Deletion
Parameter: k Input: A connected undirected graph G and an integer k. Question: Does there exist a set S of at most k edges in G such that G \ S is odd and connected?

Directed Eulerian Edge Deletion
Parameter: k Input: A strongly connected directed graph D and an integer k. Question: Does there exist a set S of at most k arcs in D such that D \ S is Eulerian?
Our algorithms for these problems also find such a set S of edges/arcs when it exists; so we slightly abuse the notation and refer to S as a solution to the problem in each case.
Previous Work. Cai and Yang [2] listed sixteen odd/even undirected subgraph problems in their pioneering paper, and settled the parameterized complexity of all but four. The first two problems above are among these four; Cai and Yang conjectured that these are both W[1]-hard, and so are unlikely to have fixedparameter tractable (FPT) algorithms: those with running times of the form f (k) · n O(1) for some computable function f where n is the number of vertices in the input graph. Cygan et al. [3] disproved this conjecture for the first problem: they used a novel and non-trivial application of the colour-coding technique to solve both Undirected Eulerian Edge Deletion and Directed Eulerian Edge Deletion in time 2 O(k log k) n O (1) . They also posed as open the question whether there exist 2 O(k) n O(1) -time algorithms for these two problems. Fomin and Golovach [7]  Our Results and Methods. We devise deterministic algorithms which run in time 2 O(k) n O (1) for all the three problems defined above. This answers the question of Cygan et al. [3] in the affirmative, solves the problem posed by Fomin and Golovach, and disproves the conjecture of Cai and Yang for Undirected Connected Odd Edge Deletion.
Our main conceptual contribution is to view the solution as an independent set of a co-graphic matroid, which we believe will be useful in other problems where one of the constraints that need to be satisfied is that of connectivity.
We now give a high-level overview of our algorithms. Given a subset of vertices T of a graph G, a T -join of G is a set S ⊆ E(G) of edges such that T is exactly the set of odd degree vertices in the subgraph H = (V (G), S). Observe that T -joins exist only for even-sized vertex subsets T . The following problem is long known to be solvable in polynomial time [5].
Min T -Join Input: An undirected graph G and a set of terminals T ⊆ V (G). Question: Find a T -join of G of the smallest size.
Consider the two problems we get when we remove the connectivity (resp. strong connectivity) requirement on the graph G \ S from Undirected Eulerian Edge Deletion and Directed Eulerian Edge Deletion; we call these problems Undirected Even Edge Deletion and Directed Balanced Edge Deletion, respectively. Cygan et al. show that Undirected Even Edge Deletion can be reduced to Min T -Join, and Directed Balanced Edge Deletion to a minimum cost flow problem with unit costs, both in polynomial time [3]. Thus it is not the local requirement of even degrees which makes these problems hard, but the simultaneous global requirement of (strong) connectivity.
To handle this situation we turn to a matroid which correctly captures the connectivity requirement. Let I be the family of all subsets X ⊆ E(G) of the edge set of a graph G such that the subgraph (V (G), E(G) \ X) is connected. Then the pair (E(G), I) forms a linear matroid called the co-graphic matroid of G (See Section 2 for definitions). Let T be the set of odd-degree vertices of the input graph G. Observe that for Undirected Eulerian Edge Deletion, the solution S we are after is both a T -join and an independent set of the co-graphic matroid of G. We exploit this property of S to design a dynamic programming algorithm which finds S by computing "representative sub-families" [8,10,12,13] of certain families of edge subsets in the context of the co-graphic matroid of G. We give simple characterizations of solutions which allow us to do dynamic programming, where at every step we only need to keep a representative family of the family of partial solutions where each partial solution is an independent set of the corresponding co-graphic matroid. To find the desired representative family of partial solutions we use the algorithm by Lokshtanov et al. [11]. Our methods also imply that Undirected Connected Odd Edge Deletion admits an algorithm with running time 2 O(k) n O(1) .

Preliminaries
Throughout the paper we use ω to denote the exponent in the running time of matrix multiplication, the current best known bound for which is ω < 2.373 [15]. Graphs and Directed Graphs. We use "graph" to denote simple graphs without self-loops, directions, or labels, and "directed graph" or "digraph" for simple directed graphs without self-loops or labels. We use standard terminology from the book of Diestel [4] for those graph-related terms which we do not explicitly define. In general we use G to denote a graph and D to denote a digraph. We use V (G) and E(G), respectively, to denote the vertex and edge sets of a graph G, and V (D) and A(D), respectively, to denote the vertex and arc sets of a digraph D. For an edge set If P is a path from vertex u to vertex v in graph G (or in digraph D) then we say that (i) P connects u and v, (ii) u, v are, respectively, the initial vertex and the final vertex of P , and (iii) u, v are the end vertices of path P . Let P 1 = x 1 x 2 . . . x r and P 2 = y 1 y 2 . . . y s be two edge-disjoint paths in graph G. If x r = y 1 and V (P 1 ) ∩ V (P 2 ) = {x r }, then we use P 1 P 2 to denote the path x 1 x 2 . . . x r y 2 . . . y s . A path system P in graph G (resp., digraph D) is a collection of paths in G (resp. in D), and it is edge-disjoint if no two paths in the system share an edge. We use V (P) and E(P) (A(P) for a path system in digraph) for the set of vertices and edges, respectively, in a path system P. We say that a path system P = {P 1 , . . . , P r } ends at a vertex u if path P r ends at u. We use V e (P) to denote the set of end vertices of paths in a path system P. For a path system P in a digraph D, we use V i (P) and V f (P), respectively, to denote the set of initial vertices and the set of final vertices, respectively, of paths in P. For a path system P = {P 1 , . . . , P r } and an edge/arc (u, v), we define P • (u, v) as follows.
. . , P r v} if u is the final vertex of P r and v / ∈ V (P r ) {P 1 , . . . , P r , uv} if u is not the final vertex of P r A directed graph D is strongly connected if for any two vertices u and v of D, there is a directed path from u to v and a directed path from v to u in D. A digraph D is weakly connected if the underlying undirected graph is connected.

Matroids.
We now state some basic definitions and properties of matroids which we use in the rest of the paper. We refer the reader to the book of Oxley [14] for a comprehensive treatment of the subject. Definition 1. A pair M = (E, I), where E is a set called the ground set and I is a family of subsets of E, which are called independent sets, is a matroid if it satisfies the following conditions: An inclusion-wise maximal set of I is called a basis of the matroid. All bases of a matroid have the same size, called the rank of the matroid M . Linear Matroids and Representable Matroids. Let E be the set of column labels of a matrix A over some field F, and let I be the set of all subsets X of E such that the set of columns labelled by X is linearly independent over F. Then M = (E, I) is a matroid, called the vector matroid of the matrix A. If a matroid M is the vector matroid of a matrix A over some field F, then we say that M (i) is representable over F, and (ii) is a linear (or representable) matroid. Co-Graphic Matroids. The co-graphic matroid of a connected graph G is defined as M = (E(G), It is a linear matroid and, given a graph G, a representation of the co-graphic matroid of G over the finite field F 2 can be found in polynomial time [12,14]. The rank of the cographic matroid of a connected graph G is (|E(G)| − |V (G)| + 1). We use M G to denote the co-graphic matroid of a graph G. For a directed graph D we use M D to denote the co-graphic matroid of the underlying undirected graph of D.
Let A be a family of path systems in a graph G. Let e = (u, v) be an edge in G (or an arc in D), and let M = (E, I) be the co-graphic matroid of graph G (or of digraph D). We use A • {e} to denote the family of path systems Representative Families of Matroids. The notion of representative families of matroids and their fast computation play key roles in our algorithms.
Definition 2. [8,12] Given a matroid M = (E, I), a family S of subsets of E, and a non-negative integer q, we say that a subfamily S ⊆ S is q-representative for S if the following holds. For every set In other words, if some independent set X in S can be extended to a larger independent set by a set Y of at most q new elements, then there is a set X in S that can be extended by the same set Y . If S ⊆ S is q-representative for S we write S ⊆ q rep S. In this paper we are interested in linear matroids and in representative families derived from them. The following theorem states the key algorithmic result which we use for the computation of representative families of linear matroids.
operations over the field F.

Undirected Eulerian Edge Deletion
In this section we describe our 2 O(k) n O(1) -time algorithm for Undirected Eulerian Edge Deletion. Let (G, k) be an instance of the problem. Cygan et al. [3] observed the following characterization.
From Observation 1 we get that the Undirected Eulerian Edge Deletion problem is equivalent to checking whether the given graph G has a co-connected T -join of size at most k, where T is the set of all odd-degree vertices in G. We present an algorithm which finds a co-connected T -join for an arbitrary (even-sized) set of terminals T within the claimed time-bound. That is, we solve the following more general problem

Co-Connected T -Join
Parameter: k Input: A connected graph G, an even-sized subset T ⊆ V (G) and an integer k. Question: Does there exist a co-connected T -join of G of size at most k?
We design a dynamic programming algorithm for this problem where the partial solutions which we store satisfy the first property of co-connected Tjoin and "almost satisfy" the second property. To limit the number of partial solutions which we need to store, we compute and store instead, at each step, a representative family of the partial solutions in the corresponding co-graphic matroid. We start with the following characterization of the T -joins of a graph G. This proposition yields the following useful property of inclusion-minimal co-connected T -joins (minimal co-connected T -joins for short) of a graph G. Proof. Suppose the subgraph G(S) is not a forest. Then there exists a cycle C in G(S). The degree of any vertex v of G in the subgraph G(S \ E(C)) is either the same as its degree in the subgraph G(S), or is smaller by exactly two. So the set S \ E(C) is also a T -join of G. And since the subgraph G \ S is connected by assumption, we get that the strictly larger subgraph G \ (S \ E(C)) is also connected. Thus S \ E(C) is a co-connected T -join of G which is a strict subset of S. This contradicts the minimality of S, and hence we get that G(S) is a forest.
Thus there are no cycles in the subgraph G(S), and hence we get from Proposition 1 that S is a union of the edge sets of ℓ pairwise edge-disjoint paths which connect disjoint pairs of vertices in T .
Note that the set of paths described in Lemma 1 are just pairwise edge-disjoint. Vertices (including terminals) may appear in more than one path as internal vertices. A partial converse of the above lemma follows directly from Proposition 1. Proof. Since S is a union of the edge sets of ℓ pairwise edge-disjoint paths which connect disjoint pairs of vertices in T , we get from Proposition 1 that S is a T -join. Since G \ S is connected as well, S is a co-connected T -join.
An immediate corollary of Lemma 1 is that for any set T ⊆ V (G), any T -join of the graph G has at least |T |/2 edges. Hence if |T | > 2k then we can directly return No as the answer for Co-Connected T -Join. So from now on we assume that |T | ≤ 2k. From Lemmas 1 and 2 we get that to solve Co-Connected T -Join it is enough to check for the existence of a pairwise edge-disjoint collection of paths P = {P 1 , . . . , P |T | 2 } such that (i) the subgraph (G \ E(P)) is connected, (ii) |E(P)| ≤ k, and (iii) the paths in P connect disjoint pairs of terminals in T . We use dynamic programming to find such a path system. We first state some notation which we need to describe the dynamic programming table. We use Q to denote the set of all path systems in G which satisfy the above conditions. For 1 ≤ i ≤ k we use Q (i) to denote the set of all potential partial solutions of size i : Each Q (i) is a collection of path systems . . , P r } ∈ Q (i) has the following properties: (i) The paths P 1 , . . . , P r are pairwise edge-disjoint. (ii) The end-vertices of the paths P 1 , . . . , P r are all terminals and are pairwise disjoint, with one possible exception. One end-vertex (the final vertex) of the path P r may be a non-terminal, or a terminal which appears as an end-vertex of another path as well.
Note that the only ways in which a partial solution P (i) s may violate one of the conditions in Lemma 2 are: (i) it may contain strictly less than T 2 paths, and/or (ii) there may be a path P r (and only one such), which has one end-vertex v r which is a non-terminal or is a terminal which is an end-vertex of another path as well. We call P r the last path in P (i) s and v r the final vertex of P (i) s , and say that P r ends at vertex v r . For a path system P = {P 1 , . . . , P r } and u ∈ V (G) ∪ {ǫ}, we use W (P, u) to denote the following set.
as the set of all potential partial solutions of size i whose set of end vertices is exactly T ′ ∪ {v}. Observe from this definition that in the case v = ǫ, the last path P r in each path system P = {P 1 , . . . , P r } ∈ Q[i, T ′ , ǫ] ends at a "good" vertex; that is, at a terminal vertex which is different from all the end vertices of the other paths P 1 , . . . , P (r−1) in P.
It is not difficult to see that this definition of Q[i, T ′ , v] is a correct notion of a partial solution for Co-Connected T -Join: r is a path in G, and (iii) P ∪ P ′ = {P 1 , P 2 , . . . , P r P ′ r , P ′ r+1 , . . . , P ′ ℓ } is an edge-disjoint path system whose edge set is a solution to the instance (G, T, k).
Given this notion of a partial solution the natural dynamic programming approach is to try to compute, in increasing order of 1 ≤ i ≤ k, partial solutions Observe now that our final solution and all partial solutions are independent sets in the co-graphic matroid M G of the input graph G. We use the algorithm of Lokshtanov et al. [11]-see Theorem 1-to compute these representative families of potential partial solutions at each intermediate step. In step i of the dynamic programming we store, in place of the set with respect to the co-graphic matroid M G ; for the purpose of this computation we think of each element P of Q[i, T ′ , v] as the edge set E(P). Lemma 4 below shows that this is a safe step. Whenever we talk about representative families in this section, it is always with respect to the co-graphic matroid M G associated with G; we do not explicitly mention the matroid from now on. We start with the following definitions.
r is a path in G, (iii) P ∪ P ′ = {P 1 , P 2 , . . . , P r P ′ r , P ′ r+1 , . . . , P ′ ℓ } is an edge-disjoint path system that connects disjoint pairs of terminals in T , (iv) V e (P ∪ P ′ ) = T and (v) G \ (E(P) ∪ E(P ′ )) is connected. Then P ′ is said to be an extender for P.
be the corresponding set of partial solutions. We say that and P ′ be an extender for P, then there exists P * ∈ J [i, T ′ , v] such that P ′ is an extender for P * as well. We say that The next lemma shows that a representative family is indeed a path-system equivalent set to Q[i, T ′ , v].
Proof. We first prove the first claim. The second claim of the lemma follows by similar arguments. Let which is an extender for P. We have to show that there exists a path system P * ∈ Q[i, T ′ , v] such that P ′ is an extender for P * as well. Since P ′ is an extender for P we have, by definition, that (i) |E(P ′ )| ≤ (k − i), (ii) P r P ′ r is a path in G, (iii) P ∪ P ′ = {P 1 , . . . , P r P ′ r , P ′ r+1 , . . . , P ′ ℓ } is an edge-disjoint path system that connects disjoint pairs of terminals in T , (iv) V e (P ∪ P ′ ) = T and (v) G \ (E(P) ∪ E(P ′ )) is connected. Since ) is connected. This follows directly from the definitions of a co-graphic matroid and a representative set.
We now show that P ′ is indeed an extender for P * . Since P and P * both belong to the set Q[i, T ′ , v] we get that |E(P)| = |E(P * )| = i and that P * is an edge-disjoint path system. And since E(P * ) ∩ E(P ′ ) = ∅, we have that P * ∪ P ′ = {P * 1 , . . . , P * r−1 , P * r P ′ r , P ′ r+1 , . . . , P ′ ℓ } is an edge-disjoint path system but for P * r P ′ r which could be an Eulerian walk (walk where vertices could repeat but not the edges). Now we prove that the "path system" P * ∪ P ′ connects disjoint pairs of terminals in T , but for a pair which is connected by an Eulerian walk. We now consider two cases for the "vertex" v. Case 1: v = ǫ. In this case, since P and P * both belong to the set Q[i, T ′ , ǫ] we have that V e (P) = V e (P * ) = T ′ . Also E(P ′ r ) = ∅, and P ∪ P ′ is the path system {P 1 , . . . , P r , P ′ r+1 , P ′ r+2 , . . . , P ′ ℓ } with exactly ℓ = |T | 2 paths which connect disjoint pairs of terminals in T . Since V e (P ∪ P ′ ) = T , P = {P 1 , . . . , P r } and V e (P) = T ′ , we get that V e (P ′ ) = T \ T ′ . Now since V e (P * ) = T ′ it follows that P * ∪ P ′ is a path system which connects disjoint pairs of terminals in T . Case 2: v = ǫ. In this case, since P and P * both belong to the set Q[i, T ′ , v] we have that V e (P) = V e (P * ) = T ′ ∪ {v}, and that the final vertex of each of these two path systems is v. Also P ∪P ′ = {P 1 , . . . , P r P ′ r , P ′ r+1 , P ′ r+2 , . . . , P ′ ℓ } is a path system with exactly ℓ = |T | 2 paths which connect disjoint pairs of terminals in T . Since (i) V e (P ∪ P ′ ) = T , (ii) P = {P 1 , . . . , P r }, (iii) P ′ = {P ′ r , P ′ r+1 , . . . , P ′ ℓ }, (iv) V e (P) = T ′ ∪ {v}, and (v) the final vertex of the path P r in P is v, we get that (i) the initial vertex of the path P ′ r in P ′ is v and (ii) V e (P ′ ) = (T \T ′ )∪{v}. Now since V e (P * ) = T ′ ∪ {v} and (ii) the final vertex of P * is v it follows that P * ∪ P ′ is a path system which connects disjoint pairs of terminals in T , where P * r P ′ r which could be an Eulerian walk. Thus, we have shown that P * ∪ P ′ connects disjoint pairs of terminals in T with paths, except for P * r P ′ r which could be an Eulerian walk. Combining this with Proposition 1 and the fact that G \ (E(P * ) ∪ E(P ′ )) is connected, we get that E(P * ) ∪ E(P ′ ) is a co-connected T -join of G. Finally, we show that P * ∪ P ′ is a path system. Towards this we only need to show that P * r P ′ r is not an Eulerian walk but a path. Observe that |E(P * ) ∪ E(P ′ )| ≤ |E(P * )| + |E(P ′ )| ≤ k. However, E(P * ) ∪ E(P ′ ) is a co-connected T -join of G and thus by our assumption, E(P * ) ∪ E(P ′ ) has size exactly kthus a minimum sized solution. By Lemma 1 this implies that E(P * ) ∪ E(P ′ ) is a forest and hence P * r P r is a path in G. This completes the proof.
For our proofs we also need the transitivity property of the relation ⊑ q peq .
Lemma 5. The relation ⊑ q peq is transitive.
Proof. Let A ⊑ q peq B and B ⊑ q peq C. We need to show that A ⊑ q peq C. Let P ∈ C and P ′ be an extender for P. By the definition of B ⊑ q peq C, there exists P b ∈ B such that P ′ is also an extender of P b . Since A ⊑ q peq B, there exists P a ∈ A such that P ′ is also an extender of P a . This implies A ⊑ q peq C.
Our algorithm is based on dynamic programming and stores a table The recurrences for dynamic programming is given by the following.
For i = 0, we have the following cases.
For i ≥ 1, we have the following cases based on whether v = ǫ or not.
The next lemma will be used in proving the correctness of the algorithm.
Proof. Let I denote the family of independent sets in M G , the co-graphic matroid associated with G. We prove the lemma using induction on i. The base case is i = 0. Observe that for i = 0, for all T ′ ⊆ T and v ∈ V (G) ∪ {ǫ} we have that However, in the recursive steps of the algorithm we need to use the • operation between two families of sets, and to make this meaningful, we define D[0, ∅, ǫ] = {∅} and ∅ otherwise. Now we prove that the claim holds for i ≥ 1. Let us also assume that by induction hypothesis the claim is true for all i ′ < i. Fix a T ′ ⊆ T , and v ∈ V (G) ∪ {ǫ} and let Q[i, T ′ , v] be the corresponding set of partial solutions. Let P = {P 1 , . . . , P r } ∈ Q[i, T ′ , v] and P ′ = {P ′ r , P ′ r+1 , . . . , P ′ ℓ } be a path system such that P ′ is an extender for P. We need to show that there exists a P * ∈ D[i, T ′ , v] such that P ′ is also an extender for P * .
Case 1: v = ǫ. Consider the path system P = {P 1 , . . . , P r } ∈ Q[i, T ′ , v]. P has i edges and its set of end-vertices is T ′ ∪ {v}. Also, its final vertex is v. Let (u, v) be the last edge in path P r . Let P ′′ r be the path obtained by deleting edge (u, v) from P r . More precisely: If P r has at least two edges then P ′′ r is the non-empty path obtained by deleting the edge (u, v) and the vertex v from P r , and if (u, v) is the only edge in P r (in which case u ∈ T ′ ) then P ′′ r = ∅. Note that the initial vertex of P ′ r ∈ P ′ is v. Let uP ′ r be the path obtained by concatenating the path uv and P ′ r . Let P 1 = {P 1 , . . . , P ′′ r } and P ′ 1 = {uP ′ r , P ′ r+1 , . . . , P ′ ℓ }. Then P 1 has (i − 1) edges and P ′ 1 is an extender for P 1 . Now we consider two cases: (u, v) is the only edge in P r : Here P ′′ r = ∅ and u ∈ T ′ ; let t = u. Note that P 1 = {P 1 , . . . , P r−1 } ∈ Q[i − 1, T ′ \ {t}, ǫ]. Hence by induction hypothesis there exists P * 1 ∈ D[i − 1, T ′ \ {t}, ǫ] such that P ′ 1 is also an extender for P * 1 . Since P ′ 1 is an extender for P * 1 , E(P * 1 ) ∪ E(P ′ 1 ) ∈ I (by the definition of extender). This implies that E(P * 1 ) ∪ {(t, v)} ∈ I. Since P * 1 ∈ D[i − 1, T ′ \ {t}, ǫ] and (t, v) ∈ E(G), by Equation 2, we get a path system P * ∈ D[i, T ′ , v] by adding the new path P r = tv to P * 1 . Since P ′ 1 is an extender of P * 1 , P ′ is an extender of P * as well. (u, v) is not the only edge in P r : Here P ′′ r = ∅, and u is the final vertex in P ′ r . Hence P 1 = {P 1 , . . . , P ′′ r } ∈ Q[i − 1, T ′ , u]. Since P ′ 1 is an extender for P 1 , by induction hypothesis there exists P * 1 ∈ D[i − 1, T ′ , u] such that P ′ 1 is also an extender for P * 1 . By the definition of extender, we have that and (u, v) ∈ E(G), by Equation 2, we get a path system P * ∈ D[i, T ′ , v] by adding the new edge {(u, v)} to P * 1 . Since P ′ 1 is an extender of P * 1 , P ′ is an extender of P * as well.
Case 2: v = ǫ. We have that P = {P 1 , . . . , P r } ∈ D[i, T ′ , ǫ]. Then P has i edges, its set of end-vertices is T ′ , and no end-vertex repeats. Let (u, t) be the last edge in path P r . Then t ∈ T ′ . Let P ′′ r be the path obtained by deleting edge (u, t) from P r . More precisely: If P r has at least two edges then P ′′ r is the non-empty path obtained by deleting the edge (u, t) and the vertex t from P r , and if (u, t) is the only edge in P r then P ′′ r = ∅. Let P 1 = {P 1 , . . . , P ′′ r } and P ′ 1 = {ut, P ′ r , P ′ r+1 , . . . , P ′ ℓ }. Then P 1 has (i − 1) edges and P ′ 1 is an extender for P 1 . Now we consider two cases: (u, t) is the only edge in P r : Here P ′′ r = ∅, and {u, t} ⊆ T ′ . Let t 1 = u, t 2 = t. Then P 1 is a path system in Q[i − 1, T ′ \ {t 1 , t 2 }, ǫ]. By induction hypothesis there exists P * 1 ∈ D[i − 1, T ′ \ {t 1 , t 2 }, ǫ] such that P ′ 1 is also an extender of P * 1 . By the definition of extender, we have that E(P * 1 ) ∪ E(P ′ 1 ) ∈ I. This implies that E(P * 1 ) ∪ {(t 1 , t 2 )} ∈ I. Since P * 1 ∈ D[i − 1, T ′ \ {t 1 , t 2 }, ǫ] and (t 1 , t 2 ) ∈ E(G), by Equation 3, we get a path system P * ∈ D[i, T ′ , v] by adding the new path t 1 t 2 to P * 1 . Since P ′ 1 is an extender of P * 1 , P ′ is an extender of P * as well. (u, t) is not the only edge in P r : Here P ′′ r = ∅, u is the final vertex in P ′′ r . Then P 1 ∈ Q[i − 1, (T ′ \ t), u]. By induction hypothesis there exists P * 1 ∈ D[i − 1, (T ′ \ t), u] such that P ′ 1 is also an extender of P * 1 . By the definition of extender, we have that E(P * 1 ) ∪ E(P ′ 1 ) ∈ I. This implies that E(P * , u] and (u, t) ∈ E(G), by Equation 3, we get a path system P * ∈ D[i, T ′ , ǫ] by adding the new edge (u, t) to P * 1 . Since P ′ 1 is an extender of P * 1 , P ′ is an extender of P * as well. In both cases above we showed that . Algorithm, Correctness and Running Time. We now describe the main steps of the algorithm. It finds a smallest sized co-connected T -join (of size at most k) for G. The algorithm iteratively tries to find a solution of size |T | 2 ≤ k ′ ≤ k and returns a solution corresponding to the smallest k ′ for which it succeeds; else it returns No. By Lemma 4 it is enough, in the dynamic programming (DP) table, to store the representative set Q[i, . We know that the co-graphic matroid M G is representable over F 2 and that its rank is bounded by m − n + 1. By Theorem 1, the running time of this computation of the (k −i)-representative family is bounded by: The Theorem 1 gives bounds on the sizes of these representative families Observe that Since the number choices for (T ′ , v) such that T ′ ⊆ T and v ∈ V (G){ǫ} is bounded by 4 k (n + 1), and we compute DP table entries for i = 1 to k, the overall running time can be bounded by: The running time above simplifies to O(2 (2+ω)k · n 2 m 3 k 5 ) + m O (1) .
Putting all these together we get We can similarly use Theorem 2 to design an algorithm for Undirected Connected Odd Edge Deletion. First we observe the following.
Observation 2 Let (G, k) be an instance of Undirected Connected Odd Edge Deletion, let T be the set of even degree vertices of G and let S be a solution to (G, k). Then S is a co-connected T -join.
Proof. Since S is a solution to the instance (G, k) of Undirected Connected Odd Edge Deletion, the set of odd degree vertices in G(S) is exactly T . Since G \ S is connected as well, S is co-connected T -join.
Therefore we must have that T is a set of even cardinality. By setting T as the set of terminal vertices and applying Theorem 2 we get

Directed Eulerian Edge Deletion
In this section we modify the algorithm described for Undirected Eulerian Edge Deletion to solve the directed version of the problem. The main ingredient of the proof is the characterization of "solution" for the directed version of the problem. We begin with a few definitions. For a digraph D, we call S ⊆ A(D) a balanced arc deletion set, if D \ S is balanced. We call a set S ⊆ A(D) a coconnected balanced arc deletion set if D \ S is balanced and weakly connected.
Let (D, k) be an instance to Directed Eulerian Edge Deletion. A solution S ⊆ A(D) of the problem should satisfy the following two properties, (a) S must be a balanced arc deletion set of D and, (b) D \ S must be strongly connected. In fact, something more stronger is known in the literature.

Proposition 2. [1] A digraph D is Eulerian if and only if D is weakly connected and balanced.
Due to Proposition 2, we can relax the property (b) of the solution S and replace the requirement of having D \ S as strongly connected with just requiring D \ S to be be weakly connected. Now observe that solution S of Directed Eulerian Edge Deletion is in fact a co-connected balanced arc deletion set of the directed graph D. Thus our goal is to compute a minimal co-connected balanced arc deletion set of D of size at most k.
We start with the following easy property of in-degrees and out-degrees of vertices in D. For a digraph D, define Proof. It is well known that This completes the proof.
The following lemma characterizes the set of arcs which form a minimal solution S of the given instance (D, k). We then use this characterization to design a dynamic-programming algorithm for the problem.
. Let S ⊆ A(D) be a minimal co-connected balanced arc deletion set. Then S is a union of ℓ arc disjoint paths P = {P 1 , . . . , P ℓ } such that (1) For i ∈ {1, . . . , ℓ}, P i starts at a vertex in T + and ends at a vertex in T − . (2) The number of paths in P that starts at v ∈ T + is equal to d + Proof. First we claim that D(S) is a directed acyclic digraph. Suppose not, then let C be a directed cycle in D(S). The in-degree and out-degree of any vertex of v of D in D(S \ A(C)) is either same as its in-degree and out-degree in the subgraph D(S) or both in-degree and out-degree of v is smaller by exactly one. So S \ A(C) is a balanced arc deletion set of D. And since the subgraph D \ S is connected by assumption, we get that the strictly larger subgraph D \ (S \ A(C)) is also connected. Thus S \ A(C) is a co-connected balanced arc deletion set of D. This contradicts the fact that S is minimal, and hence we get that D(S) a directed acyclic digraph. We prove the lemma using induction on ℓ. When ℓ = 0, the lemma holds vacuously. Now consider the induction step, i.e, when ℓ > 0. Consider a maximal path P in D(S). We claim that P starts at a vertex in T + . Suppose not, let P starts at w ∈ V (D) \ T + . Further, let (w, x) be the arc of P that is incident on w. By our assumption w ∈ T − ∪ T = , which implies that if (w, x) ∈ S, then there must exist an arc (y, w) ∈ S or else the vertex w cannot be balanced in D \ S. And since D(S) is a directed acyclic digraph we have that y ∈ V (P ). But this contradicts the assumption that P is a maximal path in D(S). By similar arguments we can prove that P ends at a vertex in T − . Let P starts at t 1 and ends at t 2 , where t 1 ∈ T + and t 2 ∈ T − . Now consider the digraph D ′ = D\A(P ). Clearly, S \ A(P ) is a minimal co-connected balanced arc deletion set for the digraph D ′ . We claim the following The correctness of this follows from the fact that the difference d + Now by applying induction hypothesis on D ′ with ℓ−1 we have that S \A(P ) is a union of ℓ − 1 arc disjoint paths P 1 , . . . , P ℓ−1 which satisfies properties (1) and (2) for the digraph D ′ . Now consider the path system P, P 1 , . . . , P ℓ−1 and observe that it indeed satisfies properties (1) and (2). This concludes the proof.
Finally, we prove a kind of "converse" of Lemma 8.
Lemma 9. Let D be a digraph, ℓ = v∈T + d + D (v) − d − D (v) and let S ⊆ A(D). Furthermore, S is a union of ℓ arc disjoint paths P = {P 1 , . . . , P ℓ } with the following properties.
1. The digraph D \ S is weakly connected. 2. For i ∈ {1, . . . , ℓ}, P i starts at a vertex in T + and ends at a vertex in T − . 3. The number of paths in P that starts at v ∈ T + is equal to d + D (v) − d − D (v) and the number of paths in P that ends at u ∈ T − is equal to d − D (u) − d + D (u). Then S is a co-connected balanced arc deletion set.
Proof. By property (2), each vertex v ∈ T = appears only as internal vertex of any path in P. Therefore v is balanced in D \ S. For every vertex t ∈ T + , exactly d + D (t) − d − D (t) paths start at t in P and no path in P ends at t and thus t is balanced in D \ S. Similar arguments hold for all t ∈ T − . Hence D \ S is balanced. Since D \ S is weakly connected as well by property (1), we have that S is a co-connected balanced arc deletion set of D.
Now we are ready to describe the algorithm for Directed Eulerian Edge Deletion. Let (D, k) be an instance of the problem. Lemma 8 and Lemma 9 imply that for a solution we can seek a path system P with properties mentioned in Lemma 9. Let T + m be the multiset of vertices in the graph G such that each vertex v ∈ T + appears d + Similarly, let T − m be the multiset of vertices in the graph D such that each vertex v ∈ T − appears d − D (v) − d + D (v) times in T − m . Due to Proposition 3 we know that |T + m | = |T − m |. Observe that if |T + m | > k, then any balanced arc deletion set must contain more than k arcs and thus the given instance is a No instance. So we assume that |T + m | ≤ k. Lemma 8 implies that the solution can be thought of as a path system P = {P 1 , . . . , P ℓ } connecting vertices from T + m to the vertices of T − m such that all the vertices of T + m ∪ T − m appear as end points exactly once and D \ A(P) is weakly connected. Observe that the solution is a path system with properties which are similar to those in the undirected case of the problem. Indeed, the solution S corresponds to an independent set in the co-graphic matroid of the underlying (undirected) graph of D. After this the algorithm for Directed Eulerian Edge Deletion is identical to the algorithm for Co-Connected T -Join. Let T = T + m ∪ T − m . We can define a notion of partial solutions analogous to Q[i, T ′ , v]. The definition of extender remains the same except for the last item, where we now require that P ∪ P ′ is an arc disjoint path system connecting vertices from T + m to the vertices of T − m such that every vertex of T + m ∪ T − m is an endpoint of exactly one path. Finally, we can define the recurrences for dynamic programming similar to those defined for D[i, T ′ , v] in the case of Co-Connected T -Join. We then use these recurrences along with an algorithm to compute representative families to solve the given instance. A pseudo-code implementation of the algorithm is presented as Algorithm 1. The correctness of the algorithm follows via similar arguments as before. And by an analysis similar to the case of Co-Connected T -Join we can obtain the following bound on the running time of the algorithm.

Conclusion
In this paper, we have designed FPT algorithms for Eulerian Edge Deletion and related problems which significantly improve upon the earlier algorithms. Our algorithms are based on simple dynamic programming over the set of partial solutions to the problems and, the construction of representative families of partial solutions. It would be interesting to find other applications of computation of representative families over a cographic matroid.