This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: 7 Integer Programming Integer programming methods are among the most powerful optimization tools available, and are used in a wide range of applications. Whereas 30 years ago, most realworld problems were unsolvable by this approach, today integer programs with thousands of variables can often be solved with the stroke of the “enter” key. However, one of the most frustrating aspects of integer programming is that one never knows for sure, in advance, whether a given model will be solved effiicently enough, or whether one will have stumbled upon a basically unsolvable input. Nonetheless, modern integer programming techniques have advanced the field to the point where applica tions get solved routinely. 7.1 Modeling the nonlinear knapsack problem as an IP We start by returning to the nonlinear knapsack problem for which we had a nearly linear integer programming formulation earlier. Recall that for this problem, we have a collection of items, and for each of N item types, there is a given number itemLimit[n] of available items of type n , and a specified weight weight[n] . There is a knapsack of capacity weightLimit , into which we will pack the items. For each item type n , there is an associated benefit benefit[n,i] of packing i items. In our earlier formulation, the difficulty was in expressing the objective, since that is where the nonlinearity of the problem was present. The key idea is to introduce a new type of decision variable y[n,i] , which is a binary variable that indicates whether exactly i items of type n are packed (by setting this variable to 1). This leads to the following AMPL model for an integer programming formulation. param N; #number of items param weightLimit; # maximum weight that we can take param itemLimit {n in 1..N}; # limit on number of copies of item n available param benefit {n in 1..N, i in 0..itemLimit[n]}; # benefit of i copies of item type n param weight {n in 1..N}>=0; # weight of item type n 84 var x {n in 1..N} integer, >=0, <=itemLimit[n]; # number of copies of item type n to take var y {n in 1..N, i in 0..itemLimit[n]} binary; # "meaning" y[n,i]=1 if x[n]=i maximize Benefit: sum {n in 1..N, i in 0..itemLimit[n]} y[n,i]*benefit[n,i]; subject to Weight: sum {n in 1..N} weight[n]*x[n] <=weightLimit; subject to Select {n in 1..N}: sum {i in 0..itemLimit[n]} y[n,i]=1; #select one y[n,i] for each n subject to Meaning {n in 1..N}: x[n] = sum {i in 0..itemLimit[n]} y[n,i]*i; The “Select” constraints ensure that for each type, there is exactly one value selected for the number of items packed. A first attempt at a for mulation might have omitted the “Meaning” constraints, but observe that otherwise there is no linkage between the x and y variables, and the former are needed to ensure that the weight constraint is obeyed. Finally, it is im portant to recognize that the “Meaning” constraints are linear, in spite of the fact that we multiply the decision variables y[n,i] by i , rather than an explicit constant.explicit constant....
View
Full
Document
This note was uploaded on 04/06/2008 for the course ORIE 321 taught by Professor Shmoys/lewis during the Spring '07 term at Cornell.
 Spring '07
 SHMOYS/LEWIS

Click to edit the document details