This is an implementation of the Kruskal's algorithm using the heap datastructure and the union find datastructure.
The heap datastructure is used to sort the vertices based on the weight. You can think of weight as a distance. The usage of union find speeds the check to see if a peer is already in the set or not.
Usage go run -input