Kruskal algorithm without steps added