How do I construct a minimum spanning forest?

670 Views Asked by At

I realize that a minimum spanning forest in a weighted graph is a spanning forest with minimal weight. Does this mean that I construct it by turning all of the trees into spanning trees?

1

There are 1 best solutions below

0
On

If you have a connected Graph to begin with, run either Kruskal's Algorithm or Prim's Algorithm on it to get a minimum spanning tree. In case your Graph is disconnected, do the above mentioned on every connected component to end up with a minimum spanning forest.