You are on page 1of 14

Miniguide for Building Constraints in Mathematical Linear Model

Phan Nguyen Ky Phuc

April 1, 2020

Contents

1 Open Facility Decision 2

2 Max Constraint 2

2.1 Max Constraint: X = max(A, 0) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

2.2 Max Constraint: X = max(A,B) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

2.3 Extension of Max Constraint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

3 Min Constraint 3

3.1 The min constraint: X=min(A,0) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

3.2 The Min Constraint: X=min(A,B) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

4 And Condition 4

5 Or Condition 4

6 Z=X × Y Constraint 5

7 Conflicted Condition 5

8 Conflicted Condition when Starting and End Times are Variables 5

9 Another Approach For Handling Conflict Constraint 8

10 Absolute Values for Binary Variables 8

11 Piece-wise Linear Constraints 8

12 Belong to The Range Constraints 9

13 Jobs Use Multiple Resources 9

14 2-stage production planning under stochastic demands 10

1
Ho Chi Minh City International University Deterministic Models in Operation Research
Industrial Systems Engineering Department Lecturer: Phan Nguyen Ky Phuc

1 Open Facility Decision

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 Max Constraint

2.1 Max Constraint: X = max(A, 0)

Consider the following constraint:

X = max(A, 0)

where X, A are variables. This constraint can be transformed to linear form:


Let Y be the index variable: 
1 , if A ≥ 0
Y =
0 , if A ≤ 0

The constraints between A and Y can be expressed as:



A ≥ BigM × (Y − 1)
A ≤ BigM × Y

Now the constraints between X = max(A, 0) can be transformed as linear :



0 ≤ X ≤ 0 + BigM × Y
A ≤ X ≤ A + BigM × (1 − Y )

2.2 Max Constraint: X = max(A,B)

Consider the following constraints:

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

Guide to Construct Linear Constraint Page 2


Ho Chi Minh City International University Deterministic Models in Operation Research
Industrial Systems Engineering Department Lecturer: Phan Nguyen Ky Phuc

The constraints between (A − B) and Y can be expressed as:



(A − B) ≥ BigM × (Y − 1)
(A − B) ≤ BigM × Y

Now the constraints X = max(A, B) can be transformed to linear form as :



B ≤ X ≤ B + BigM × Y
A ≤ X ≤ A + BigM × (1 − Y )

2.3 Extension of Max Constraint

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

Let Z be the index variable: 


1 , if (P C Y − R) ≥ 0
i i i
Z=
0 , if (P C Y − R) ≤ 0
i i i
P
The constraints between ( i Ci Yi − R) and Z can be expressed as:

(P C Y − R) ≥ BigM × (Z − 1)
i i i
(P C Y − R) ≤ BigM × Z
i i 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

3 Min Constraint

3.1 The min constraint: X=min(A,0)

Consider the following constraints:

X = min(A, 0)

where X, A are variables. This constraint can be transformed to linear as follow:


Let Y be the index variable: 
1 , if A ≥ 0
Y =
0 , if A ≤ 0

The constraints between A and Y can be expressed as:



A ≥ BigM × (Y − 1)
A ≤ BigM × Y

Guide to Construct Linear Constraint Page 3


Ho Chi Minh City International University Deterministic Models in Operation Research
Industrial Systems Engineering Department Lecturer: Phan Nguyen Ky Phuc

Now the constraints between X = min(A, 0) can be transformed to linear form:



0 ≥ X ≥ 0 − BigM × (1 − Y )
A ≥ X ≥ A − BigM × Y

3.2 The Min Constraint: X=min(A,B)

Consider the following constraints:

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

The constraints between (A − B) and Y can be expressed as:



(A − B) ≥ BigM × (Y − 1)
(A − B) ≤ BigM × Y

Now the constraint X = min(A, B) can be transformed to linear form:



B ≥ X ≥ B − BigM × (1 − Y )
A ≥ X ≥ A − BigM × Y

4 And Condition

Given Xi , Y are binary variable Y relates to Xi through AND operator

Y = X1 ∩ X2 ∩ X3 ... ∩ Xn

This constraint can be transformed to linear form as



Y ≤ X ,∀i, i = 1...n
i
Y ≥ P X − n + 1
i i

