Advanced Topic 38 of 51 Algorithms
Minimum Spanning Tree
Cheapest set of edges connecting all vertices.
How it works
A minimum spanning tree of a connected, weighted, undirected graph is a subset of edges that connects all vertices with no cycles and has the smallest possible total weight. It has V minus 1 edges. The cut property and cycle property justify greedy algorithms like Kruskal's and Prim's, and if all weights are distinct the tree is unique.
Where it is used
Designing low-cost networks of cables, pipelines or roads, clustering data, approximating the traveling salesman problem, image segmentation and laying out circuits use minimum spanning trees.
Common pitfall
It applies to undirected graphs; directed graphs need minimum arborescences instead. A disconnected graph has a spanning forest, not a tree. Tied weights can give several valid trees. A minimum spanning tree does not give shortest paths between vertices, a common confusion with Dijkstra.
Where it fits in the course
Minimum Spanning Tree is topic 38 of 51 in Algorithms, rated Advanced. It follows A* Search. The next topic is Kruskal's Algorithm.
Practice and explore
- Open the interactive lesson, with a mini quiz.
- Take the Algorithms quiz.
- Explore the Graph Traversal visualizer: BFS, DFS and Dijkstra on a weighted graph.
How to study this topic
- Read the explanation above and restate the definition in your own words.
- Open the interactive lesson and answer its mini quiz.
- Read the common pitfall, then write a short example that avoids it.
- Check your understanding in the Algorithms quiz, and revisit the topic if you miss a question.
Frequently asked questions
What is Minimum Spanning Tree?
Where do people use Minimum Spanning Tree?
What is the most common mistake with Minimum Spanning Tree?
What should I learn before this topic?
How can I practice it?
Is Minimum Spanning Tree hard to learn?
How long does it take to learn Minimum Spanning Tree?
Which topics are related to Minimum Spanning Tree?
What should I study after Minimum Spanning Tree?
Related topics
- A* Search (Algorithms)
- Kruskal's Algorithm (Algorithms)
- Floyd-Warshall Algorithm (Algorithms)
- Prim's Algorithm (Algorithms)
- Tree Traversals (Data Structures)