Professional Documents
Culture Documents
Contents
2 Binary Inference 2
3 Inference Condition 2
4 Max Constraint 3
5 Min Constraint 4
6 And Condition 5
7 Or Condition 5
8 XOR Condition 5
9 Imply Condition 6
10 Z=X × Y Constraint 6
1
Ho Chi Minh City International University Deterministic Models in Operation Research
Industrial Systems Engineering Department Lecturer: Phan Nguyen Ky Phuc
18 Other Inference 9
Let:
Cj : be the capacity regarding to facility j
BigM : be the very large number
Oj : be the binary decision variable, Oj = 1 if the facility j is opened; otherwise Oj = 0
It is often that, there are at least one of 2 following constraints
X
() ≤ Cj × Oj
i
X
() ≤ BigM × Oj
i
2 Binary Inference
If X = 1 then Y = 1: Y ≥ X
If X = 1 then Y = 0: Y ≤ 1 − X
If X = 0 then Y = 0: Y ≤ X
If X = 0 then Y = 1: Y ≥ 1 − X
3 Inference Condition
• If (X = 1) then A ≤ B:
BigM × (X − 1) + A ≤ B
• If (X = 0) then A ≥ B:
BigM × X + A ≥ B
• If (X = 1) then A = B
BigM × (X − 1) + A ≤ B
BigM × (1 − X) + A ≥ B
4 Max Constraint
X = max(A, 0)
X = max(A, B)
where X, A, B are variables. This constraint can be transformed to linear form as follow:
Let Y be the index variable:
1 , if (A − B) ≥ 0
Y =
0 , if (A − B) ≤ 0
Given a threshold R for a resource , if the usage of this resource is higher than R it will incur an extra cost
for each extra usage resource.
In short the following constraints need to be transform into linear constraint:
!
X
X = max Ci Yi − R, 0
i
P
Now the constraints X = max ( i Ci Yi − R, 0) can be transformed to linear form as :
0 ≤ X ≤ 0 + BigM × Z
(P C Y − R) ≤ X ≤ (P C Y − R) + BigM × (1 − Z)
i i i i i i
5 Min Constraint
X = min(A, 0)
X = min(A, B)
where X, A, B are variables. This constraint can be transformed to linear form as follow:
Let Y be the binary variable:
1 , if A − B ≥ 0
Y =
0 , if A − B ≤ 0
6 And Condition
Y = X1 ∩ X2 ∩ X3 ... ∩ Xn
7 Or Condition
Y = X1 ∪ X2 ∪ X3 ... ∪ Xn
8 XOR Condition
Y = X1 XOR X2
Y ≥ X1 + X2 − 1
≥ 1 − X1 − X2
Y
Y ≤ 1 − X1 + X2
≤ 1 − X2 + X1
Y
X Y ¬X Z=X→Y ¬X ∪ Y
1 1 1 1 1
0 0 1 1 1
0 1 1 1 1
1 0 0 0 0
9 Imply Condition
Z ≥1−X
Z≥Y
Z ≤ 1 − X + Y
10 Z=X × Y Constraint
Parameters
sj : starting time of job j
fj : finishing time of job j
Ejm = {0, 1}. Ejm = 1 if job j is possible to be assigned to machine m; otherwise Ejm = 0
Cjk = {0, 1}. Cjk = 1 if job j and job k cannot be assigned to the same machine m due to overlap constraint;
otherwise Cjk = 0
Decision variables
Xjm = {0, 1}. Xjm = 1 if job j is assigned to machine m; otherwise Xjm = 0
Constraints
Note
In general, we need only consider variables Xjm which having Ejm = 1
Let E be the set which containing tuples of possible assignment < j, m > of job j to machine m
Let C be the set which containing tuples of conflict jobs < j, k > due to overlap
Constraints
Parameters
Ejm = {0, 1}. Ejm = 1 if job j is possible to be assigned to machine m; otherwise Eim = 0
Variables
sj : starting time of job j
fj : finishing time of job j
Xjm = {0, 1}. Xjm = 1 if job j is assigned to machine m, otherwise Xjm = 0
Rkj = {0, 1}. Rkj = 1 if job k finishes before job j starts, i.e. fk ≤ sj , otherwise Rkj = 0
BigM × (Rkj − 1) + fk ≤ sj
BigM × Rkj + fk ≥ sj
To avoid the overlap, following constraint is applied
If both Rkj and Rjk are zero then only one Xjm or Xkm are allowed
Index
i: index of job
j: index of job
m: index of machine
Parameters
BigM : Very large number
P roim : be the processing time if job i on machine m
Setkjm : be the setup time of job j on on machine m if job k is an immediate precedence job of job j on
machine m
Enim = {0, 1}. Enim = 1 if job i is able to be assigned to worker w;otherwise Enij = 0
Bm and Fm are two values identify the time window of machine m
Decision Variables
Xim = {0, 1}. Xim = 1 if job i is assigned to machine m; otherwise Xim = 0
Ykj = {0, 1}. Ykj = 1 if job j is the immediate successor job of job k on the same machine, otherwise Ykj = 0
sj starting time of job j
fj finishing time of job j
X ≥A−B
X ≥B−A
X ≤A+B
X ≤2−A−B
Given several ranges [ai ; bi ] , i = 1...n and decision variable X, Y . If ai ≤ X ≤ bi then Y = fi (X)
Let ri be the index variable if X ∈ [ai ; bi ] then ri = 1 otherwise ri = 0.
Basic constraints include:
ai ≤ Xi + BigM × (1 − ri )
Xi ≤ bi + BigM × (1 − ri ) ∀i = 1...I
Xi ≤ BigM × ri ∀i = 1...I
I
X
ri = 1, ∀i = 1...I
i=1
X
Y = ri × fi (Xi ) ∀i = 1...I
i
Zi ≤ BigM × ri ∀i = 1...I
Zi ≤ fi (Xi ) + BigM × (1 − ri ) ∀i = 1...I
Zi ≥ fi (Xi ) − BigM × (1 − ri ) ∀i = 1...I
ai ≤ Xi + BigM × (1 − ri )
Xi ≤ bi + BigM × (1 − ri )
Xi ≤ BigM × ri
D departure time
S starting time
p processing time
Ut binary variable, Ut = 1 if t ≥ S, otherwise; Ut = 0
Vt binary variable, Vt = 1 if t ≤ D − 1, otherwise; Vt = 0
Rt binary variable, Rt = 1 if S ≤ t ≤ D − 1, otherwise; Rt = 0
D ≥S+p
t ≥ S − BigM × (1 − Ut )
t ≤ S − 1 + BigM × Ut
t ≤ D − 1 + BigM × (1 − Vt )
t ≥ D − BigM × Vt
Rt ≤ Ut
Rt ≤ Vt
Rt ≥ Ut + Vt − 1
18 Other Inference
Given A ≥ 0 and α is constant. Assume that the following inferences should be satisfied
If X = 1 then A ≥ α
If X = 0 then A = 0
These constraints can be expressed as
A ≥ α × X
A ≤ BigM × X
Another way
α ≤ A + BigM (1 − X)
A ≤ BigM × X
If Lower Bound and Upper Bound for A can be estimated, i.e. A ∈ [LBA ; U BA ] and A − α ∈ [LBA −
α; U BA − α]
In this case the constraints can be rewritten as
(α − LB ) × (1 − X) + A − α ≥0
A
U B × X ≥A
A
In case BigM coefficient can affect the computation time, this analysis can be used to estimate the values
of some BigM
Job 1 2 3 4 5
wj 1 1 2 3 3
sj 0 4 3 7 6
fi 5 6 8 12 10
Resources {1,3} {2,3} {2,3} {1} {3}
Parameters
wj weight of job j
sj starting time of job j
fj finishing time of job j
Ojt parameters, if sj ≤ t ≤ fj then Ojt = 1 otherwise Ojt = 0
Rjs number of resource s using by job j
Ns be the maximum number of resource s
Decision variable
Xj if job j is selected
Mathematical model
J
X
max wj Xj
j=1
Constraints:
I
X
Oit × Ris × Xi ≤ Ns , ∀t, s
i=1