5 Or Condition

Given Xi , Y are binary variable Y relates to Xi through OR operator

Y = X1 ∪ X2 ∪ X3 ... ∪ Xn

This constraint can be transformed to linear form as



Y ≥ X ,∀i, i = 1...n
i
Y ≤ P X
i i

Guide to Construct Linear Constraint Page 4


Ho Chi Minh City International University Deterministic Models in Operation Research
Industrial Systems Engineering Department Lecturer: Phan Nguyen Ky Phuc

6 Z=X × Y Constraint

Given X is binary variable, Y ≥ 0


This constraint can be transformed to linear form as



 Z ≤ BigM × X

Z ≤ Y + BigM × (1 − X)


Z ≥ Y − BigM × (1 − X)

7 Conflicted Condition

Example
Assume that there are 2 jobs i and j. These jobs must be finished in their time window [si ; ei ] and [sj ; ej ].
If their time windows are overlapped, so these jobs cannot be assigned to the same worker. These jobs are
called conflicted jobs. If [si ; ei ] and [sj ; ej ] are not decision variables so their conflict due to overlap can be
express through a parameters Cij .
Parameters
Eim be the enable matrix Eim = 1 if job i is possible to be assigned to worker m; otherwise Eim = 0
Cij be the conflict matrix Cij = 1 if job i and job j cannot be assigned to the same worker m due to overlap
constraint; otherwise Cij = 0
Decision variables
Xim be the binary variable; Xim = 1 if job i is assigned to worker m; otherwise Xim = 0
Basic constraints

Xim + Xjm ≤ 2 − Cij , ∀i, j, m


X
Xim = 1, ∀i
m

Xim ≤ Eim , ∀i, m

8 Conflicted Condition when Starting and End Times are Variables

Index
i: index of job
j: index of job
w: index of worker
Parameters
BigM : Very large number
Sijm :setup time for job j on machine mif job i is immediate precedence job of job j on machine m Eniw : be
the enable matrix Eniw = 1 if job i is able to be assigned to worker w;otherwise Enij = 0
Bw and Fw are two values identify the time window of worker w
Decision Variables
Xiw be the binary variable, Xiw = 1 if job i is assigned to worker w; otherwise Xiw = 0
si starting time of job i
ei finishing time of job i
Basically there are two cases when 2 jobs are overlapped:

• The first is the starting time of job i, si in the range of job j, [sj , ej ]

Guide to Construct Linear Constraint Page 5


Ho Chi Minh City International University Deterministic Models in Operation Research
Industrial Systems Engineering Department Lecturer: Phan Nguyen Ky Phuc

• The second is the ending time of job i, ei in the range of job j, [sj , ej ]

Following auxiliary variables will be used to consider the overlap constraint:

• uij be the binary variable uij = 1 if sj < si otherwise uij = 0

• vij be the binary variable vij = 1 if si < ej otherwise vij = 0

• pij be the binary variable pij = 1 if sj < ei otherwise pij = 0

• qij be the binary variable qij = 1 if ei < ej otherwise qij = 0


1 1 1
• rij be the binary variable rij = 1 if sj < si < ei otherwise rij =0
2 2 2
• rij be the binary variable rij = 1 if sj < ei < ej otherwise rij =0

Basic constraints include:


X
Xiw = 1, ∀i
w
X
ei = si + Xiw P roiw , ∀i
w

ei ≤ sj , ∀P reij = 1

For each uij , vij , pij , qij pair of constrains are used

uij = 1 if sj < si otherwise uij = 0

sj ≤ si + BigM × (1 − uij ), ∀i, j


sj ≥ si − BigM × uij , ∀i, j

vij = 1 if si < ej otherwise vij = 0

si ≤ ej + BigM × (1 − vij ), ∀i, j


si ≥ ej − BigM × vij , ∀i, j

pij be the binary variable pij = 1 if sj < ei otherwise pij = 0

sj ≤ ei + BigM × (1 − pij ), ∀i, j


sj ≥ ei − BigM × pij , ∀i, j

qij be the binary variable qij = 1 if ei < ej otherwise qij = 0

ei ≤ ej + BigM × (1 − qij ), ∀i, j i 6= j


ei ≥ ej − BigM × qij , ∀i, j i 6= j

