Use mathematics on paper, not code please. Suppose we have the following instance of the knapsack problem:
Fantastic news! We've Found the answer you've been seeking!
Question:
Use mathematics on paper, not code please.
Suppose we have the following instance of the knapsack problem: 5 objects, with weights 7, 8, 9, 11, 12, and profits (respectively) 13, 15, 16, 23, 24. The knapsack capacity is 26. a) Use the greedy technique to solve the fractional knapsack problem for this problem instance. b) Use the same greedy strategy to obtain a feasible solution for the 0/1 knapsack problem. c) Check all possible subsets of the 5 objects for feasibility for the 0/1 knapsack problem. i) How many are feasible? ii) What is the optimal solution? iii) Where does the solution found in part b) rank among all the feasible solutions? Solve c) by filling the following 32x5 table: Profit Rank Objects 1 2 3 4 5 11111 Total Weight 47 Feasible Solution? No 11110 35 No 11101 36 No 11100 24 Yes 13 + 15 + 16 = 44 Note: The first 4 rows are filled. No need to fill Profit and Rank for infeasible solutions. Rank should be filled in once all feasible solutions are known. [Stinson_1987, Problem 3.1, page 99]
Posted Date: