Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Finding a New Minimum Spanning Tree After a New Edge Was Added to The Graph

Let G = (V, E) be a weighted, connected and undirected graph and let T be a minimum spanning tree. Let e be any edge not in E (and has a weight W(e)). Prove or disprove: T U {e} is an edge set that contains a minimum spanning tree of G' = (V, E U {e}).

Well, it sounds true to me, so I decided to prove it but I just get stuck every time...

For example, if e is the new edge with minimum weight, who can promise us that the edges in T weren't chosen in a bad way that would prevent us from obtaining a new minimum weight without the 'help' of other edges in E - T ?

I would appreciate any help, Thanks in advance.

like image 735
Robert777 Avatar asked Feb 25 '13 17:02

Robert777


People also ask

How can I find a minimum spanning tree containing a given edge?

STEP 1: Begin with set S containing a vertex picked randomly. STEP 2: From all the edges with one vertex in set S and other vertex in set V - S,pick the one with minimum weight. Let it be (x,y), x belongs to S and y belongs to V - S. STEP 3: Add y to set S.

How do you find the second minimum spanning tree?

Using Kruskal's Algorithm – of edges) and find MST using Kruskal's algorithm in O(E) time (No. of edges in MST = V-1 where V = no. of vertices in the graph G). For each edge in MST, temporarily exclude it from the edge list (so that we cannot choose it).

Does adding an edge to a spanning tree create a cycle?

We recall two of the defining properties of a tree: Adding an edge that connects two vertices in a tree creates a unique cycle.


2 Answers

Let [a(1), a(2), ..., a(n-1)] be a sequence of edges selected from E to construct MST of G by Kruskal's algorithm (in the order they were selected - weight(a(i)) <= weight(a(i + 1))).

Let's now consider how Kruskal's Algorithm behaves being given as input E' = E U {e}. Let i = min{i: weight(e) < weight(a(i))}. Firstly algorithm decides to choose edges [a(1), ..., a(i - 1)] (e hasn't been processed yet, so it behaves the same). Then it need to decide on e - if e is dropped, solution for E' will be the same as for E. So let's suppose that first i edges selected by algorithm are [a(1), ..., a(i - 1), e] - I will call this new sequence a'. Algorithm continues - as long as its following selections (for j > i) satisfy a'(j) = a(j - 1) we are cool. There are two scenarios that break such great streak (let's say streak breaks at index k + 1):

1) Algorithm selects some edge e' that is not in T, and weight(e') < weight(a(k+1)). By now a' sequence is:

[a(1), ..., a(i-1), e, a(i), a(i+1), ..., a(k-1), a(k), e']

But if it was possible to append e' to this list it would be also possible to append it to [a(1), ..., a(k-1), a(k)]. But Kruskal's algorithm didn't do it when looking for MST for G. That leads to contradiction.

2) Algorithm politely selected:

[a(1), ..., a(i-1), e, a(i), a(i+1), ..., a(k-1), a(k)]

but decided to drop edge a(k+1). But if e was not present in the list algorithm would decide to append a(k+1). That means that in graph (V, {a(1), ..., a(k)}) edge a(k+1) would connect the same components as edge e. And that means that after considering by algorithm edge a(k + 1) in case of both G and G' the division into connected components (determined by set of selected edges) is the same. So after processing a(k+1) algorithm will proceed in the same way in both cases.

like image 112
lopek Avatar answered Sep 28 '22 05:09

lopek


When ever a edge is add to a graph without adding a node , then that edge creates a cycle in minimum spanning tree of graph, cycle length may vary from 2 to n where n= no of nodes in graph. T = Minimum spanning tree of G Now to find the MST for (T + added edge) , we have to just remove one edge from that cycle .. so remove that edge which has maximum weight.

So T' always comes from T U {e}.

And if you are thinking that this doesn't prove that new MST will be an edge set of T U {e} then analyse Kruskal algorithim for for new graph. i.e. if e is of minimum weight it must have been selected for MST acc to Kruskal algorithim and same here if it is minimum it can not be removed from cycle.

like image 33
Aditya Kumar Avatar answered Sep 28 '22 05:09

Aditya Kumar