Assignment 2 - CSE 4131
Assignment 2 - CSE 4131
ASSIGNMENT 2:
--------------------------------------------------------------------------------------------------------------------------------------------------------
1. Using the (conditions, operators) model, formulate a planning instance for the L2, L3
fifteen-puzzle problem — a 4 × 4 grid with fifteen movable tiles labeled as 1, 2, . . . PO1,
, 15, and a single hole, with the goal of moving the tiles around so that the numbers PO2
on the tiles end up in ascending order.
1 2 3
4 5 8
PO1,
7 6 PO2
3. Prove the following statement. “If a Planning instance with n conditions has a PO1, L2, L3, L4
solution, then it has one using at most 2𝑛𝑛 − 1 steps.” PO2
4. Given an instance of the QSAT problem as follows. L2, L3, L4
Draw the recursion tree that leads to all possible truth assignments for the given
QSAT. Check each assignment for the solution of 𝜑𝜑.
5. Given a new problem P, being a student of Algorithm Design, discuss in detail, the L2, L3, L4
PO1,
possible options/approaches you will explore to solve the problem using a
PO4
computer.
7. Consider a statement - “The intractability of Vertex Cover decision problem only L2, L3, L4
sets in for real, once k grows as a function of n.” (Where n is the number of nodes PO1,
in the graph, and k is the allowable size of a vertex cover.) Justify the statement PO2
with proper reasoning.
8. The Uncapacitated facility location problem can be defined as follows. L2, L3, L4
For j = 1, . . . , n do {
Let 𝑀𝑀𝑖𝑖 be a machine that achieves the minimum load min 𝑇𝑇𝑘𝑘
𝑘𝑘
11. Consider an example scenario of Center-Selection problem with only two sites s L2, L3, L4
and z, and the number of centers k = 2. Assume that s and z are located in the plane, PO1,
with distance equal to the standard Euclidean distance in the plane, and that any PO2
point in the plane is an option for placing a center. Let d be the distance between s
and z. Then find the best location for (i) Case1: a single center c1 and (ii) Case2:
then subsequent best location for second center c2. In each case, also find the
optimal covering radius r(C).
12. Given an approximation algorithm for weighted-set-cover problem as below: L2, L3, L4
Greedy-Set-Cover (U, 𝑆𝑆1 , … , 𝑆𝑆𝑚𝑚 , w) {
Start with 𝑅𝑅 ← 𝑈𝑈 (No element is covered yet)
Initialize 𝐶𝐶 ← ∅ (No set is selected yet)
While 𝑅𝑅 ≠ ∅
𝑤𝑤𝑖𝑖
Select a set 𝑆𝑆𝑖𝑖 that minimizes |𝑆𝑆 ∩𝑅𝑅|
𝑖𝑖
Using the above algorithm, find the solution C for the following set-cover problem
instance and compare this solution with the optimal solution C*.
A Set-Cover instance is given as, U={1,2,3,4,5,6,7,8}, and list of subsets
S1={1,3,5,7}, S2={2,4,6,8}, S3={1}, S4={2}, S5={3,4}, S6={5,6,7,8} and the
weight array w[ ] = {1+ε, 1+ε, 1,1,1,1,1,1}, where ε is a very small value between 0
and 1.
cover for the given graph with four vertices having vertex weights/costs 2, 2, 4 and
9. Compare your solution with the optimal solution for this example.
14. Prove that: “For any vertex cover S, and any nonnegative and fair prices 𝑝𝑝𝑒𝑒 , we PO1, L2, L3
have Σ 𝑝𝑝 ≤ 𝑤𝑤(𝑆𝑆).” (Fairness lemma) PO2
e∈E 𝑒𝑒
15. Show that “the set S returned by the algorithm (mentioned in Q13) is a vertex PO1, L2, L3
cover, and its cost is at most twice the minimum cost of any vertex cover.” PO2
16. Give a critical comparison between the two versions of the Dynamic Programming L2, L3
based solutions described as follows to solve the Knapsack problem.
i. The first version formulate the structure of the sub problems as OPT(i, w):
the sub problem to compute the maximum value of any solution using a PO1,
subset of items 1,…,i and a knapsack of capacity w. PO2
ii. The second version formulate the structure of the sub problems as OPT(i, v):
the sub problem of finding the minimum weight of a knapsack for which we
can obtain a solution of value at least v using a subset of items 1,…,i.
17. Give a comparison between Approximation algorithm, Approximation scheme and PO1, L2, L3
Fully polynomial-time approximation scheme with examples. PO2
18. Though Vertex-Cover ≤𝑝𝑝 Set-Cover, why do they have different lower bounds on PO1, L2, L3
the approximability? PO2
19. Compare the fairness conditions used in the approximation solutions for Weighted- PO1, L2, L3
Set-Cover and Weighted-Vertex-Cover problems. PO2
20. Show that the approximation algorithm we studied in the class for the Knapsack L2, L3
PO1,
problem always runs in polynomial time even if the values and weights are large
PO2
and achieves the approximation ratio (1+ε).
Submit the hard copy of your assignment by the due date, i.e. 14.06.2023.
Part of your assignment grade comes from its "external correctness." This is based on correct output on various sample inputs.
The rest of your assignment's score comes from "internal correctness." Internal correctness includes:
1. Use of methods to minimize the number of steps.
2. Appropriate use of rules, axioms, and suitable diagrams to enhance readability of your responses.
Send a zip folder (name of the zip folder must be your registration number_AD2) containing the code and output file/screen-shot of each program
implementation mentioned to the official email id of your AD2 class teacher. On the top of each program, you must mention your full name, registration
number, title of the program and date.