Answered step by step
Verified Expert Solution
Question
1 Approved Answer
(20 points) We talked in class about writing the knapsack problem as an integer linear program. Remember for the knapsack problem (without replacement) you are
(20 points) We talked in class about writing the knapsack problem as an integer linear program. Remember for the knapsack problem (without replacement) you are given the following: W; - the weight of item i for i=1..., vi- the value of each item i for i=1...n, and m - the maximum weight you can cary in your knapsack. The goal is to find a set of items with maximum value such that the total weight of the items is less than or equal to the maximum weight you can cary. Your task for this homework assignment is to formalize the ILP for the 0/1 knapsack problem, and provide an explanation to how each component (each constraint or group of constraints and the objective equation) contributes to solving the problem. The definition should be in the same form as the example below. The explanation should be in paragraph form following the solution. The variables in your ILP will be the set ti of binary values (ie. Bi {1,0}) that states if item i is in (1) or not in (0) your knapsack. Writing down an ILP In this example below we are minimizing our objective function, our variables are 11, 12, &zz, and we have a collection of maximum values mj. m2, &mz. As a reminder the objective function (which is being maximized or minimized) defines what makes a solution optimal, and the set of constraints (linear in- equalities) define what makes a solution valid As an aside, even though the values of m, are arbitrary that are not technically variables that we're trying to optimize. minimize 701 + 14x2 - 12.13 subject to dismi 1
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started