Professional Documents
Culture Documents
March 2015
Due March 15th, 2016. 11:00 AM. Submit the solutions at CSE 4246. No late submissions.
No electronic submissions.
Instructions:
1. Solve exactly four problems so that for 1 ≤ i ≤ 4 you select exactly one of the two problems
numbered 2i − 1 and 2i. The first two problems carry 11 points each and all other problems
carry 12 points each.
2. Although this exam is an open book exam, you are only allowed to consult the following
standard textbooks or course lecture notes. You should not consult the Web.
3. This test is designed to give you an opportunity to demonstrate your understanding of the
principles of algorithm design, analysis and application. Consequently, you are required to
work by yourself in answering the questions. Group work or consultation with others is not
allowed. You can check with the instructor or the TA for any clarification.
4. Each problem requires that you achieve an algorithm with certain complexity (for example,
polynomial time, linear time, etc.). To the extent the problem permits latitude in terms of
complexity (for example, polynomial time provides considerable latitude), obtain the most
efficient algorithm.
(a) Write your solutions neatly. Proofread them before you submit.
(b) Write a high-level description of your algorithm. State the main ideas and strategies used
in developing your algorithm. Include all important details.
(c) Write your algorithm using a high-level pseudo language providing important imple-
mentation details. If you are using a modified version of a well-known algorithm, show
clearly what your modifications are. If you are using a well-known algorithm without
any modifications, it is enough to specify how you plan to apply the algorithm.
1
(d) Provide a detailed proof of correctness.
(e) Analyze the time complexity of your algorithm.
(f) Quality of the high-level description of your algorithm, its correctness and efficiency are
the prime determinants of your grade.
(b) Give a polynomial-time approximation algorithm for this problem with the following guarantee:
It returns a feasible set S ⊆ A whose total sum is at least half as large as the maximum total
sum of any feasible set S 0 ⊆ A. Your algorithm should have a running time of at most O(n log n).
Less efficient algorithms will get partial credit.
Provide a clear description of your algorithm, analyze its time complexity, argue that it returns
a feasible set, and prove its performance guarantee.
2
2. Give a polynomial time algorithm that, given a graph G with n vertices, either finds an
independent set of size at least n/3 or certifies that no independent set in G has size greater
than 2n/3. (It may involve using an algorithm for linear programming.)
Provide a clear description of your algorithm, analyze its time complexity, and argue that it
either returns an independent set of size at least n/3 or concludes that there is no independent
set of size greater than 2n/3.
3. Consider the special case of graphs of at most degree 3. Find α > 1/3 and a polynomial time
algorithm that either finds an independent set of size αn or certifies that no independent set
has size (1 − α)n. Obtain as good an α as you can.
Provide a clear description of your algorithm, analyze its time complexity, determine α, and
argue that your algorithm either returns an independent set of size at least αn or concludes
that there is no independent set of size greater than (1 − α)n.
rV + rW = d¯
Let vi be the cost of shipping a widget from warehouse V to destination Di , and wi be the cost
of shipping a widget from warehouse W to destination Di , for 1 ≤ i ≤ n. The warehouse problem is
the problem of finding xi , yi ∈ N for 1 ≤ i ≤ n such that when xi widgets are sent from V to Di
and yi widgets are sent from W to Di :
3
simple) e1 , . . . , et in G is always non−negative if the sum of the weights of e1 up to ei is non-negative
for all 1 ≤ i ≤ t. A source s and a destination s0 are given as inputs. Give an algorithm to decide
whether there is an always non-negative path from s to s0 .
Use dynamic programming to design an O(nm) algorithm where m is number of edges in
the graph. Provide a clear description of your dynamic programming definitions and recursive
formulations. Make sure that your definitions and recursive formulations deal with the determination
of the desired path as well as its existence. Prove the correctness of your algorithm.
Present pseudocode to implement your algorithm and analyze its time complexity.
You will get partial credit if you present an algorithm whose complexity is worse than nm.
Note: A path in a graph is simple if it does not repeat vertices.
1. Prove that for any sequence of sets S1 , . . . , Sd , there exists a fair driving schedule.
2. Give an algorithm to compute a fair driving schedule with running time in polynomial in k
and d.
4
Provide a high-level description of your algorithm, prove its correctness, and analyze its time
complexity.
Problem 7: IPO
Consider the following problem. You are designing the business plan for a start-up company. You
have identified n possible projects for your company, and for each project, i, you have calculated
the minimum capital you need to start the project, Ri > 0, and the profit you will get after you
complete the project, Pi > 0. Profit is the net revenue obtained after subtracting the capital used
for carrying out the project. You also know your initial capital C0 > 0. You want to perform at
most k, 1 ≤ k ≤ n, projects before the IPO and want to maximize your total capital at the IPO.
Your company cannot perform the same project twice.
0
In other words, you want to pick a list of up to k distinct Ph=jprojects, i1 , · · · , ik with k ≤ k.
0
Your accumulated capital after project ij will be Cj = C0 + h=1 Pih . The sequence must satisfy
the constraint that you have sufficient capital to start ij+1 after completing the first j jobs, i.e.,
Cj ≥ Rij+1 for each j = 0, · · · , k 0 − 1. You want to maximize the final amount of capital, Ck0 .
Design an efficient algorithm. There is an O(n log n) algorithm for this problem. Less efficient
algorithms will get partial credit.
Provide a clear high-level description of your algorithm, write pseudo-code, argue correctness
and analyze time complexity.