Question: In the knapsack problem KNAPSACK, the goal is , given a tuple of elements M = ( m 1 , . . . , m

In the knapsack problem KNAPSACK, the goal is, given a tuple of elements M=(m1,...,mn) with weights W=(w1,...,wn) and values C=(c1,...,cn), and two numbers U,LinN, to decide whether there is a sublist M'=(mi1,...,mil) of M, such that
j=1lwijU and j=1lcijL.
In this case the instance (M,W,C,U,L) is called solveable.
We now define the problem
KNAPSACK ={(M,W,C,U,L)|(M,W,C,U,L)is solveable }.
(a) Prove: KNAPSACK is decideable in time polynomial in U,L and n by a DTM.
Hint: Use dynamic programming.
(b) Prove: KNAPSACK is NP-complete.
(c) Why are the previous two subtasks not contradictory?
 In the knapsack problem KNAPSACK, the goal is, given a tuple

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!