



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Main points of this exam paper are: Dijkstra'S Algorithm, Network Flows, Fulkerson Algorithm, Residual Network, Augmenting Paths, Augmentation Step, Numerical Value, Maximum , Ow, Minimum Cut
Typology: Exams
1 / 5
This page cannot be seen from the preview
Don't miss anything!




Spring 2000 Midterm #2 Demmel / Shewchuk
This is a closed book, closed calculator, closed computer, closed network, open brain exam, but you are permitted a one-page, double-sided set of notes.
Write all your answers on this exam. If you need scratch paper, ask for it, write your name on each sheet, and attach it when you turn it in (we have a stapler).
Do not open your exam until you are told to do so!
Spring 2000 Midterm #2 Demmel / Shewchuk
(a) (6 points) Draw the residual network after we have updated the flow using these two augmenting paths (in the order given).
(b) (4 points) List all of the augmenting paths that could have been chosen for the third augmentation step.
(c) (2 points) What is the numerical value of the maximum flow? Draw a dotted line through the original graph to represent the minimum cut.
Spring 2000 Midterm #2 Demmel / Shewchuk
(b) (3 points) Show that MAX-SATURATED-FLOW is in NP.
(c) (8 points) Show that MAX-SATURATED-FLOW is NP-hard. Hint: the easiest reduction is not from one of the NP-complete graph problems you know. What other NP-complete problems do you know?
Spring 2000 Midterm #2 Demmel / Shewchuk
For example, if S = [4, 9 , 2 , 4 , 1 , 3 , 7], the MASS is A = [9, 2 , 4 , 1 , 7] which evaluates to 9 − 2 + 4 − 1 + 7 = 17. If S = [7, 6 , 5 , 4 , 3 , 2 , 1], the MASS is A = [7]. Clearly, the length of the MASS depends on the actual values in S. Assume that the length of S is at least one, and all its elements are integers greater than zero. The following questions ask you to develop a dynamic programming algorithm to find the value of the MASS (but not the actual subsequence) for a given sequence. We would like a solution with optimal running time, but you will only lose a few points if you have a correct, suboptimal algorithm. (a) (3 points) Describe the subproblems you will need to solve. How many tables (of sub- problem solutions) do you need? What is the dimension of the table(s)? What do the table entries represent? (Hint: it helps to treat subsequences of even and odd lengths separately.)
(b) (7 points) Write a recursion for the values your algorithm will fill into the table(s). Also write the base case(s); i.e. the table value(s) that bootstrap(s) the recursion.
(c) (4 points) Write iterative, non-recursive pseudocode for your algorithm.
(d) (1 point) What is the running time of your algorithm?