Question

Show the step-by-step result of applying the Prim’s algorithm on the following graph.

15 8 13 13 16 4 12 14 14 12 16 3 1 7 15

0 0
Add a comment Improve this question Transcribed image text
Answer #1

For Prims algorithm first we need to create the minimum spanning tree(mst) set initially it will be empty and keys assigned to vertices are {0, Inf, inf, inf, inf, inf, inf, inf} where inf indicates infinite. Now pick the vertex with minimum key value. The vertex 1 is picked, include it in mst Set, So mst Set becomes {1}. After including to mst Set, update key values of adjacent vertices. Adjacent vertices of 1 are 2 , 4 and 8. The key values of 2, 4 and 8 are updated as 12, 16 and 13. Following attached subgraph shows vertices and their key values, only the vertices with finite key values I am showing.

4- 12. 1 2. o.0 12 2. adtaeeut af 13 12 2

Add a comment
Know the answer?
Add Answer to:
Show the step-by-step result of applying the Prim’s algorithm on the following graph. 15 8 13...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT