Professional Documents
Culture Documents
Design Analysis Algorithm 5
Design Analysis Algorithm 5
Weighted graph
The possible spanning trees from the above graph are:
The minimum spanning tree from the above spanning trees is:
The minimum spanning tree from a graph is found using the following algorithms:
1. Prim's Algorithm
2. Kruskal's Algorithm
Prim’s Algorithm
• Prim’s Algorithm is a famous greedy algorithm.
• It is used for finding the Minimum Spanning Tree (MST) of a given graph.
• To apply Prim’s algorithm, the given graph must be weighted, connected and
undirected.