The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
Matroids
1. Introduction Greedy Correspondence linear algebra Matroid intersection Conclusion
Matroids
Bernhard Mallinger
Seminar in Algorithms WS12
TU Wien
December 18th, 2012
Bernhard Mallinger Seminar in Algorithms WS12 TU Wien
Matroids
2. Introduction Greedy Correspondence linear algebra Matroid intersection Conclusion
Outline
1 Introduction
2 Greedy
3 Correspondence linear algebra
4 Matroid intersection
5 Conclusion
Bernhard Mallinger Seminar in Algorithms WS12 TU Wien
Matroids
3. Introduction Greedy Correspondence linear algebra Matroid intersection Conclusion
Outline
1 Introduction
2 Greedy
3 Correspondence linear algebra
4 Matroid intersection
5 Conclusion
Bernhard Mallinger Seminar in Algorithms WS12 TU Wien
Matroids
4. Introduction Greedy Correspondence linear algebra Matroid intersection Conclusion
Definition
Definition (Independence system)
Independence system S = (E , I)
Finite set E (universe)
I ⊆ 2E (independent sets)
Closed under inclusion (hereditary property)
Independent sets describe solutions
Framework for combinatorial optimisation problems (given a
weight function)
Bernhard Mallinger Seminar in Algorithms WS12 TU Wien
Matroids
5. Introduction Greedy Correspondence linear algebra Matroid intersection Conclusion
Definition
Definition (Matroid)
A matroid M is is an independence system (E , I) satisfying the
augmentation property:
I , J ∈ I, |I | < |J| ⇒ ∃e ∈ (J I ) s.t. I ∪ {e} ∈ I.
Bernhard Mallinger Seminar in Algorithms WS12 TU Wien
Matroids
6. Introduction Greedy Correspondence linear algebra Matroid intersection Conclusion
Example: Minimal spanning forest/tree
Example (Minimal spanning forest/tree)
Given an undirected graph G = (V , E )
Find a subgraph G = (V , E ), E ⊆ E , E acyclic
Hereditary property: Subset of acyclic set is acyclic.
Augmentation property:
Given 2 forests I and J, |I | < |J|
Always possible to find e ∈ J such that I ∪ {e} acyclic
Bernhard Mallinger Seminar in Algorithms WS12 TU Wien
Matroids
7. Introduction Greedy Correspondence linear algebra Matroid intersection Conclusion
Example: Minimal spanning forest/tree
Example (Minimal spanning forest/tree)
Given an undirected graph G = (V , E )
Find a subgraph G = (V , E ), E ⊆ E , E acyclic
Hereditary property: Subset of acyclic set is acyclic.
Augmentation property:
Given 2 forests I and J, |I | < |J|
Always possible to find e ∈ J such that I ∪ {e} acyclic
Bernhard Mallinger Seminar in Algorithms WS12 TU Wien
Matroids
8. Introduction Greedy Correspondence linear algebra Matroid intersection Conclusion
Example: Minimal spanning forest/tree
Example (Minimal spanning forest/tree)
Given an undirected graph G = (V , E )
Find a subgraph G = (V , E ), E ⊆ E , E acyclic
Hereditary property: Subset of acyclic set is acyclic.
Augmentation property:
Given 2 forests I and J, |I | < |J|
Always possible to find e ∈ J such that I ∪ {e} acyclic
Bernhard Mallinger Seminar in Algorithms WS12 TU Wien
Matroids
9. Introduction Greedy Correspondence linear algebra Matroid intersection Conclusion
Example: Matchings I
Example (Matching)
Given an undirected graph G = (V , E )
Find M ⊆ E such that all edges are disjoint
Hereditary property: Subsets of disjoint sets are disjoint sets.
Augmentation property
Given 2 matchings I and J, |I | < |J|
Always possible to find e ∈ J such that I ∪ {e} is a matching?
Bernhard Mallinger Seminar in Algorithms WS12 TU Wien
Matroids
10. Introduction Greedy Correspondence linear algebra Matroid intersection Conclusion
Example: Matchings I
Example (Matching)
Given an undirected graph G = (V , E )
Find M ⊆ E such that all edges are disjoint
Hereditary property: Subsets of disjoint sets are disjoint sets.
Augmentation property
Given 2 matchings I and J, |I | < |J|
Always possible to find e ∈ J such that I ∪ {e} is a matching?
Bernhard Mallinger Seminar in Algorithms WS12 TU Wien
Matroids
11. Introduction Greedy Correspondence linear algebra Matroid intersection Conclusion
Example: Matchings I
Example (Matching)
Given an undirected graph G = (V , E )
Find M ⊆ E such that all edges are disjoint
Hereditary property: Subsets of disjoint sets are disjoint sets.
Augmentation property
Given 2 matchings I and J, |I | < |J|
Always possible to find e ∈ J such that I ∪ {e} is a matching?
Bernhard Mallinger Seminar in Algorithms WS12 TU Wien
Matroids
12. Introduction Greedy Correspondence linear algebra Matroid intersection Conclusion
Example: Matchings II
2 3
1 6
4 5
Figure: The matching in red clearly has a larger cardinality, but the
matching in blue cannot be augmented by any of the red edges.
Bernhard Mallinger Seminar in Algorithms WS12 TU Wien
Matroids
13. Introduction Greedy Correspondence linear algebra Matroid intersection Conclusion
Outline
1 Introduction
2 Greedy
3 Correspondence linear algebra
4 Matroid intersection
5 Conclusion
Bernhard Mallinger Seminar in Algorithms WS12 TU Wien
Matroids
14. Introduction Greedy Correspondence linear algebra Matroid intersection Conclusion
Greedy I
Given a weight function w : E → R+ , Greedy can be used to
find an optimal independent set.
Optimal w.r.t MST: maximal size, minimal weight
In fact:
Theorem
An independence system S = (E , I) is a matroid iff Greedy finds an
optimal solution.
Bernhard Mallinger Seminar in Algorithms WS12 TU Wien
Matroids
15. Introduction Greedy Correspondence linear algebra Matroid intersection Conclusion
Greedy II
Algorithm 1 Greedy
Input: A matroid M = (E , I) together with a weight function w :
E → R+
Output: A set I ∈ I with minimal weight and maximal size
1 I ←∅
2 Sort E = {e1 , e2 , . . . , en } such that w (ei ) ≤ w (ei+1 ), 1 ≤ i < n
3 for i = 1 to n do
4 if (I ∪ {ei }) ∈ I then I ← I ∪ {ei }
5 end if
6 end for
7 return I
Bernhard Mallinger Seminar in Algorithms WS12 TU Wien
Matroids
16. Introduction Greedy Correspondence linear algebra Matroid intersection Conclusion
Greedy III
Theorem
If an independence system is a matroid, Greedy finds an optimal
solution.
Proof sketch: maximal size
Greedy returns I ∈ I
Assume there is some J ∈ I with |J| > |I |
⇒ can augment I by some e ∈ (J I ), which Greedy would
have chosen.
Bernhard Mallinger Seminar in Algorithms WS12 TU Wien
Matroids
17. Introduction Greedy Correspondence linear algebra Matroid intersection Conclusion
Greedy IV
Proof sketch: minimal weight
Greedy returns I ∈ I
Assume there is some J ∈ I with w (J) < w (I )
Consider sets with elements ordered by weight:
I = {e1 , e2 , . . . , em }
J = {e1 , e2 , . . . , em }
Since w (J) < w (I ), some w (ei ) < w (ei )
But Greedy picks elements with increasing weight, so it would
have picked ei for I
Bernhard Mallinger Seminar in Algorithms WS12 TU Wien
Matroids
18. Introduction Greedy Correspondence linear algebra Matroid intersection Conclusion
Greedy V
Theorem
If Greedy finds an optimal solution, the structure is a matroid.
Proof sketch (for maximisation problem)
Assume the augmentation property doesn’t hold
I , J ∈ I with |I | < |J|, but e ∈ (J I ) s.t. (I ∪ {e}) ∈ I.
Find weight function such that Greedy fails (|I | = m)
m + 2 e ∈ I
w (e) = m + 1 e ∈ (J I )
0 otherwise
w (I ) = m(m + 2) = m2 + 2m
w (J) ≥ (m + 1)2 = m2 + 2m + 1
Bernhard Mallinger Seminar in Algorithms WS12 TU Wien
Matroids
19. Introduction Greedy Correspondence linear algebra Matroid intersection Conclusion
Outline
1 Introduction
2 Greedy
3 Correspondence linear algebra
4 Matroid intersection
5 Conclusion
Bernhard Mallinger Seminar in Algorithms WS12 TU Wien
Matroids
20. Introduction Greedy Correspondence linear algebra Matroid intersection Conclusion
Example: Matric matroid
Example (Matric matroid)
Let E be a set of vectors
Let I ∈ 2E be the linearly independent sets
Hereditary property:
Subset of linearly independent set of vectors is linearly
independent.
Augmentation property:
More linearly independent vectors span vector space with
larger dimension, so smaller sets can be augmented
Bernhard Mallinger Seminar in Algorithms WS12 TU Wien
Matroids
21. Introduction Greedy Correspondence linear algebra Matroid intersection Conclusion
Example: Matric matroid
Example (Matric matroid)
Let E be a set of vectors
Let I ∈ 2E be the linearly independent sets
Hereditary property:
Subset of linearly independent set of vectors is linearly
independent.
Augmentation property:
More linearly independent vectors span vector space with
larger dimension, so smaller sets can be augmented
Bernhard Mallinger Seminar in Algorithms WS12 TU Wien
Matroids
22. Introduction Greedy Correspondence linear algebra Matroid intersection Conclusion
Example: Matric matroid
Example (Matric matroid)
Let E be a set of vectors
Let I ∈ 2E be the linearly independent sets
Hereditary property:
Subset of linearly independent set of vectors is linearly
independent.
Augmentation property:
More linearly independent vectors span vector space with
larger dimension, so smaller sets can be augmented
Bernhard Mallinger Seminar in Algorithms WS12 TU Wien
Matroids
23. Introduction Greedy Correspondence linear algebra Matroid intersection Conclusion
Bases I
Definition (Base)
A base is a maximal independent set.
All bases have same cardinality
(if there was a smaller base, it could be augmented using an
element of a larger base)
Augmentation property on bases:
B1 , B2 ∈ B
∀x ∈ (B1 B2 ) ∃y ∈ (B2 B1 ) s.t. (B1 {x} ∪ {y }) ∈ B
Bernhard Mallinger Seminar in Algorithms WS12 TU Wien
Matroids
24. Introduction Greedy Correspondence linear algebra Matroid intersection Conclusion
Bases II
Vector space
Let W be a vector space.
Vector spaces are spanned by a set of linearly independent
vectors ⇒ base
Every base has the same cardinality.
Steinitz exchange lemma on bases:
B1 , B2 ∈ B
∀x ∈ (B1 B2 ) ∃y ∈ (B2 B1 ) s.t. (B1 {x} ∪ {y }) ∈ B
Bernhard Mallinger Seminar in Algorithms WS12 TU Wien
Matroids
25. Introduction Greedy Correspondence linear algebra Matroid intersection Conclusion
Bases III
Augmentation property = Exchange lemma
ˆ
dim W = r (I ) (rank)
ˆ
Closure/span:
Matroids: {e ∈ E | r (I ∪ {e}) = r (I )}
Vector space: All linear combinations
Origin of matroids (1935)
Bernhard Mallinger Seminar in Algorithms WS12 TU Wien
Matroids
26. Introduction Greedy Correspondence linear algebra Matroid intersection Conclusion
Outline
1 Introduction
2 Greedy
3 Correspondence linear algebra
4 Matroid intersection
5 Conclusion
Bernhard Mallinger Seminar in Algorithms WS12 TU Wien
Matroids
27. Introduction Greedy Correspondence linear algebra Matroid intersection Conclusion
Partition matroid I
Example (Partition matroid)
Given a finite set E and a partition Π = (E1 , . . . , En )
Let I ⊆ E ∈ I iff I contains at most one element of each Ei .
⇒ (E , I) is a matroid
Possible interpretation:
E are the edges of a directed graph
In Π, edges are in the same set if they have the same end
vertex
Bernhard Mallinger Seminar in Algorithms WS12 TU Wien
Matroids
28. Introduction Greedy Correspondence linear algebra Matroid intersection Conclusion
Partition matroid II
e4
e1 2 3 e8
e5
1 e3 e9 6
e2 e7
e6
4 5
Figure: A directed graph. Its partition matroid:
E = {e1 , e2 , . . . , e9 }
Π = {{e1 }, {e2 , e3 , e5 }, {e4 }, {e6 , e9 }, {e7 , e8 }}
Bernhard Mallinger Seminar in Algorithms WS12 TU Wien
Matroids
29. Introduction Greedy Correspondence linear algebra Matroid intersection Conclusion
Partition matroid III
e4
e1 2 3 e8
e5
1 e3 e9 6
e2 e7
e6
4 5
Figure: A directed graph with an independent set of its partition matroid.
E = {e1 , e2 , . . . , e9 }
Π = {{e1 }, {e2 , e3 , e5 }, {e4 }, {e6 , e9 }, {e7 , e8 }}
Bernhard Mallinger Seminar in Algorithms WS12 TU Wien
Matroids
30. Introduction Greedy Correspondence linear algebra Matroid intersection Conclusion
Hamiltonian path I
Example (Hamiltonian path)
Given a directed graph G = (V , A)
Let M1 be the acyclic matroid (cf. minimal spanning forest)
Let M2 and M3 be partition matroids, where the partitions are
defined by start and end vertices of the arcs respectively
⇒ Sets, that are independent in Mi , 1 ≤ i ≤ 3 and maximal are:
Acyclic
Enter each vertex at most once
Leave each vertex at most once
⇒ Hamiltonian paths (if there are some)
Bernhard Mallinger Seminar in Algorithms WS12 TU Wien
Matroids
32. Introduction Greedy Correspondence linear algebra Matroid intersection Conclusion
Hamiltonian path III
e4
e1 2 3 e8
e5
1 e3 e9 6
e2 e7
e6
4 5
Figure: A directed graph with a Hamiltonian path.
E = {e1 , e2 , . . . , e9 }
Π1 = {{e1 }, {e2 , e3 , e5 }, {e4 , e8 }, {e6 , e9 }, {e7 }}
Π2 = {{e1 , e2 }, {e3 , e4 }, {e5 , e9 }, {e6 }, {e7 }}, {e8 }}
Bernhard Mallinger Seminar in Algorithms WS12 TU Wien
Matroids
33. Introduction Greedy Correspondence linear algebra Matroid intersection Conclusion
Matroid intersection
Definition (Matroid intersection)
Let M1 = (E , I1 ) and M2 = (E , I2 ) be matroids. Their
intersection M = M1 ∩ M2 is given by (E , I1 ∩ I2 ).
Cannot be solved by Greedy
NP-complete if at least 3 matroids are involved
Solvable in P for 2 matroids (e.g. bipartite matching)
Bernhard Mallinger Seminar in Algorithms WS12 TU Wien
Matroids
34. Introduction Greedy Correspondence linear algebra Matroid intersection Conclusion
Outline
1 Introduction
2 Greedy
3 Correspondence linear algebra
4 Matroid intersection
5 Conclusion
Bernhard Mallinger Seminar in Algorithms WS12 TU Wien
Matroids
35. Introduction Greedy Correspondence linear algebra Matroid intersection Conclusion
Conclusion
Independent sets with augmentation property
Provable optimality for Greedy
E.g. Minimal spanning tree
Is the underlying structure of various problems
Derived from linear algebra (linear independent set of vectors)
Many advanced uses
Most of them not covered here, except for:
Matroid intersection
Bernhard Mallinger Seminar in Algorithms WS12 TU Wien
Matroids
36. Introduction Greedy Correspondence linear algebra Matroid intersection Conclusion
References
Bernhard Korte and Jens Vygen.
Combinatorial Optimization: Theory and Algorithms.
Springer Publishing Company, Incorporated, 4th edition, 2007.
James G. Oxley.
Matroid Theory.
Oxford Graduate Texts in Mathematics Series. Oxford
University Press, 2nd edition, 2011.
Christos H. Papadimitriou and Kenneth Steiglitz.
Combinatorial Optimization: Algorithms and Complexity.
Prentice-Hall, Inc., Upper Saddle River, NJ, USA, 1982.
Bernhard Mallinger Seminar in Algorithms WS12 TU Wien
Matroids