retagged by
1,632 views
2 votes
2 votes
Can Prim's and Kruskal's algorithm yield different minimum spanning trees? Explain why or why not.
retagged by

3 Answers

2 votes
2 votes
Yes, In case if they have more than one Spanning Tree

But the cost of Both tree is Same
0 votes
0 votes

It's true tat only the procedure is different. However in Krushkal's algorithm sorting is done as regards the minimum edge is taken first. But in Prim's algorithm this is not done. The major difference takes occurs when their comparison is made on the basis of time complexity. The resultant minimum spanning tree which is obtained is the same. 

Please kindly refer the link below for more detailed explanation which are given as under:

http://www.geeksforgeeks.org/greedy-algorithms-set-2-kruskals-minimum-spanning-tree-mst/

http://www.geeksforgeeks.org/greedy-algorithms-set-5-prims-minimum-spanning-tree-mst-2/

Hope it helps u. :)

Related questions

3 votes
3 votes
1 answer
1
Pooja Palod asked Oct 15, 2015
3,029 views
Suppose that edge weights are uniformly distributed over half open interval $[0,1)$. Which algorithm kruskal's or prim's can make you run faster?
2 votes
2 votes
2 answers
2
Psy Duck asked Jun 24, 2023
969 views
Can anyone help in solving the question 105 to 109.I don't have answer key I want to confirm my answer ...i will update my answer in the comments.
5 votes
5 votes
1 answer
4