BAB 9 Matroid
BAB 9 Matroid
CONTOH
Elemen-elemen dari S disebut elemen dari matroid M. Anggota-anggota disebut himpunan
bebas dari M. Subset-subset dari S yang bukan anggota Ĩ disebut himpunan tak bebas dari M .
Koleksi himpunan tak bebas dilambangkan dengan D . Himpunan bebas yang maksimal adalah
himpunan bebas yang tidak termuat dalam himpunan bebas lainnya. Basis dari matroid M adalah
sebuah himpunan bebas yang maksimal dari . Koleksi basis dari M dinotasikan sebagai B(M).
Sirkit dari M matroid adalah himpunan tak bebas yang minimal dari M . Koleksi sirkit dari
dilambangkan dengan C(M). Misal A adalah himpunan bagian dari S, rank dari A yang
dinotasikan p(A) adalah p(A) maksimum
Now if we remove the second vector in B1, then we can replace it with the second vector in B2
to get a new base, B3,
For this case, B(ii) is satisfied. We would find the same results if we continued this process with
all possible bases of A. It is well known from Linear Algebra that no basis of A properly
contains another basis.
EXAMPLE MATROID GRAF.
We will take a base of our matroid to be a spanning tree of G. The following is a
definition of a spanning tree. Let G be a graph with n vertices. A spanning tree is a connected
subgraph that uses all vertices of G that has n − 1 edges.[4] If we refer back to Figure 1, then we
can see that the bases of the graph, G, are in Table 2.2.
By observing the set of bases listed above, we can see that B(i) is satisfied, because no base
properly contains another base. We can now demonstrate B(ii) by using this property with two
bases. If we choose, B1 = {a, b, c, d} and B2 = {c, g, a, e}, then we can see the spanning trees of
B1 and B2 in Figures 2 and 3.
Notice that each spanning tree has 5 vertices and 4 edges. We can demonstrate B(ii) by removing
an element {a} from B1, and then there exists an element in B2 such that a new base is created,
B3 = (B1 \ {a}) ∪ {e}). Figure 4 shows the new base, B3.
Selecting the most valuable items to fit into a knapsack with limited capacity.
conditions - can of course be applied to other systems (E, S), too. We give some definitions. An
independence system is a pair (E, S), where E is a set and S is a subset of the power set of E
closed under inclusion: from A ∈ S and B ⊂ A it follows that B ∈ S. The elements of S are called
independent sets. The optimization problem associated with (E, S) is the following: for a given
weight function w : E -t ~ , we want to find an independent set A whose weight
is maximal. (The restriction to non-negative weight functions makes sure that there is a maximal
independent set among the independent sets of maximal weight. We can drop this restriction if
we assume A to be a maximal independent set, see Theorem 5.5.1.)
Thus, determining a maximal spanning forest is the optimization problem associated with (E, S),
where E is the edge set of the graph G, and S is the set of all edge sets which are forests. We
generalize the Algorithm of Kruskal to work for an arbitrary independence system.
Algorithm 5.1.1. Let (E, S) be an independence system and w : E -t IR+
a weight function
Output: 0 4 12 19 21 11 9 8 14
Explanation: The distance from 0 to 1 = 4.
The minimum distance from 0 to 2 = 12. 0->1->2
The minimum distance from 0 to 3 = 19. 0->1->2->3
The minimum distance from 0 to 4 = 21. 0->7->6->5->4
The minimum distance from 0 to 5 = 11. 0->7->6->5
The minimum distance from 0 to 6 = 9. 0->7->6
The minimum distance from 0 to 7 = 8. 0->7
The minimum distance from 0 to 8 = 14. 0->1->2->8
Algorithm:
Algorithm :
Create a set sptSet (shortest path tree set) that keeps track of vertices included in the
shortest path tree, i.e., whose minimum distance from the source is calculated and
finalized. Initially, this set is empty.
Assign a distance value to all vertices in the input graph. Initialize all distance values as
INFINITE . Assign the distance value as 0 for the source vertex so that it is picked first.
o Pick a vertex u that is not there in sptSet and has a minimum distance value.
o Include u to sptSet .
o Then update the distance value of all adjacent vertices of u .
For every adjacent vertex v, if the sum of the distance value of u (from
source) and weight of edge u-v , is less than the distance value of v , then
update the distance value of v .
Note: We use a boolean array sptSet[] to represent the set of vertices included in SPT . If a
value sptSet[v] is true, then vertex v is included in SPT , otherwise not. Array dist[] is used to
store the shortest distance values of all vertices.
Step 1:
The set sptSet is initially empty and distances assigned to vertices are {0, INF, INF, INF,
INF, INF, INF, INF} where INF indicates infinite.
Now pick the vertex with a minimum distance value. The vertex 0 is picked, include it in
sptSet . So sptSet becomes {0}. After including 0 to sptSet , update distance values of its
adjacent vertices.
Adjacent vertices of 0 are 1 and 7. The distance values of 1 and 7 are updated as 4 and 8.
The following subgraph shows vertices and their distance values, only the vertices with finite distance
values are shown. The vertices included in SPT are shown in green colour.
Step 2:
Pick the vertex with minimum distance value and not already included in SPT (not in
sptSET ). The vertex 1 is picked and added to sptSet .
So sptSet now becomes {0, 1}. Update the distance values of adjacent vertices of 1.
Step 3:
Pick the vertex with minimum distance value and not already included in SPT (not in
sptSET ). Vertex 7 is picked. So sptSet now becomes {0, 1, 7}.
Update the distance values of adjacent vertices of 7. The distance value of vertex 6 and 8
becomes finite ( 15 and 9 respectively).
Step 4:
Pick the vertex with minimum distance value and not already included in SPT (not in
sptSET ). Vertex 6 is picked. So sptSet now becomes {0, 1, 7, 6} .
Update the distance values of adjacent vertices of 6. The distance value of vertex 5 and 8
are updated.
We repeat the above steps until sptSet includes all vertices of the given graph. Finally, we get the
following S hortest Path Tree (SPT).
Matroid Greedy Theorem
The Matroid Greedy Theorem is a fundamental result in combinatorial optimization that provides
conditions under which a greedy algorithm yields an optimal solution. Matroids are
mathematical structures that generalize the notion of linear independence in vector spaces and
provide a unifying framework for various optimization problems.
Definitions
2. Weight Function A function w: E →R that assigns a real number (weight) to each element of
E.
3. Greedy Algorithm for Matroids: Given a matroid M = (E,I) and a weight function w, the
greedy algorithm constructs a maximal independent set by iteratively adding the element with
the highest weight that maintains independence.
Proof Sketch
Examples
ican Journal of Mathematics. Vol 57. John Hopkins University Press, 1935.
ited, 1996.
Alvinaria, Alvinaria. "Dual pada Matroid." MATHunesa, vol. 2, no. 3, Aug. 2013.
Jungnickel, Dieter, and Dieter Jungnickel. "The greedy algorithm." Graphs, networks and
algorithms (1999): 129-153.