Implementing Kruskal's Algo on a Graph