0% found this document useful (0 votes)
2 views

Kru Skal

Kruskal's Algorithm is used to find the minimum spanning tree of a graph defined by its vertices and edges. The algorithm involves sorting the edges, constructing a forest, and iteratively adding the least cost edges while avoiding cycles until all vertices are visited. The final output includes the minimum spanning tree and its associated cost.

Uploaded by

Dugasa Bekele
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Kru Skal

Kruskal's Algorithm is used to find the minimum spanning tree of a graph defined by its vertices and edges. The algorithm involves sorting the edges, constructing a forest, and iteratively adding the least cost edges while avoiding cycles until all vertices are visited. The final output includes the minimum spanning tree and its associated cost.

Uploaded by

Dugasa Bekele
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Kruskal's Algorithm

The inputs taken by the kruskal’s algorithm are the graph G {V, E}, where V
is the set of vertices and E is the set of edges, and the source vertex S and
the minimum spanning tree of graph G is obtained as an output.

Algorithm
 Sort all the edges in the graph in an ascending order and store it in an
array edge[].
 Construct the forest of the graph on a plane with all the vertices in it.
 Select the least cost edge from the edge[] array and add it into the forest of
the graph. Mark the vertices visited by adding them into the visited[] array.
 Repeat the steps 2 and 3 until all the vertices are visited without having any
cycles forming in the graph
 When all the vertices are visited, the minimum spanning tree is formed.
 Calculate the minimum cost of the output spanning tree formed.

You might also like