Show all work. Partial credit is granted for sound reasoning.
b. Determine whether or not T(n) is O(n3 3n) and verify that your answer is correct.
1. Algorithm Cover(V, E)
2. {
3. U: = Ø ;
4. repeat
5. {
6. Let q be a vertex from V of maximum degree;
7. Add q to U; Eliminate q from V;
8. E: = E - { (x,y) such that x = q or y = q};
9. } until ( E = Ø ); // U is the node cover
10. }
Does this algorithm always generate a minimum node cover? Explain your answer.
V.
Suppose V = {1, 2, . . . , n}. A dynamic programming formulation computes the matrix Ak where
V.
We start with A0 = A and it is easy to see that A* = An. Describe how you would compute Ak from Ak-1. What is the worse case time complexity for computing A*?
b. State the dynamic programming algorithm formulation for finding the shortest path from s to t in a multistage graph where s and t are nodes in the first and last stages respectively.
EXTRA: (10 points) (only try when numbers 1-3 are completed)
Let G = (V, E, w) be a weighted undirected graph with all weights positive and distinct. Let {A, B} be a partition of V, i.e,
B = Ø , A
Ø , B
Ø