Here is an exercise:
Either prove the following or give a counterexample:
(a) Is the path between a pair of vertices in a minimum spanning tree of an undirected graph necessarily the shortest (minimum weight) path?
(b) Suppose that the minimum spanning tree of the graph is unique. Is the path between a pair of vertices in a minimum spanning tree of an undirected graph necessarily the shortest (minimum weight) path?
My Answer is
(a)
No, for example, for graph 0, 1, 2, 0-1 is 4, 1-2 is 2, 2-0 is 5, then 0-2’s true shortest path is 5, but the mst is 0-1-2, in mst, 0-2 is 6
(b)
My problem comes into this (b).
I don't understand how whether the MST is unique
can affect the shortest path.
First, my understanding is that when the weights of edges are not distinct, multiple MST may exist at the same time, right?
Second, even if MST is unique, the answer of (a) above still applies for (b), right?
If there are N vertices are present inside graph G then the minimum spanning tree of the graph will contain N-1 edges and N vertices. If there are N vertices present inside graph G, then in the shortest path between two vertices there can be at most N-1 edges, and at most N vertices can be present in the shortest path.
The shortest path between node 0 and node 3 is along the path 0->1->3. However, the edge between node 1 and node 3 is not in the minimum spanning tree. Therefore, the generated shortest-path tree is different from the minimum spanning tree.
A minimum spanning tree is a spanning tree in which the sum of the weight of the edges is as minimum as possible.
In mathematics and computer science, a shortest-path tree rooted at a vertex v of a connected, undirected graph G is a spanning tree T of G, such that the path distance from root v to any other vertex u in T is the shortest path distance from v to u in G.
So lets take a look at a very simple graph:
(A)---2----(B)----2---(C)
\ /
---------3----------
The minimum spanning tree for this graph consists of the two edges A-B
and B-C
. No other set of edges form a minimum spanning tree.
But of course, the shortest path from A
to C
is A-C
, which does not exist in the MST.
EDIT
So to answer part (b) the answer is no, because there is a shorter path that exists that is not in the MST.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With