Question: Problem 1. (50 points) Here are two possible algorithms for computing MST. The input of these algorithms is a connected and undirected graph G=(V,E) that

 Problem 1. (50 points) Here are two possible algorithms for computing

Problem 1. (50 points) Here are two possible algorithms for computing MST. The input of these algorithms is a connected and undirected graph G=(V,E) that is edge weighted by . The output is a set of edges TE. For each algorithm, you need to determine whether the possible MST algorithm works, i.e., returns an MST for G. If you determine it works, then show the correctness of the algorithm. Otherwise, show that the algorithm does not compute a MST. \begin{tabular}{l} \hline Algorithm 1 PossiblE-MST-1 (G,w) \\ 1: sort the edges in nonincreasing order based on their weight \\ 2: TE \\ 3: for each edge e, obtained in nonincreasing oreder by weight do \\ 4: if T{e} is a connected graph then \\ 5: TT{e} \\ 6: return T \\ \hline \end{tabular} \begin{tabular}{l} \hline Algorithm 2 Possible-MST-2 (G,w) \\ \hline 1: T \\ 2: for each edge e, obtained in arbitrary order do \\ 3: if there is no cycle in T{e} then \\ 4: TT{e} \\ 5: return T \end{tabular}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!