Lecture Notes On Matroid Intersection: 6.1.1 Bipartite Matchings
Lecture Notes On Matroid Intersection: 6.1.1 Bipartite Matchings
Lecture Notes On Matroid Intersection: 6.1.1 Bipartite Matchings
6.1 Examples
6.1.1 Bipartite matchings
Matchings in a bipartite graph G = (V, E) with bipartition (A, B) do not form the indepen-
dent sets of a matroid. However, they can be viewed as the common independent sets to
two matroids; this is the canonical example of matroid intersection.
LetSMA be a partition matroid with ground set E where the partition of E is given by
E = {δ(v) : v ∈ A} where δ(v) denotes the edges incident to v. Notice that this is a
partition since all edges have precisely one endpoint in A. We also define kv = 1 for every
v ∈ A. Thus, the family of independent sets of MA is given by
In other words, a set of edges is independent for MA if it has at most one edge incident to
every vertex of A (and any number of edges incident to every vertex of b). We can similarly
define MB = (E, IB ) by
Now observe that any F ∈ IA ∩ IB corresponds to a matching in G, and vice versa. And the
largest common independent set to IA and IB corresponds to a maximum matching in G.
6.1.2 Arborescences
Given a digraph D = (V, A) and a special root vertex r ∈ V , an r-arborescence (or just
arborescence) is a spanning tree (when viewed as an undirected graph) directed away from
r. Thus, in a r-arborescence, every vertex is reachable from the root r. As an r-arborescence
has no arc incoming to the root, we assume that D has no such arc.
r-arborescences can be viewed as sets simultaneously independent in two matroids. Let
G denote the undirected counterpart of D obtained by disregarding the directions of the arcs.
Note that if we have both arcs a1 = (u, v) and a2 = (v, u) in D then we get two undirected
edges also labelled a1 and a2 between u and v in G. Define M1 = (A, I1 ) = M (G) the graphic
matroid corresponding to G, and M2 = (A, I2 ) the partition matroid in which independent
sets are those with at most one arc incoming to every vertex v 6= r. In other words, we let
where δ − (v) denotes the set {(u, v) ∈ A} of arcs incoming to v. Thus, any r-arborescence is
independent in both matroids M1 and M2 . Conversely, any set T independent in both M1
and M2 and of cardinality |V | − 1 (so that it is a base in both matroids) is an r-arborescence.
Indeed, such a T being a spanning tree in G has a unique path between r and any vertex
v; this path must be directed from the root r since otherwise we would have either an arc
incoming to r or two arcs incoming to the same vertex.
In the minimum cost arborescence problem, we are also given a cost function c : A →
R and we are interested in finding the minimum cost r-arborescence. This is a directed
counterpart to the minimum spanning tree problem but, here, the greedy algorithm does not
solve the problem.
6.1.3 Orientations
Given an undirected graph G = (V, E), we consider orientations of all its edges into directed
arcs; namely, each (undirected) edge1 {u, v} is either replaced by an arc2 (u, v) from u to v,
or by an arc (v, u) from v to u. Our goal is, given k : V → N, to decide whether there exists
an orientation such that, for every vertex v ∈ V , the indegree of vertex v (the number of
arcs entering v) is at most k(v). Clearly, this is not always possible, and this problem can
be solved using matroid intersection (or network flows as well).
To attack this problem through matroid intersection, consider the directed graph D =
(V, A) in which every edge e = {u, v} of E is replaced by two arcs (u, v) and (v, u). With the
1
Usually, we use (u, v) to denote an (undirected) edge. In this section, however, we use the notation
{u, v} rather than (u, v) to emphasize that edges are undirected.
2
We use arcs in the case of directed graphs, and edges for undirected graphs.
6. Lecture notes on matroid intersection May 2, 2017 3
arc set A as ground set, we define two partition matroids, M1 and M2 . To be independent
in M1 , one can take at most one of {(u, v), (v, u)} for every (u, v) ∈ E, i.e.
I1 = {F ⊆ A : |F ∩ {(u, v), (v, u)}| ≤ 1 for all (u, v) ∈ E}.
To be independent in M2 , one can take at most k(v) arcs among δ − (v) for every v:
I2 = {F ⊆ A : |F ∩ δ − (v)| ≤ k(v) for all v ∈ V }.
Observe that this indeed defines a partition matroid since the sets δ − (v) over all v partition
A.
Therefore, there exists an orientation satisfying the required indegree restrictions if there
exists a common independent set to M1 and M2 of cardinality precisely |E| (in which case
we select either (u, v) or (v, u) but not both).
Theorem 6.1 (Matroid Intersection) For any two matroids M1 = (E, I1 ) and M2 =
(E, I2 ) with rank functions r1 and r2 respectively, we have:
Before describing an algorithm for matroid intersection that proves this theorem, we
consider what the min-max result says for some special cases. First, observe that we can
always restrict our attention to sets U which are closed for matroid M1 . Indeed, if that was
not the case, we could replace U by V = spanM1 (U ) and we would have that r1 (V ) = r1 (U )
while r2 (E \ V ) ≤ r2 (E \ U ). This shows that there always exists a set U attaining the
minimum which is closed for M1 . Similarly, we could assume that E \ U is closed for M2
(but both assumptions cannot be made simultaneously).
When specializing the matroid intersection theorem to the graph orientation problem
discussed earlier in this chapter, we can derive the following.
Theorem 6.2 G = (V, E) has an orientation such that the indegree of vertex v is at most
k(v) for every v ∈ V if and only if for all P ⊆ V we have3 :
X
|E(P )| ≤ k(v).
v∈P
Theorem 6.3 Given a graph G = (V, E) with edges of Ei colored i for i = 1, · · · , k, there
exists a colorful spanning tree if and only if deleting the edges of any c colors (for any c ∈ N)
produces at most c + 1 connected components.
We now prove Theorem 6.1 by exhibiting an algorithm for finding a maximum cardinality
independent set common to two matroids and a corresponding set U for which we have
equality in (1). For the algorithm, we will start with S = ∅ and at each step either augment
S or produce a U that gives equality. Our algorithm will rely heavily on a structure called
the exchange graph. We first focus on just one matroid.
Definition 6.1 Given a matroid M = (E, I) and an independent set S ∈ I, the exchange
graph GM (S) (or just G(S)) is the bipartite graph with bipartition S and E \ S with an edge
between y ∈ S and x ∈ E \ S if S − y + x ∈ I.
Lemma 6.4 Let S and T be two independent sets in M with |S| = |T |. Then there exists a
perfect matching between S \ T and T \ S in GM (S).
The proof is omitted. The converse to Lemma 6.4 does not hold. We next prove a
proposition that is a partial converse to the above lemma.
3
E(P ) denotes the set of edges with both endoints in P .
6. Lecture notes on matroid intersection May 2, 2017 5
Proposition 6.5 Let S ∈ I with exchange graph GM (S). Let T be a set with |T | = |S| and
such that GM (S) has a unique perfect matching between S \ T and T \ S. Then T ∈ I.
Definition 6.2 For S ∈ I1 ∩ I2 , the exchange graph DM1 ,M2 (S) is the directed bipartite
graph with bipartition S and E \ S such that (y, x) is an arc if S − y + x ∈ I1 and (x, y) is
an arc if S − y + x ∈ I2 .
Exercise 6-1. Deduce König’s theorem about the maximum size of a matching in a bi-
partite graph from the min-max relation for the maximum independent set common to two
matroids.
The main result is that conv(X) is precisely given by the intersection of the matroid polytopes
for M1 and M2 .
Theorem 6.6 Let
P = {x ∈ R|E| : x(S) ≤ r1 (S) ∀S ⊆ E
x(S) ≤ r2 (S) ∀S ⊆ E .
xe ≥ 0 ∀e ∈ E}
Then conv(X) = P .
Our proof will be vertex-based. We will show that any extreme point of P is integral,
and it can then be easily seen that it corresponds to a common independent set. The proof
will rely on total unimodularity in a subtle way. Even though the overall matrix defining P
is not totally unimodular, we will show that, for every extreme point x∗ , x∗ can be seen as
the solution of a system of equations whose underlying matrix is totally unimodular. This
is a powerful approach that can apply to many settings.
Proof: Let x∗ be an extreme point of P . We know that x∗ is uniquely characterized once
we know the inequalities that are tight in the description of P . Let
Fi = {S ⊆ E : x∗ (S) = ri (S)},
for i = 1, 2. Let E0 = {e ∈ E : x∗e = 0}. We know that x∗ is the unique solution to
x(S) = r1 (S) S ∈ F1
x(S) = r2 (S) S ∈ F2
xe = 0 e ∈ E0 .
Consider the matroid polytope Pi for matroid Mi for i = 1, 2, and define the face Fi of Pi
(for i = 1, 2) to be
Fi = {x ∈ Pi : x(S) = r1 (S) ∀S ∈ Fi
.
xe = 0 ∀e ∈ E0 }
Observe that F1 ∩ F2 = {x∗ }. Also, by Theorem 4.6 of the chapter on matroid optimization,
we have that Fi can be alternatively defined by a chain Ci . Thus, x∗ is the unique solution
to
x(S) = r1 (S) S ∈ C1
x(S) = r2 (S) S ∈ C2
xe = 0 e ∈ E0 .
After eliminating all variables in E0 , this system can be written as Ax = b, where the rows
of A are the characteristic vectors of C1 ∪ C2 .
Such a matrix A is totally unimodular and this can be shown by using Theorem 3.14.
Consider any subset of rows; this corresponds to restricting our attention to chains C10 and C20 .
Consider first C10 . If we assign the largest set to R1 and then keep alternating the assignment
between R2 and R1 as we consider smaller and smaller sets, we obtain that
X X
aij − aij ∈ {0, 1},
i∈C10 ∩R1 i∈C10 ∩R2
6. Lecture notes on matroid intersection May 2, 2017 8
for all j. If for C20 we start with the largest set being in R2 , we get
X X
aij − aij ∈ {0, −1},
i∈C20 ∩R1 i∈C20 ∩R2
for all j. Combining both, we get that indeed for every j, we get a value in {0, 1, −1} showing
that the matrix is totally unimodular. As a result, x∗ is integral, and therefore corresponds
to the characteristic vector of a common independent set. 4
X
OP T = min ca x a
a∈A
subject to:
X
xa ≥ 1 ∀S ⊆ V \ {r}
a∈δ − (S)
X
xa = 1 ∀v ∈ V \ {r}
a∈δ − (v)
xa ∈ {0, 1} a ∈ A.
X
LP = min ca x a
a∈A
subject to:
X
(P ) xa ≥ 1 ∀S ⊆ V \ {r}
a∈δ − (S)
xa ≥ 0 a ∈ A.
subject to:
X
(D) y S ≤ ca
S:a∈δ − (S)
yS ≥ 0 S ⊆ V \ {r}.
The algorithm will proceed in 2 phases. In the first phase, it will construct a dual feasible
solution y and a set F of arcs which has a directed path from the root to every vertex. This
may not be an r-arborescence as there might be too many arcs. The arcs in F will satisfy
condition 2 above (but not condition 1). In the second phase, the algorithm will remove
unnecessary arcs, and will get an r-arborescence satisfying condition 1.
Phase 1 is initialized with F = ∅ and yS = 0 for all S. While F does not contain a directed
path to every vertex in V , the algorithm selects a set S such that (i) inside S, F is strongly
connected (i.e. every vertex can reach every vertex) and (ii) F ∩ δ − (S) = ∅. This set S exists
since we can contract all strongly connected components and in the resulting acyclic digraph,
there must be a vertex (which may be coming from the shrinking of a strongly connected
component) with no incoming arc (otherwise tracing back from that vertex we would either
get to the root or discover a new directed cycle (which we could P shrink)). Now we increase
yS as much as possible until a new inequality, say for arc ak , S:ak ∈δ− (S) yS ≤ cak becomes
an equality. In so doing, the solution y remains dual feasible and still satisfies condition 2.
We can now add ak to F without violating complementary slackness condition 2, and then
6. Lecture notes on matroid intersection May 2, 2017 10
For the graphic matroid, we know that rM (F ) = n − κ(F ) where n = |V | and κ(F ) denotes
the number of connected components of (V, F ). But by the matroid intersection theorem,
we can write:
where we replaced κ(E) by 1 since otherwise G would even have one spanning tree. Re-
arranging terms, we get that G has two edge-dsjoint spanning trees if and only if for all
E1 ⊆ E, we have that E \ E1 ≥ 2(κ(E1 ) − 1). If this inequality is violated for some E1 ,
we can add to E1 any edge that does not decrease κ(E1 ). In other words, if the connected
components of E1 are V1 , V2 , · · · , Vp then we can assume that E1 = E \δ(V1 , V2 , · · · Vp ) where
δ(V1 , · · · , Vp ) = {(u, v) ∈ E : u ∈ Vi , v ∈ Vj and i 6= j}. Thus we have shown:
Theorem 6.8 G has two edge-disjoint spanning trees if and only if for all partitions V1 ,
V2 , · · · Vp of V , we have
|δ(V1 , · · · , Vp )| ≥ 2(p − 1).
Theorem 6.9 G has k edge-disjoint spanning trees if and only if for all partitions V1 ,
V2 , · · · Vp of V , we have
|δ(V1 , · · · , Vp )| ≥ k(p − 1).
From two matroids M1 = (E, I1 ) and M2 = (E, I2 ), we can also define its union by
M1 ∪ M2 = (E, I) where I = {S1 ∪ S2 : S1 ∈ I1 , S2 ∈ I2 }. Notice that we do not impose the
two matroids to be identical as we just did for edge-disjoint spanning trees.
We can show that:
Proof: To show that it is a matroid, assume that X, Y ∈ I with |X| < |Y |. Let
X = X1 ∪ X2 and Y = Y1 ∪ Y2 where X1 , Y1 ∈ I1 and X2 , Y2 ∈ I2 . We can furthermore
assume that the Xi ’s are disjoint and so are the Yi ’s. Finally we assume that among all
choices for X1 , X2 , Y1 and Y2 , we choose the one maximizing |X1 ∩ Y1 | + |X2 ∩ Y2 |. Since
|Y | > |X|, we can assume that |Y1 | > |X1 |. Thus, there exists e ∈ (Y1 \ X1 ) such that
X1 ∪ {e} is independent for M1 . The maximality implies that e ∈ / X2 (otherwise consider
X1 ∪ {e} and X2 \ {e}). But this implies that X ∪ {e} ∈ I as desired.
6. Lecture notes on matroid intersection May 2, 2017 12
We now show the expression for the rank function. The fact that it is ≤ is obvious as an
independent set S ∈ I has size |S \ F | + |S ∩ F | ≤ |S \ F | + rM1 (F ) + rM2 (F ) and this is
true for any F .
For the converse, let us prove it for the entire ground set S = E. Once we prove that
rM1 ∪M2 (E) = min {|E \ F | + rM1 (F ) + rM2 (F )} ,
F ⊆S
the corresponding statement for any set S will follow by just restricting our matroids to S.
Let X be a base of M1 ∪ M2 . The fact that X ∈ I means that X = X1 ∪ X2 with
X1 ∈ I1 and X2 ∈ I2 . We can furthermore assume that X1 and X2 are disjoint and that
rM2 (X2 ) = rM2 (E) (otherwise add elements to X2 and possibly remove them from X1 ).
Thus we can assume that |X| = |X1 | + rM2 (E). We have that X1 ∈ I1 and also that X1 is
independent for the dual of M2 (as the complement of X1 contains a base of M2 ). In other
words, X1 ∈ I1 ∩ I2∗ . The proof is completed by using the matroid intersection theorem and
Theorem 6.7:
rM1 ∪M2 (E) = |X| = max (|X1 | + rM2 (E))
X1 ∈I1 ∩I2∗
= min rM1 (E1 ) + rM2∗ (E \ E1 ) + rM2 (E)
E1 ⊆E
= min (rM1 (E1 ) + |E \ E1 | + rM2 (E1 ) − rM2 (E) + rM2 (E))
E1 ⊆E
= min (|E \ E1 | + rM1 (E1 ) + rM2 (E1 )) ,
E1 ⊆E
as desired. 4
Since Theorem 6.10 says that M1 ∪ M2 is a matroid, we know that its rank function is
submodular. This is, however, not obvious from the formula given in the theorem.
Exercise 6-2. Derive from theorem 6.10 that the union of k matroids M1 , M2 , · · · , Mk is
a matroid with rank function
Exercise 6-4. Assume that G has 2 edge-disjoint spanning trees. Give a winning strategy
for player 2 in the spanning tree game.
Exercise 6-5. Find two edge-disjoint spanning trees in the following graph with 16 vertices
and 30 edges or prove that no such trees exist.
1 2 3 4
6 7
5 8
10 11
9 12
13 14 15 16