Question: PYTHON: Brute-Force Optimization Starting from the knapsack problem (the coin or souvenir example), rewrite (simplify) it to consider the given weights [ 6,7,3,4,5,2,2,1,8 ] and

PYTHON:

Brute-Force Optimization

Starting from the knapsack problem (the coin or souvenir example), rewrite (simplify) it to consider the given weights

[ 6,7,3,4,5,2,2,1,8 ] 

and the values

[ 5,6,3,3,4,1,1,2,9 ] 

(Note that there are nine items now instead of ten.)

Retain the same figure of merit, except that the total weight can be 20 instead of 50. Identify the subset of items (indices) max_set which maximizes value with that constraint.

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!