Create a MST with depth-first search?

前端 未结 1 1104
小蘑菇
小蘑菇 2021-01-27 11:22

I have a symmetrical graph and created a tree with all shortest path from a random vertex to any other vertex. Can I use the tree to construct a Minimum Spanning Tree(MST)? My

相关标签:
1条回答
  • 2021-01-27 11:30

    In the worst case, a shortest path tree does not help in finding a minimum spanning tree. Consider a graph where we want to find the MST. Add a source vertex with edges of an identical large length to each other vertex. The shortest path tree from that source consists of the very long edges, which we knew a priori, hence the shortest path tree is not useful in this case.

    0 讨论(0)
提交回复
热议问题