Consider the following greedy algorithm which finds an optimal set in a weighted matroid $(S; I)$.
- $A$ := $\phi$;;
- Sort the elements of $S$ in non-increasing order by weight: $s_1, s_2, ... ,s_m$;
- For $i$ := 1 to $m$ do:
3.1 if $A \cup {s_i} $ is independent
3.1.1 then $A := A \cup {s_i}$;
How exactly does this show that Kruskal's algorithm gives a minimum weight-spanning tree?
Suppose $B$ is a spanning tree of smaller weight. Let $s$ be the element of smallest weight in $B$ but not in $A$. Then $s$ cannot be independent of the elements of smaller weight, or it would have been added to $A$, contradiction.