Question: [10 marks] The algorithm Another MST given in the following pseudocode takes a connected, undirected graph G = (V, E) and a weight function w
[10 marks] The algorithm Another MST given in the following pseudocode takes a connected, undirected graph G = (V, E) and a weight function w as input, and returns a set of edges T E:
Another MST(G, w)
1: T empty set
2: for each edge e E, taken in arbitrary order do
3: T T e
4: if T has a cycle c then
5: let e be a maximum-weight edge on c
6: T T e
7: return (T)
**Argue that the above algorithm always returns a spanning tree of G. That is, argue that the tree, T, computed by this algorithm is a connected, acyclic graph containing all the vertices of G. Next, consider the Another MST algorithm. This time you can simplify your solution by assuming that the edge weights are distinct in G. Is the spanning tree T computed by this algorithm a minimum spanning tree of G? (a) Give your answer. (b) Prove the answer that you gave for question (a).
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
