Disjoint Spanning Trees Luis Goddyn

1 Forest Partitioning

A forest in a graph G is a set of edges which induces an acyclic subgraph of G. We say that a set J of Sk edges of a graph G is k-partitionable if J = i=1 Ji is the union of k forests Ji in G. (We may assume the forests to be disjoint, where convenient.) We consider the following question. Forest Partitioning Problem Given a graph G = (V,E), find a k-partitionable set J ⊆ E of maximum size, and provide a certificate that proves |J| is indeed maximum. For any edge set A ⊆ E of a graph G = (V,E), we define the rank of A, written r(A) to be the maximum size of a subforest of A. Thus r(A) is the number of vertices minus the number of connected components in the induced subgraph G[A] := (V,A). We now describe a barrier which prevents G from having a large k-partitionable set. Suppose that G contains a dense subgraph. In particular, suppose that A is a set of edges for which |A| is large but r(A) is Sk small. Then for any k-partitionable J = i=1 Ji, each set Ji ∩A is a subforest of A, whence |Ji ∩A| ≤ r(A). It follows that k X |J| = |Ji ∩ A| + |J ∩ (E − A)| ≤ kr(A) + |E − A|. (1) i=1 The surprising fact is that some such inequality is always tight.

Theorem 1 For any graph G and positive integer k,

max{|J| : J ⊆ E is k-partitionable} = min{|E − A| + kr(A): A ⊆ E}.

Before the proof, we give two applications. By setting J = E and solving for k we solve a forest covering problem. Corollary 2 The minimum number of forests needed to cover the edges of a graph G is

max{d|A|/r(A)e : A ⊆ E}.

Informally, the ‘forest covering number’ of a graph is determined by its ‘densest’ subgraph. Similarly, if G is connected we may equate |J| with kr(E) = k(|V | − 1) to solve a packing problem. Corollary 3 The maximum number of edge disjoint spanning trees which can be packed into a connected graph G is min{b|E − A|/(|V | − 1 − r(A))c : A ⊆ E}. This expression is best interpreted in terms of the graph G/A obtained by contracting the edges in A. It is easy to see that r(G/A) = |V (G/A)| − 1 = |V | − 1 − r(A), so the expression we are minimizing is b|E(G/A)|/r(G/A)c. Informally, the ‘tree packing number’ is determined by the ‘least dense contraction’. In graphs the relevant subsets A arise from vertex partitions. For any partition π ` V , let θ(π)(δ(π)) denote the set of edges with its ends in the same (resp. different) parts. A set A ⊆ E is closed if every e ∈ E belonging to some circuit C ⊆ A ∪ {e} also belongs to A. Thus closed sets are precisely those of the form θ(π) for some π ` V . It is not hard to see that any set A achieving the minimum in Theorem 1 must be closed. For a given closed set A ⊆ E there is a unique most refined partition π = (πi) ` V satisfying θ(π) = A; namely π is the partition for which each induced subgraph G[πi] is connected. For such π we observe that r(θ(π)) = |V | − |π| and r(δ(π)) = |π| − 1. Thus we may replace the formulae in the above three results by the following expressions, respectively.

k|V | + min{|δ(π)| − k|π| : π ` V }.

max{d|θ(π)|/(|V | − |π|)e : π ` V }. min{b|δ(π)|/(|π| − 1)c : π ` V }.

1 2 The Algorithm Proving Theorem 1

The proof of Theorem 1 consists of an algorithm (which happens to be polytime) which, when given G and a k-partition (Ji,...,Jk) of J ⊆ E, produces either a k-partition of J + e for some e ∈ E − J, or a set A ⊆ E satisfying |J| = |E − A| + kr(A). Thus for a given G and k we may find a largest partitionable set and a suitable A ⊆ E by iterating this algorithm starting with Ji = ∅, i = 1..k. Given G, k and (Ji) we set J = ∪Ji and construct an auxiliary arc-coloured digraph D = D(G, k, (Ji)) with vertex set {s, t} ∪ E(G) and three types of arcs. For every e, f ∈ E and i ∈ {1, . . . , k}, D has

1. an arc (s, e) (having no colour), if e ∈ E − J;

2. an arc (e, t) of colour i, if Ji + e is acyclic.

3. an arc (e, f) of colour i, if Ji + e − f is acyclic; Now we seek a shortest path P from s to t in D. If P does not exist, then we output the set A of vertices in V (D) − {s} which are reachable from s by some dipath in D. Since there are no arcs in δ+({s} ∪ A) of types 1,2 or 3, we deduce the following facts respectively. 1. E − A ⊆ J

2. For any i ∈ {1, . . . , k} and e ∈ A, Ji ∪ {e} has a cycle.

3. For any i ∈ {1, . . . , k} and e ∈ A and f ∈ A, if f belongs to the cycle in Ji ∪ {e}, then f ∈ A. In other words, Ji ∩ A is a spanning forest of A whence |Ji ∩ A| = r(A).

