KRUSKAL(G=(V,E), w)
- A = {}
- for each vertex $v \in V$
- MAKE-SET(v)
- sort the edges into nondecreasing order by weight w
- for each edge $(u,v) \in E$ in non-decreasing order
- if FIND-SET(u) ≠ FIND-SET(v)
- $A = A \cup \{u,v\}$
- UNION(FIND-SET(u), FIND-SET(v))
- return A