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 e in E is modified from w(e) to a new value 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. Note, you are given the tree T and the edge e = (y, z) whose weight is changed; you are told its old weight w(e) and its new weight w~(e) (which you type in latex by widetilde{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 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.
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 e in E is modified from w(e) to a new value 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
Note, you are given the tree T and the edge e = (y, z) whose weight is changed; you are told its old weight w(e) and its new weight w~(e) (which you type in latex by widetilde{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 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.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps