Question

Let G=(V, E) be a connected graph with a weight w(e) associated with each edge e....

Let G=(V, E) be a connected graph with a weight w(e) associated with each edge e. Suppose G has n vertices and m edges. Let E’ be a given subset of the edges of E such that the edges of E’ do not form a cycle. (E’ is given as part of input.) Design an O(mlogn) time algorithm for finding a minimum spanning tree of G induced by E’. Prove that your algorithm indeed runs in O(mlogn) time. A minimum weight spanning tree of G induced by E’ is defined as follows: Let T be the set of all the spanning trees of G that contain all the edges of E’. Tmin is defined as the tree with minimum weight among all the trees in T. Notice that Tmin can be different from the minimum spanning tree (MST) of the graph.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

First of all, what is minimum spanning tree?

Given a graph G(V,E), a spanning tree is a sub-graph of that graph which is a tree(do not contain any cycle) and has all the nodes connected. There could be multiple spanning trees in a graph. A minimum spanning tree is a tree which has minimum weights among all the other spanning trees i.e. the minimum spanning tree has has weight less than weight of any other spanning tree.

A minimum spanning tree will have V-1 edges where V is the number of nodes in that tree.

We can find the minimum spanning tree of a graph in O(mLogn) time. There are several algorithms to find the Minimum Spanning Tree. Here, we will be discussing Kruskal algorithm to find minimum spanning tree.

Kruskal Algorithm to find minimum spanning tree:

  1. Sort all the edges in the increasing/(non-decreasing) order of their weight in the given graph. Let it be denoted by E'.
  2. Initialize the empty tree, say MST.
  3. Repeat Step 4 until V-1 edges are taken.
  4. Pick the smallest edge from the E' and check if it do not form a cycle by including it in the MST.
    If it do not form the cycle by adding that edge, then include it in the MST.
    Else, discard that edge and do not include it in the MST.

The above 4 steps will create the Minimum Spanning Tree from the given graph.

Time Complexity for this algorithm:

Firstly, we sort the edges of the graph which can be done in O(ELogE) time.
After sorting, we run a loop for the edges and checking of the cycle after including that edge can be done in O(LogV) time using find and union operations. Hence, this step takes O(ELogV) time.

Hence, the total time complexity will be: O(ELogE) + O(ELogV). As number of edges can be utmost the square of number of nodes in the graph i.e. , so O(LogV) and O(LogE) are same.

Hence, the net time complexity will become O(ELogE) or O(ELogV) i.e. the algorithm takes O(mLogn) time.

Lets see and example:

For any further details, you may write in the comment section.

Add a comment
Know the answer?
Add Answer to:
Let G=(V, E) be a connected graph with a weight w(e) associated with each edge e....
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 2. Let G = (V, E) be an undirected connected graph with n vertices and with...

    2. Let G = (V, E) be an undirected connected graph with n vertices and with an edge-weight function w : E → Z. An edge (u, v) ∈ E is sparkling if it is contained in some minimum spanning tree (MST) of G. The computational problem is to return the set of all sparkling edges in E. Describe an efficient algorithm for this computational problem. You do not need to use pseudocode. What is the asymptotic time complexity of...

  • Problem 3's picture are given below. 5. (a) Let G = (V, E) be a weighted connected undirected simple graph. For n...

    Problem 3's picture are given below. 5. (a) Let G = (V, E) be a weighted connected undirected simple graph. For n 1, let cycles in G. Modify {e1, e2,.. . ,en} be a subset of edges (from E) that includes no Kruskal's algorithm in order to obtain a spanning tree of G that is minimal among all the spanning trees of G that include the edges e1, e2, . . . , Cn. (b) Apply your algorithm in (a)...

  • Let G = (V. E) be an undirected, connected graph with weight function w : E → R

    Problem 4 Let G = (V. E) be an undirected, connected graph with weight function w : E → R. Furthermore, suppose that E 2 |V and that all edge weights are distinct. Prove that the MST of G is unique (that is, that there is only one minimum spanning tree of G).

  • Let G = (V, E, W) be a connected weighted graph where each edge e has...

    Let G = (V, E, W) be a connected weighted graph where each edge e has an associated non-negative weight w(e). We call a subset of edges F subset of E unseparating if the graph G' = (V, E\F) is connected. This means that if you remove all of the edges F from the original edge set, this new graph is still connected. For a set of edges E' subset of E the weight of the set is just the...

  • IN JAVA Given is a weighted undirected graph G = (V, E) with positive weights and...

    IN JAVA Given is a weighted undirected graph G = (V, E) with positive weights and a subset of its edges F E. ⊆ E. An F-containing spanning tree of G is a spanning tree that contains all edges from F (there might be other edges as well). Give an algorithm that finds the cost of the minimum-cost F-containing spanning tree of G and runs in time O(m log n) or O(n2). Input: The first line of the text file...

  • Let G be an undirected graph and let X be a subset of the vertices of...

    Let G be an undirected graph and let X be a subset of the vertices of G. A connecting tree on X is a tree composed out of the edges of G that contains all the vertices in X. One way to compute a connecting tree consists of two steps: (1) Compute a minimum spanning tree T over G. (2) Delete all the edges out of T not needed to connect vertices in X. Give an algorithm(Pseudo-code) to carry out...

  • You are given an undirected graph G with weighted edges and a minimum spanning tree T of G.

    You are given an undirected graph G with weighted edges and a minimum spanning tree T of G. Design an algorithm to update the minimum spanning tree when the weight of a single edge is increased. The input to your algorithm should be the edge e and its new weight: your algorithm should modify T so that it is still a MST. Analyze the running time of your algorithm and prove its correctness.

  • You are given an undirected graph G with weighted edges and a minimum spanning tree T of G.

    You are given an undirected graph G with weighted edges and a minimum spanning tree T of G. Design an algorithm to update the minimum spanning tree when the weight of a single edge is decreased. The input to your algorithm should be the edge e and its new weight; your algorithm should modify T so that it is still a MST. Analyze the running time of your algorithm and prove its correctness.

  • Suppose you are given a connected graph G, with edge costs that you may assume are...

    Suppose you are given a connected graph G, with edge costs that you may assume are all distinct. G has n vertices and m edges. A particular edge e of G is specified. Give an algorithm with running time O(m + n) to decide whether e is contained in a minimum spanning tree of G.

  • Updating an MST when an edge weight changes. You have a graph G= (V, E) with...

    Updating an MST when an edge weight changes. You have a graph G= (V, E) with edge weights given in the graph (whatever they are). In addition, a minimum spanning tree T= (V, E′) of this graph has also been given to you. Now, say we need to increase the weight of one particular edge e. Does the MST change? If so, show how to compute the new MST in linear time. You should consider two cases: 1). when e∈E′and...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT