Exam 3 1
Exam 3 1
Instructions
No need to prove the correctness of your algorithm, unless the question explicitly asks you to
prove it.
Most questions have a page limit mentioned in square brackets against them. You are expected
to complete your answers within the allowed number of pages. Your answers should be neat and
clean.
Problem Set
1. We run the matching-based 2-approximation algorithm for computing a minimum vertex cover
of the complete graph Kn (it has all the n2 edges) on n > 100 vertices. Which of the following
statements is necessarily true?
(a) The algorithm produces a vertex cover of size exactly twice the optimal.
(b) The algorithm produces an optimal vertex cover.
(c) The algorithm produces a non-optimal vertex cover.
(d) The algorithm produces a vertex cover with at most one more vertex than in an optimal
cover.
2. Consider Karger’s min-cut algorithm being run on a graph G with 22 vertices and 31 edges that
has a single minimum cut. Which of the following is the tightest lower bound on the probability
that the minimum cut is still present after 5 steps?
67
(a) 100
136
(b) 231
53
(c) 100
167
(d) 231
1
4. You are given a stream of songs lasting for t1 , t2 , t3 , . . . , tn seconds. You have two write-once
devices D1 and D2 , each capable of storing songs of total duration T seconds. When the i-th
song starts, you have three options: (i) copy the song to D1 , (ii) copy the song to D2 , or (iii)
discard the song. The copy of a song to a device is allowed only when there is enough memory
left in that device. Assume that the individual song durations ti are known to you beforehand,
Pn
and these durations satisfy ti ≤ T for all i, and ti ≤ 2T . Your goal is to maximize the
i=1
total copy time in the two output devices together. To that effect, you run the following greedy
algorithm. Derive a tight approximation ratio of the algorithm. Prove that the approximation
ratio is tight.
for i = 1, 2, 3, . . . , n (in that order)
{
If D1 can accommodate the i-th song, copy the i-th song to D1 ,
else if D2 can accommodate the i-th song, copy the i-th song to D2 ,
else discard the i-th song, and continue.
}
5+3=8 marks [1 page].