Proof.
Theorem 2.
If F is a non-empty collection of subsets of a
finite set S such that F is
closed under the subset operation and if
the greedy algorithm works for (F,w),
for every weight function w, then F is the set of independent sets
of a matroid.
Let A and B be elements of F
with |A| < |B|.
Let t = |A ∩ B|,k = |A \ B| = |A| - t,
and
r = |B| − |A| = |B| − t − k > 0.
Define a weight function w on S by the rules
w(e) = k+r+2 if e ∈ A w(e) = k+2 if e ∈ B \ A w(e) = 0 if e ∉ A ∪ B.
Apply the greedy algorithm to (F,w).
The algorithm must first take
all of the elements of A and then
continue until it finds a maximum weight
element of F. But
w(B) = t(k+r+2)+(k+r)(k+2) = t(k+r+2)+k(k+r+2)+2r = 2r+w(A) > w(A).
Therefore, the
greedy algorithm does not stop once it constructs A,
but must at the next
stage find an element x ∉ A
with w(x) > 0
and such that A ∪ {x} ∈ F.
However, the only elements with positive weight are in
B ∪ A.
Thus, x ∈ B \ A,
completing the proof.
Department of Mathematical Sciences Florida Atlantic University
777 Glades Road Boca Raton, Florida 33431-0991
USA