Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

5 . 2 2 . You are given a graph G = ( V , E ) with positive edge Note, you are given the

5.22. You are given a graph G=(V,E) with positive edge Note, you are given the tree T and the edge e=(y,z) whose weight is changed; you are told it's
old weight w(e) and it's new weight widehat(w)(e)(which you type in latex by Iwidehat {w}(e) surrounded by
double dollar signs).
In each case specify if the tree might change. And if it might change then give an algorithm to find
the weight of the possibly new MST (just return the weight or the MST, whatever's easier). You can
use the algorithms from class (DFS, Explore, BFS, Dijkstra's, SCC, Topological Sort) as black-box
algorithms if you'd like. Explain your algorithm in words. Note the running time of your algorithm
in terms of n and m.
Part (a): e!inT and widehat(w)(e)>w(e) :weights, and a minimum spanning tree5.22. You are given a graph G=(V,E) with positive edge weights, and a minimum spanning tree
T=(V,E') with respect to these weights; you may assume G and T are given as adjacency lists.
Now suppose the weight of a particular edge einE is modified from w(e) to a new value hat(w)(e). You
wish to quickly update the minimum spanning tree T to reflect this change, without recomputing
the entire tree from scratch. There are four cases. In each case give a linear-time algorithm for
updating the tree.
(a)e!inE' and hat(w)(e)>w(e).
(b)e!inE' and hat(w)(e)
T=(V,E') with respect to these weights; you may assume G and T are given as adjacency lists.
Now suppose the weight of a particular edge einE is modified from w(e) to a new value hat(w)(e). You
wish to quickly update the minimum spanning tree T to reflect this change, without recomputing
the entire tree from scratch. There are four cases. In each case give a linear-time algorithm for
updating the tree.
(a)e!inE' and hat(w)(e)>w(e).
(b)e!inE' and einE'einE'hat(w)(e)>w(e)hat(w)(e).
(d)einE' and hat(w)(e)>w(e).hat(w)(e).
(c)einE' and hat(w)(e).
(d)einE' and hat(w)(e)>w(e).5.22. You are given a graph G=(V,E) with positive edge weights, and a minimum spanning tree
T=(V,E') with respect to these weights; you may assume G and T are given as adjacency lists.
Now suppose the weight of a particular edge einE is modified from w(e) to a new value hat(w)(e). You
wish to quickly update the minimum spanning tree T to reflect this change, without recomputing
the entire tree from scratch. There are four cases. In each case give a linear-time algorithm for
updating the tree.
(a)e!inE' and hat(w)(e)>w(e).
(b)e!inE' and einE'einE'hat(w)(e)>w(e)hat(w)(e).
(d)einE' and hat(w)(e)>w(e).hat(w)(e).
(c)einE' and hat(w)(e).
(d)einE' and hat(w)(e)>w(e).Note, you are given the tree T and the edge e=(y,z) whose weight is changed; you are told it's
old weight w(e) and it's new weight widehat(w)(e)(which you type in latex by Iwidehat {w}(e) surrounded by
double dollar signs).
In each case specify if the tree might change. And if it might change then give an algorithm to find
the weight of the possibly new MST (just return the weight or the MST, whatever's easier). You can
use the algorithms from class (DFS, Explore, BFS, Dijkstra's, SCC, Topological Sort) as black-box
algorithms if you'd like. Explain your algorithm in words. Note the running time of your algorithm
in terms of n and m.
Part (a): e!inT and widehat(w)(e)>w(e) :
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

=+j What rules will apply to the process of negotiations?

Answered: 1 week ago

Question

What is Change Control and how does it operate?

Answered: 1 week ago

Question

How do Data Requirements relate to Functional Requirements?

Answered: 1 week ago