The Wayback Machine - https://web.archive.org/web/20241107013328/https://www.geeksforgeeks.org/properties-of-minimum-spanning-tree-mst/
Open In App

Properties of Minimum Spanning Tree (MST)

Last Updated : 26 Feb, 2023
Summarize
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

For a connected and undirected graph, a spanning tree of that graph is a subgraph that is a tree and connects all the vertices together. A single graph can have multiple spanning trees.

A Spanning Tree is a tree which have V vertices and V-1 edges. All nodes in a spanning tree are reachable from each other.

A Minimum Spanning Tree(MST) or minimum weight spanning tree for a weighted, connected, undirected graph is a spanning tree having a weight less than or equal to the weight of every other possible spanning tree. The weight of a spanning tree is the sum of weights given to each edge of the spanning tree. In short out of all spanning trees of a given graph, the spanning tree having minimum weight is MST.

Necessary conditions for Minimum Spanning Tree:

  1. It must not form a cycle i.e, no edge is traversed twice.
  2. There must be no other spanning tree with lesser weight.

In this article, we will discuss the properties of MST:

Possible Multiplicity:

If G(V, E) is a graph then every spanning tree of graph G consists of (V – 1) edges, where V is the number of vertices in the graph and E is the number of edges in the graph. So, (E – V + 1) edges are not a part of the spanning tree. There may be several minimum spanning trees of the same weight. If all the edge weights of a graph are the same, then every spanning tree of that graph is minimum.

Consider a complete graph of three vertices and all the edge weights are the same then there will be three spanning trees(which are also minimal) of the same path length are possible. Below is the image to illustrate the same:

Each of the spanning trees has the same weight equal to 2.

Cut property:

For any cut C of the graph, if the weight of an edge E in the cut-set of C is strictly smaller than the weights of all other edges of the cut-set of C, then this edge belongs to all the MSTs of the graph. Below is the image to illustrate the same:

Cycle property:

For any cycle C in the graph, if the weight of an edge E of C is larger than the individual weights of all other edges of C, then this edge cannot belong to an MST. In the above figure, in cycle ABD, edge BD can not be present in any minimal spanning tree because it has the largest weight among all the edges in the cycle.

Uniqueness:

If each edge has a distinct weight then there will be only one, i.e., a unique minimum spanning tree.

Minimum Cost Subgraph

For all the possible spanning trees, the minimum spanning tree must have the minimum weight possible. However, there may exist some more spanning with the same weight that of minimum spanning tree, and those all may also be considered as Minimum Spanning tree.

  • Minimum Cost Edge: If the minimum cost edge of a graph is unique, then this edge is included in any MST. For example, in the above figure, the edge AB (of the least weight) is always included in MST.
  • If a new edge is added to the spanning tree then it will become cyclic because every spanning tree is minimally acyclic. In the above figure, if edge AD or BC is added to the resultant MST, then it will form a cycle.
  • The spanning tree is minimally connected, i.e., if any edge is removed from the spanning tree it will disconnect the graph. In the above figure, if any edge is removed from the resultant MST, then it will disconnect the graph.

Algorithms for finding Minimum Spanning Tree(MST):-

  1. Prim’s Algorithm
  2. Kruskal’s Algorithm


Similar Reads

