IP modeling techniques III In this handout Modeling

  • Slides: 6
Download presentation
IP modeling techniques III In this handout, Modeling techniques: Ø Making choices with non-binary

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:

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: yt + 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

Piecewise linear functions • So far all our functions were linear. • In many

Piecewise linear functions • So far all our functions were linear. • In many situations, it might not be the case. • Example: Production cost. – c 1= $11/unit for first 5 items – c 2= $8/unit for next 4 items – c 3= $5/unit for next 7 items – c 4= $7/unit for next 10 items • The cost of producing x items is an example of so-called piecewise linear function:

Piecewise linear functions • How to include piecewise linear cost functions in an objective

Piecewise linear functions • 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, 4 yi = 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 11 y 1 + 8 y 2 + 5 y 3 + 7 y 4 • What is the shortcoming of this model?

Piecewise linear functions • We should require that – y 2>0 implies that y

Piecewise linear functions • We should require that – y 2>0 implies that y 1=5 (1) – y 3>0 implies that y 2=4 (2) – y 4>0 implies that y 3=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 4 w 1 and 5 w 1 y 1 provide (1) y 3 7 w 2 and 4 w 2 y 2 provide (2) y 4 10 w 3 and 7 w 3 y 3 provide (3)

Piecewise linear functions • Summarizing, the bound constraints in (*) should be substituted with

Piecewise linear functions • Summarizing, the bound constraints in (*) should be substituted with 5 w 1 y 1 5, 4 w 2 y 2 4 w 1 , 7 w 3 y 3 7 w 2 , 0 y 4 10 w 3. • Generalizing, suppose we have k segments with lengths L 1, L 2, …, Lk. Then the necessary constraints: L 1 w 1 y 1 L 1 , Liwi yi Liwi-1 for i = 2, …, k-1 0 yk Lkwk-1