Professional Documents
Culture Documents
11111111
11111111
Objectives
1. To understand graph representation using the adjacency matrix
2. To implement Kruskal's MST algorithm using priority queue (heap), disjoint set, and
union-find functions
Problem Description
Implement Kruskal's MST algorithm on slide 17 of the DisjointSet lecture notes. The
"sort" operation at the beginning of the algorithm is actually creating the priority queue to
store all the edges.
Requirements
1. Store the input graph in an adjacency matrix.
2. Print out the edges in the MST and draw the picture of the MST.
4. You can either implement the priority queue using heap by yourself or use Java's
java.util.PriorityQueue class.
5. Use find3() and union3() discussed in the class to perform find and union, respectively.
6. Good documentation and style.
7. You are required to implement the algorithm on slide 17 of the DisjointSet lecture
notes. Using any other approach will result in zero point.
Test Cases
1. The following graph of four nodes and five edges.
Submission
1. Email the source program, executables, and the report to the instructor.
2. The report should include the names of files required to run your program, how to run
your program, the input adjacency matrices, the output (MST) and pictures, what you
learned from this project, any obstacle encountered, and any additional comments.
Grading
Correctness, requirements, test runs, documentation, and reports.