Compre
Compre
2024)
• This question paper has 4 printed pages with 6 questions in all and total marks (5 + 3 + 2) +
(8 + 2 + 8) + (8 + 8) + (14) + (1 + 4 + 10) + (2 + 1 + 1 + 1 + 4 + 1 + 4 + 1) = 88. Please show
all steps in computations or proofs with complete derivation of complexity results. This is an
open-book exam. You can use any printed or handwritten material restricted to the textbook,
reference books, and lecture notes. Calculators are allowed. Time: 180 minutes
• Algorithms should be written in standard English in either the form of Pseudocode, the
styles followed in textbooks or mathematical expressions. Time complexity and recurrence
relations are compulsory.
• Show each step and draw a diagram in pen-only with legibility/clarity. Write all subsequent
parts of a question together. Write “END” after your last answer. DON’T KEEP ANY PAGE
BLANK in between pages of the Answer booklet. Strike out if any such blank page exists at
the end of your answer/exam.
• Don’t unnecessarily copy the lecture slides/textbook / other study materials anywhere in the
answer booklet to avoid plagiarism. Marks might be deducted in such cases. Just cite the
reference of the resources used in your answer, if needed.
• Overwritten and illegible answers in any form will not be given full/partial credit and will
not be considered for RECHECKs. You can make necessary assumptions in case you need
to derive your solutions.
• Penalties will be as per AUGSD rules for any misconduct.
• GOOD LUCK!
1. (a) Solve the following scenario of the Fractional Knapsack problem: There are 5 items
(I1 , I2 , I3 , I4 , I5 ) with profit of the items given by (p1 , p2 , p3 , p4 , p5 ) = (15, 40, 32, 20, 30),
and weight of the items given by (w1 , w2 , w3 , w4 , w5 ) = (3, 4, 6, 2, 3). The knapsack ca-
pacity is W = 12. The loss for dividing any item into fractions is 2 units of the profit
made. Find out the maximum profit that can be made in this scenario.
(b) Is it possible to solve the Fractional Knapsack problem in linear time complexity? If
Yes, can you suggest an algorithm for the Fractional Knapsack problem with linear time
complexity? If No, why not?
(c) Solve the following reccurrence:
√
T (n) = 4T n + (log2 n)2 .
1
C1 C2 C3 C4 Sum
R1 6.4 4.5 2.5 9.6 23.0
R2 2.1 1.3 8.6 4.0 16.0
R3 7.5 3.2 1.9 6.4 19.0
Sum 16.0 9.0 13.0 20.0 58.0
Table 1: Table for Question 2.
(a) Design an efficient algorithm to determine whether such an integer conversion by round-
ing off is possible. Determine the time complexity of your algorithm.
(b) Using your algorithm in part (a), derive the rounded matrix for the given example in
Table 1.
(a) Design an efficient algorithm to solve his requirement to maximize the team’s product
value in O(MN) time. The top-left part is defined below, following which you can derive
the other parts. First part, top-left = { all cells (p, q)|p < m, q < n }.
(b) Using your algorithm in part (a), solve the given problem, which will maximize the
product value of the table shown in Figure 1.
2
4. By making use of efficient algorithms, find the last three (least significant) digits in the
decimal expansion of
20242024 .
5. Consider the algorithm RSAT (Algorithm 1) for solving the 3SAT problem:
Algorithm 1 RSAT(F)
i←1 t
3
while i ≤ 20 · do ▷ t is the number of clauses in F
2
Let F ′ be the set of 2-CNF and 1-CNF clauses in F
for Every 3-clause C = (l1 ∨ l2 ∨ l3 ) in F do ▷ l1 , l2 , l3 are literals
Randomly choose an l j (1 ≤ j ≤ 3)
Remove l j from C forming a new 2-clause C′
Add C′ to F ′
end for
Solve the resulting 2SAT instance F ′ in polynomial time, getting an assignment A
if A satisfies F then
return SAT
end if
i ← i+1
end while
return UNSAT
(a) Find the minimum cardinality vertex cover for Cn , and also prove your result.
(b) Give an Integer Linear Programming formulation for the problem of finding the mini-
mum cardinality vertex cover for Cn .
(c) Convert your formulation in (b) into a Linear Programming formulation.
(d) Write the Dual Linear Program for the Linear Program in (c).
(e) Solve the Linear Program in (c), giving a proof that your solution is indeed optimal.
(f) Convert your solution in (e) into a vertex cover, giving the rule that you followed for the
conversion.
3
(g) Solve the Dual Linear Program in (d), giving a proof that your solution is indeed optimal.
(h) Convert your solution in (g) into a vertex cover, giving the rule that you followed for the
conversion.