Give an algorithm to find a maximum spanning tree. Is this harder than finding a minimum spanning tree?
Expert Answer
Solution:
Algorithm to find maximum spanning tree:
- Begin
- Draw a forest of the given graph or tree (A forest means the vertices which are present in the graph should be initialized or maintained without any edge associated with it)
- start with the edge with the max value and add it into the spanning tree
- Make sure that any cycle is not generated while creating Maximum spanning tree
- Repeat step 3 until n-1 edges are added in Maximum spanning tree
- End
No, it is not harder than finding maximum spanning tree.