Skip to content

Latest commit

 

History

History
13 lines (10 loc) · 1.14 KB

README.md

File metadata and controls

13 lines (10 loc) · 1.14 KB

Project Description

Java Program that uses Kruskal’s algorithm that finds a minimum spanning tree (MST) of an undirected weighted graph.

Project Features

  • Uses the unionFind strategy in its most efficient form.
  • Uses the greedy strategy
  • reads undirected weighted graph from input file via the command line. Input files consist of the following (see testUF.txt):
    • zero or more lines of comments begining with 'c '
    • followed by an integer that represents the number of nodes in the graph
    • then followed by one edge per line. A triplet of integers represents each edge, where the third integer is the weight of the edge between the first two integers. i.e. an edge 1 2 3 means that the weight of the edge between 1 and 2 is 3.
  • Outputs results to file (see testUFOutput.txt). Output file consists of the edges making the minnimum spanning tree along with the total weight of the MST.