SlideShare a Scribd company logo
MINIMUM
SPANNING TREE
By Raksha kanwar
SPANNING TREE
A spanning tree of an undirected graph is a
subgraph that includes all the vertices of the
original graph connected with the minimum
number of edges, ensuring no cycles are
present.
MINIMUM SPANNING TREE
Given a connected, undirected graph G=(V,E) with weighted edges, a
Minimum Spanning Tree is a spanning tree that:
Connects all vertices: Ensures there is a path between any pair of
nodes.
Is acyclic: Contains no cycles, maintaining the tree structure.
Has minimal total edge weight: The sum of the weights of its edges is
the smallest among all possible spanning trees of the graph.
For a graph with v vertices, any spanning tree, including the MST, will
have exactly (V−1) edges.
Definition
GRAPH:MST
Fig1:MST
PROPERTIES:MST
Uniqueness: If all edge weights are distinct, the MST is unique.
Multiple MSTs: If edge weights are not unique, there may be
multiple MSTs with the same total weight.
Cycle Property: For any cycle in the graph, the edge with
the highest weight in that cycle does not belong to the MST.
Cut Property: For any cut in the graph, the edge with the
smallest weight crossing the cut is included in the MST.
ALGORITHNMS
Two primary greedy
algorithms are used to
compute the MST:
1. Kruskal’s Algorithm
2.Prim’s Algorithm
KRUSKAL’S ALGORITHM
Below are the steps for finding MST using Kruskal’s algorithm:
Sort all the edges in a non-decreasing order of their
weight.
Pick the smallest edge. Check if it forms a cycle with the
spanning tree formed so far. If the cycle is not formed,
include this edge. Else, discard it.
Repeat step 2 until there are (V-1) edges in the spanning
tree.
EXAMPLE
Fig2:eg of kruskal’s algo
Greedy Approach: Selects the smallest-weight edge that
doesn't form a cycle to construct the Minimum Spanning Tree
(MST).
Edge-Centric: Emphasizes edges rather than vertices, making it
particularly effective for sparse graphs.
Cycle Detection: Uses the Union-Find data structure to efficiently
merge disjoint sets and prevent cycles.
Time Complexity: Runs in O(E log V) time, thanks to edge sorting
and near-constant time Union-Find operations.
Key Characteristics
PRIM’S ALGORITHM
The steps how prim’s algorithm works are below:
Choose a starting point – Pick any vertex to begin, like 0.
Find new connections – Look at all the vertices not yet included in
the tree.
Check available edges – Find edges connecting the tree to those
new vertices.
Pick the smallest edge – Choose the edge with the least weight.
Add it to the tree – Bring the connected vertex into the growing MST.
Since we only add edges that connect new vertices, there are no
loops.
Repeat until done – Keep adding edges until all vertices are
included, then return the final MST.
EXAMPLE
Fig3:eg prim’s algorithm
Greedy approach – Always selects the smallest edge.
Incremental growth – Expands the MST one edge at a time.
No cycles – Ensures an acyclic spanning tree.
Works with weighted graphs – Requires a connected,
weighted, undirected graph.
Efficient with priority queue – Optimized using a min-heap.
Time complexity – Runs in O(V²) with an adjacency matrix, or
O(E log V) with a priority queue.
Key Characteristics
DIFFERENCE
APPLICATIONS OF MST
Internet & Network Connections – Helps design cost-effective
layouts for laying cables and setting up Wi-Fi networks.
Road Planning – Used to find the shortest way to connect cities or
towns with minimal road length.
Electricity Distribution – Helps power companies create efficient
grids to supply electricity with fewer cables.
Water Supply Systems – Used to design pipeline networks that
connect homes and cities with minimal material cost.
Cluster Analysis in AI – Helps group similar data points, like
organizing images or sorting customer preferences.
THANK YOU

More Related Content

