Kruskals
Kruskal's algorithm, named after Joseph B. Kruskal who described it in 1956, is a greedy algorithm for finding a minimum spanning tree of a connected weighted graph. It can also produce a minimum spanning forest for disconnected graphs. The algorithm operates by considering edges in nondecreasing order of weight and adding an edge if it connects two previously disconnected components, thereby avoiding cycles.
The standard procedure is: sort all edges by weight, initialize a forest where each vertex is its
Time complexity is typically O(m log n), dominated by the initial sort of the edges, with near-constant
Applications include network design, such as laying out cheapest feasible wiring or fiber layouts, and hierarchical