Skip to content

Kruskal's minimum-spanning-tree algorithm implemented in Java

Notifications You must be signed in to change notification settings

ntyler1/KruskalMST

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Kruskal's minimum-spanning-tree algorithm implemented in Java

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages