In Kruskal’s algorithm we need to find edge with the lowest weight at each step. Taking the worst case of a complete network there will be edges, which is equal to possible edges. Inspecting each edge to determine the one with the lowest weight is the most time consuming job so the number of inspections to complete the problem will give an indiation of the complexity of the algorithm.
1/2 n (n+1)
In the first round of inspections, all of the edges need to be inspected and compared. There will be comparisons to make.
In the second round of inspections, all of the edges, except the one already selected, need to be inspected and compared. There will be comparisons to make.
In a spanning tree for a network with nodes, there will be edges that will have to be selected. This would require the following number of comparisons to be made in total:
After messing about with all of the algebra you discover that this can also be written as:
It follows that Kruskal’s algorithm has cubic complexity.