PPTX
Presentation.pptx
PPTX
Minimal spanning tree class 15
PDF
Minimum-Spanning-Tree.pdf ramswaroop memorial University
PDF
Ijciras1101
PPTX
_A C program for Prim's Minimum Spanning Tree (MST) algorithm. The program is...
PDF
A NEW PARALLEL ALGORITHM FOR COMPUTING MINIMUM SPANNING TREE
PDF
A NEW PARALLEL ALGORITHM FOR COMPUTING MINIMUM SPANNING TREE
PPTX
Minimum spanning tree.pptx data structure programming
Presentation.pptx
Minimal spanning tree class 15
Minimum-Spanning-Tree.pdf ramswaroop memorial University
Ijciras1101
_A C program for Prim's Minimum Spanning Tree (MST) algorithm. The program is...
A NEW PARALLEL ALGORITHM FOR COMPUTING MINIMUM SPANNING TREE
A NEW PARALLEL ALGORITHM FOR COMPUTING MINIMUM SPANNING TREE
Minimum spanning tree.pptx data structure programming

Similar to Minimum Spanning Tree in design and analysis (20)

PPTX
Lecture 5.2 - 6.1 MINIMUM SPANNING TREE.pptx
PPTX
1 sollins algorithm
PPTX
Minimum Spinning Tree Full Explaination pptx
PPTX
MSadfadsfafdadfccadradfT_Presentation.pptx
PDF
OTP, Phishing, QR code, Shares, Visual Cryptography.
PPTX
Greedy Strategy.pptxbfasjbjfn asnfn anjn
PPTX
APznzaZLM_MVouyxM4cxHPJR5BC-TAxTWqhQJ2EywQQuXStxJTDoGkHdsKEQGd4Vo7BS3Q1npCOMV...
PDF
lecture 23 algorithm design and analysis
PPTX
Data structure
PPT
Graph Theory PPT presentation created by Selvam.
PPTX
Ram minimum spanning tree
PDF
19 Minimum Spanning Trees
PPTX
GRAPH - DISCRETE STRUCTURE AND ALGORITHM
PPT
Minimum spanning tree
PPT
Greedy Approach in Design Analysis and Algorithms
PDF
Minimum Spanning Tree (MST), Kruskal's algorithm and Prim's Algorithm, and th...
PPTX
DATA STRUCTURE AND ALGORITHM LMS MST KRUSKAL'S ALGORITHM
PPTX
Minimum spanning tree
PPTX
Greedy technique - Algorithm design techniques using data structures
PPTX
Data Structures and Algorithms Kruskals algorithm
Lecture 5.2 - 6.1 MINIMUM SPANNING TREE.pptx
1 sollins algorithm
Minimum Spinning Tree Full Explaination pptx
MSadfadsfafdadfccadradfT_Presentation.pptx
OTP, Phishing, QR code, Shares, Visual Cryptography.
Greedy Strategy.pptxbfasjbjfn asnfn anjn
APznzaZLM_MVouyxM4cxHPJR5BC-TAxTWqhQJ2EywQQuXStxJTDoGkHdsKEQGd4Vo7BS3Q1npCOMV...
lecture 23 algorithm design and analysis
Data structure
Graph Theory PPT presentation created by Selvam.
Ram minimum spanning tree
19 Minimum Spanning Trees
GRAPH - DISCRETE STRUCTURE AND ALGORITHM
Minimum spanning tree
Greedy Approach in Design Analysis and Algorithms
Minimum Spanning Tree (MST), Kruskal's algorithm and Prim's Algorithm, and th...
DATA STRUCTURE AND ALGORITHM LMS MST KRUSKAL'S ALGORITHM
Minimum spanning tree
Greedy technique - Algorithm design techniques using data structures
Data Structures and Algorithms Kruskals algorithm
Ad

Recently uploaded (20)

