SlideShare a Scribd company logo
WELCOME TO MY
PRESENTATION
Md. Harun Or Rashid
ID: 193-15-2966
PC-A
PRESENTATION TOPIC
Minimum Spanning Tree
WHAT IS SPANNING TREE?
• Before we learn about spanning trees, we need to understand two
graphs: undirected graphs and connected graphs.
1. Undirected Graph: An undirected graph is a graph in which the
edges do not point in any direction (ie. the edges are bidirectional).
2. Connected Graph: A connected graph is a graph in which there is
always a path from a vertex to any other vertex.
• Spinning Tree: A spanning tree is a sub-graph of an undirected
connected graph, which includes all the vertices of the graph with a
minimum possible number of edges.
WHAT IS MINIMUM SPANNING TREE?
• Minimum Spanning Tree: A minimum spanning tree is a spanning tree
in which the sum of the weight of the edges is as minimum as possible.
• The minimum spanning tree from a graph is found using the following
algorithms:
1. Prim’s Algorithms.
2. Kruskal’s Algorithms.
PRIM’S ALGORITHM
Prim's algorithm is a minimum spanning tree algorithm that finds the
subset of the edges of that graph which
• form a tree that includes every vertex.
• has the minimum sum of weights among all the trees that can be
formed from the graph.
HOW PRIM'S ALGORITHM WORKS
• We start from one vertex and keep adding edges with the lowest
weight until we reach our goal.
• The steps for implementing Prim's algorithm are as follows:
1.Initialize the minimum spanning tree with a vertex chosen at
random.
2.Find all the edges that connect the tree to new vertices, find the
minimum and add it to the tree
3.Keep repeating step 2 until we get a minimum spanning tree
EXAMPLE OF PRIM'S ALGORITHM
Start with a weighted graph
EXAMPLE OF PRIM'S ALGORITHM
Choose a vertex
EXAMPLE OF PRIM'S ALGORITHM
Choose the shortest edge from this vertex
and add it.
EXAMPLE OF PRIM'S ALGORITHM
Choose the nearest vertex not yet in the
solution.
EXAMPLE OF PRIM'S ALGORITHM
Choose the nearest edge not yet in the
solution, if there are multiple choices,
choose one at random.
EXAMPLE OF PRIM'S ALGORITHM
Find the minimum spanning tree.
MINIMUM CONNECTOR ALGORITHMS
Kruskal’s Algorithm Prim’s Algorithm
Se
THANK YOU

More Related Content

Similar to Minimum Spanning Tree.pptx

Lecture 5.2 - 6.1 MINIMUM SPANNING TREE.pptx
Lecture 5.2 - 6.1 MINIMUM SPANNING TREE.pptxLecture 5.2 - 6.1 MINIMUM SPANNING TREE.pptx
Lecture 5.2 - 6.1 MINIMUM SPANNING TREE.pptx
MdNuhIslam210041108
 
Lecture 5.2 - 6.1 MINIMUM SPANNING TREE.pptx
Lecture 5.2 - 6.1 MINIMUM SPANNING TREE.pptxLecture 5.2 - 6.1 MINIMUM SPANNING TREE.pptx
Lecture 5.2 - 6.1 MINIMUM SPANNING TREE.pptx
MdNuhIslam210041108
 
Shortest path by using suitable algorithm.pdf
Shortest path by using suitable algorithm.pdfShortest path by using suitable algorithm.pdf
Shortest path by using suitable algorithm.pdf
zefergaming
 
Data structure
Data structureData structure
Data structure
SangeethaSasi1
 
Data structure and algorithm
Data structure and algorithmData structure and algorithm
Data structure and algorithm
sakthibalabalamuruga
 
1 sollins algorithm
1 sollins algorithm1 sollins algorithm
1 sollins algorithm
Muhammad Salman
 