Kruskal’s Minimum Spanning Tree (MST) Algorithm
A minimum spanning tree (MST) or minimum weight spanning tree for a weighted, connected, undirected graph is a spanning tree with a weight less than or equal to the weight of every other spanning tree. To learn more about Minimum Spanning Tree, refer to this article. Introduction to Kruskal's Algorithm:Here we will discuss Kruskal's algorithm to fi
15+ min read
What is Minimum Spanning Tree (MST)
A minimum spanning tree (MST) is defined as a spanning tree that has the minimum weight among all the possible spanning trees 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 (acycl
7 min read
Prim’s Algorithm for Minimum Spanning Tree (MST)
Introduction to Prim's algorithm:We have discussed Kruskal's algorithm for Minimum Spanning Tree. Like Kruskal's algorithm, Prim’s algorithm is also a Greedy algorithm. This algorithm always starts with a single node and moves through several adjacent nodes, in order to explore all of the connected edges along the way. The algorithm starts with an
15+ min read
Spanning Tree vs Minimum Spanning Tree
Spanning Tree (ST):A spanning tree of a graph is a subgraph that includes all the vertices of the original graph and is also a tree (a connected acyclic graph). The primary goal of a spanning tree is to connect all vertices with the minimum number of edges. Uses of Spanning Tree: STs are used in network design and routing algorithms to ensure conne
2 min read
Boruvka's algorithm for Minimum Spanning Tree
Following two algorithms are generally taught for Minimum Spanning Tree (MST) problem. Prim's algorithm Kruskal's algorithm There is a third algorithm called Boruvka's algorithm for MST which (like the above two) is also Greedy algorithm. The Boruvka's algorithm is the oldest minimum spanning tree algorithm was discovered by Boruvka in 1926, long b
1 min read
Algorithms | Graph Minimum Spanning Tree | Question 1
An undirected graph G(V, E) contains n ( n > 2 ) nodes named v1 , v2 ,….vn. Two nodes vi , vj are connected if and only if 0 < |i – j| <= 2. Each edge (vi, vj ) is assigned a weight i + j. A sample graph with n = 4 is shown below. What will be the cost of the minimum spanning tree (MST) of such a graph with n nodes? (GATE CS 2011) (A) 1/12
1 min read
Algorithms | Graph Minimum Spanning Tree | Question 2
The length of the path from v5 to v6 in the MST of previous question with n = 10 is (A) 11 (B) 25 (C) 31 (D) 41 Answer: (C) Explanation: See question 2 of https://www.geeksforgeeks.org/data-structures-and-algorithms-set-27/ for explanation.Quiz of this Question
1 min read
Algorithms | Graph Minimum Spanning Tree | Question 3
Consider a complete undirected graph with vertex set {0, 1, 2, 3, 4}. Entry Wij in the matrix W below is the weight of the edge {i, j}. What is the minimum possible weight of a spanning tree T in this graph such that vertex 0 is a leaf node in the tree T? (GATE CS 2010) (A) 7 (B) 8 (C) 9 (D) 10 Answer: (D) Explanation: To get the minimum spanning t
1 min read
Algorithms | Graph Minimum Spanning Tree | Question 4
In the graph given in above question, what is the minimum possible weight of a path P from vertex 1 to vertex 2 in this graph such that P contains at most 3 edges? (A) 7 (B) 8 (C) 9 (D) 10 Answer: (B)Explanation: Path: 1 -> 0 -> 4 -> 2 Weight: 1 + 4 + 3 Quiz of this QuestionPlease comment below if you find anything wrong in the above post
1 min read
Algorithms | Graph Minimum Spanning Tree | Question 5
An undirected graph G has n nodes. Its adjacency matrix is given by an n × n square matrix whose (i) diagonal elements are 0‘s and (ii) non-diagonal elements are 1‘s. which one of the following is TRUE? (A) Graph G has no minimum spanning tree (MST) (B) Graph G has a unique MST of cost n-1 (C) Graph G has multiple distinct MSTs, each of cost n-1 (D
2 min read
Algorithms | Graph Minimum Spanning Tree | Question 6
Consider the following graph: Which one of the following cannot be the sequence of edges added, in that order, to a minimum spanning tree using Kruskal’s algorithm? (A) (a—b),(d—f),(b—f),(d—c),(d—e) (B) (a—b),(d—f),(d—c),(b—f),(d—e) (C) (d—f),(a—b),(d—c),(b—f),(d—e) (D) (d—f),(a—b),(b—f),(d—e),(d—c) Answer: (D) Explanation: The edge (d-e) cannot be
1 min read
Algorithms | Graph Minimum Spanning Tree | Question 7
Let G be an undirected connected graph with distinct edge weight. Let emax be the edge with maximum weight and emin the edge with minimum weight. Which of the following statements is false? (GATE CS 2000) (A) Every minimum spanning tree of G must contain emin (B) If emax is in a minimum spanning tree, then its removal must disconnect G (C) No minim
1 min read
Algorithms | Graph Minimum Spanning Tree | Question 8
Consider a weighted complete graph G on the vertex set {v1,v2 ,v} such that the weight of the edge (v,,v) is 2|i-j|. The weight of a minimum spanning tree of G is: (GATE CS 2006) (A) n — 1 (B) 2n — 2 (C) nC2 (D) 2 Answer: (B) Explanation: Minimum spanning tree of such a graph is v1 \ v2 \ v3 \ v4 . . . vn Weight of the minimum spanning tree = 2|2 -
1 min read
Minimum spanning tree cost of given Graphs
Given an undirected graph of V nodes (V > 2) named V1, V2, V3, ..., Vn. Two nodes Vi and Vj are connected to each other if and only if 0 < | i - j | ? 2. Each edge between any vertex pair (Vi, Vj) is assigned a weight i + j. The task is to find the cost of the minimum spanning tree of such graph with V nodes. Examples: Input: V = 4 Output: 13
4 min read
Find the minimum spanning tree with alternating colored edges
Given a graph with N nodes and M edges where each edge has a color (either black or green) and a cost associated with it. Find the minimum spanning tree of the graph such that every path in the tree is made up of alternating colored edges. Examples: Input: N = 3, M = 4 Output: 6 Input: N = 4, M = 6 Output: 4 Approach: The first observation we make
8 min read
Minimum Spanning Tree using Priority Queue and Array List
Given a bi-directed weighted (positive) graph without self-loops, the task is to generate the minimum spanning tree of the graph.Examples: Input: N = 9, E = 14, edges = {{0, 1, 4}, {0, 7, 8}, {1, 2, 8}, {1, 7, 11}, {2, 3, 7}, {2, 8, 2}, {2, 5, 4}, {3, 4, 9}, {3, 5, 14}, {4, 5, 10}, {5, 6, 2}, {6, 7, 1}, {6, 8, 6}, {7, 8, 7}} Output: ((A, B), Cost)
5 min read
Second Best Minimum Spanning Tree
Prerequisites - Graph, Spanning tree, Disjoint Set (Union - Find). A minimum spanning tree (MST) T, for a given graph G, spans over all vertices of a given graph and has minimum weight sum of all edges, out of all the possible spanning trees. Second best MST, T’, is a spanning tree with the second minimum weight sum of all edges, out of all spannin
15+ min read
Difference between Minimum Spanning Tree and Shortest Path
Spanning tree: A spanning tree (T) of an undirected graph(G) is a subgraph which is a tree that includes all the vertices of a graph (G) and the minimum number of edges required to connect the graph (G). And it is a known maximal set of edges with no cycles. Properties: If a graph(G) is not connected then it does not contain a spanning tree (i.e. i
4 min read
Check if an edge is a part of any Minimum Spanning Tree
Given a connected undirected weighted graph in the form of a 2D array where each row is of the type [start node, end node, weight] describing an edge, and also two integers (A, B). Return if the edge formed between (A, B) is a part of any of the Minimum Spanning Tree (MST) of the graph. Minimum Spanning Tree (MST): This is a special subgraph of the
13 min read
Applications of Minimum Spanning Tree
A Minimum Spanning Tree (MST) is a subset of the edges of a connected, undirected graph that connects all the vertices together, without any cycles and with the minimum possible total edge weight. It is a way to connect all the vertices in a graph in a way that minimizes the total weight of the edges in the tree. MST is a fundamental problem with d
3 min read
Minimum Bottleneck Spanning Tree(MBST)
The minimum bottleneck spanning tree in an undirected graph is a tree whose most expensive edge is as minimum as possible. In this article, we will understand more about how to identify a minimum bottleneck spanning tree and understand that every minimum spanning tree is a minimum bottleneck spanning tree. A minimum spanning tree is completely diff
4 min read
Which Minimum Spanning Tree Algorithm is better?
A spanning tree is defined as a tree-like sub-graph of a connected, undirected graph that includes all the graph's vertices. Or, 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 e tree. A fixed number of edges in the spanning tree . Properties of a Spanning TreeTh
6 min read
Kruskal's Minimum Spanning Tree using STL in C++
Given an undirected, connected and weighted graph, find Minimum Spanning Tree (MST) of the graph using Kruskal's algorithm. Input : Graph as an array of edges Output : Edges of MST are 6 - 7 2 - 8 5 - 6 0 - 1 2 - 5 2 - 3 0 - 7 3 - 4 Weight of MST is 37 Note : There are two possible MSTs, the other MST includes edge 1-2 in place of 0-7. We have disc
6 min read
Minimum Product Spanning Tree
Given a connected and undirected graph, a spanning tree of that graph is a subgraph that is a tree and connects all the vertices together. A single graph can have many different spanning trees. A minimum product spanning tree for a weighted, connected, and undirected graph is a spanning tree with a weight product less than or equal to the weight pr
15+ min read
Reverse Delete Algorithm for Minimum Spanning Tree
Reverse Delete algorithm is closely related to Kruskal's algorithm. In Kruskal's algorithm what we do is : Sort edges by increasing order of their weights. After sorting, we one by one pick edges in increasing order. We include current picked edge if by including this in spanning tree not form any cycle until there are V-1 edges in spanning tree, w
14 min read
Find the weight of the minimum spanning tree
Given a connected undirected weighted graph with N nodes and M edges. The task is to perform given queries and find the weight of the minimum spanning tree. Queries are of three types:   query(1) -> Find the weight of the minimum spanning tree.query(2, x, y) -> Change the weight of the edge between the nodes x and y to 0.query(3, x, y) ->
14 min read
Approximate solution for Travelling Salesman Problem using MST
We introduced Travelling Salesman Problem and discussed Naive and Dynamic Programming Solutions for the problem in the previous post,. Both of the solutions are infeasible. In fact, there is no polynomial time solution available for this problem as the problem is a known NP-Hard problem. There are approximate algorithms to solve the problem though.
3 min read
Why Prim’s and Kruskal's MST algorithm fails for Directed Graph?
Pre-requisites: Graph and its representations Greedy Algorithms | Set 5 (Prim’s Minimum Spanning Tree (MST)) Kruskal’s Minimum Spanning Tree Algorithm | Greedy Algo-2 Given a directed graph D = < V, E >, the task is to find the minimum spanning tree for the given directed graph Example: But the Prim's Minimum Spanning Tree and Kruskal's algor
2 min read
Find weight of MST in a complete graph with edge-weights either 0 or 1
Given an undirected weighted complete graph of N vertices. There are exactly M edges having weight 1 and rest all the possible edges have weight 0. The array arr[][] gives the set of edges having weight 1. The task is to calculate the total weight of the minimum spanning tree of this graph. Examples: Input: N = 6, M = 11, arr[][] = {(1 3), (1 4), (
10 min read
Prim’s MST for Adjacency List Representation | Greedy Algo-6
We recommend reading the following two posts as a prerequisite to this post. Greedy Algorithms | Set 5 (Prim’s Minimum Spanning Tree (MST)) Graph and its representationsWe have discussed Prim's algorithm and its implementation for adjacency matrix representation of graphs. The time complexity for the matrix representation is O(V^2). In this post, O
15+ min read
three90RightbarBannerImg