Consider an instance of the knapsack problem without repetitions with 4 items, having weights and values as follows. The weights (in pounds) are w1 = 2, w2 - 7, w3 = 10, w4 =12. The dollar values of these items are respectively v1 = 12, v2 = 28, v3 = 30, v4 = 5. The capacity of the knapsack is 12.
a. Find the optimal solution for Fractional Knapsack
b. Find the optimal solution for 0-1 Knapsack