A topic in the Open Knowledge Graph — a free, open map of 15,290 topics and the order to learn them in.

Minimum Spanning Trees and Optimization

College Depth 84 in the knowledge graph I know this Set as goal
1topic build on this
402prerequisites beneath it
See this on the map →
Trees, Forests, and Spanning TreesMinimum Spanning Trees and Algorithms
graph-theory spanning-trees optimization

Core Idea

A minimum spanning tree (MST) of a weighted graph is a spanning tree with minimum total edge weight. MSTs can be found using greedy algorithms like Kruskal's or Prim's algorithm. Every connected weighted graph has at least one MST.

Explainer

From your study of trees and forests, you know that a spanning tree of a connected graph is a subgraph that includes all vertices and is itself a tree — connected and acyclic, with exactly n−1 edges for n vertices. A weighted graph assigns a cost to each edge, and the minimum spanning tree (MST) is the spanning tree whose total edge weight is as small as possible. Think of it as the cheapest network that keeps all nodes connected: the MST of a map of cities gives you the minimum-cost set of roads that lets you travel between any two cities.

The key theoretical insight behind MST algorithms is the cut property: given any partition of the graph's vertices into two groups (a "cut"), the minimum-weight edge crossing that cut must belong to every MST (assuming unique edge weights). This greedy property is what makes the problem tractable — you can make locally optimal edge choices and be guaranteed a globally optimal result.

Kruskal's algorithm exploits this by sorting all edges by weight and adding each one if it doesn't form a cycle (using a union-find data structure to check efficiently). Starting with n isolated vertices (a forest), you add the cheapest safe edge one at a time, growing toward a single connected tree. Prim's algorithm takes the opposite perspective: start with any single vertex and repeatedly add the cheapest edge that connects the current tree to a new vertex not yet included. Both algorithms are greedy and both produce an MST, but they differ in implementation: Kruskal's is edge-focused and works well for sparse graphs, while Prim's is vertex-focused and efficient with adjacency matrices or priority queues for dense graphs.

MSTs appear throughout applied mathematics and computer science: designing minimum-cost communication networks, approximating the traveling salesman problem (the MST gives a lower bound on the optimal tour), clustering (removing the heaviest MST edges creates natural clusters), and even modeling protein structures. The MST problem is one of the cleanest examples of a problem where a greedy algorithm is provably optimal — a lesson that carries into more advanced algorithm design.

Practice Questions 5 questions

Prerequisite Chain

Understanding ZeroThe Number ZeroCounting to FiveCounting to 10Counting to 20Counting a Set of Objects Up to 20Cardinality: The Last Number CountedMatching Numerals to QuantitiesSubitizing Small QuantitiesAddition Within 10Number Bonds to 10Addition Within 20Doubles and Near DoublesDoubles Facts Within 10Near Doubles Facts Within 20Mental Math Strategies for AdditionMental Math: Adding and Subtracting TensAddition Within 100Repeated Addition as MultiplicationMultiplication as Equal GroupsMultiplication: ArraysBasic Multiplication Facts (0s, 1s, 2s, 5s, 10s)Multiplication Facts Within 100Division as Equal SharingDivision as Grouping (Measurement Division)Division: Grouping (Repeated Subtraction) ModelDivision: Fair Sharing ModelDivision as Equal SharingDivision as GroupingBasic Division FactsDivision Facts Within 100Multiplication and Division Fact FamiliesRelationship Between Multiplication and DivisionDivision Facts as Inverse of MultiplicationRemainders and Quotients in DivisionDivision Word ProblemsMulti-Step Word ProblemsSolving Multi-Step Word ProblemsMultiplication Word ProblemsDivision Word ProblemsIntroduction to Long DivisionFactors and MultiplesPrime and Composite NumbersEquivalent FractionsRelating Fractions and DecimalsDecimal Place ValueIntegers and the Number LineComparing and Ordering IntegersAbsolute ValueAdding IntegersSubtracting IntegersMultiplying IntegersIntroduction to ExponentsOrder of OperationsInteger Order of OperationsVariable ExpressionsThe Distributive PropertyVariables and Expressions ReviewIntroduction to PolynomialsAdding and Subtracting PolynomialsMultiplying PolynomialsFactorialPermutationsCombinationsCounting Principles: Addition and Multiplication RulesIntroduction to Graph TheoryPropositional Logic FoundationsLogical EquivalencesSet Operations: Union, Intersection, and ComplementProof by CasesProving by Cases and ExhaustionVacuous Truth and Trivial CasesProof by Cases (Proof by Exhaustion)Mathematical InductionGraph Paths, Cycles, and ConnectivityTrees and Spanning TreesPlanar Graphs and Euler's FormulaGraph Coloring and the Chromatic NumberGraph Coloring and Chromatic NumbersBipartite Graphs and Matching ProblemsBipartite Graphs and 2-ColorabilityGraph Matching and Hall's Marriage TheoremNetwork Flows: Maximum Flow and Minimum CutTrees, Forests, and Spanning TreesMinimum Spanning Trees and Optimization

Longest path: 85 steps · 402 total prerequisite topics

Prerequisites (1)

Leads To (1)