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.
Asked
Active
Viewed 587 times
0

Grijesh Chauhan
- 57,103
- 20
- 141
- 208

Micromega
- 12,486
- 7
- 35
- 72
-
No, because the shortest path from A to B and from A to C will not tell you the shortest path from B to C. – Tyler Durden Jul 05 '13 at 17:37
-
can you explain? when you have 3 vertex mst is a-b and a-c. no need b-c? – Micromega Jul 05 '13 at 17:42
-
"mst is a-b and a-c" --- it's an "st" all right, but why is it "m"? – n. m. could be an AI Jul 05 '13 at 17:46
-
why it's a-b-c? I have all shortest path. – Micromega Jul 05 '13 at 17:51
-
not sure why you freaking. my accuracy isn't so good. – Micromega Jul 05 '13 at 18:53
-
mst needs to visit all vertex. but shortest path not. there you have the information you asked me? – Micromega Jul 05 '13 at 18:55
-
"a tree with all shortest path from a random vertex to any other vertex" I think that Tyler and I both understand this to mean the rooted tree such that, for every vertex, the path that appears in the tree from the root to that vertex is a shortest path. If we forget the root, then this tree is a spanning tree, but in general, it has very little to do with the minimum spanning tree. If this still does not make sense, then you need to edit in an example with enough vertices to be interesting. – David Eisenstat Jul 05 '13 at 19:12
-
my shortest path tree was a minimum spanning tree. I confused vertex and edged. – Micromega Jul 08 '13 at 01:09
1 Answers
1
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.

David Eisenstat
- 64,237
- 7
- 60
- 120
-
-
@Phpdna Suppose a-b has length 100 and a-c has length 100 and b-c has length 1. The shortest path tree rooted at a is a-b and a-c. The MST is b-c and one of the other edges. – David Eisenstat Jul 05 '13 at 18:16
-
but mst needs to visit all vertex. if you can merge the shortest path you have the mst. – Micromega Jul 05 '13 at 18:21