For a connected, weighed, undirected graph G:
G has a unique MST, if for every cut of G there is a unique minimum weight edge crossing the cut.
Is this statement true?
I think false because for the following graph in the given link there can be multiple MSTs.
https://drive.google.com/file/d/1yDK3juPxeDBdS-aEOx0aAsphy4odZ55l/view?usp=drivesdk
If you mean a connected graph G, with edge costs that are all distinct. Then G has a unique minimum spanning tree.
proof:
Suppose there are two different MSTs, call them T1 and T2, who have different sets of edges--{t11, t12, … t1n-1} for T1 and {t21, t22, … t2n-1} for T2. So, let ti be the edge with the smallest weight only in T1 (not in T2). Since it is the smallest, ti must be included in "every choice" of MST. That is, both MST of T1 and T2 would have it. But this contradicts the definition of ti.
Related
Given an Undirected graph G with with weight on its edges and 2 different minimal spanning trees: T, T'
Then I want to prove the following:
For every edge e in T that's not in T', there is an edge e' in T'
that's not in T such that if we replace e with e' in T (let's call
it T_new) then it's still a minimal spanning tree of G.
I think I am too close for finding the right algorithm but stuck a little:
I have proved that weight(e) must be exactly equal to weight(e').
Since T is a tree, deleting e will result in 2 separated components, then for T_new to be a tree it must use one of the edges connecting two vertices from those different components.
But, I wasn't able to know which edge e' exactly will work. Plus I wasn't able to prove that always there is such an edge (I just found some requirements for e' that is must satisfy).
Some notes: I know Kruskal algorithm, and familiar with an algorithm in which we can paint some edges in yellow and request it to generate minimal spanning trees with maximum yellow edges (In other words from all found minimal spanning trees return the one with maximum number of yellow edges)
Let T1 and T2 be the two connected components of T \ {e}. Consider the path P joining the endpoints of e in T'. Since e connects T1 and T2, so does P, and therefore there exists an edge e' in P that connects T1 and T2. The edge e' cannot be lighter than e, or else T would not be minimum (T \ {e} U {e'}). The edge e' cannot be heavier than e, or else T' would not be minimum (T' \ {e'} U {e}).
My notes tell me that the first and last is false. I need some idea of how to understand the validity of these sentences in a more simple and concise manner.
Suppose M is an MST (minimum spanning tree) of the Weighted Graph - GR.
Let A be a vertex of GR then M-{A} is also MST of GR-{A}.
Let A be a leaf of M then M-{A} is also MST of GR-{A}.
If e is a edge of M then (M-{e}) is a forest of M1 and M2 trees such that for M_i, i=1,2 is a MST of Induced Graph GR on vertexes T_i.
Let A be a vertex of GR, then M-{A} is also MST of GR-{A}.
This is false.
If A is not a leaf, then M-{A} is not a connected graph, and so it cannot be a MST.
In more detail: A has at least two neighbors, and the single path (MST property) that exists between two of them includes A. If A is removed, then there is no more path between those two other vertices.
Let A be a leaf of M, then M-{A} is also MST of GR-{A}.
This is true.
As A is a leaf, M-{A} is a connected graph, and has one fewer edge than M: it does not have the edge e that connects with A in M.
Now assume that M-{A} is not a MST of GR-{A}. We know that M-{A} is a connected graph, and has no cycles -- otherwise M would not be an MST. So if it is not an MST, it must be that its weight is not minimised. Then there is a different graph P that is a MST of GR-{A}. But then P+e would have less total weight than M, but still be a spanning tree of GR. So then M could not have been a MST of GR. This is a contradiction, and so the original statement is true.
If e is a edge of M then M-{e} is a forest of M1 and M2 trees such that for Mi, i=1,2 is a MST of the induced graph GR on vertexes Ti.
This is true. Your notes are wrong on this one.
Let's assume that Mi (for either i=1,2) is not a MST of the induced graph on vertexes Ti. We know that Mi is not disconnected (the removal of e creates exactly 2 connected graphs), and that it has no cycles (otherwise M would have had those as well). So if it is not a MST, then the reason would be that its weight is not minimised, and another graph Pi is a MST on that induced graph, and has less total weight than Mi.
If you would then reintroduce the edge e, and so connect Pi with M3-i, we would have a spanning tree for GR which would have less weight than M, and so M is not a MST. This is again a contradiction and so the original statement is true.
Given:
G = (V,E)
T is an MST of G
G'=(V', E') ⊆ G
T' is an MST of G'
Prove:
(V',E∩T) is a subgraph of T'
Under what conditions is E∩T an MST of G'?
The edge-weights need not be distinct.
My approach:
By applying Kruskal's algorithm to edges in E∩T, one would join edges in ascending order of weight and simultaneously ensure that a join does not produce a cycle. This will produce an MST, but can a we show that this MST is a subgraph of T'?
Does this approach make sense? Since I do not use the fact that T is the MST of G, I have a hunch that I'm ignoring something important.
First observation: any graph with number of nodes |V'| and number of edges other than |V'|-1 is not a tree, so one necessary condition is: |E∩T| = |V'|-1
Second observation: if T' is MST of G' then the sum of its edges is minimal among all other possible spanning trees of G'. which means that if (V', E∩T) is MST of G', then the sum of its edges has to be equal to the sum of edges of T'
From observations above, the necessary and sufficient conditions for (V', E∩T) being MST of G' is:
1. |E∩T| = |V'|-1
2. sumofweights((V', E∩T))=sumofweights(T')
So, basically what you need to do is to count the number of edges in E∩T and compare with |V'|-1, and also calculate the sum of edge weights in T' and compare with the sum of edge weights in E∩T
However I got some suspicions about this line: (V',E∩T) is a subgraph of T'
Since T' also has V' nodes, any subgraph of T' other than T' itself, would not be a tree, and if it's not a tree, it can't be MST either. Probably it is (V',E∩T) is a subgraph of G' or (V',E∩T) is a subgraph of T, not (V',E∩T) is a subgraph of T'?
I have a connected graph G=(V,E) V={1,2,...,n} and a cost function c:E->R
and a second partial graph G'=(V,T) where T={ for every vertex v∈ V find the neighbor with the minimum cost and add the new edge to T}
If G' graph has at least 2 connected components with the set of vertices we consider the graph H where
iff the set of edges (from the initial graph G) is not null.We define over the edges of H a cost function.
Let's say I choose V(H)={a,e,f} and E(H)={ae,af,fe} and
E12={ab,bc,bd,ed}
E23={eg,ef} E31={fc,fd}
c'(ae)=min{c(ab),c(bc),c(bd),c(ed)}=4
c'(af)=min{c(fc),c(fd)}=9
c'(fe)=min{c(eg),c(ef)}=8
Now for every edge e ∈ E(H) we note with e' the edge (from the original graph G)
for which this minimum is attained.
So e'={bc,df,eg} because bc=4 , df=9 and eg=8 and are the min edges that connect my components.
And I have a minimum spanning tree in H relative to the cost function c' and A' is the set of edges for this tree.
So A'={ae,fe} (I deleted the edge with the maximum cost=af from my graph H to create a min spanning tree)
and I have another set of edges A'={e'|e∈A'} and
is a min spanning tree in G relative to the function cost c.
But none of my edges from A' are the same with the ones from e'.
What I'm I doing wrong?
Looks like you're implementing Boruvka's algorithm. If you look at the notation, it says there's an edge from one new node vC1 to a new node vC2 if there are a pair of nodes x ∈ C1 and y ∈ C2 that are adjacentnin the original graph G. In other words, there's an edge between two new nodes if the connected components they correspond to in G' are adjacent in G. The cost of the edge running between them is then the lowest of the costs of any of the edges running between those CC's in the original graph G.
I have a graph represented with adjacency lists and his MST represented by parent array.
My problem is that I need to delete an edge from the graph and update parent array.
I've already manage to do the cases when:
the edge doesn't exist;
the edge is in graph but not in MST (MST doesn't change);
and the edge is the only path from two nodes(in this case I return null, because the
graph is not connected).
What can I do when the edge is in MST and the edge in graph is in a cycle? I need to do this in O(n+m) complexity.
I write the costs of edges with red color.
Just search the minimum-distance path of
the now-disconnected tree portion
to the rest of the tree and
add that path in between-- which is a single edge.
Say your original tree is T. With the removal
of the edge, it is now split into trees T1 and T2.
Take one of these-- say T2.
Every edge incident to a node on T2 is either
on T2 or is one connecting T2 to T1. Among these
edges incident to a node on T2, pick the one which
( (has its other end at a T1 node) and
(has the minimum cost among all such edges) ).
Search for this edge, say e=(u,v), takes O(|E|) time. O(|N|) if the separated portion is a leaf.
if there were a tree, say T', with less cost than T1 \union T2 \union {e},
then the node sets N1 and N2 of T1 and T2 would have more inter-connections than just one edge,
i.e., there would be two or more more edges on T' that begin at a node in N1 and end at a node in N2.
Otherwise, ( (T1 and T2 are minimum spanning trees resply. over N1 and N2) and (e is the least costly
connection between T1 and T2) ) would be false. But then, any go-between T1 and T2 is costlier than e=(u,v)-- contradicts.
Skipped some proof details. hope this helps.