Minimum Spanning Trees

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 7

Minimum Spanning Trees

presented by:
Muhammad Mahad Hanif (BCSM-F20-204)
Mohsin Amjad (BCSM-F20-405)
presented to:
Sir Saleem Mustafa
Minimum Spanning Trees
• The Minimum Spanning Tree is the one whose cumulative edge weights have
the smallest value

• To find the minimum spanning tree among all the spanning trees, we need to
calculate the total edge weight for each spanning tree.

• Applications of MST:
1. Telephone and Cable Network
2. To find paths in map
Algorithms to find MST
• Prim’s Algorithm
– Prim’s Algorithm is preferred when the graph is dense.

• Kruskal’s Algorithm
– Kruskal’s Algorithm is preferred when the graph is sparse.
Example for MST
• This graph consists of
6 Vertices
8 Edges

• We have to find the


shortest path of this graph.
Results for Prim’s Algorithm
• Cost=14 Units
• Edges= 5
Results for Kruskal’s Algorithm
• Cost= 14 Units
• Edges=5
Difference between Kruskal’s and Prim’s Algorithm

You might also like