Question: Problem: Double - Knapsack Input: Item values v 1 , v 2 , , vn , item sizes s 1 , s 2 , ,

Problem: Double-Knapsack
Input: Item values v1,v2,,vn, item sizes s1,s2,,sn, and capacities C1and C2 of two knapsacks. (All positive integers.)
Output: Two disjoint subsets S1, S2{1,2,,n} of items with the maximum possible total value i in S1S2vi, subject to
i in S1C1 and i in S2C2.
Here are two possible algorithmic approaches:
(1) use the single Knapsackalgorithm to pick a maximum-value solution S1 that fits in the first knapsack, and then use it again on the remaining items to pick a maximum-value solution S2 that fits in the second knapsack.
(2) use the single Knapsack algorithm to pick a maximum-value solution S that would fit in a knapsack with capacity C1+C2, then partition S arbitrarily into two sets S1and S2 with total sizes at most C1and C2, respectively.
Which of the following statements are true? (Choose all that apply.)
Group of answer choices
Algorithm (1) is guaranteed to produce an optimal solution to the double-knapsack problem but algorithm (2) is not.
Algorithm (2) is guaranteed to produce an optimal solution to the double-knapsack problem but algorithm (1) is not.
Algorithm (1) is guaranteed to produce an optimal solution to the double-knapsack problem when C1=C2.
Neither algorithm is guaranteed to produce an optimal solution to the double-knapsack problem.

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 Programming Questions!