PPTX
Sustainable Sites - Green Building Construction
PPTX
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
PDF
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
PDF
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
PPTX
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
DOCX
573137875-Attendance-Management-System-original
PDF
Digital Logic Computer Design lecture notes
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
PPTX
Internet of Things (IOT) - A guide to understanding
PPTX
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
PPT
CRASH COURSE IN ALTERNATIVE PLUMBING CLASS
PDF
Operating System & Kernel Study Guide-1 - converted.pdf
PDF
composite construction of structures.pdf
PPTX
Construction Project Organization Group 2.pptx
PPTX
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
Sustainable Sites - Green Building Construction
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
573137875-Attendance-Management-System-original
Digital Logic Computer Design lecture notes
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
CYBER-CRIMES AND SECURITY A guide to understanding
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
Embodied AI: Ushering in the Next Era of Intelligent Systems
Internet of Things (IOT) - A guide to understanding
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
UNIT-1 - COAL BASED THERMAL POWER PLANTS
CRASH COURSE IN ALTERNATIVE PLUMBING CLASS
Operating System & Kernel Study Guide-1 - converted.pdf
composite construction of structures.pdf
Construction Project Organization Group 2.pptx
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
Ad

Minimum Spanning Tree in design and analysis

  • 2. SPANNING TREE A spanning tree of an undirected graph is a subgraph that includes all the vertices of the original graph connected with the minimum number of edges, ensuring no cycles are present.
  • 3. MINIMUM SPANNING TREE Given a connected, undirected graph G=(V,E) with weighted edges, a Minimum Spanning Tree is a spanning tree that: Connects all vertices: Ensures there is a path between any pair of nodes. Is acyclic: Contains no cycles, maintaining the tree structure. Has minimal total edge weight: The sum of the weights of its edges is the smallest among all possible spanning trees of the graph. For a graph with v vertices, any spanning tree, including the MST, will have exactly (V−1) edges. Definition
  • 5. PROPERTIES:MST Uniqueness: If all edge weights are distinct, the MST is unique. Multiple MSTs: If edge weights are not unique, there may be multiple MSTs with the same total weight. Cycle Property: For any cycle in the graph, the edge with the highest weight in that cycle does not belong to the MST. Cut Property: For any cut in the graph, the edge with the smallest weight crossing the cut is included in the MST.
  • 6. ALGORITHNMS Two primary greedy algorithms are used to compute the MST: 1. Kruskal’s Algorithm 2.Prim’s Algorithm
  • 7. KRUSKAL’S ALGORITHM Below are the steps for finding MST using Kruskal’s algorithm: Sort all the edges in a non-decreasing order of their weight. Pick the smallest edge. Check if it forms a cycle with the spanning tree formed so far. If the cycle is not formed, include this edge. Else, discard it. Repeat step 2 until there are (V-1) edges in the spanning tree.
  • 9. Greedy Approach: Selects the smallest-weight edge that doesn't form a cycle to construct the Minimum Spanning Tree (MST). Edge-Centric: Emphasizes edges rather than vertices, making it particularly effective for sparse graphs. Cycle Detection: Uses the Union-Find data structure to efficiently merge disjoint sets and prevent cycles. Time Complexity: Runs in O(E log V) time, thanks to edge sorting and near-constant time Union-Find operations. Key Characteristics
  • 10. PRIM’S ALGORITHM The steps how prim’s algorithm works are below: Choose a starting point – Pick any vertex to begin, like 0. Find new connections – Look at all the vertices not yet included in the tree. Check available edges – Find edges connecting the tree to those new vertices. Pick the smallest edge – Choose the edge with the least weight. Add it to the tree – Bring the connected vertex into the growing MST. Since we only add edges that connect new vertices, there are no loops. Repeat until done – Keep adding edges until all vertices are included, then return the final MST.
  • 12. Greedy approach – Always selects the smallest edge. Incremental growth – Expands the MST one edge at a time. No cycles – Ensures an acyclic spanning tree. Works with weighted graphs – Requires a connected, weighted, undirected graph. Efficient with priority queue – Optimized using a min-heap. Time complexity – Runs in O(V²) with an adjacency matrix, or O(E log V) with a priority queue. Key Characteristics
  • 14. APPLICATIONS OF MST Internet & Network Connections – Helps design cost-effective layouts for laying cables and setting up Wi-Fi networks. Road Planning – Used to find the shortest way to connect cities or towns with minimal road length. Electricity Distribution – Helps power companies create efficient grids to supply electricity with fewer cables. Water Supply Systems – Used to design pipeline networks that connect homes and cities with minimal material cost. Cluster Analysis in AI – Helps group similar data points, like organizing images or sorting customer preferences.