Elimination condition

uij + uji = 1, ∀i, j, i 6= j


vij + vji = 1, ∀i, j, i 6= j
pij + pji = 1, ∀i, j, i 6= j
qij + qji = 1, ∀i, j, i 6= j

Guide to Construct Linear Constraint Page 6


Ho Chi Minh City International University Deterministic Models in Operation Research
Industrial Systems Engineering Department Lecturer: Phan Nguyen Ky Phuc

1 1
If uij = 1 and vij = 1, then rij = 1 otherwise rij =0

1
rij ≤ uij , ∀i, j
1
rij ≤ vij , ∀i, j
1
rij ≥ uij + vij − 1, ∀i, j

2 2
If pij = 1 and qij = 1, then rij = 1 otherwise rij =0

2
rij ≤ pij , ∀i, j
2
rij ≤ qij , ∀i, j
2
rij ≥ pij + qij − 1, ∀i, j

1 2
The values of rij and rij will create following constraints

Xiw ≤ Eniw , ∀i, w


1
Xiw + Xjw ≤ 2 − rij , ∀i, j, w
2
Xiw + Xjw ≤ 2 − rij , ∀i, j, w

Furthermore if Xiw = 1 then si and ei must be in the range [Bw ; Fw ], this will create the following constraints

Bw + BigM × (Xiw − 1) ≤ si , ∀i, w


Bw + BigM × (Xiw − 1) ≤ ei , ∀i, w
si ≤ Fw + BigM × (1 − Xiw ), ∀i, w
ei ≤ Fw + BigM × (1 − Xiw ), ∀i, w

s1 e1

s2 e2

s1 e1

s2 e2

Figure 1: Possible overlap case

Guide to Construct Linear Constraint Page 7


Ho Chi Minh City International University Deterministic Models in Operation Research
Industrial Systems Engineering Department Lecturer: Phan Nguyen Ky Phuc

9 Another Approach For Handling Conflict Constraint

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
Setijm : be the setup time of job j on on machine m if job i is an immediate precedence job of job j on
machine m
Enim : be the enable matrix 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 be the binary variable, Xim = 1 if job i is assigned to machine m; otherwise Xim = 0
Yij be the binary variable, Yij = 1 if job j is the immediate successor job of job i on the same machine,
otherwise Yij = 0
si starting time of job i
ei finishing time of job i

Yij + Yji ≤ 1, ∀i, j


Xim + Xjm − Yij − Yji ≤ 1, ∀i, j, m
Xim + Xjk + Yij + Yji ≤ 2, ∀i, j, m, k
M
X
si + P roim Xim = ei , ∀i, m
m=1
M
X
ei + Xim Setijm − BigM (1 − Yij ) ≤ sj , ∀i, j, m
m=1

10 Absolute Values for Binary Variables

Consider the case


X = |A − B|

where X, A, B are binary variables

X ≥A−B
X ≥B−A
X ≤A+B
X ≤2−A−B

11 Piece-wise Linear Constraints

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.

Guide to Construct Linear Constraint Page 8


Ho Chi Minh City International University Deterministic Models in Operation Research
Industrial Systems Engineering Department Lecturer: Phan Nguyen Ky Phuc

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

Using Z = X × Y constraint the above can be transformed


X
Y = Zi ∀i = 1...I
i

Zi ≤ BigM × ri ∀i = 1...I
Zi ≤ F (Xi ) + BigM × (1 − ri ) ∀i = 1...I
Zi ≥ F (Xi ) − BigM × (1 − ri ) ∀i = 1...I

12 Belong to The Range Constraints

Let ri be the index variable if Xi ∈ [ai ; bi ] then ri = 1 otherwise ri = 0.

ai ≤ Xi + BigM × (1 − ri )
Xi ≤ bi + BigM × (1 − ri )
Xi ≤ BigM × ri

13 Jobs Use Multiple Resources

Given the following data


Index

Table 1: Job Parameters

Job 1 2 3 4 5
wi 1 1 2 3 3
si 0 4 3 7 6
ei 5 6 8 12 10
Resources {1,3} {2,3} {2,3} {1} {3}

• j index of job j = 1...J

• s index of resource s = 1...S

• t index of time t = 0...T

Parameters

• wi weight of job i

