阅读背景:

整洁的和克鲁斯卡算法

来源:互联网 

Prim's and Kruskal's algorithm both produce the minimum spanning tree. According to the cut property, the total cost of the tree will be the same for these algorithms, but is it possible that these two algorithms give different MST with the same total cost, given that we choose it in alphabetic order when faced with multiple choices. for example, we compare max(source,dest), for edges A->B and B->C, we compare A from A->B and B from B->C.Prim's and Kruskal's algorithm both produce the




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: