Computer Science Engineering (CSE) Exam  >  Computer Science Engineering (CSE) Questions  >  Let G = (V, G) be a weighted undirected graph... Start Learning for Free
Let G = (V, G) be a weighted undirected graph and let T be a Minimum Spanning Tree (MST) of G maintained using adjacency lists. Suppose a new weighed edge (u, v) ∈ V×V is added to G. The worst case time complexity of determining if T is still an MST of the resultant graph is
  • a)
    Θ(∣E∣ + ∣V∣)
  • b)
    Θ(∣E∣.∣V∣)
  • c)
    Θ(E∣ log ∣V∣)
  • d)
    Θ(∣V∣)
Correct answer is option 'D'. Can you explain this answer?
Most Upvoted Answer
Let G = (V, G) be a weighted undirected graph and let T be a Minimum S...
Is added to G with weight w. In order to update the MST T, we can follow the following steps:

1. Add the edge (u, v) to G with weight w.
2. If the weight of (u, v) is greater than the weight of the maximum weight edge in T, then the MST T remains unchanged.
3. Otherwise, find the cycle C in T that is formed by adding the edge (u, v).
4. Find the maximum weight edge e in cycle C. Remove edge e from T.
5. Add the edge (u, v) to T.
6. Repeat steps 3-5 until there are no cycles formed by adding edges.

By following these steps, we can update the MST T in O(log^2(V)) time complexity, where V is the number of vertices in the graph. This is because finding the cycle and the maximum weight edge in the cycle can be done in O(log(V)) time using a union-find data structure.

Note: If the graph is not connected, we need to consider each connected component separately and update the MST for each component.
Free Test
Community Answer
Let G = (V, G) be a weighted undirected graph and let T be a Minimum S...
As T is a minimum spanning tree and we need to add a new edge to existing spanning tree.
Later we need to check still T is a minimum spanning tree or not, So we need to check all vertices whether there is any cycle present after adding a new edge.
All vertices need to traverse to confirm minimum spanning tree after adding new edge then time complexity is O(V).
Explore Courses for Computer Science Engineering (CSE) exam

Similar Computer Science Engineering (CSE) Doubts

Top Courses for Computer Science Engineering (CSE)

Let G = (V, G) be a weighted undirected graph and let T be a Minimum Spanning Tree (MST) of G maintained using adjacency lists. Suppose a new weighed edge (u, v) ∈ V×V is added to G. The worst case time complexity of determining if T is still an MST of the resultant graph isa)Θ(E + V)b)Θ(E.V)c)Θ(E log V)d)Θ(V)Correct answer is option 'D'. Can you explain this answer?
Question Description
Let G = (V, G) be a weighted undirected graph and let T be a Minimum Spanning Tree (MST) of G maintained using adjacency lists. Suppose a new weighed edge (u, v) ∈ V×V is added to G. The worst case time complexity of determining if T is still an MST of the resultant graph isa)Θ(E + V)b)Θ(E.V)c)Θ(E log V)d)Θ(V)Correct answer is option 'D'. Can you explain this answer? for Computer Science Engineering (CSE) 2024 is part of Computer Science Engineering (CSE) preparation. The Question and answers have been prepared according to the Computer Science Engineering (CSE) exam syllabus. Information about Let G = (V, G) be a weighted undirected graph and let T be a Minimum Spanning Tree (MST) of G maintained using adjacency lists. Suppose a new weighed edge (u, v) ∈ V×V is added to G. The worst case time complexity of determining if T is still an MST of the resultant graph isa)Θ(E + V)b)Θ(E.V)c)Θ(E log V)d)Θ(V)Correct answer is option 'D'. Can you explain this answer? covers all topics & solutions for Computer Science Engineering (CSE) 2024 Exam. Find important definitions, questions, meanings, examples, exercises and tests below for Let G = (V, G) be a weighted undirected graph and let T be a Minimum Spanning Tree (MST) of G maintained using adjacency lists. Suppose a new weighed edge (u, v) ∈ V×V is added to G. The worst case time complexity of determining if T is still an MST of the resultant graph isa)Θ(E + V)b)Θ(E.V)c)Θ(E log V)d)Θ(V)Correct answer is option 'D'. Can you explain this answer?.
Solutions for Let G = (V, G) be a weighted undirected graph and let T be a Minimum Spanning Tree (MST) of G maintained using adjacency lists. Suppose a new weighed edge (u, v) ∈ V×V is added to G. The worst case time complexity of determining if T is still an MST of the resultant graph isa)Θ(E + V)b)Θ(E.V)c)Θ(E log V)d)Θ(V)Correct answer is option 'D'. Can you explain this answer? in English & in Hindi are available as part of our courses for Computer Science Engineering (CSE). Download more important topics, notes, lectures and mock test series for Computer Science Engineering (CSE) Exam by signing up for free.
Here you can find the meaning of Let G = (V, G) be a weighted undirected graph and let T be a Minimum Spanning Tree (MST) of G maintained using adjacency lists. Suppose a new weighed edge (u, v) ∈ V×V is added to G. The worst case time complexity of determining if T is still an MST of the resultant graph isa)Θ(E + V)b)Θ(E.V)c)Θ(E log V)d)Θ(V)Correct answer is option 'D'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of Let G = (V, G) be a weighted undirected graph and let T be a Minimum Spanning Tree (MST) of G maintained using adjacency lists. Suppose a new weighed edge (u, v) ∈ V×V is added to G. The worst case time complexity of determining if T is still an MST of the resultant graph isa)Θ(E + V)b)Θ(E.V)c)Θ(E log V)d)Θ(V)Correct answer is option 'D'. Can you explain this answer?, a detailed solution for Let G = (V, G) be a weighted undirected graph and let T be a Minimum Spanning Tree (MST) of G maintained using adjacency lists. Suppose a new weighed edge (u, v) ∈ V×V is added to G. The worst case time complexity of determining if T is still an MST of the resultant graph isa)Θ(E + V)b)Θ(E.V)c)Θ(E log V)d)Θ(V)Correct answer is option 'D'. Can you explain this answer? has been provided alongside types of Let G = (V, G) be a weighted undirected graph and let T be a Minimum Spanning Tree (MST) of G maintained using adjacency lists. Suppose a new weighed edge (u, v) ∈ V×V is added to G. The worst case time complexity of determining if T is still an MST of the resultant graph isa)Θ(E + V)b)Θ(E.V)c)Θ(E log V)d)Θ(V)Correct answer is option 'D'. Can you explain this answer? theory, EduRev gives you an ample number of questions to practice Let G = (V, G) be a weighted undirected graph and let T be a Minimum Spanning Tree (MST) of G maintained using adjacency lists. Suppose a new weighed edge (u, v) ∈ V×V is added to G. The worst case time complexity of determining if T is still an MST of the resultant graph isa)Θ(E + V)b)Θ(E.V)c)Θ(E log V)d)Θ(V)Correct answer is option 'D'. Can you explain this answer? tests, examples and also practice Computer Science Engineering (CSE) tests.
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

Explore Courses
Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev