What’s an MST?

Learn about a minimum spanning tree of a graph.

A tree that spans the graph

The notion of a spanning tree is defined only for connected graphs. A spanning tree of a connected graph GG is a subgraph in GG that is a tree containing all vertices of GG.

For example, the subgraph of the following graph, highlighted in red, contains all vertices of the graph. It is also a tree since by definition of a tree, it contains no cycles and is connected. That makes it a spanning tree.

Get hands-on with 1400+ tech skills courses.