Minimum Spanning Tree Using Prism's Algorithm
Minimum  Spanning Tree Using  Prism's AlgorithmMinimum  Spanning Tree Using  Prism's Algorithm
Minimum Spanning Tree Using Prism's Algorithm
Mrunal Patil
 
Mastering Greedy Algorithms: Optimizing Solutions for Efficiency"
Mastering Greedy Algorithms: Optimizing Solutions for Efficiency"Mastering Greedy Algorithms: Optimizing Solutions for Efficiency"
Mastering Greedy Algorithms: Optimizing Solutions for Efficiency"
22bcs058
 
Minimum Spanning Tree using Kruskal's Algorithm
Minimum Spanning Tree using Kruskal's Algorithm Minimum Spanning Tree using Kruskal's Algorithm
Minimum Spanning Tree using Kruskal's Algorithm
Mrunal Patil
 
APznzaZLM_MVouyxM4cxHPJR5BC-TAxTWqhQJ2EywQQuXStxJTDoGkHdsKEQGd4Vo7BS3Q1npCOMV...
APznzaZLM_MVouyxM4cxHPJR5BC-TAxTWqhQJ2EywQQuXStxJTDoGkHdsKEQGd4Vo7BS3Q1npCOMV...APznzaZLM_MVouyxM4cxHPJR5BC-TAxTWqhQJ2EywQQuXStxJTDoGkHdsKEQGd4Vo7BS3Q1npCOMV...
APznzaZLM_MVouyxM4cxHPJR5BC-TAxTWqhQJ2EywQQuXStxJTDoGkHdsKEQGd4Vo7BS3Q1npCOMV...
KUSHDHIRRA2111026030
 
Ram minimum spanning tree
Ram   minimum spanning treeRam   minimum spanning tree
Ram minimum spanning tree
Rama Prasath A
 
Approximation Algorithms TSP
Approximation Algorithms   TSPApproximation Algorithms   TSP
Shortest path (Dijkistra's Algorithm) & Spanning Tree (Prim's Algorithm)
Shortest path (Dijkistra's Algorithm) & Spanning Tree (Prim's Algorithm)Shortest path (Dijkistra's Algorithm) & Spanning Tree (Prim's Algorithm)
Shortest path (Dijkistra's Algorithm) & Spanning Tree (Prim's Algorithm)
Mohanlal Sukhadia University (MLSU)
 
UNIT III.pptx
UNIT III.pptxUNIT III.pptx
UNIT III.pptx
SwarndeviKm
 
Unit V - ppt.pptx
Unit V - ppt.pptxUnit V - ppt.pptx
15 chapter9 graph_algorithms_mst
15 chapter9 graph_algorithms_mst15 chapter9 graph_algorithms_mst
15 chapter9 graph_algorithms_mst
SSE_AndyLi
 

Similar to Minimum Spanning Tree.pptx (16)

Lecture 5.2 - 6.1 MINIMUM SPANNING TREE.pptx
Lecture 5.2 - 6.1 MINIMUM SPANNING TREE.pptxLecture 5.2 - 6.1 MINIMUM SPANNING TREE.pptx
Lecture 5.2 - 6.1 MINIMUM SPANNING TREE.pptx
 
Lecture 5.2 - 6.1 MINIMUM SPANNING TREE.pptx
Lecture 5.2 - 6.1 MINIMUM SPANNING TREE.pptxLecture 5.2 - 6.1 MINIMUM SPANNING TREE.pptx
Lecture 5.2 - 6.1 MINIMUM SPANNING TREE.pptx
 
Shortest path by using suitable algorithm.pdf
Shortest path by using suitable algorithm.pdfShortest path by using suitable algorithm.pdf
Shortest path by using suitable algorithm.pdf
 
Data structure
Data structureData structure
Data structure
 
Data structure and algorithm
Data structure and algorithmData structure and algorithm
Data structure and algorithm
 
1 sollins algorithm
1 sollins algorithm1 sollins algorithm
1 sollins algorithm
 
