Ip modeling techniques for making choices with non-binary variables and piecewise linear functions. The techniques include introducing binary variables and constraints for limiting the number of non-zero products, and using new variables for each cost segment in the objective function. The document also addresses the shortcomings of the model and provides necessary constraints for k segments.
Download IP Modeling Techniques III: Non-Binary Variables & Piecewise Linear Functions and more Slides Discrete Structures and Graph Theory in PDF only on Docsity!
IP modeling techniques III
In this handout,
Modeling techniques:
Making choices with non-binary variables
Piecewise linear functions
Making choices with non-binary variables
Recall the furniture manufacturer problem.
Extra requirement : From the 3 possible products (tables, chairs, desks), at most two should be chosen to be produced. That is, at most two of xt , xc , xd can be non-zero.
How to achieve this in the model?
Introduce new binary variables. For i=t,c,d,
To enforce the requirement, need the following constraint: y (^) t + yc + yd ≤ 2
Need also to relate xi ’s and yi ’s. Add constraints: xi ≤ Myi for i=t,c,d and large positive M
0 if product icannot be produced (x 0)
y^1 if product icanbe produced (x 0)
i i i
How to include piecewise linear cost functions in an
objective function of IP?
Idea : Introduce a new variable for each cost segment.
For i=1,2,3,
y i = number of items produced at cost ci
Then the total number of items is x = y 1 +y 2 +y 3 +y 4.
We need constraints
0 ≤ y 1 ≤ 5, 0 ≤ y 2 ≤ 4, 0 ≤ y 3 ≤ 7, 0 ≤ y 4 ≤ 10 , (*)
and the production cost in the objective function is
11y 1 + 8y 2 + 5y 3 + 7y 4
What is the shortcoming of this model?
We should require that
y 2 >0 implies that y1 =5 (1)
y 3 >0 implies that y2 =4 (2)
y 4 >0 implies that y3 =7 (3)
Introduce new variables to translate these requirements into linear constraints. For i=1,2,3,4,
Proper constraints relating wi and yi will provide that requirements (1)-(3) are satisfied. y 2 ≤ 4w 1 and 5w 1 ≤ y1 provide (1) y 3 ≤ 7w 2 and 4w 2 ≤ y2 provide (2) y 4 ≤ 10w 3 and 7w 3 ≤ y3 provide (3)