• si starting time of job i

Guide to Construct Linear Constraint Page 9


Ho Chi Minh City International University Deterministic Models in Operation Research
Industrial Systems Engineering Department Lecturer: Phan Nguyen Ky Phuc

Figure 2: Conflict Graph

• ei ending time of job i

• Oijt matrix, if job i and job j are overlap at time t then Oijt = 1 otherwise Oijt = 0

• Rjs resource matrix, if job j requires resource s then Rjs = 1 otherwise Rjs = 0

• 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:
J
X
Ris Xi + Oijt Rjs Xj ≤ Ns , ∀i, t, s
j=1,j6=I

14 2-stage production planning under stochastic demands

Problem description

• This model is multi products and multi suppliers model.

• The demand for each product is stochastic.

• Some materials can be shared among products when manufacturing.

• Decision variable includes the purchase quantity, number of production lines and savage actions. They
are divided into 2 stages:

– In the first stage, decision variables are made without information about the demands, i.e, only
their distributions are known.
– In the second stage decision variables are made when the demands are known, i.e. , the correct
activities are made.

• Total cost includes cost of 1st stage and expected cost of 2nd stage.

Guide to Construct Linear Constraint Page 10


Ho Chi Minh City International University Deterministic Models in Operation Research
Industrial Systems Engineering Department Lecturer: Phan Nguyen Ky Phuc

Annotations
m: index of materials m = 1...M
p: index of products p = 1...P
s: index of suppliers s = 1...S
r: index of price ranges r = 1...R
l: index of production lines l = 1...L
e: index of scenarios e = 1...E

Parameters
Dpe : demand of product p under scenario e
BigM : very large number
αmp : number of material m for one product p
M
βm : savage price of one unit of material m
βpP : savage price of one unit of product p
γp : selling price of one unit of product p
1
θmsr : the offer price of material m from supplier s at price ranger at stage 1
2
θmsr : the offer price of material m from supplier s at price ranger at stage 2
1
LBmsr : the lower bound for purchasing the material m from supplier s at price range r in stage 1
2
LBmsr : the lower bound for purchasing the material m from supplier s at price range r in stage 2
1
U Bmsr : the upper bound for purchasing the material m from supplier s at price range r in stage 1
2
U Bmsr : the upper bound for purchasing the material m from supplier s at price range r in stage 2
πe : the probability associating to scenario e
Φ1s : fixed cost for ordering from supplier s at stage 1
Φ2s : fixed cost for ordering from supplier s at stage 2
ωl1 fixed cost for using line l at stage 1
ωl2 fixed cost for using line l at stage 2

tpl : time required for manufacturing one product p on line l


1
Cms : capacity of supplier s for material m at stage 1
2
Cms : capacity of supplier s for material m at stage 2
Hl1 : number of available hour of line l for material m at stage 1
Hl2 : number of available hour of line l for material m at stage 2

Decision Variables
1
Xmsr :number of material m purchased from supplier s at price range r in stage 1
2
Xmsre :number of material m purchased from supplier s at price range r under scenario e in stage 2
Ypl1 :number of product p manufactured in line l in stage 1
2
Yple :number of product p manufactured in line l under scenario e in stage 2
Zl1 : binary , Zl1 = 1 if line l is used in stage 1, otherwise Zl1 = 0
2 2 2
Zle : binary, Zle = 1 if line l is used in stage 2 under scenario e, otherwise Zle =0
Auxiliary Variables
1 1
Vmsr :binary, Vmsp = 1 if material m is purchased from supplier s at price range r in stage 1, otherwise
1
Vmsr = 0;
2 2
Vmsre :binary, Vmspe = 1 if material m is purchased from supplier s at price range r under scenario e in stage
2
2, otherwise Vmsre = 0;
Fpe : binary Fpe = 1 if at the end of stage 2 under scenario e there is no redundant product p, otherwise
Fpe = 0

Guide to Construct Linear Constraint Page 11


Ho Chi Minh City International University Deterministic Models in Operation Research
Industrial Systems Engineering Department Lecturer: Phan Nguyen Ky Phuc