Minimum Spanning Tree Using Prism's Algorithm
Minimum  Spanning Tree Using  Prism's AlgorithmMinimum  Spanning Tree Using  Prism's Algorithm
Minimum Spanning Tree Using Prism's Algorithm
 
Mastering Greedy Algorithms: Optimizing Solutions for Efficiency"
Mastering Greedy Algorithms: Optimizing Solutions for Efficiency"Mastering Greedy Algorithms: Optimizing Solutions for Efficiency"
Mastering Greedy Algorithms: Optimizing Solutions for Efficiency"
 
Minimum Spanning Tree using Kruskal's Algorithm
Minimum Spanning Tree using Kruskal's Algorithm Minimum Spanning Tree using Kruskal's Algorithm
Minimum Spanning Tree using Kruskal's Algorithm
 
APznzaZLM_MVouyxM4cxHPJR5BC-TAxTWqhQJ2EywQQuXStxJTDoGkHdsKEQGd4Vo7BS3Q1npCOMV...
APznzaZLM_MVouyxM4cxHPJR5BC-TAxTWqhQJ2EywQQuXStxJTDoGkHdsKEQGd4Vo7BS3Q1npCOMV...APznzaZLM_MVouyxM4cxHPJR5BC-TAxTWqhQJ2EywQQuXStxJTDoGkHdsKEQGd4Vo7BS3Q1npCOMV...
APznzaZLM_MVouyxM4cxHPJR5BC-TAxTWqhQJ2EywQQuXStxJTDoGkHdsKEQGd4Vo7BS3Q1npCOMV...
 
Ram minimum spanning tree
Ram   minimum spanning treeRam   minimum spanning tree
Ram minimum spanning tree
 
Approximation Algorithms TSP
Approximation Algorithms   TSPApproximation Algorithms   TSP
Approximation Algorithms TSP
 
Shortest path (Dijkistra's Algorithm) & Spanning Tree (Prim's Algorithm)
Shortest path (Dijkistra's Algorithm) & Spanning Tree (Prim's Algorithm)Shortest path (Dijkistra's Algorithm) & Spanning Tree (Prim's Algorithm)
Shortest path (Dijkistra's Algorithm) & Spanning Tree (Prim's Algorithm)
 
UNIT III.pptx
UNIT III.pptxUNIT III.pptx
UNIT III.pptx
 
Unit V - ppt.pptx
Unit V - ppt.pptxUnit V - ppt.pptx
Unit V - ppt.pptx
 
15 chapter9 graph_algorithms_mst
15 chapter9 graph_algorithms_mst15 chapter9 graph_algorithms_mst
15 chapter9 graph_algorithms_mst
 

More from HrRajon2

Measure of Central Tendency .pptx
Measure of Central Tendency .pptxMeasure of Central Tendency .pptx
Measure of Central Tendency .pptx
HrRajon2
 
Logic Gate.pptx
Logic Gate.pptxLogic Gate.pptx
Logic Gate.pptx
HrRajon2
 
NetworkTopology.pptx
NetworkTopology.pptxNetworkTopology.pptx
NetworkTopology.pptx
HrRajon2
 
Shortest Path.pptx
Shortest Path.pptxShortest Path.pptx
Shortest Path.pptx
HrRajon2
 
 Etiquette, Personal Behavior and Professionalism .pptx
 Etiquette, Personal Behavior and Professionalism.pptx Etiquette, Personal Behavior and Professionalism.pptx
 Etiquette, Personal Behavior and Professionalism .pptx
HrRajon2
 
SQl Injection.ppt
SQl Injection.pptSQl Injection.ppt
SQl Injection.ppt
HrRajon2
 

More from HrRajon2 (6)

Measure of Central Tendency .pptx
Measure of Central Tendency .pptxMeasure of Central Tendency .pptx
Measure of Central Tendency .pptx
 
