Question

Write the Prim’s algorithm to find the minimum cost spanning tree of a graph. Also, find the time complexity of Prim’s algorithm. Demonstrate the use of Kruskal’s algorithm and Prim’s algorithm to find the minimum cost spanning tree for the Graph given in Figure 1. Show all the steps.

29 Apr 2025
Answer :
Word Count : 414
## a) Prim’s and Kruskal’s Algorithm for Minimum Spanning Tree ### **Prim’s Algorithm: Steps and Time Complexity** **Algorithm Steps**: 1. Start from any vertex (say, **A**), add it to the MST. 2. Repeatedly add the minimum weight edge that connects a vertex in the MST to a vertex outside the MST until all vertices are included. **Time Complexity**: - Using a simple array: $$O(V^2)$$ - With Min Heap (priority queue): $$O((V+E)\log V)$$ *** ### **Prim’s Algorithm: Step-by-Step on Given Graph** **Vertices:** A, B, C, D, E, F, G | Step | Candidate Edges from MST | Smallest Edge | Add Vertex | MST ________ _____ ___ _____ _________ __________ ________ ____.
_________ ________ ___ ___ ________ ________ _____ ______ ___.
____ _______ _________ ________ ___ ______ ___ _______ ____ ____ ______ _______.
__________ ________ _______ __________ ______ __________.
____ ______ __________ _________ ___ __________.
________ _____ _______ ____ _______ ____ __________ ________ _______.
________ _____ __________ _________ ____ ___ __________ ___.
___ ______ _____ ______ _______ ______ _______ ______ _______ ____ __________.
______ __________ _____ ____ __________ _____.
_______ _________ ___ ____ ___ ________ ______ _____ _______ _____.
________ ___ ____ _______ ______ ______ __________ ____ ________ ________.
_____ ______ ________ _____ _______.
____ ____ ____ ______ ________ __________ _____ ______ ______.
________ ________ __________ _______ _______ ____ ___ _____ _____ _________ ____ _______.
__________ _________ _________ _____ ________ ______ _________ _________ ___.
___ _______ ____ _______ _________ ________ ________ __________ _______ _________ ____.
________ ___ __________ _________ ____ _____ _________.
_________ ____ _________ ________ _____.
______ ____ _________ _____ ___ _____ ____ ________.
_______ _____ __________ _____ _______ __________ ________.
___ ________ ____ _____ ____ ________ _____.
______ ____ _____ __________ ____ ________ _______ ___ _________.
_________ ________ __________ ____ ____ ____.
_________ ______ _____ _____ ___ __________ ___.
___ _________ ____ ____ ___ ________ _______ _______ ________.
____ ______ _______ ______ ___ _________.
_______ ______ __________ __________ ____ ____ ______ _____ _____.
________ _______ ___ __________ ____.
________ ___ _________ _______ ______ ________ ________ ______.
__________ _______ __________ _______ _______ ___ ____ __________ _________.
____ __________ ___ _____ ______ _______ _______.
_____ ______ ____ _____ __________ ______ ____.
_____ __________ ______ _________ ___.
___ ____ ______ _______ ____ ___ ________ __________ _________ __________.
____ ________ _____ ________ ______ ____ ________.
_________ __________ _____ ____ ______ ____ _______ _________ _____.
_________ ___ ________ _________ _____ ________ _______ _____ ___ ___.
_________ __________ _____ ________ ____ ________ __________ _________ _________ ____ ______.
_____ _________.
Get Full Answer on WhatsApp
IGNOU NEWS
Assignment Submission Last Date Extended Till 30 June 2026 Click Here★★★IGNOU June 2026 TEE Date Sheet Released Click Here★★★
Top
📞
Call Support Instant phone assistance Write the Prim’s algorithm to find the minimum cost spanning tre
→
🟢
WhatsApp Chat Fast live messaging
→
Email Us Business enquiries & support
→