Greedy Algorithm For Matroids
Greedy Algorithm For Matroids
Yassin Tesfaw
Advisor: Professor Nan y Ann Neudauer
◮ Denition of Matroids
◮ Weighted Fun tion
◮ Kruskal's Algorithm
2 / 11
Denition of Matroids
Denition
A matroid M is an order pair (E , I) onsisting a nite set E and a
olle tion I of subsets of E satisfying the following three onditions:
(M1) ∅ ∈ I .
(M2) If I ∈ I and I ′ ⊆ I , then I ′ ∈ I .
(M3) If I1 and I2 are in I and |I1 | < |I2 |, then there is an element e of
I2 − I1 su h that I1 ∪ e ∈ I .
Example
Given a set E = {a, b, c} and
I = {∅, {a}, {b}, {c}, {a, b}, {a, c}, {b, c}}, then (E , I) is a matroid.
3 / 11
Denition
A matroid (E , I) if it equipped with a weight fun tion w : E → R+ , i.e.,
all weights are positive real numbers. If X ⊆ E then
X
w (X ) = w (x).
x∈X
Example
Consider the graph with the E = {a, b, c, d, e} and their weight under
the subs ript.
a1
4 / 11
Greedy Algorithm for Matroids
◮ Kruskal's Algorithm(1956)
5 / 11
Greedy Algorithm for Matroids
◮ Kruskal's Algorithm(1956)
5 / 11
Find a maximal member B of I of maximum weight?
The greedy algorithm for the pair (I, w ) pro eeds as follows:
// Maximizing version
1. Set X0 = ∅ and j = 0.
2. If E − Xj ontains an element e su h that Xj ∪ e ∈ I , hoose su h
an element ej+1 of maximum weight, Let Xj+1 = Xj ∪ ej+1 , and go
to (3); otherwise, let Xj = BG and go to (4).
3. Add 1 to j and go to (2).
4. stop.
Example
a1
◮ E = {a, b, c, d, e} and
X0 = ∅.
b2 c3 e4 ◮ Iteration for sele ting
d5 ◮ Xj = BG = {d, e, c}
6 / 11
Theorem for Greedy Algorithm
Theorem
Let I be a olle tion of subsets of set E . Then (E , I) is a matroid if and
only if I satises the following onditions:
(M1) ∅ ∈ I .
(M2) If I ∈ I and I ′ ⊆ I , then I ′ ∈ I .
(G) For all weighted fun tion w : E −→ R, the greedy algorithm
produ es a maximal member of I of maximum weight.
Proof.
◮ If (E , I) is a matroid M 1 and M 2 holds and so too does (G ).
7 / 11
Assume the ontrary, that is suppose that I1 , I2 are members of I with
|I1 | < |I2 | su h that I1 ∪ e ∈
/ I for all e ∈ I2 − I1 .
8 / 11
Assume the ontrary, that is suppose that I1 , I2 are members of I with
|I1 | < |I2 | su h that I1 ∪ e ∈
/ I for all e ∈ I2 − I1 .
8 / 11
Assume the ontrary, that is suppose that I1 , I2 are members of I with
|I1 | < |I2 | su h that I1 ∪ e ∈
/ I for all e ∈ I2 − I1 .
Dene w : E → R+ by
2 if e ∈ I1 ∩ I2 ,
1
if e ∈ I1 − I2 ,
|I1 −I2 |
w (e) = 1+ǫ
|I2 −I1 | if e ∈ I2 − I1 ,
0
otherwise
8 / 11
Then
w (BG ) = 2|I1 ∩ I2 | + 1 (2)
9 / 11
Then
w (BG ) = 2|I1 ∩ I2 | + 1 (2)
Hen e from (2) and (3), we dedu e that w (I2′ ) > w (BG ), that the greedy
algorithm fails.
9 / 11
Referen es
10 / 11
Time for Questions
Thank You
11 / 11