L2 (Without Solution)
L2 (Without Solution)
Formulations
Lecture 2
Integer Programming Formulations Integer Programming
Logical constraints
MATH3220 Operations Research and Logistics Nonlinear Functions
Jan. 8, 2015
Pan Li
The Chinese University of Hong Kong
2.1
Integer Programming
Agenda Formulations
Integer Programming
Logical constraints
1 Integer Programming Nonlinear Functions
2 Logical constraints
3 Nonlinear Functions
2.2
Integer Programming
Integer Programming Formulations
Integer Programming
Logical constraints
Integer Programming: a linear program plus the additional Nonlinear Functions
constraints that some or all of the variables must be integer
valued.
0 ≤ xj ≤ 1 and xj is integer.
2.3
Integer Programming
Simple logical constraints Formulations
Nonlinear Functions
If item i is selected, then item j is also selected. xi − xj ≤ 0
Either item i is selected or item j is selected, xi + xj = 1
but not both.
Item i is selected or item j is selected or both. xi + xj ≥ 1
If item i is selected, then item j is not selected. xi + xj ≤ 1
If item i is not selected, then item j is −xi + xj ≤ 0
not selected.
At most one of item i, j and k are selected. xi + xj + xk ≤1
At most two of items i, j and k are selected. xi + xj + xk ≤2
Exactly one of items i, j, and k are selected. xi + xj + xk =1
At least one of items i, j and k are selected. xi + xj + xk ≥1
2.4
Integer Programming
Simple logical constraints - con’t Formulations
Logical constraints
x = 4w1 + 8w2 + 13w3 Nonlinear Functions
w1 + w2 + w3 = 1
wi ∈ {0, 1}for i = 1 to 3.
2.5
Integer Programming
Simple logical constraints - con’t Formulations
Logical constraints
x = 4w1 + 8w2 + 13w3 Nonlinear Functions
w1 + w2 + w3 = 1
wi ∈ {0, 1}for i = 1 to 3.
2.6
Integer Programming
Simple logical constraints - con’t Formulations
Logical constraints
x =0 or l ≤x ≤u Nonlinear Functions
Define:
0 for x = 0
y=
1 for l ≤ x ≤ u
ly ≤ x ≤ uy
y ∈ {0, 1}
2.7
Integer Programming
Other logical constraints, and the big M method. Formulations
Logical constraints
Nonlinear Functions
1 if f (x1 , x2 , . . . , xn ) ≤ b Integer Programming
w= Logical constraints
0 otherwise
Nonlinear Functions
x ≤2 + M(1 − w)
x ≥6 − Mw
w ∈ {0, 1}
2.10
Integer Programming
The logical constraint - Alternative constraint (con’t) Formulations
Logical constraints
w ∈ {0, 1} Nonlinear Functions
if w = 1, thenx ≤ 2.
if w = 0, thenx ≥ 6.
Logical constraints
w ∈ {0, 1} Nonlinear Functions
To show:
The logical constraints are equivalent to the IP constraints.
2.12
Integer Programming
The logical constraint - Alternative constraint (con’t) Formulations
Logical constraints
w ∈ {0, 1} Nonlinear Functions
To show:
The logical constraints are equivalent to the IP constraints.
2.13
Integer Programming
Logical constraint - Conditional constraints Formulations
Logical constraints
Since this implication is not satisfied only when both
Nonlinear Functions
f1 (x1 , x2 , . . . , xn ) > b1 and f2 (x1 , x2 , . . . , xn ) > b2 , the conditional
constraint is logically equivalent to the alternate constraints
f1 (x1 , x2 , . . . , xn ) ≤ b1 + B1 y ,
f2 (x1 , x2 , . . . , xn ) ≤ b2 + B2 (1 − y ),
y ∈ {0, 1}
2.14
Integer Programming
At least one of three inequalities is satisfied. Formulations
Nonlinear Functions
If w1 = 1, then x1 + 4x2 + 2x4 ≥ 7
If w2 = 1, then 3x1 − 5x2 ≤ 12
If w3 = 1, then 2x2 + x3 ≥ 6
w1 + w2 + w3 ≥ 1
wi ∈ {0, 1} for i = 1 to 3.
This above system of constraints is equivalent to the following.
x1 + 4x2 + 2x4 ≥ 7 − M(1 − w1 )
3x1 − 5x2 ≤ 12 + M(1 − w2 )
2x2 + x3 ≥ 6 − M(1 − w3 )
w1 + w2 + w3 ≥ 1
wi ∈ {0, 1} for i = 1 to 3 .
2.15
Integer Programming
Logical constraint - k-Fold alternative Formulations
fi (x) ≤ bi (j = 1, 2, . . . , m)
Integer Programming
Assuming that Bi are chosen so that the ignored constraints Logical constraints
will not be binding, the general problem can be formulated as Nonlinear Functions
follows:
fi (x) ≤ bi + Bi (1 − yi )
Pm
i=1 yi ≥ k ,
yi ∈ {0, 1} (i = 1, 2, . . . , m)
2.16
Integer Programming
Nonlinear Functions Formulations
Logical constraints
Nonlinear Functions
2.17
Integer Programming
Fixed costs Formulations
Nonlinear Functions
dj + cj xj xj > 0
fj (xj ) =
0 xj = 0
2.18
Integer Programming
Fixed costs (con’t) Formulations
Nonlinear Functions
yj = 0, if xj = 0
fj (xj ) = dj yj + cj xj
with the constraints:
xj ≤ uj yj ,
xj ≥ 0,
y = 0 or 1.
2.19
Integer Programming
Fixed costs (con’t) Formulations
Nonlinear Functions
dj + cj xj xj > 0
fj (xj ) =
0 xj = 0
2.20
Integer Programming
Piecewise linear representation Formulations
Integer Programming
Logical constraints
Nonlinear Functions
Integer Programming
Logical constraints
Nonlinear Functions
Hence,
x = δ1 + δ2 + δ3 ,
where
0 ≤ δ1 ≤ 4, 0 ≤ δ2 ≤ 6, 0 ≤ δ3 ≤ 5, (1)
and the total variable cost is given by:
Cost = 5δ1 + δ2 + 3δ3 .
2.22
Integer Programming
Piecewise linear representation Formulations
δ2 = 6, if δ3 > 0
Hence,
x = δ1 + δ2 + δ3 ,
where
0 ≤ δ1 ≤ 4, 0 ≤ δ2 ≤ 6, 0 ≤ δ3 ≤ 5, (2)
and the total variable cost is given by:
2.23
Integer Programming
Piecewise linear representation (I) Formulations
Logical constraints:
0 ≤ δ1 ≤ 4, 0 ≤ δ2 ≤ 6, 0 ≤ δ3 ≤ 5,
Integer Programming
δ1 = 4, if δ2 > 0
Logical constraints
Define
1 if δ1 is at its upper bound
w1 =
0 otherwise
1 if δ2 is at its upper bound
w2 =
0 otherwise
2.24
Integer Programming
Piecewise linear representation (I) (con’t) Formulations
Logical constraints:
0 ≤ δ1 ≤ 4, 0 ≤ δ2 ≤ 6, 0 ≤ δ3 ≤ 5,
Integer Programming
δ1 = 4, if δ2 > 0
Logical constraints
4w1 ≤ δ1 ≤ 4,
6w2 ≤ δ2 ≤ 6w1 ,
0 ≤ δ3 ≤ 5w2
w1 and w2 binary.
2.25
Integer Programming
Piecewise linear representation (I) (con’t) Formulations
Logical constraints:
0 ≤ δ1 ≤ 4, 0 ≤ δ2 ≤ 6, 0 ≤ δ3 ≤ 5,
δ1 = 4, if δ2 > 0 Integer Programming
Logical constraints
δ2 = 6, if δ3 > 0 Nonlinear Functions
4w1 ≤ δ1 ≤ 4,
6w2 ≤ δ2 ≤ 6w1 ,
0 ≤ δ3 ≤ 5w2
w1 and w2 binary.
The general constraint imposed upon the variable δj for the jth Integer Programming
Nonlinear Functions
Lj wj ≤ δj ≤ Lj wj−1
where Lj is the length of the segment.
2.27
Integer Programming
Approximation of Nonlinear Functions Formulations
Suppose the expansion cost in our previous example is given Integer Programming
Nonlinear Functions
2.28
Integer Programming
Approximation of Nonlinear Functions (con’t) Formulations
Integer Programming
Logical constraints
Nonlinear Functions
y= 2x if 0 ≤ x ≤ 3
y= 9−x if 4 ≤ x ≤ 7
Integer Programming
y= −5 + x if 8 ≤ x ≤ 9 Logical constraints
Nonlinear Functions
x is integer valued.
Add constraints
Constraints
Logical constraints
w1 ∈ {0, 1} Nonlinear Functions
4w2 ≤ x2 ≤ 7w2
w2 ∈ {0, 1}
8w3 ≤ x3 ≤ 9w3
w3 ∈ {0, 1}
w1 + w2 + w3 = 1
x = x1 + x2 + x3
xi integer∀i
Suppose that 0 ≤ x ≤ 9, x integer.
If (x, w) satisfies the definitions, then it also satisfies the
constraints.
If (x, w) satisfies the constraints, then it also satisfies the
definitions. 2.31
Integer Programming
Exercise Formulations
2.32
Integer Programming
Summary Formulations
Nonlinear Functions
2.33