Search⌘ K

The Minimum Spanning Tree Problem

Get introduced to the minimum spanning tree problem.

Defining the problem

The minimum spanning tree (MST) problem deals with connected, weighted, undirected graphs G=(V,E,w)G = (V, E, w). Here, the weights can be interpreted as costs, and the goal is to select some subset of edges FEF \subseteq E that connect the nodes of VV in a cost-optimal way. In particular, we want

  • FF contains enough edges such that they connect all nodes of VV
  • the total cost of the edges in FF is as small as possible.

As an example, consider the following weighted graph:

g a a b b a--b 7 c c c--a 2 b--c 8 d d d--a 8 d--b 3 e e e--a 4 e--c 6
An example graph for the MST problem

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 FEF \subseteq E of minimal cost which connects VV. The solution is given below, with the edges of FF highlighted in blue:

g a a b b a--b 7 c c c--a 2 b--c 8 d d d--a 8 d--b 3 e e e--a 4 e--c 6
The minimum spanning tree of the example graph

The total cost of FF ...