Write a program that determines a Minimum Spanning Tree (MST) for a graph using Kruskal's algorithm. Your should be read a description of a graph from a text file as follows :
1 {[neighbor (int)] [weight of edge (int)]}* 2 {[neighbor (int)] [weight of edge (int)]}* 3 {[neighbor (int)] [weight of edge (int)]}* 4 {[neighbor (int)] [weight of edge (int)]}* 5 {[neighbor (int)] [weight of edge (int)]}* ... N-1 {[neighbor (int)] [weight of edge (int)]}* {}* means "repeat 0 or more times.
So, an example graph of 5 nodes might be described by :
5 1 2 500 3 600 4 20 5 60 2 3 70 4 80 5 10 3 4 40 5 700 4 5 50
Run your algorithm on graphs of your own design of different sizes. Plot the run time (in terms of # of comparisons) as a function of the graph size. Compare this to the theoretical results and discuss the comparison in your README file.
For extra credit, plot the nodes and edges on an applet with the MST edges in a different color.