The following problem with two parts explores a condition that always implies a unique minimum spanning tree.
Part A
Suppose G G G is a simple connected graph with finitely many vertices, and suppose that e e e is an edge in G G G such that removing e e e from G G G results in a disconnected graph. Show that e is in every spanning tree of G G G.
Proof
- Firstly, we want to show e e e is not in any cycle. Suppose e e e is in some cycle, then, by the important exercise, removing e e e from G G G will still give us a connected graph as G G G is connected in the first place. However, this is a contradiction because removing e e e from G G G results in a disconnected graph. Thus, e e e is not in any cycle.
- Then, we suppose T T T is an arbitrary spanning tree of G G G. Notice that we always have a spanning tree because every connected graph has a spanning tree. However, since this is an assumption, it is not necessary to state the existence (see vacuous truth).
- Suppose e e e is incident on v , w v,w v,w. Then there is a path (as T T T is connected) between v , w v,w v,w in T T T. If the path is v , e , w v,e,w v,e,w, then we are done. If the path does not contain e e e, then the path, along with e e e, completes a cycle containing v , w v,w v,w, which is a contradiction. Therefore, T T T must contain e e e.
Part B
Suppose that G G G is a simple connected weighted graph with finitely many vertices, and that if distinct edges e e e and e ′ e′ e′ in G G G have the same weight, then removing either e e e or e ′ e′ e′ from G G G results in a disconnected graph. Show that G G G has a unique minimal spanning tree.
Proof
- Claim: in a connected weighted graph G G G, if the weight of each edge is distinct, then the graph G G G has a unique minimum spanning tree.
- Proof of the claim:
- Suppose G G G is such a graph.
- Suppose T , T ′ T,T' T,T′ are two mst. Suppose an edge e e e is in T ′ T' T′ but not in T T T. Adding e e e to T T T completes a cycle. Choose from this cycle (except for e e e) the edge with the smallest possible weight and remove it. Say we choose e ′ e' e′, and we thus obtain a new spanning tree T ′ ′ T'' T′′.
- Because the weights are all distinct, it’s either w ( e ′ ) > w ( e ) w(e')>w(e) w(e′)>w(e) or w ( e ′ ) < w ( e ) w(e')<w(e) w(e′)<w(e).
- If w ( e ′ ) > w ( e ) w(e') > w(e) w(e′)>w(e), then w ( T ′ ′ ) < w ( T ) w(T'')<w(T) w(T′′)<w(T), a contradiction since w ( T ) w(T) w(T) is already an MST, which means e e e is also in T T T.
- If
w
(
e
′
)
<
w
(
e
)
w(e') < w(e)
w(e′)<w(e), then
- If in this cycle, the vertex with the largest weight is not e e e, say it’s k k k, then we can always obtain a smaller total weight by including e e e and not including k k k in our mst, which means we get a contradiction on the weight of T T T.
- If in this cycle, the vertex with the largest weight is e e e. Then observe that not all edges in the cycle we completed before are in T ′ T' T′, or T ′ T' T′ will contain that exact same cycle. Thus, we pick any one of those edges from the cycle that is not in T ′ T' T′, say l l l, and w ( l ) < w ( e ) w(l)<w(e) w(l)<w(e). Adding l l l to T ′ T' T′ completes a cycle (not necessarily the same one as before) in T ′ T' T′. Therefore, in T ′ T' T′, we can get a smaller total weight by replacing e e e with l l l. Thus, we get a contradiction on the weight of T ′ T' T′.
- Therefore, T , T ′ T,T' T,T′ must not contain any different edge. We successfully proved the claim that in a connected weighted graph G G G, if the weight of each edge is distinct, then the graph G G G has a unique minimum spanning tree.
- Now we can use the claim to prove Part B.
- Suppose we remove all (groups of) edges in G G G with the same weight. We get at least one component, and within each component, each edge must have distinct weight.
- Apply the claim to every component, we see that each of them has its unique minimum spanning tree.
- By Part A, a minimum spanning tree of G G G must contain all the edges with the same weight. Thus, minimizing the weight of the spanning tree of T T T is equivalent to minimizing the sum of the spanning tree of the spanning tree(s) of the component(s). Since each component has a unique mst, so does G G G.