In this study, we try to compare the performance of prim’s and Kruskal algorithm by constructing a minimum spanning tree containing all the nodes for which the total distance is minimum. Kruskal algorithm finds a minimum spanning forest of an undirected edge-weighted graph. It is a greedy algorithm in graph theory as in each step it adds the next lowest-weight edge that will not form a cycle to the minimum spanning forest. While, Prim’s algorithm is a greedy algorithm that finds a minimum spanning tree for a weighted undirected graph. It operates by building this tree one vertex at a time, from an arbitrary starting vertex, at each step adding the cheapest possible connection from the tree to another vertex. We use java to show the working of above two algorithm and MATLAB to show the visualization of above two algorithm using particle swarm optimization technique. Our project reveals that Prim’s algorithm runs faster in dense graphs and Kruskal’s algorithm runs faster in sparse graphs.
Stars
1
Forks
0
Watchers
1
Open Issues
0
Overall repository health assessment
No package.json found
This might not be a Node.js project
2
commits