A question on Kruskal's Algorithm

67 Views Asked by At

Consider the following greedy algorithm which finds an optimal set in a weighted matroid $(S; I)$.

  1. $A$ := $\phi$;;
  2. Sort the elements of $S$ in non-increasing order by weight: $s_1, s_2, ... ,s_m$;
  3. 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?

1

There are 1 best solutions below

0
On

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.