Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 8 years ago.
Improve this question
Let G be a weighted undirected graph and e be an edge with maximum weight in G.Suppose there is a minimum weight spanning tree in G containing the edge e.Which of the following statements is always TRUE?
a.There exists a cut in g having all edges of maximum weight
b.There exists a cycle in G having all edges of maximum weight
c.Edge e can not be contained in a cycle
d.All edges in G have the same weight
Is a previous year exam questing .i am having trouble to under stand it can any one explain it to me .
The bottom three are false, and the following simple graph is a counter-example to all three:
1
a --- b
| /
2 | /
| / 2
| /
c
Any minimum-weight spanning tree contains either the edge <a,c> or the edge <b,c>. In either case, it is easy to check that (b), (c), and (d) all fail.
Edit: (a) is true. Here is a proof:
Let e be an edge of M which is of maximum weight in G, and let M be a minimum-weight spanning tree for G containing the edge e. If the edge e cuts the graph G, then (a) is obviously true. So, let G' be obtained from G by removing the edge e, and suppose G' is connected.
Let M' be obtained from M by removing the edge e. Now we know that M' consists of two components, because M is a tree, and removing one edge from a tree disconnects it into two components. Furthermore every vertex of G' belongs to M', and G' is connected, so we can obtain a spanning tree of G' by adding a single edge of G' to M'. I claim that every such edge is of maximum weight in G.
To see why, suppose there is an edge e' in G' which connects the two components of M', but is of sub-maximal weight in G. Then, we could remove the edge e from M (our original spanning tree), add this edge e' to M to obtain a new spanning tree of G, but it would be of total weight less than that of M, contradicting the minimal-weight of M.
So, consider the set of all edges of G' which connect the two components of M'. These edges together with e form an edge-cut-set of G, and all must be of maximal weight in G.
Let's start from the simple ones - d is wrong - take any MST, and reduce one of the weights to some unique new value in some edge (not e) - it's still an MST, but not all edges have the same weight
c is false - if e was heavier that any other edge it would have been true because if it was in a cycle, you could have removed e from the MST (and if required for connectivity - pick any other edge instead and receive a lighter MST). However, e can be in a cycle if the alternative edges are all of the same weight.
b is false - say e is the heaviest, but not in a cycle, just connects the graph to some remote vertice (that isn't connected otherwise).
a - i'm not sure if you meant that the cut is max weight or all the edges of max weight are there (that's not the same thing), please clarify
Related
The following is an example from my graph theory and algorithm course:
Let A be a minimal subset of edges of a weighted undirected graph G (distinct weight), such that if we remove A from G then G becomes disconnected. The lightest edge in A must be in any MST.
Why this is a correct fact? I couldn't understand it.
According to the definition of minimal edge cut:
A minimal edge cut is an edge cut such that if any edge is put back in the graph, the graph will be reconnected.
In the following figure:
The set, A = {a, b, c, d} is a minimal edge cut.
If A is removed from G, the graph becomes disconnected.
Now, the property: "lightest edge in A must be in any MST" can be explained by the Cut Property:
Therefore the statement is true, because,
The lightest edge of the set A = e = min(a, min(b, min(c,d))) will be the part of MST.
Here's how I think of it. It's given that A is a set of edges that when removed disconnects G. We could say that A connects (at least) two subsets of nodes in G, G1 and G2. There can be no edges linking G1 and G2 that don't go through A, because otherwise the connection of G1 and G2 would not depend on A. Also denote m as the minimum edge within A (not necessarily the minimum of G, although it could be!).
So the question is, can you make the minimum path from G1 to G2 through A without taking its minimum edge m? Well think of another subgraph which is all of the nodes which contain an edge within A. So at least one node from G1 and one node from G2 (such that they are connected through A). The MST of this subgraph must include m, because a MST must include the smallest edge weight. And the MST of G must include the MST of A, else we would be getting from G1 to G2 in a suboptimal way.
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.
I was reading minimum spanning trees in CLRS and came across the following corollary which is basis of algorithms to compute minimum spanning tree:
Corollary 23.2
Let G = (V,E) be a connected, undirected graph with a real-valued weight function w defined on E. Let A be a subset of E that is included in some minimum
spanning tree for G, and let C = (V_C,E_C) be a connected component (tree) in the forest G_A = (V,A). If (u,v) is a light edge connecting C to some other component in G_A, then (u,v) is safe for A.
Proof The cut (V_C, V-V_C) respects A, and (u,v) is a light edge for this cut. Therefore, it is safe for A.
I find some inconsistency. Why? Let me show you:
Some Statements skimmed from Corollary
These are the statements copied from the Same Corollary and its proof in the text:
STATEMENT 1 - G_A = (V, A)
STATEMENT 2 - (u,v) is a light edge connecting C to some other component in G_A.
STATEMENT 3 - The cut (V_C, V - V_C) respects A
STATEMENT 4 - (u,v) is a light edge for this cut.
Lemma 1
Statement 1 and 2 imply (u,v) is in A
Proof
For purpose of contradiction lets assume that it does not belong to A. As (u,v) connects two components of graph G_A it must be an edge in graph G_A. As Set of edge is given by A in graph G_A it must belong to A which contradict our assumption.
Inconsistency
Now Lemma 1 implies (u,v) belongs to A . Statement 3 implies the cut respects (u,v) which further implies (u,v) cannot cross the cut. Since it cannot cross the cut, it cannot be a light edge which contradicts Statement 4.
Does this imply the algorithms are incorrect. According to me G_A should be changed to G. Am I wrong?
EDIT
Other Possible Change
Well then Edge should belong to E as it cannot be any edge that is light. Let say we have edge set F superset of E that contains edge lighter than (u,v). Than upon finishing we will have MST not spanning G. An example has been attached to clarify the statement. Go to Example. Sorry for the shadowing. Stack Overflow wasnot uploading the image - I tried numerous times.
So shouldn't the last line of corollary be changed to (u,v) belongs to E and is a light edge for G_A for clarification purposes?
So I have an exercise that I should prove or disprove that:
1) if e is a minimum weight edge in the connected graph G such that not all edges are necessarily distinct, then every minimum spanning tree of G contains e
2) Same as 1) but now all edge weights are distinct.
Ok so intuitively, I understand that for 1) since not all edge weights are distinct, then it's possible that a vertex has the path with edge e but also another edge e_1 such that if weight(e) = weight (e_1) then there is a spanning tree which does not contain the edge e since the graph is connected. Otherwise if both e_1 and e are in the minimum spanning tree, then there is a cycle
and for 2) since all edge weights are distinct, then of course the minimum spanning tree will contain the edge e since any algorithm will always choose the smaller path.
Any suggestions on how to prove these two though? induction? Not sure how to approach.
Actually in your first proof when you say that if both e and e_1 are in G, then there's a cycle, that's not true, because they're minimal edges, so there doesn't have to be a cycle, and you do need to include them both into the MST, because if |E| > 1 and |V| > 2 then they both have to be there.
Anyways, a counter example for the first one is a complete graph with all edges of the same weight as e, the MST will contain only |V|-1 edges, but you didn't include all the other edges of that same weight, hence you have a contradiction.
As for the second one, if all edges are distinct, then if you remove the minimum edge and want to reconstruct the MST, the only way to go about this is to add a an edge connecting the 2 disjoint sets that were broken up by that minimum-weight edge.
Now suppose that you didn't remove that minimum-weight edge, and added that other edge, now you've created a cycle, and since all edges are distinct the cycle-creating edge will be greater than all of them, hence if you remove any former MST edge from that cycle, it will only increase the size of the MST. Which means that pretty much all former MST edges are critical when all edges have distinct weights.
Hi so i'm doing some test prep and i need to figure out parts b and c. I know part a is true and i can prove it, but finding the algorithms for part b and c is currently eluding me.
Solve the following for a minimum bottleneck tree where the edge with the maximum cost is referred to as the bottleneck.
(a) Is every minimum-bottleneck
spanning tree of G a minimum-spanning tree of G? Prove your claim.
(b) For a given cost c, give an O(n+m)-time algorithm to
find if the bottleneck cost of a minimum-bottleneck spanning tree
of G is not more than c.
(c) Find an algorithm to find a minimum-bottleneck
spanning tree of G.
thanks in advance to anyone who can help me out
For (b):
Erase every edge in G that costs more than c, then check if the left graph is still connected.
For (c):
Do a binary search on c, using the algorithm that solved (b) as the dividing condition.
Proof of (b):
Let's say the graph we got after deleting edges cost more than c from G is G' .
Then:
If G' is connected, then there must be a spanning tree T in G'. Since no edge in G' costs more than c, we can tell for sure that no edge in T costs more than c. Therefore T is a spanning tree for G' and also G whose bottle neck is at most c
If G' is not connected, then there's no spanning tree in G' at all. Since we know every edge in G- G' costs more than c, and we know that any spanning tree of G will contains at least one edge of G- G', therefore we know there's no edge spanning tree of G whose bottle neck <= c
And of course detecting if a graph is connected costs O(n+m)
Proof of (c):
Say, the algorithm we used in (b) is F(G,c) .
Then we have
If F(G,c) = True for some c, then F(G,c') = True for all c' that have c'>=c
If F(G,c) = False for some c, then F(G,c') = False for all c' that have c'<=c
So we can binary search on c :)
Ans. a)False,every minimum bottleneck spanning tree of graph G is not a minimum spanning tree of G.
b)To check whether the value of minimum bottleneck spanning tree is atmost c,you can apply depth first search by selecting any vertex from the set of vertices in graph G.
***Algorithm:***
check_atmostvalue(Graph G,int c)
{
for each vertex v belongs to V[G] do {
visited[v]=false;
}
DFS(v,c); //v is any randomly choosen vertex in Graph G
for each vertex v belongs to V[G] do {
if(visited[v]==false) then
return false;
}
return true;
}
DFS(v,c)
{
visited[v]=true;
for each w adjacent to v do {
if(visited[w]=false and weight(v,w)<=c) then
DFS(w,c);
}
visited[w]=true;
}
This algorithm works in O(V+E) in the worst case as running timr for depth first search DFS is O(V+E).
This problem can be solved by simply finding the MST of the graph. This based on the following claim:
MST is a MBST for a connected graph.
For a MST, choose the maximum edge e in the MST and the edge e divides the MST into two sets S and T. Then from the cut property, edge e must be the minimum weight among those edges that connects S and T.
Then for a MBST, there must be some edge e' that connect S and T. Then w(e') must be no less than w(e). Thus we know that MST must be a MBST.
However, there is another way to determine the minimum bottleneck. We don't need to computer the MBST. In your question, you actually implies the monotocity of the minimum bottleneck. Therefor we can use binary search combined with the connectivity algorithm to find the minimum bottle neck. I haves seen the use of monocity in other cases. I am a bit amazed that the similar technique can be used here!