Presentation is loading. Please wait.

Presentation is loading. Please wait.

IP modeling techniques III In this handout, Modeling techniques:  Making choices with non-binary variables  Piecewise linear functions.

Similar presentations


Presentation on theme: "IP modeling techniques III In this handout, Modeling techniques:  Making choices with non-binary variables  Piecewise linear functions."— Presentation transcript:

1 IP modeling techniques III In this handout, Modeling techniques:  Making choices with non-binary variables  Piecewise linear functions

2 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 x t, x c, x d 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 + y c + y d  2 Need also to relate x i ’s and y i ’s. Add constraints: x i  My i for i=t,c,d and large positive M

3 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:

4 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 y i = number of items produced at cost c i 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?

5 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 w i and y i will provide that requirements (1)-(3) are satisfied. y 2  4w 1 and 5w 1  y 1 provide (1) y 3  7w 2 and 4w 2  y 2 provide (2) y 4  10w 3 and 7w 3  y 3 provide (3)

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


Download ppt "IP modeling techniques III In this handout, Modeling techniques:  Making choices with non-binary variables  Piecewise linear functions."

Similar presentations


Ads by Google