Frage

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 algorithm is similar to depth-first algorithm.

War es hilfreich?

Lösung

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.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top