Kruskal Algorithm

Domain: Algorithms

🎯 Motivation

Find the Minimum Spanning Tree (MST) of a graph: sort all edges by weight, add the smallest that does not form a cycle. Uses union-find.

📋 Concrete Example

Connect 5 offices with cheapest cables: sort all possible cable links by cost, add the cheapest that does not create a loop. Stop when all offices are connected.

🔗 Analogy

Building roads between villages: you always build the cheapest road that connects a new village to the network, never building a road that creates a redundant loop.