从这个图中Prim算法的正确顶点顺序是什么?

时间:2016-12-16 14:13:01

标签: graph-algorithm graph-theory minimum-spanning-tree graph-traversal

我想从这张图中了解Prim算法的顶点顺序: enter image description here

我的回答是{a,c,b,e,f,g,d},但其他人说{a,c,b,e,d,f,g}{a,c,d,e,b,f,g}

哪个答案是对的?

1 个答案:

答案 0 :(得分:0)

<强>正确!

如果我们选择a 开始,最小生成树如下:

a -> c -> b-> e -> f -> g
     |
     -> d

正如您所知,我们将树顶点添加到树中的顺序为{a,c,b,e,f,g,d}

相关问题