Matroid
Matroid
Modules in
Undergraduate Matroids: The Theory
Mathematics
and Its
and Practice of Greed
Applications Christian Jones
Published in
cooperation with
The Mathematical
Association of America,
The American
Mathematical
Association of
Two-Year Colleges,
The American
Statistical Association.
Ran Libeskind-Hadas
Dept. of Computer Science
Harvey Mudd College
Claremont, CA 91711
[email protected]
Permission to make digital or hard copies of part or all of this work for personal or classroom use
is granted without fee provided that copies are not made or distributed for profit or commercial
advantage and that copies bear this notice. Abstracting with credit is permitted, but copyrights
for components of this work owned by others than COMAP must be honored. To copy otherwise,
to republish, to post on servers, or to redistribute to lists requires prior permission from COMAP.
Table of Contents
1. INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
2. MATROIDS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
4. A SCHEDULING PROBLEM . . . . . . . . . . . . . . . . . . . . . . . . 7
6. CONCLUSION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
7. EXERCISES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
8. SOLUTIONS TO THE EXERCISES . . . . . . . . . . . . . . . . . . . . . . 16
9. REFERENCES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
ABOUT THE AUTHORS . . . . . . . . . . . . . . . . . . . . . . . . . . 19
182 The UMAP Journal 21.2 (2000)
1. Introduction
This paper shows how some natural generalizations of concepts from linear
algebra can be used to find simple and efficient algorithms for many discrete op-
timization problems. Specifically, we describe a mathematical structure called
a matroid. We then show how matroids can be used to construct so-called greedy
algorithms for a variety of discrete optimization problems.
We begin by considering the case of a new long-distance telephone company.
The company plans to offer service between n cities but to lease the actual phone
lines from existing companies. A direct phone line exists between certain pairs
of cities, and there is a positive cost associated with leasing each line. The
new company would like to lease a subset of lines such that the company can
provide a path between any two cities using only the leased lines. A solution
is any subset of lines with this property. An optimal solution is a solution of
minimum total cost. For example, consider the weighted graph in Figure 1a,
where vertices correspond to cities, edges correspond to existing phone lines,
and the edge weights correspond to the leasing costs of the phone lines. One
possible solution is shown in Figure 1b, with a total cost of 18. Another solution
is shown in Figure 1c, with a total cost of only 11; it is possible to verify that
this is an optimal solution.
Note that any solution must span all of the vertices in the graph and an
optimal solution must be a tree: a connected graph with no cycles. If a solution
contains a cycle, then any edge on the cycle can be removed without destroying
connectivity while decreasing the cost of the solution. Thus, given a connected
graph, an optimal solution is a spanning tree of minimum total cost, also known
as a minimum spanning tree.
a 5 b a b a 5 b
5 4 5 4
3 3
6 6
e c e c e c
2 1 2 2 1
d d d
Figure 1. a. A weighted graph with five vertices. b. A solution with cost 18. c. An optimal
solution with cost 11.
The minimum spanning tree problem was studied as early as 1926 by the
Czech mathematician Otakar Borůvka in connection with minimizing the cost
of electric networks [1926]. The problem was later studied by Prim [1957] and
Kruskal [1956] among others.
Kruskal showed that the following simple algorithm can be used for finding
a minimum spanning tree in a connected graph: Let S be an initially empty set.
Sort the edges of the graph in order of nondecreasing edge costs. Consider each
edge in the sorted list, beginning with an edge of least cost, and add the edge
1
184 The UMAP Journal 21.2 (2000)
to S if and only if it does not create a cycle with the edges already in S. Kruskal
showed that after all edges have been considered, S is a minimum spanning
tree for the graph. For example, in the graph in Figure 1, Kruskal’s algorithm
sorts the edges in the order 1, 2, 3, 4, 5, 5, 6. It begins by selecting the edge of
weight 1 and adding it to S. The edge of weight 2 is added next, followed by
the edge of weight 3. The edge of weight 4 is considered next but cannot be
added to S because it creates a cycle with existing edges in S. Next, one of the
two edges of weight 5 is considered and added to S. The next edge of weight 5
cannot be added to S because it creates a cycle with existing edges. Similarly,
the edge of weight 6 cannot be added. At this point, the algorithm terminates
and S is a minimum spanning tree.
Kruskal’s algorithm is said to be “greedy” because at each step it simply
chooses the cheapest remaining edge that does not introduce a cycle. In general,
a “greedy” algorithm is one that makes a sequence of locally optimal decisions.
In the case of the minimum spanning tree problem, this sequence of locally
optimal decisions leads to a globally optimal solution. Unfortunately, for other
problems, greedy algorithms do not always find optimal solutions.
Consider the famous and seemingly similar traveling salesperson problem.
In this problem, we are given a graph with n vertices representing n cities.
There is an edge between every pair of vertices with an associated positive
real number representing the cost of a direct flight between the corresponding
cities. A salesperson wishes to start at her home city, visit each city at least once,
and return to her home city. However, since she is very busy, the salesperson
stipulates that she will not fly to any city more than once. Thus, the salesperson
wishes to find a cycle that visits each city exactly once: a traveling salesperson
tour or Hamiltonian cycle in the graph. Among all tours, the salesperson wants
to find one that minimizes the sum of the edge costs. For example, consider the
weighted graph with five vertices, representing five cities, in Figure 2a. One
tour is shown in Figure 2b and has a total cost of 12. Another tour is shown in
Figure 2c and has a cost of 7; it can be shown that this tour is an optimal tour.
1 a b 1 a b 1 a b 1
2 2 2
4 3 4 3
5 6
7
e c e c e c
1 2 1 2 1 2
d d d
Figure 2. a. A weighted graph with five vertices. b. A tour with cost 12. c. An optimal tour with
cost 7.
2
Matroids: The Theory and Practice of Greed 185
flight brings us to city v. We could now “greedily” select the cheapest flight
from city v that brings us to a city that we have not yet visited. The process
can be repeated until we reach a city such that all other cities have been visited.
At this point, we are forced to fly directly to the starting city and the tour is
complete.
Surprisingly, this greedy approach for the traveling salesperson problem
does not always find optimal solutions. For example, consider the graph with
four vertices in Figure 3a. If vertex a represents the start city, the greedy al-
gorithm selects vertex b as the next city followed by vertex c, then vertex d,
and finally returning to vertex a. The cost of this tour, shown in Figure 3b is
1,000,003. On the other hand, the tour in Figure 3c has a cost of 6.
a 1 a 1 a 1
b b b
2 2
1,000,000 1 1,000,000 1
2 2
d c d c d c
1 1 1
Figure 3. a. A weighted graph with four vertices. b. A solution with cost 1,000,003. c. An optimal
solution with cost 6.
Not only does this particular greedy algorithm fail for the traveling salesper-
son problem, but no efficient algorithm is known for this problem.1 In fact, the
traveling salesperson problem is an NP-complete problem. This means, roughly,
that not only is no efficient algorithm known for the problem but that the dis-
covery of an efficient algorithm would immediately imply efficient algorithms
for a multitude of other apparently intractable computational problems.
While many discrete optimization problems can be solved by greedy algo-
rithms, many others seem not to be amenable to greed or even any efficient
algorithm at all. This article describes how an elegant mathematical struc-
ture, called a matroid, can be used to construct and establish the correctness of
greedy algorithms for a variety of discrete optimization problems. Moreover,
matroids also help us understand why certain other problems are not amenable
to efficient solution.
In the following sections of this paper, we begin by defining the concept of
a matroid. Next, we show how matroids are directly related to greedy algo-
rithms. We then use matroids to find greedy algorithms for several optimization
problems. We conclude with a discussion of the relationship between matroids
and intractable problems (such as the traveling salesperson problem) and give
a brief overview of some other mathematical structures related to matroids and
their applications.
1 An algorithm is said to be efficient if its running time is polynomial in the size of the problem
instance. The size of the problem instance is the number of digits required to encode it in binary.
See Garey and Johnson [1970] or Cormen et al. [1990] for more on this topic.
3
186 The UMAP Journal 21.2 (2000)
2. Matroids
A matroid is a mathematical structure, introduced by Whitney [1935], that
generalizes the notion of linear independence. Recall that in any vector space,
an independent set of vectors has the property that each of its subsets is also
an independent set. In addition, if X and Y are two independent sets such that
|X| > |Y |, then there exists some element e ∈ X − Y such that Y + e is also an
independent set.2
Remarkably, there are many sets, other than vector spaces, with their own
associated definitions of “independence” that satisfy the two properties above.
A matroid is any structure that satisfies these properties.
Heredity Property: The empty set is in I and for any set X ∈ I all subsets of X are
also elements of I.
Exchange Property: If X, Y ∈ I such that |X| > |Y |, then there exists some e ∈
X − Y such that Y + e ∈ I.
The elements of set I are called, not surprisingly, the independent sets of M .
As an example of a matroid, consider any matrix whose elements are real
numbers. Let E be the set of rows of the matrix and let I be the set of all linearly
independent subsets of E. Now, M = (E, I) is easily verified to be a matroid.
In fact, the name “matroid” comes from this relationship with matrices.
A more interesting example of a matroid is one induced from a graph,
known as the graphic matroid. Consider a graph G = (V, E) where V is the set
of vertices and E is the set of edges. If E ⊆ E and if F = (V, E ) contains no
cycles, then F is said to be a spanning forest of G. Each connected component
in the spanning forest is called a tree. For any graph G = (V, E), let I be the
set of all E ⊆ E such that (V, E ) is a spanning forest of G. We claim that
MG = (E, I) is a matroid.
The heredity property of matroids is easily seen to hold for MG : Since (V, ∅)
is a spanning forest of G, ∅ ∈ I. In addition, if E ∈ I then (V, E ) is a spanning
forest and thus (V, E ) is a spanning forest for any E ⊆ E .
The exchange property requires slightly more work to verify. Assume that
graph G has n vertices and let F = (V, E ) be a spanning forest in G. Note
that if E = ∅, then it contains no edges and thus comprises n distinct trees,
each of which is a single vertex. If |E | = 1, then F comprises n − 1 trees: One
tree is two vertices connected by an edge, and the remaining n − 2 trees are
distinct vertices. In general, if an edge e ∈ / E does not create a cycle when
added to E , then the edge must connect two distinct trees in F . Therefore
2 Throughout this paper, the notation |A| denotes the cardinality of set A, A − B denotes the set
of elements in set A that are not in set B, and A + e denotes the set formed by adding element e
to set A.
4
Matroids: The Theory and Practice of Greed 187
F + e comprises one fewer tree than does F . Thus, in general, a forest with
k < n edges comprises exactly n − k trees.
In relation to the graphic matroid, let X and Y be two edge sets in I such that
|X| > |Y |. Thus, FX = (V, X) and FY = (V, Y ) are both spanning forests of G.
By the above observation, FX comprises fewer trees than does FY . Therefore,
there is some tree in FX whose vertices are in more than one tree of FY . This
means that there is an edge e ∈ X whose endpoints are in different trees of FY ,
and therefore FY + e does not contain a cycle and hence is a spanning forest.
Thus, MG is indeed a matroid. For example, for the graph in Figure 1 some of
the independent sets are {ab}, {ab, bc, de}, {ae, ce, de, bc}, and {ab, bd, cd, de}.
Before turning to applications of matroids to discrete optimization prob-
lems, we note that the analogy between matroids and vector spaces does not
end with independent sets. A related analogy, which is used extensively in the
next section, is that of a basis. In a vector space, a basis is a maximal independent
set: an independent set such that the addition of any other vector to this set
results in a set that is no longer independent. Similarly, a basis in a matroid
M = (E, I) is defined to be a maximal independent set; an element I ∈ I such
that I + e ∈/ I for all e ∈ E − I. A fundamental result of vector spaces is that
all bases have the same size. Analogously, we can directly apply the definition
of a matroid to prove the following lemma.
Lemma 1 All bases of a matroid have the same size.
The proof of this lemma and other analogies between vector spaces and ma-
troids are explored in the exercises.
To see how this extension of the weight function is useful, we revisit the
the minimum spanning tree problem. For a given instance, we can construct
a corresponding graphic matroid MG = (E, I), where E is the set of edges
in the graph and I is the set of all spanning forests in the graph. Let w be a
5
188 The UMAP Journal 21.2 (2000)
weight function that assigns a positive weight to each edge in the graph. Then
we claim that the objective of the minimum spanning tree problem is to find
a basis of MG such that w(X) is minimized. To see this, recall that a basis is
a maximal independent set: an element in I such that no proper superset of
this element is in I. In this case, elements in I are spanning forests, and thus a
maximal element is a forest such that no edge can be added without creating a
cycle. Such a forest is a spanning tree. Thus, a basis of minimum weight in the
graphic matroid is a minimum spanning tree in the graph.
A remarkable property of matroids is that a basis of maximum weight can
be found using a simple greedy algorithm. (The case of finding a basis of
minimum weight will be shown to follow easily from this.) Given a matroid
M = (E, I) and a weight function w : E → R, the matroid greedy algorithm
performs the following steps:
Sort the n elements of E into list e1 , e2 , . . . , en such that
w(e1 ) ≥ w(e2 ) ≥ · · · ≥ w(en )
Let X = ∅
for i = 1 to n
if X + ei ∈ I
then let X = X + ei
return X
Proof: First, we observe that the set X returned by the algorithm is a basis of
M . If not, then there exists ei ∈ E − X such that X + ei ∈ I. By the heredity
property, every subset of X + ei is in I, and thus ei would have been added to
the set X in step i of the for loop, a contradiction.
Let X = {x1 , . . . , xk }, where w(x1 ) ≥ w(x2 ) ≥ · · · ≥ w(xk ). Let Y be a basis
of M of maximum weight. By Lemma 1, |Y | = k. Let Y = {y1 , . . . , yk }, where
w(y1 ) ≥ w(y2 ) ≥ · · · ≥ w(yk ). If w(xi ) ≥ w(yi ) for all i, 1 ≤ i ≤ k, then X is
also a basis of maximum weight. Assume therefore that this is not the case and
let be the least value such that w(x ) < w(y ). Consider the sets
By the heredity property, these sets are independent. The exchange property
implies that there exists some yi ∈ Y − X −1 such that X −1 + yi ∈ I. Since
w(yi ) ≥ w(y ) > w(x ), the greedy algorithm considers yi before x . By the
heredity property, every subset of X −1 + yi is in I and thus the algorithm
would have included yi in X, a contradiction.
As an example, we again revisit the minimum spanning tree problem, which
we noted earlier is exactly that of finding a basis of minimum weight in the
graphic matroid MG = (E, I). Assume for a moment that we actually wanted
to find a spanning tree of maximum weight, a maximum spanning tree. In this
6
Matroids: The Theory and Practice of Greed 189
case, Theorem 1 tells us that we can simply apply the matroid greedy algorithm
to the corresponding graphic matroid. In other words, we begin by sorting the
edges in E in order of nonincreasing weights. Beginning with an initially
empty set X, we consider the sorted edges in E one at a time. If an edge under
consideration does not create a cycle with respect to the edges already in X,
we add the edge to X. This results in a basis of maximum weight: a maximum
spanning tree. Now observe that a minimum spanning tree can be found by
replacing each w(e) in the graph by its negative, −w(e), and finding a maximum
spanning tree in this reweighted graph. This procedure is exactly equivalent
to the aforementioned algorithm due to Kruskal.
In the next two sections we explore two more discrete optimization prob-
lems. For each of these problems, we find a corresponding matroid. We can
then apply the matroid greedy algorithm to solve each of these problems.
4. A Scheduling Problem
Consider a set S = {1, . . . , n} of n jobs that must be performed by a single
machine. Each job takes one unit of time to complete; once a job is started
on the machine, it must be completed before the next job can be started. For
each job, there is a deadline d(i) such that 1 ≤ d(i) ≤ n, 1 ≤ i ≤ n. For
each job, there is also an associated positive real reward or weight, w(i), that is
obtained if the job is completed no later than its deadline. The objective is to
determine a schedule, an ordering of the n jobs, that maximizes the total reward.
In practice, these jobs might be mechanical tasks performed on a machine or
programs run on a computer, and the rewards might represent profits earned by
completing the jobs by their deadlines. We solve this problem by constructing
a corresponding matroid, showing that an optimal solution to the scheduling
problem corresponds to a basis of maximum weight in the matroid, and then
finding such a basis using the matroid greedy algorithm.
Given a schedule for the n jobs, we say that a job is on time if it is completed
on or before its deadline; otherwise the job is said to be late. Let S be a set of
jobs with associated deadlines and weights. A feasible schedule for X ⊆ S is a
schedule in which all of the jobs in X are on time. A subset X of S is said to
be feasible if there exists at least one feasible schedule for X. Notice that the
problem of finding an optimal schedule for S can be reduced to that of finding
a feasible subset X ⊆ S of maximum total weight. We would then like to find a
feasible schedule for X. The elements in S − X will all be late and can therefore
be scheduled in any order after the jobs in X. Of course, we need some way of
determining whether a subset X ⊆ S is feasible, and if it is, we need to find a
feasible schedule for it.
Imagine for a moment that we are given a set X ⊆ S and told that X is
feasible. We know that a feasible schedule exists for X, but it would seem that
we might need to test all of the permutations of the elements of X, one by one,
until we find a feasible schedule. This, of course, would be a prohibitively slow
7
190 The UMAP Journal 21.2 (2000)
Lemma 2 A set X is feasible if and only if the schedule formed by sorting the elements
of X in order of nondecreasing deadlines results in each job being on time.
Proof: Assume that X is feasible. Then there exists some schedule that com-
pletes the jobs in X on time. If this schedule has some pair of jobs i and j
both of which are completed on time but such that i is completed before j
and d(i) > d(j), then we swap the two jobs. Now, job j is completed even
earlier and is therefore still on time. Moreover, job i is now completed when
j was completed in the original schedule and is therefore completed no later
than time d(j). Since d(i) > d(j), job i is still on time in this new schedule.
Therefore, given any schedule that completes all of the jobs in X on time, we
can repeatedly swap pairs of on-time jobs until they are completed in order of
nondecreasing deadlines with all jobs still being completed on time.
Conversely, assume that for a given set X, the schedule formed by sorting
the elements of X in order of nondecreasing deadlines results in each job being
on time. Since this is a feasible schedule for X, X is feasible by definition.
Lemma 3 Given a set of jobs S, let I denote the set of all feasible subsets of S. Then
MS = (S, I) is a matroid.
Proof: The heredity property is satisfied because ∅ is trivially feasible and every
subset of a feasible set is clearly also feasible.
To show that the exchange property is satisfied, let X and Y be two elements
of I such that |X| > |Y |. Without loss of generality, assume that |X| = |Y | + 1.
(If this is not the case, we simply remove elements from X arbitrarily until this
assumption is true.) Let |Y | = n and let x1 , . . . , xn+1 and y1 , . . . , yn denote the
elements of X and Y in order of nondecreasing deadlines. That is, d(xi ) ≤
d(xi+1 ), 1 ≤ i ≤ n, and d(yj ) ≤ d(yj+1 ), 1 ≤ j ≤ n − 1. If xn+1 ∈ / Y , then
xn+1 ∈ X − Y , and the schedule y1 , . . . , yn , xn+1 is a feasible schedule for
Y + xn+1 because xn+1 completes at time n + 1 in the schedule for X and thus
d(xn+1 ) ≥ n + 1.
Assume, therefore, that xn+1 ∈ Y . Since |X| > |Y |, there exists an element of
X that is not in Y . Let k be the largest value of i such that xi ∈
/ Y . Then 1 ≤ k ≤ n
8
Matroids: The Theory and Practice of Greed 191
9
192 The UMAP Journal 21.2 (2000)
Lemma 4 Given a bipartite graph with vertices E ∪ T , let I denote the set of all
matchable subsets of T . Then MT = (T, I) is a matroid.
10
Matroids: The Theory and Practice of Greed 193
6. Conclusion
We have seen that matroids are a powerful tool for constructing and show-
ing the correctness of greedy algorithms. Matroids can also be used to develop
efficient algorithms for even more difficult optimization problems where sim-
ple greedy algorithms fail. For example, consider a variant of the bipartite
matching problem that arose in the task assignment problem. In that prob-
lem, weights were associated with a subset of the vertices in the graph and
the objective was to find a matching that maximized the sum of these weights.
Now consider the situation in which there is a positive weight associated with
each edge, rather than with some vertices, and we wish to find a matching
that maximizes the sum of the weights on the matched edges. Although the
greedy algorithm does not always find an optimal solution for this problem,
the problem can be solved using the notion of matroid intersections.
Given two matroids M1 = (E, I1 ) and M2 = (E, I2 ) over the same set E
and a weight function w : E → R, the matroid intersection problem for two
matroids is that of finding an element X ∈ I1 ∩I2 of maximum weight. Efficient
algorithms are known for solving the matroid intersection problem for two
matroids. Many discrete optimization problems, including the aforementioned
bipartite matching problem with edge weights, can be formulated as a matroid
intersection problem for two matroids.
Some optimization problems that cannot be solved by greedy algorithms,
11
194 The UMAP Journal 21.2 (2000)
7. Exercises
1. Prove Lemma 1.
2. Let M = (E, I) be a matroid. Analogous to the definition in a vector space,
the rank of a set X ⊆ E, denoted r(X), is the size of a largest independent
subset of X. Let B be a basis of M . Show that r(B) = r(E) = |B|.
3. Recall that if V is a vector space and X ⊆ V , the span of X, denoted span(X),
is the subspace of all vectors that can be expressed as a linear combination
of vectors in X. One property of vector spaces is that for any basis B in
vector space V , span(B) = V .
If M = (E, I) is a matroid and X ⊆ E, the span of X, denoted span(X),
is defined to be a maximal superset Y of X such that r(Y ) = r(X). Let
M = (E, I) be a matroid and let B be a basis in the matroid. Show that
span(B) = E.
4. In the Introduction, we described a problem involving a weighted graph in
which each vertex corresponds to a city, each edge corresponds to an existing
phone line, and the weight on each edge corresponds to the cost of leasing
that phone line. We assumed that the weight on each edge is a positive real
number. We then argued that the problem of finding the least expensive
subset of edges that permit us to find a path between any two vertices is
exactly that of finding a minimum spanning tree in the graph. Show that if
12
Matroids: The Theory and Practice of Greed 195
the edge weights are not necessarily all positive, then a minimum spanning
tree does not necessarily give an optimal solution to this problem.
5. Does the matroid greedy algorithm find a minimum spanning tree if edges
can have arbitrary real weights?
6. In the scheduling problem we assumed that all jobs had positive weights.
Can the matroid greedy algorithm be used to solve this problem if jobs can
have arbitrary real weights?
7. Consider the weighted graph shown in Figure 4. Use the greedy algorithm
described earlier to find a minimum spanning tree in this graph.
8. Consider the scheduling problem for five jobs with deadlines d(1) = 2,
d(2) = 3, d(3) = 1, d(4) = 2, d(5) = 4 and weights w(1) = 3, w(2) = 1,
w(3) = 2, w(4) = 5, w(5) = 1.
a) Use the greedy algorithm to find an optimal schedule.
b) What is the sum of the weights of the on-time jobs in an optimal schedule
in this case?
c) How does this compare to the sum of the weights of the on-time jobs in
the schedule 1, 2, 3, 4, 5?
9. Consider the task assignment problem for three employees {e1 , e2 , e3 } and
four tasks {t1 , t2 , t3 , t4 }. Employee e1 is qualified to perform task t4 , em-
ployee e2 is qualified to perform tasks t1 and t2 , and employee e3 is qualified
to perform tasks t1 and t3 . The weights on the tasks are w(t1 ) = 5, w(t2 ) = 4,
w(t3 ) = 2, and w(t4 ) = 1.
a) Use the greedy algorithm to find an optimal solution for this instance of
the task assignment problem.
b) What is the total weight of the completed tasks in this solution?
13
196 The UMAP Journal 21.2 (2000)
14
Matroids: The Theory and Practice of Greed 197
15
198 The UMAP Journal 21.2 (2000)
16
Matroids: The Theory and Practice of Greed 199
10. a) The empty set has no elements from any Pi , 1 ≤ i ≤ k, and is therefore
independent. Let X ∈ I and Y ⊆ X. Since X has at most 1 element
from each Pi , 1 ≤ i ≤ k, Y does as well. Hence, Y is independent.
b) Let X, Y ∈ I with |X| > |Y |. There must exist some i, 1 ≤ i ≤ k, such
that X contains an element e of Pi but such that Y contains no element
of Pi . Therefore, e ∈ X − Y and Y + e ∈ I.
11. a) Each set in I corresponds to a solution to the problem. Since the weight
function is positive, an optimal solution is a set in I such that the addition
of any other element of V results in a set not in I. This is a basis of I.
b) The hereditary property is satisfied since ∅ ∈ I and if X ∈ I is covered
by some matching M , then M also covers any subset Y ⊆ X and thus
Y ∈ I.
c) If MY covers some vertex v ∈ X − Y , then MY covers Y + v and thus
Y + v ∈ I and the exchange property is satisfied.
d) Assume that MY covers no vertex in X − Y . The gray edges are those
in MX ∩ MY and thus cannot cover a vertex in X − Y . Thus, if a gray
edge covers a vertex in X, that vertex must be in Y as well. Therefore,
the gray edges cover at least as many vertices in Y as in X.
e) Every vertex on an alternating cycle is covered by an edge in MY . Thus,
any vertex in X on an alternating cycle must also be in Y . Therefore, the
alternating cycles cover at least as many vertices in Y as in X.
f) Every vertex in X ∪Y is covered by a gray, black, or white edge. From the
previous two results, we know that the gray edges and the alternating
cycles contain at least as many vertices in Y as in X. Since |X| > |Y |,
the alternating paths must contain more vertices of X than Y .
g) Let v1 , . . . , vk be an alternating path and assume that v1 ∈ X ∩ Y . Then
both MX and MY contain edges incident on v1 . Since edge (v1 , v2 ) is
from either MX or MY but not both, there must exist another edge from
MX or MY incident on v1 . Thus, v1 is either incident on two edges from
the same matching or is not an endpoint of the alternating path, both of
which are contradictions.
h) From the above observations, there must exist an alternating path P
with more vertices in X than Y . Let v1 , . . . , vk be the vertices of P from
one endpoint to the other. At least one endpoint must be in X − Y since
otherwise the path has at least as many vertices in Y as in X. Without
loss of generality, assume v1 ∈ X − Y . If vk ∈ Y , then from the above
observation vk cannot be in X. In this case, the path contains at least as
many vertices in Y as in X, a contradiction.
i) Let us remove the white edges in P from MY and add the black edges
of P to MY . This is still a matching, and it is is incident on all vertices in
Y + v1 . This matching confirms that Y + v1 is matchable and that MM
is a matroid.
17
200 The UMAP Journal 21.2 (2000)
9. References
Bondy, J.A., and U.S.R. Murty. 1976. Graph Theory with Applications. London:
Macmillan.
Borůvka, O. 1926. On a certain minimal problem. Prace Moravske Predovedecke
Spolecrosti 3: 37–58
Cormen, T.H., C.E. Leiserson, and R.L. Rivest. 1990. Introduction to Algorithms.
New York: McGraw-Hill.
Edmonds, J., and D.R. Fulkerson. 1965. Transversals and matroid partition.
Journal of Research of the National Bureau of Standards, Section B 69: 147–153.
Garey, M.R., and D.S. Johnson. 1970. Computers and Intractability: A Guide to
the Theory of NP-Completeness. New York: W.H. Freeman.
Korte, B., L. Lovász, and R. Schrader. 1991. Greedoids. New York: Springer
Verlag.
Kruskal, J.B. 1956. On the shortest spanning subtree of a graph and the trav-
elling salesman problem. Proceedings of the American Mathematical Society 7:
48–50.
Lawler, E. 1976. Combinatorial Optimization: Networks and Matroids. New York:
Holt, Rinehart, and Winston.
Oxley, J.G. 1992. Matroid Theory. New York: Oxford University Press.
Papadimitriou, C., and K. Steiglitz. 1982. Combinatorial Optimization: Algo-
rithms and Complexity. Englewood Cliffs, NJ: Prentice-Hall.
Prim, R.C. 1957. The shortest connecting network and some generalisations.
Bell Systems Technical Journal 36: 1389–1401.
Whitney, H. 1935. On the abstract properties of linear independence. American
Journal of Mathematics 57: 509–533.
18
Matroids: The Theory and Practice of Greed 201
19