Will a minimum spanning tree and shortest path tree always share at least one edge?

前端 未结 2 457
花落未央
花落未央 2021-02-07 20:27

I\'m studying graph theory and I have a question about the connection between minimum spanning trees and shortest path trees.

Let G be an undirected, co

2条回答
  •  梦谈多话
    2021-02-07 21:13

    I think that this statement is actually true, so I doubt you can find a counterexample.

    Here's a hint - take any node in the graph and find a shortest path tree for that node. Now consider what would happen if you were to run Prim's algorithm starting from that node - can you guarantee that at least one edge from the MST will find its way into the shortest path tree?

    Hope this helps!

提交回复
热议问题