The Minimum Spanning Tree Problem
Explore the minimum spanning tree problem and understand how to identify the lowest cost subset of edges connecting all nodes in a weighted, undirected graph. Learn the properties of trees and why the MST ensures connectivity with minimal cost. This lesson also introduces Kruskal's algorithm as a method to compute MST solutions effectively.
We'll cover the following...
Defining the problem
The minimum spanning tree (MST) problem deals with connected, weighted, undirected graphs . Here, the weights can be interpreted as costs, and the goal is to select some subset of edges that connect the nodes of in a cost-optimal way. In particular, we want
- contains enough edges such that they connect all nodes of
- the total cost of the edges in is as small as possible.
As an example, consider the following weighted graph:
We can think of the nodes as representing cities, and the edges representing distances between them. Now, assume that we want to build a railroad network to connect these cities. Laying down train tracks is expensive, so we’ll want to find a way to connect all the nodes using the existing edges while keeping the total edge cost to a minimum.
In fact, this translates to finding a subset of minimal cost which connects . The solution is given below, with the edges of highlighted in blue:
The total cost of ...