For a double knapsack problem, assume follwoing 2 algorithms used. (1) Use the regular subset sum knapsack algorithm 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 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 S1 and S2 with total sizes at most C1 and C2, respectively. Which of the following statements are true? (Choose all that apply.) a) Algorithm (1) is guaranteed to produce an optimal solution to the double-knapsack problem but algorithm (2) is not. b) Algorithm (2) is guaranteed to produce an optimal solution to the double-knapsack problem but algorithm (1) is not. c) Algorithm (1) is guaranteed to produce an optimal solution to the double-knapsack problem when C1=C2. d) Neither algorithm is guaranteed to produce an optimal solution to the double-knapsack problem. (explain if this is the case)
For a double knapsack problem, assume follwoing 2 algorithms used.
(1) Use the regular subset sum knapsack
(2) Use the 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 S1 and S2 with total sizes at most C1 and C2, respectively.
Which of the following statements are true? (Choose all that apply.)
a) Algorithm (1) is guaranteed to produce an optimal solution to the double-knapsack problem but algorithm (2) is not.
b) Algorithm (2) is guaranteed to produce an optimal solution to the double-knapsack problem but algorithm (1) is not.
c) Algorithm (1) is guaranteed to produce an optimal solution to the double-knapsack problem when C1=C2.
d) Neither algorithm is guaranteed to produce an optimal solution to the double-knapsack problem. (explain if this is the case)
Unlock instant AI solutions
Tap the button
to generate a solution