Kruskal's algorithm
Builds on GraphConnected graphCycleSpanning treeMinimum spanning treeAlgorithm
Definition
Let be a finite connected graph and let be a weight function on its edges. Kruskal's algorithm is the following algorithm.
- List the edges as with .
- Start with the empty set .
- For in turn, add to if the graph has no cycle.
It returns , which is the edge set of a minimum spanning tree of .
Remarks
Example: let be the triangle on with , and . The algorithm adds and , and it rejects because form a cycle. The tree has weight , the least weight of a spanning tree of .
Non-example: if is not connected, no spanning tree exists. The same steps then return a minimum spanning forest, that is, a minimum spanning tree of each connected component.
Correctness follows from the cut property: a lightest edge crossing any partition of into two parts lies in some minimum spanning tree. With a disjoint-set (union-find) structure for the cycle test, the running time is .
Reading path
To understand this page from the ground up, read these 7 pages in order. The foundations come first.
Show the path as a graph
- no evidence level
- Algorithm concept
- Connected graph concept
- Cycle concept
- Graph concept
- Minimum spanning tree concept
- Spanning tree concept
- Kruskal's algorithm definition
Further reading
About this page
| Tag | ZQVQTP6E2K |
|---|---|
| URI | m2://ZQVQTP6E2K |
| Kind | definition |
| Writing | W0 stub |
| MSC | 05C85, 05C05, 90C27 |
| Defines | Kruskal's algorithm |
| Uses | Graph, Connected graph, Cycle, Spanning tree, Minimum spanning tree, Algorithm |
| Changed | 3 November 2026 |
Markdown · JSON · Edit on GitHub
What this page needs for W1
- an inventory row: the row of the inventory that the node accounts for (0 of 1)
- a source with a locator (0 of 1)
The writing levels say how complete the text of a page is. They do not measure its truth.
What links here
No page links to this page yet.