Two mst in one graph, require exactly the same weights on the edgs? - data-structures

I need to find two different minimum spanning tree in one graph, I wanted to know if it must be that for every weight of a edge that exists in the first minimum spanning tree there is a edge with the same weight in the second minimum spanning tree.

Related

Is there any minimum spanning tree that contains the maximum-weight edge on some cycle?

The origin problem is from the exercise of Introduction of Algorithm.
23.1-5 Let e be a maximum-weight edge on some cycle of connected graph G=(V, E). Prove that there is a minimum spanning tree of G'=(V, E - {e}) that is also a minimum spanning tree of G. That is, there is a minimum spanning tree of G that does not include e.
The question is that: I think the proposition that all the minimum spanning tree of G do not include e is right. The e is the only one maximum-weight edge on some cycle. Is it ?
Update: 2016-10-28 20:21
Add the restriction that e is the only one maximum-weight edge on some cycle.
One test case is when there are nodes labeled 0..n-1 and there are links only between node i and node (i + 1) mod n (that is, a ring). In this case the minimum spanning tree is created by leaving out just one of the links. If e is the unique maximum weight edge it is not in the unique spanning tree, which is all the other links. If there is more than one edge of maximum weight then there are as many different minimum spanning trees as there are edges of maximum weight, each one of them leaving out a different edge of maximum weight and keeping the other ones in.
Consider the case when there is just one edge of maximum weight. Supposing somebody hands you a minimum spanning tree that uses this edge. Delete it from the tree, giving you two disconnected components. Now try adding each of the other edges in the cycle, one at a time. If the edge doesn't connect the two components, delete it again. If any of the edges connect the two components, you have a spanning tree of smaller weight than before, so it can't have been a minimum spanning tree. Can it be the case that none of the edges connect the two components? Adding an edge that doesn't connect the two components doesn't increase the set of nodes reachable from either component, so if no single edge connected the two components, adding all of them at the same time won't. But we know that adding all of these edges adds a path that connects the two nodes connected by the previous maximum weight edge, so one of the edges must connect the components. So our original so-called minimum spanning tree wasn't, and an edge which is of unique maximum weight in a cycle can't be part of a minimum spanning tree.
Your guess is correct:
all the minimum spanning tree of G do not include e is right.
First we need to prove:
e is not a light edge crossing any cut of G.
Let C be any cut that cuts e, since e is in a cycle, so e is not a light edge for any of those cuts, and all the other cuts won't have the edge e crossing it, we won't have that the edge is light for any of those cuts either.
Then we need to prove:
if e is not a light edge crossing any cut of G, then all the minimum spanning tree of G do not include e.
Which is exactly the inverse proposition of 23.1-3.

Adding the lightest possible edges without affecting the graph's minimum spanning tree?

We have a graph G and wish to add edges between every vertex pair, that are as light as possible without affecting the minimum spanning tree.
Given the minimum spanning tree and a pair of vertices, how would one compute the weight of the lightest edge that can be added between them without affecting the MST?
Thought adding an edge that is heavier than every other edge the two vertices have would work but it appears to be erroneous in trials I've conducted.
The number of edges of a spanning tree is determined by the number of vertices. Hence, if you add an edge to the MST, you need to remove another in order to get a spanning tree. However, you cannot remove any edge. Obviously, removing an edge that is not on the path between the two vertices disconnects the graph. Therefore, you can only remove an edge on this path. If you want to find the minimum spanning tree, you would remove the heaviest edge, of course.
This new spanning tree is heavier than the original one iff the new edge's weight is greater than the heaviest edge weight on the old path. Therefore, the new edge must be heavier than this edge in order to keep the original MST.
Just to recapture and explain it in my own words (after accepting the answer):
To find the minimal weight for a newly added edge e between v and u (vertices in graph G), such that it does not improve (lighten) G's minimum spanning tree's weight, do the following:
Find the path between v and u on the tree (there is only one such path).
Find the heaviest edge(s) on that path.
Make the newly added edge as heavy or heavier than that weight.
This will not affect the total weight of the tree.

Update minimum spanning tree if edge is removed

I am having trouble with the following question:
Assume we have already found a minimum spanning tree T for a weighted, undirected graph G = (V,E). We would like to be able to efficiently update T should G be altered slightly.
An edge is removed from G to produce a new graph such that the new graph is still connected. Give an algorithm that uses T to find a minimum spanning tree for the new graph in O(|E|) time.
Since everything is still connected and only one edge has been removed, then most (and maybe all) of the spanning tree remains the same. Attempt to construct the same minimum spanning tree, and if the edge that was removed was part of the spanning tree, grab the next smallest edge that completes the minimum spanning tree.

Trying to create an algo that creates a spanning tree with least number of edges removed from a unweighed graph

I am trying to create an algo that will get a spanning tree with root node such that, the spanning tree will have least number of edges removed from Original Graph G.
Thanks in advance
For any connected graph, the spanning tree always contains n-1 edges where n is the number of nodes in the graph. So you will have to remove all the remaining edges. (If I have understood your question correctly)
Even for disconnected graphs, the number of edges in a spanning tree is defined by the number of components and number of nodes in each component.

Proving that no minimum spanning tree contains the maximum weighted edge

Let's say there's Graph G such that it all its edges have weights that correspond to distinct integers. So no two edge has the same weight.
Let E be all the edges of G. Let emax be an edge in E with the maximum weight.
Another property of Graph G is that every edge e belongs to some cycle in G.
I have to prove that no minimum spanning tree of G contains the edge emax.
I can see why this is true, since all edges are distinct and every edge belongs to a cycle, the minimum spanning tree algorithm can simply choose the edge with lower weight in the cycle that contains emax.
But I'm not sure how to concretely prove it.
This is related to the Cycle Property of the Minimum Spanning Tree, which is basically saying that given a cycle in a graph the edge with the greatest weight does not belong in the MST (easily proven by contradiction in the link above). Thus since the edge emax belongs to a cycle it must not be in the MST.
Proof by contradiction works here. Suppose you have a minimum spanning tree including the maximum edge. If you remove that edge you have two components no longer connected from each other. Every vertex is in one component or the other. There is a cycle including the maximum edge. Start on a vertex at one side of the maximum edge and move along the cycle. Because you will eventually cycle round to the other side of the maximum edge in the other component you will find - before then - an edge which has one vertex in one of the disconnected components and one vertex in another of the disconnected components. Since the components are disconnected that edge is not in the minimum spanning tree. By adding it to the tree you reconnect the components and create a minimum spanning tree with smaller weight than you started with - so you original minimum spanning tree was not minimum.
Does a MST contain the maximum weight edge?
Sometimes, Yes.
It depends on the type of graph. If the edge with maximum weight is the only bridge that connects the components of a graph, then that edge must also be present in the MST.

Resources