After running Kruskal, check if you added exactly edges. If you added fewer, the graph is disconnected. Some cities cannot be reached. This is a simple validation step. Count the edges in the MST. If count is less than , return "IMPOSSIBLE".
Otherwise, return the total weight. Kruskal stops when all edges are processed. If the forest has multiple trees, you know the graph is not connected. The edge count tells you everything.