Chapter 11: Minimum Spanning Trees and Connectivity. 26 sections.
26 items
You are given a connected undirected graph.
Minimum spanning tree algorithms repeatedly make local decisions.
The cut property identifies edges that can safely be added to a minimum spanning tree.
Given a connected weighted undirected graph, find a spanning tree whose total edge weight is minimum.
Kruskal's algorithm builds a minimum spanning tree by selecting edges globally.
Kruskal's algorithm grows a forest by processing edges globally.
Many graph algorithms repeatedly ask the same question: > Do these two vertices already belong to the same connected component?
The basic union-find structure can become highly unbalanced.
Path compression makes existing trees flatter, but it does not prevent bad trees from being created.
Suppose you are given a graph and thousands or millions of connectivity queries: ```text Are vertices u and v connected?
Offline connectivity works well when edges are fixed, or when all updates can be processed in a convenient order.
Minimum spanning trees minimize the **total weight** of selected edges.
A minimum spanning tree gives the cheapest way to connect all vertices.
You have a set of objects and pairwise distances between them.
Many real-world optimization problems can be modeled as graphs.
Minimum spanning tree algorithms are usually described in terms of `V` vertices and `E` edges.
Sparse graphs reward algorithms that touch only existing edges.
The classical MST algorithms were designed for a single machine processing a graph stored in local memory.
Minimum spanning tree algorithms are short.
Minimum spanning tree algorithms are easy to state, but their performance depends heavily on representation and data structure choices.
After studying cut properties, union-find, Kruskal, Prim, Borůvka, clustering, network design, and complexity analysis, a practical question remains: > How should MST algorithms actually be implemente...
Minimum spanning tree implementations can look correct while failing on small edge cases.
By this point, you have seen three major minimum spanning tree algorithms: ```text Kruskal Prim
Minimum spanning tree code often fails for reasons that are easy to miss in clean textbook examples.
Throughout this chapter, we have studied minimum spanning trees from multiple perspectives: * Graph theory * Greedy algorithms * Union-find
Minimum spanning tree algorithms become useful only after you can recognize the pattern in unfamiliar problems.