使用哪些算法来查找最小生成林?

时间:2017-05-16 09:03:35

标签: algorithm graph minimum-spanning-tree minimum-spanning-forest

正如维基百科所说:

  

最小生成林是最小生成树的联合   它的连接组件。

要查找最小生成树,我们可以使用Prim's algorithmKruskal's algorithmBorůvka's algorithm

我们可以使用什么算法来查找最小生成林?

1 个答案:

答案 0 :(得分:1)

I don't see how you need any other algorithm than you use for trees - you may need to adapt them a bit.
If you use for example Kruskal's algorithm you get all cheapest edges in every sub graph/minimum spanning tree of your (now also minimum spanning) forest. Or you can use Prim's algorithm and if your iteration stops, restart it with a node that is not connected yet (i.e. with another tree).

So my answer in one sentence: "The algorithms used to find a minimum spanning forest are the same ones that are used to find a minimum spanning tree - in some cases with adaptions and in some cases without them."