/Kruskal-MST

Implementing Kruskal's algorithm to find a Minimum Spanning Tree — C++

Primary LanguageC++

Kruskal-MST

Implementing Kruskal's algorithm to find a Minimum Spanning Tree in C++

This program inputs a weighted graph from a file. It stores the weights in a two-dimensional vector, and it stores the edges in a vector of struct Edge, which stores the two connecting vertices and the cost of the edge.

The program then implements Kruskal’s algorithm to find the minimum spanning tree of the graph. It creates the tree and then outputs each path, the weight of each path, and the total weight of the tree.