Weighted Undirected Graphs and Kruskal's algorithm Implementation