Gme : binary Gme = 1 if at the end of stage 2 under scenario e there is no redundant material m, otherwise
Gme = 0
Ipe : be the income we obtain the from selling product p under scenario e when the demand smaller than the
total manufacturing quantities
Ope : be the money we obtain from selling the unsold products p at savage price under scenario e
Nme : be the money we obtain from selling the unsold materials m at savage price under scenario e

Mathematical Model
The objective function
The objective function is to maximize the expected profit, includes:
At stage 1

• Purchasing cost

• Manufacturing cost

At stage 2

• Purchasing cost

• Manufacturing cost

• Benefit of Selling products

• Benefit of Selling savage products

• Benefit of Selling savage materials

For Stage 1 The total cost is given by:

M X R
S X S R
M X
! L
X X X X
1 1
θmsr Xmsr + Φ1s 1
Vmsr + ωl1 Zl1
m=1 s=1 r=1 s=1 m=1 r=1 l=1

For Stage 2 The expected total cost is given by:


P  P  P 
 E πe PM PS PR θmsre 2 2
Xmsre
PS
+ s=1 Φ2s
M PR 2 L 2 2
e=1 m=1 s=1 r=1 m=1 r=1 Vmsre + l=1 ωl Zle
 
PE π PP I + PP O + PM N
e=1 e p=1 pe p=1 pe m=1 me

Constraints The materials purchased from each supplier is either zero or belong to only one price range

R
X
1
Vmsr ≤ 1, ∀m = 1...m, s = 1...S
r=1
R
X
2
Vmsre ≤ 1, ∀m = 1...m, s = 1...S, e = 1...E
r=1

1 1
If Vmsr = 1 then the purchasing quantity from supplier s, Xmsr must belong to the the range of price r at
1 1 1 1
stage 1, i.e., [LBmsr ≤ Xmsr ≤ U Bmsr ], otherwise; Xmsr =0
2 2
If Vmsre = 1 then the purchasing quantity from supplier s, Xmsre must belong to the the range of price r at
2 2 2 2
stage 2, i.e., [LBmsr ≤ Xmsre ≤ U Bmsr ], otherwise; Xmsre =0

Guide to Construct Linear Constraint Page 12


Ho Chi Minh City International University Deterministic Models in Operation Research
Industrial Systems Engineering Department Lecturer: Phan Nguyen Ky Phuc

1 1 1
LBmsr ≤ Xmsr + BigM (1 − Vmsr ), ∀m = 1..M, s = 1...S, r = 1...R
1 1 1
Xmsr ≤ U Bmsr + BigM (1 − Vmsr ), ∀m = 1..M, s = 1...S, r = 1...R
1 1 1
Xmsr ≤ U Bmsr Vmsr , ∀m = 1..M, s = 1...S, r = 1...R
2 2 2
LBmsr ≤ Xmsre + BigM (1 − Vmsre ), ∀m = 1..M, s = 1...S, r = 1...R, e = 1...E
2 2 2
Xmsre ≤ U Bmsr + BigM (1 − Vmsre ), ∀m = 1..M, s = 1...S, r = 1...R, e = 1...E
2 2 2
Xmsre ≤ U Bmsr Vmsr , ∀m = 1..M, s = 1...S, r = 1...R, e = 1...E
The total purchasing materials in both 2 stages must be smaller than the maximize usage of them in all
scenarios
S X
X R S X
X R P
X
1 2
Xmsr + Xmsre ≤ Dpmax αmp , ∀m = 1...M, e = 1...E
s=1 r=1 s=1 r=1 p=1

The quantity of purchasing material m from the supplier s must be smaller than the supplier capacity in
each stage

R
X
1 1
Xmsr ≤ Cms , ∀m = 1...M, s = 1...S
r=1
R
X
2 2
Xmsre ≤ Cms , ∀m = 1...M, s = 1...S
r=1

The number of product p produce on each stage must be smaller than the total available of material m on
this stage

X L
P X S X
X R
αmp Ypl1 ≤ 1
Xmsr , ∀m = 1...M
p=1 l=1 s=1 r=1
P X
X L P X
X L X R
S X
αmp Ypl1 + 2 1 2

αmp Yple ≤ Xmsr + Xmsre , ∀m = 1...M, e = 1...E
p=1 l=1 p=1 l=1 s=1 r=1

