This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: % % nz = NNZ(S) is the number of nonzero elements in S. % I = FIND(X) returns the linear indices corresponding to % the nonzero entries of the array X. X may be a logical expression. Ap = A; x = zeros(size(A,2),1); while (nnz(Ap) > 0) cov = sum(Ap,1); ind = find(max(cov) == cov); x(ind) = 1; 1 eInd = find(Ap(:,ind)==1); Ap(eInd,:) = 0; end What does the above code do? What is its bound to the optimum? What is the stopping criteria? 3 MST What is a minimum spanning tree? What type of algorithm is Kruskal’s algorithm? Why? Write out pseudo code for Kruskal’s algorithm. 2...
View Full Document
- Spring '12
- Kruskal's algorithm, Kruskal, worst running time, pseudo code. procedure