What is Minimum Spanning Tree (MST) (original) (raw)

Last Updated : 23 Jul, 2025

A **spanning tree is defined as a tree-like subgraph of a connected, undirected graph that includes all the vertices of the graph. Or, to say in Layman's words, it is a subset of the edges of the graph that forms a tree (**acyclic) where every node of the graph is a part of the tree.

The minimum spanning tree has all the properties of a spanning tree with an added constraint of having the minimum possible weights among all possible spanning trees. Like a spanning tree, there can also be many possible MSTs for a graph.

Minimum Spanning Tree (MST)

Properties of a Spanning Tree

The spanning tree holds the **below-mentioned principles:

To knowing about the properties of Minimum Spanning Tree, click here.

Minimum Spanning Tree

A **minimum spanning tree ****(MST)** is defined as a **spanning tree that has the minimum weight among all the possible spanning trees.

The minimum spanning tree has all the properties of a spanning tree with an added constraint of having the minimum possible weights among all possible spanning trees. Like a spanning tree, there can also be many possible MSTs for a graph.

Minimum Spanning Tree

Algorithms to find Minimum Spanning Tree

There are several algorithms to find the minimum spanning tree from a given graph, some of them are listed below:

Kruskal's Minimum Spanning Tree Algorithm

This is one of the popular algorithms for finding the minimum spanning tree from a connected, undirected graph. This is a greedy algorithm. The algorithm workflow is as below:

This algorithm can be implemented efficiently using a DSU (Disjoint-Set) data structure to keep track of the connected components of the graph. This is used in a variety of practical applications such as network design, clustering, and data analysis.

Follow the article on ****"Kruskal's Minimum Spanning Tree Algorithm"** for a better understanding and implementation of the algorithm.

Prim's Minimum Spanning Tree Algorithm:

This is also a greedy algorithm. This algorithm has the following workflow:

To efficiently select the minimum weight edge for each iteration, this algorithm uses priority_queue to store the vertices sorted by their minimum edge weight currently. It also simultaneously keeps track of the MST using an array or other data structure suitable considering the data type it is storing.

This algorithm can be used in various scenarios such as image segmentation based on color, texture, or other features. For Routing, as in finding the shortest path between two points for a delivery truck to follow.

Follow the article on ****"Prim's Minimum Spanning Tree Algorithm"** for a better understanding and implementation of this algorithm.

Boruvka's Minimum Spanning Tree Algorithm:

This is also a graph traversal algorithm used to find the minimum spanning tree of a connected, undirected graph. This is one of the oldest algorithms. The algorithm works by iteratively building the minimum spanning tree, starting with each vertex in the graph as its own tree. In each iteration, the algorithm finds the cheapest edge that connects a tree to another tree, and adds that edge to the minimum spanning tree. This is almost similar to the Prim's algorithm for finding the minimum spanning tree. The algorithm has the following workflow:

The algorithm can be implemented using a data structure such as a priority queue to efficiently find the cheapest edge between trees. Boruvka's algorithm is a simple and easy-to-implement algorithm for finding minimum spanning trees, but it may not be as efficient as other algorithms for large graphs with many edges.

Follow the article on ****"Boruvka's Minimum Spanning Tree Algorithm"** for a better understanding and implementation of this algorithm.

Applications of Minimum Spanning Trees:

Follow the article on ****"**Applications of Minimum Spanning Trees****"** for a better understanding.