Рет қаралды 3,654
The purpose of the knapsack problem is to select which items to fit into the bag without exceeding a weight limit of what can be carried. We solve the problem with an integer programming solver (APOPT) by setting up each item as a binary variable (0 or 1).
📙 Knapsack Optimization: apmonitor.com/...
Objective: Maximize the value of items that can fit into a knapsack without exceeding a maximum weight constraint.
There are 4 items available to be placed in a knapsack: a towel, hammer, wrench, and screwdriver. The value and weight of the items are listed in the table below.
Towel Hammer Wrench Screwdriver
Item Value (vi) 11 8 3 6
Item Weight (wi) 3 5 7 4