Question: Algorithm Homework please me help me im in need 3. (20 points) Knapsack Problem. In this problem we will revisit the 0/1 and fractional knapsack

 Algorithm Homework please me help me im in need 3. (20

Algorithm Homework please me help me im in need

3. (20 points) Knapsack Problem. In this problem we will revisit the 0/1 and fractional knapsack problems. Suppose that you are given the following weight/value pairs for objects to be inserted in a bag of capacity 8. item no. 1 3 4 weight value 4. 2 6 24 3 15 2 16 12 (a) (10 points) Find the optimum solution of the 0/1 knapsack problem for the above instance using dynamic programming. Determine the set of items that yield the optimum solution. Show the table and all your work. (b) (5 points) Show that a greedy algorithm using the density of items as its greedy choice will not yield the optimum solution if it is trying to solve the 0/1 knapsack problem for the above instance. Compare the value obtained by the greedy algorithm against the optimum solution. (c) (5 points) Show the output of the greedy algorithm when solving the fractional knap- sack problem for the above instance. State whether the result is an optimum solution or not

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!