Logic Gate.pptx
Logic Gate.pptxLogic Gate.pptx
Logic Gate.pptx
 
NetworkTopology.pptx
NetworkTopology.pptxNetworkTopology.pptx
NetworkTopology.pptx
 
Shortest Path.pptx
Shortest Path.pptxShortest Path.pptx
Shortest Path.pptx
 
 Etiquette, Personal Behavior and Professionalism .pptx
 Etiquette, Personal Behavior and Professionalism.pptx Etiquette, Personal Behavior and Professionalism.pptx
 Etiquette, Personal Behavior and Professionalism .pptx
 
SQl Injection.ppt
SQl Injection.pptSQl Injection.ppt
SQl Injection.ppt
 

Recently uploaded

Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
timhan337
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
Chapter -12, Antibiotics (One Page Notes).pdf
Chapter -12, Antibiotics (One Page Notes).pdfChapter -12, Antibiotics (One Page Notes).pdf
Chapter -12, Antibiotics (One Page Notes).pdf
Kartik Tiwari
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
Multithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race conditionMultithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race condition
Mohammed Sikander
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
Wasim Ak
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
tarandeep35
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 

Recently uploaded (20)

Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
Chapter -12, Antibiotics (One Page Notes).pdf
Chapter -12, Antibiotics (One Page Notes).pdfChapter -12, Antibiotics (One Page Notes).pdf
Chapter -12, Antibiotics (One Page Notes).pdf
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
Multithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race conditionMultithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race condition
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 

Minimum Spanning Tree.pptx

  • 2. Md. Harun Or Rashid ID: 193-15-2966 PC-A
  • 4. WHAT IS SPANNING TREE? • Before we learn about spanning trees, we need to understand two graphs: undirected graphs and connected graphs. 1. Undirected Graph: An undirected graph is a graph in which the edges do not point in any direction (ie. the edges are bidirectional). 2. Connected Graph: A connected graph is a graph in which there is always a path from a vertex to any other vertex. • Spinning Tree: A spanning tree is a sub-graph of an undirected connected graph, which includes all the vertices of the graph with a minimum possible number of edges.
  • 5. WHAT IS MINIMUM SPANNING TREE? • Minimum Spanning Tree: A minimum spanning tree is a spanning tree in which the sum of the weight of the edges is as minimum as possible. • The minimum spanning tree from a graph is found using the following algorithms: 1. Prim’s Algorithms. 2. Kruskal’s Algorithms.
  • 6. PRIM’S ALGORITHM Prim's algorithm is a minimum spanning tree algorithm that finds the subset of the edges of that graph which • form a tree that includes every vertex. • has the minimum sum of weights among all the trees that can be formed from the graph.
  • 7. HOW PRIM'S ALGORITHM WORKS • We start from one vertex and keep adding edges with the lowest weight until we reach our goal. • The steps for implementing Prim's algorithm are as follows: 1.Initialize the minimum spanning tree with a vertex chosen at random. 2.Find all the edges that connect the tree to new vertices, find the minimum and add it to the tree 3.Keep repeating step 2 until we get a minimum spanning tree
  • 8. EXAMPLE OF PRIM'S ALGORITHM Start with a weighted graph
  • 9. EXAMPLE OF PRIM'S ALGORITHM Choose a vertex
  • 10. EXAMPLE OF PRIM'S ALGORITHM Choose the shortest edge from this vertex and add it.
  • 11. EXAMPLE OF PRIM'S ALGORITHM Choose the nearest vertex not yet in the solution.
  • 12. EXAMPLE OF PRIM'S ALGORITHM Choose the nearest edge not yet in the solution, if there are multiple choices, choose one at random.
  • 13. EXAMPLE OF PRIM'S ALGORITHM Find the minimum spanning tree.
  • 14. MINIMUM CONNECTOR ALGORITHMS Kruskal’s Algorithm Prim’s Algorithm Se
  • 15.