Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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