From facts 1. and 3., it we find that the inequality (1) is tight for the pair (A, (Ji)), so A proves that |J| is indeed maximum. If a shortest s, t-path P = (s, e1, e2, . . . , es, t) does exist, then by the construction of D, we have e1 ∈ E − J. We shall the edges of P and their colours to guide an ‘augmenting sequence’, which modify the sets (Ji) in such a way as to produce a k-partition of set J ∪ {e1}. Let i be the colour of the arc (e1, e2) (we allow here that e2 = t). We modify the forest Ji by adding e1 to it. If e2 = t, then (e1, t) is of type 2, and we output the resulting partition of J + e. Otherwise, 0 (e1, e2) is an arc of type 3. so Ji + e1 has a fundamental cycle which contains e2. Let i be the colour of (e2, e3) (again, we permit e3 = t). Then we then we modify both Ji and Ji0 by transfering e2 from Ji to Ji0 . This restores Ji to being acyclic, but now either we are done (if e3 = t) or Ji0 + e3 has a fundamental cycle containing e4. We continue modifying (Ji) in this manner until we have traversed P . Clearly J is now larger by one element, but it remains to prove that each modification to a forest Ji leaves it acyclic. This is fact not trivial, but is easier to prove by relying on the fact P was chosen to be a shortest path in D. Suppose for example exactly two arcs (ea, ea+1), (eb, eb+1) in P have label i, where a < b. The modification in step a leaves Ji acyclic by construction of D. However at the start of step b, it may no longer be true that Ji + eb − eb+1 is acyclic, since Ji has been changed in step a. This trouble can only have occurred if eb+1 also belonged to the fundamental cycle Ji + ea at the start of step a. This would imply that (ea, eb+1) is an arc of D, contradicting that P is a shortest path. Equivalently, we have argued that the set sp(J) of edges of G which have both endpoints in the same connected component of G[J] is equal to sp(J + eb − eb+1). If Ji has been modified more than twice we must argue more carefully. Suppose that label i occurs in steps a1, a2, . . . at in that order along P . For j = 0, . . . , t − 1 we define

(j) J = Ji + eat−j − eat−j +1 + eat−j+1 − eat−j+1+1 + ··· + eat − eat+1 Here we are adding and subtracting edges from J in ‘reverse order’ to the way it was done in the (t) (0) algorithm, so J = Ji input at the start of the algorithm and J is the set after all modifications have been made. We now argue by induction on j that the set sp(J (j)) of edges spanned by each connected component of J (j) is the same as sp(J (0)). We leave out the details of this argument. In the end, we have (0) (t) (0) that sp(J ) = sp(J ) = sp(Ji), which implies J is acyclic, since it has the same cardinality as Ji.

2 3 Generalization to

The above algorithm in fact works in a more general framework. Let M1, M2,...,Mk be a list of matroids all having the same set E for its elements. We say that J ⊆ E is partitionable (with respect to the list) S There exist subsets Ji, i = 1, /dots, k such that Each Ji is an independent set of Mi and J = Ji. An obvious modification of the above algorithm, and its proof of correctness solves the following problem.

Matroid Partitioning Problem Given matroids M1,..., Mk on E, find a k-partitionable set J ⊆ E of maximum size, and provide a certificate that proves |J| is indeed maximum. The algorithm runs in polynomial time provided that there is an oracle that reports in constant time whether an arbitray set of elements is independent in the Mi. The certificate provided the algorithm is a subset A which is a witness to the minimum in the following.

Theorem 4 For any list of k matroids on the set E we have X max{|J| : J ⊆ E is k-partitionable} = min{|E − A| + ri(A): A ⊆ E}. 1≤i≤k

Here, ri is the rank function for the ith matroid.

It is a fact that the set of partitionable sets J for M1,..., Mk constitutes the independent sets of a new matroid on E which is called the matroid sum or then partition matroid for M1,..., Mk. The rank of this partition matroid sum is given by the above theorem. Here is a closely related problem

Matroid Partitioning Problem Given matroids M1, M2 on E, find a subset J ⊆ E of maximum size which is independent in both matroids, and provide a certificate that proves |J| is indeed maximum. It turns out that this problem is equivalent to the matroid partitioning problem for the two matroids ∗ ∗ M1 and M2 , where M2 is the dual matroid to M2. Moreover, in polynomial time, we can find a certificate of optimality from a subset achieving the minimum in the following.

Theorem 5 For any two matroids M1 and M2 on the set E we have

max{|J| : J ⊆ E is independent in both matroids} = min{r1(A) + r2(E − A): A ⊆ E}.

Here, ri is the rank function for the ith matroid. Here are some applications of .

1. Let G be a bipartite graph with parts (X,Y ). Let M1 (resp. M2) be the partition matroid on E(G) where A ⊆ E is independent if every vertex in X (resp. Y ) is incident to at most one edge of A. Then the algorithm finds a maximum matching in the bipartite graph G.

2. Let s be a vertex of a directed graph D. Let M1 be the of the simple graph underlying G, and let M2 be the partition matroid whose independent sets correspond to subgraphs with maximum in-degree 1, and where s has in-degree 0. The algorithm finds a maximum directed tree rooted at s. 3. The problem of deciding whether a graph G has a Hamilton cycle can be reduced to the problem of finding the largest subset which is independent in each of three matroids on E(G) (details are omitted). Thus matroid intersection of more than two matroids is NP-hard in genera.

3