0% found this document useful (0 votes)
2 views

Minimum Spanning Tree in Data Structures (1)

A Minimum Spanning Tree (MST) is a subset of edges in a connected weighted undirected graph that connects all vertices with the lowest total edge weight, which can be derived using Prim’s or Kruskal’s algorithm. Each graph can have multiple spanning trees, and if edges have duplicate weights, it may result in multiple MSTs. A spanning tree must have n - 1 edges for n vertices, and the document illustrates an example of a spanning tree that is not the minimum spanning tree.

Uploaded by

ashwini biradar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Minimum Spanning Tree in Data Structures (1)

A Minimum Spanning Tree (MST) is a subset of edges in a connected weighted undirected graph that connects all vertices with the lowest total edge weight, which can be derived using Prim’s or Kruskal’s algorithm. Each graph can have multiple spanning trees, and if edges have duplicate weights, it may result in multiple MSTs. A spanning tree must have n - 1 edges for n vertices, and the document illustrates an example of a spanning tree that is not the minimum spanning tree.

Uploaded by

ashwini biradar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Minimum Spanning Tree in Data Structures

Data Structure Algorithms Analysis of Algorithms Algorithms

A spanning tree is a subset of an undirected Graph that has all the vertices connected
by minimum number of edges.

If all the vertices are connected in a graph, then there exists at least one spanning tree.
In a graph, there may exist more than one spanning tree.

Minimum Spanning Tree


A Minimum Spanning Tree (MST) is a subset of edges of a connected weighted
undirected graph that connects all the vertices together with the minimum possible total
edge weight. To derive an MST, Prim’s algorithm or Kruskal’s algorithm can be used.
Hence, we will discuss Prim’s algorithm in this chapter.

As we have discussed, one graph may have more than one spanning tree. If there are n
number of vertices, the spanning tree should have n - 1 number of edges. In this
context, if each edge of the graph is associated with a weight and there exists more than
one spanning tree, we need to find the minimum spanning tree of the graph.

Moreover, if there exist any duplicate weighted edges, the graph may have multiple
minimum spanning tree.
In the above graph, we have shown a spanning tree though it’s not the minimum
spanning tree. The cost of this spanning tree is (5 + 7 + 3 + 3 + 5 + 8 + 3 + 4) = 38.

You might also like