Added Kruskal algorithm.