An implementation of Kruskals algorithm to find the total weight of all edges in a minimum spanning tree.
To run a test first enter in the number of input values, then the matrix. In the tests provided above, the number that comes before the main matrix is the numbe of input values.
Example:
3
0 1 0
1 0 2
0 2 0
To compute the total weight of the minimum spanning tree for the above matrix, do the following.
Reading input values from stdin.
3
Reading graph 1
0 1 0
1 0 2
0 2 0