The total quantities of all products p manufacturing on each line l in each stage must be smaller than the
number of available hours on this line
P
X
tpl Ypl1 ≤ Hl1 Zl1 , ∀l = 1...L;
p=1
P
X
2
tpl Yple ≤ Hl2 Zle
2
, ∀l = 1...L, e = 1...E;
p=1

If we manufacture or purchase more than demand in each scenario, it will incur a savage benefit

L L
!
X X
Ope = βpP max Ypl1 + 2
Yple − Dpe , 0 ∀p = 1...P ; e = 1...E
l=1 l=1
S S L X
P L X
P
!
X X X X
M 1 2
Nme = βm max Xms + Xmse − αmp Ypl1 − 2
αmp Yple ,0
s=1 s=1 l=1 p=1 l=1 p=1

∀m = 1...M ; e = 1...E

The max constraints


P can be formulated as
L 1
PL 2
Fpe = 1 if l=1 Ypl + l=1 Yple − Dpe ≥ 0; otherwise, Fpe = 0

Guide to Construct Linear Constraint Page 13


Ho Chi Minh City International University Deterministic Models in Operation Research
Industrial Systems Engineering Department Lecturer: Phan Nguyen Ky Phuc

P 
S PR 1
PS PR 2
PP PL 1
PP PL 2
Gme = 1 if s=1 r=1 Xmsr + s=1 r=1 Xmsre − p=1 l=1 αmp Ypl − p=1 l=1 α mp Yple , 0 ≥ 0;
otherwise, Gme = 0

P 
L PL
The constraints between l=1 Ypl1 + l=1
2
Yple − Dpe and Fpe can be expressed as:
 P 
L 1
PL 2
l=1 Ypl + l=1 Yple − Dpe ≥ BigM × (Fpe − 1)

 
 PL Y 1 + PL Y 2 − D ≤ BigM × Fpe
l=1 pl l=1 ple pe

Now the constraints

L L
!
X X
Ope = βpP × max Ypl1 + 2
Yple − Dpe , 0 ∀p = 1...P ; e = 1...E
l=1 l=1

can be expressed as:





0 ≤ Ope ≤ 0 + BigM × Fpe
 P 
L PL
βpP Y
l=1 pl
1
+ Y 2
l=1 ple − D pe ≤ Ope

 P 
O ≤ β P L 1
P L 2
− + BigM (1 − Fpe )

pe p Y
l=1 pl + Y
l=1 ple Dpe

P 
L 1
PL 2
 Y
l=1 pl + Y
l=1 ple − D pe ≥ BigM (Fpe − 1)
P 
L 1
P L 2
l=1 Ypl + l=1 Yple − Dpe ≤ BigM × Fpe

Doing in the same way

 P 
M S 1
PS 2
PP PL 1
PP PL 2
s=1 Xmse − l=1 αmp Ypl − ≥ BigM (Gme − 1)
 βm
s=1 Xms + p=1 p=1 l=1 αmp Yple
P 
β M S 1
P S 2
PP PL 1
P P PL 2
m s=1 Xms + s=1 Xmse − p=1 l=1 αmp Ypl − p=1 l=1 αmp Yple ≤ BigM × Gme




 0 ≤ Nme ≤ 0 + BigM × Gme
 P 
M S 1
PS 2
PP PL 1
PP PL 2
βm s=1 Xms + s=1 Xmse − p=1 l=1 αmp Ypl − p=1 l=1 αmp Yple ≤ Nme

  
N ≤ β M PS X 1 + PS X 2 − PP PL α Y 1 − PP PL α Y 2 + BigM (1 − G )

me m s=1 ms s=1 mse p=1 l=1 mp pl p=1 l=1 mp ple me

If we manufacture or purchase less than demand in each scenario, we can sold all the product with the price
γp
L L
!
X X
Ipe = γp min Ypl1 + 2
Yple , Dpe ∀p = 1...P ; e = 1...E
l=1 l=1


γp Dpe ≥ Ipe ≥ γp Dpe − BigM (1 − Fpe )
   
γp PL Y 1 + PL Y 2 ≥ Ipe ≥ γp PL Y 1 + PL Y 2 − BigM × Fpe
l=1 pl l=1 ple l=1 pl l=1 ple

Guide to Construct Linear Constraint Page 14

You might also like