Next: Proof Of Correctness
Up: KRUSKAL'S ALGORITHM
Previous: KRUSKAL'S ALGORITHM
- Operations:
- UNION(i,j), of sets i and j, contains elements of sets i
and j
- FIND
iff
set i
- a) Construct a min-heap E of edges in E
- b) Each
forms singleton set by itself, such that
FIND
.
- c)
{Tree is empty}
- d) while
do
- Delete the root edge {v,w} from min-heap E and restore
heap E
- if FIND
FIND
has no
cycle*/
- then
/*now, combine the components of
joined by {v,w}
into one*/
- UNION ( FIND(v), FIND(w))
- end if
end while
Sushil Prasad
Thu Nov 4 14:09:59 EST 1999