0% found this document useful (0 votes)
5 views27 pages

Lecture MILP

The document provides an overview of Mixed-Integer Linear Programming (MILP), including its fundamentals, algorithms like branch and bound, and modeling techniques using binary variables. It discusses the complexity of MILP compared to linear programming and introduces methods for modeling logical statements and constraints. Key learning outcomes include understanding MILP concepts, binary variable modeling, and the branch and bound method.

Uploaded by

Hanan Amarki
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views27 pages

Lecture MILP

The document provides an overview of Mixed-Integer Linear Programming (MILP), including its fundamentals, algorithms like branch and bound, and modeling techniques using binary variables. It discusses the complexity of MILP compared to linear programming and introduces methods for modeling logical statements and constraints. Key learning outcomes include understanding MILP concepts, binary variable modeling, and the branch and bound method.

Uploaded by

Hanan Amarki
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 27

ILP

Lecture
Process Optimization: MILP

Gonzalo Guillén-Gosálbez, Carlos


Pozo, Laureano Jiménez
DPPI | 31.11.2024 | 1
Outline and learning outcomes

1. Fundamentals of MILP.
2. Branch and bound method.
3. Tearing using MILP.

Learning outcomes
• Develop understanding of the fundamentals of MILP.
• Model simple logic statements using algebraic equations containing binary variables
• Develop understanding of the fundamentals of the branch and bound method.

DPPI | 31.11.2024 | 2
Mixed-integer linear programming
min 𝑓 𝑥, 𝑦 = 0
s. t. ℎ 𝑥, 𝑦 = 0 • Only difference compared to LP: existence of binary
variables
𝑔 𝑥, 𝑦 ≤ 0 • Any integer variable can be replaced by binary
𝑥 ∈ ℝ𝑛 variables
𝑦 ∈ 0,1 𝑛 binary
variable

• If there are no integer variables, then the model is an LP


• If there are no continuous variables, then it becomes a pure integer programming (IP) problem

Algorithms:
Major software codes
• Branch and bound
(they are usually used to solve both LPs and
• NO
Cutting planes (convexification, convert the MILP MILPs):
into an LP)
CPLEX, XPRESS, OSL, GUROBI

N

Branch and cut

Much more complex to solve compared to LPs! (complexity grows with the number of binaries)
DPPI | 31.11.2024 | 3

3
Mixed-integer linear programming
• Is the feasible region of an MILP convex?

not convex

you
!!
cannot draw
𝑥1 , 𝑥2 ∈ 0,1,2 three possible
discrite values
it's be
of an especific problem

line between

−𝑥1 + 𝑥2 = 1
a

it
2 point be

doesn't belong
to the feasable
all of then
I not
region
e of
.

b are feasible
This canno
w restriction
Me

Maximized f-value
𝑓=5
O Maximum
doesn't lie on

any Vertex

NOT convex 𝑓=3


Optimization Feasible region
unconnect at

O O O
Only the 5
point
𝑓 =0
are

𝑥1 + 𝑥2 = 2 the feasible region

DPPI | 31.11.2024 | 4
Integer and binary variables

• Integer variables can only take integer values (e.g., 0, 1, 2, 3, 4, …)


• How many 25m3 storage tanks should we install?
• How many –OH groups should be included in a solvent molecule we are
designing?

• A special case is binary variables (0 or 1)


• Used to model yes/no decisions
• XA = 1 if unit operation A exists; 0 otherwise
• YCD = 1 if there is a pipe between C and D; 0 otherwise

Any integer variable N can be expressed as a summation of binary variables y, e.g., N from 0 to 9:

𝑁 = 1𝑦1 + 2𝑦2 + 3𝑦3 + 4𝑦4 + 5𝑦5 + 6𝑦6 + 7𝑦7 + 8𝑦8 + 9𝑦9 + 10𝑦10 − 1
𝑦1 + 𝑦2 + 𝑦3 + 𝑦4 + 𝑦5 + 𝑦6 + 𝑦7 + 𝑦8 + 𝑦9 + 𝑦10 = 1
N =
20 ,
1 ,
2 ,
]
...,

𝑁+1 𝑁+1
NE (0

to
,

can
1
,
2
,

be
...
)
converted

1)
y ( (0 .

0 Vi + 3
𝑁 = ෍ 𝑖𝑦𝑖 − 1, ෍ 𝑦𝑖 = 1 , 𝑦𝑖 ∈ 0,1
DPPI N= 2 (z = 1 =
y
=
| 31.11.2024 | 5
𝑖=1 𝑖=1
Modelling with 0-1 variables
𝑦𝑗 = 1 Binary variable is one if j is true (select item j)
Binary variable is zero if j is false (do not select item j)
𝑦𝑗 = 0
At most one is true (both cannot be true simultaneously)
non lineat

𝑦1 𝑦2 =0 A Nonlinear expression (can cause numerical difficulties)

J
iecome a
we

better 𝑦1 + 𝑦2 ≤ 1 Linear expression (more convenient)


B

AB2 X
X

Select at least one item I


--
෍ 𝑦𝑗 ≥ 1 ,
[ or --
𝑗∈𝐽
% To
~

y ,
+
y23d a
y X X

Select exactly one item Yz


෍ 𝑦𝑗 = 1 D
𝑗∈𝐽 y, +
yz
= 1

Select no more than one item

෍ 𝑦𝑗 ≤ 1
𝑗∈𝐽
y ,
+
yz[1B
DPPI | 31.11.2024 | 6
Modelling with 0-1 variables

AND operator

𝑦1 + 𝑦2 ≥ 1 ⋀ 𝑦3 + 𝑦4 ≥ 1

𝑦1 + 𝑦2 ≥ 1
(select 1 or 2 or both) AND (select 3 or 4 or both)
𝑦3 + 𝑦4 ≥ 1 E F

- ~

,
C'e X
X

3 , 4 O
~

~
X

𝑦𝑘 − 𝑦𝑗 ≤ 0 E IF select k then select j Y2

A 31 y210
-

𝑦𝑘 = 𝑦𝑗 IFF (IF and only IF) select k then select j


F
y
=
y2

DPPI | 31.11.2024 | 7
Modelling with 0-1 variables + P-550
f, (x)20
OR
fr(x)20
10 P5
- only I are

selected
- Y1 + ye = 1 M=

parameter
106

t I
bigm
X

f, (x) = M(1 -

y) ,

Fi
OR (disjunctions, can be inclusive or exclusive) Six = m (1
-
Y2)

04210- Pos
OR
v 52M(1
y1)(y, 1
-

P + =
yz
𝑓1 (𝑥) ≤ 0 𝑓2 𝑥 ≤ 0
-

*
P -
10 = M(1 -

yz)

0
more restricted
1 the
byz
=
= =

y -
is
thisa
PIS

𝑓1 𝑥 ≤ 𝑀(1 − 𝑦1 ) M: Big parameter (big positive number)


3 P-520

P-10 [
M PE1O + OX

𝑓2 𝑥 ≤ 𝑀(1 − 𝑦2 )
𝑦1 + 𝑦2 = 1 Exclusive disjunction (inclusive OR would imply 𝑦1 + 𝑦2 ≥ 1)
If something is true, then an equation is satisfied
u(x) = M(1 y)
𝑖𝑓 𝑦 = 1 → ℎ 𝑥 = 0 E hi
-

h(x)Y M(1 y)
-
-

𝑦ℎ 𝑥 = 0 Leads to:
−𝑀(1 − 𝑦) ≤ ℎ 𝑥 ≤ 𝑀(1 − 𝑦)

DPPI | 31.11.2024 | 8
Modelling with 0-1 variables
Modelling disjunctions (exclusive disjunction, i.e., only one term is true)

𝐹 = ˅𝑖∈𝐷 ℎ𝑖 (𝑥) ≤ 0 𝑥 ∈ 𝕽𝑛 𝑟𝑒𝑚𝑎𝑟𝑘: ℎ𝑖 𝑥 𝑖𝑠 𝑎 𝑙𝑖𝑛𝑒𝑎𝑟 𝑓𝑢𝑛𝑐𝑡𝑖𝑜𝑛

Big-M reformulation (where M is a sufficiently large parameter)


ℎ𝑖 𝑥 ≤ 𝑀𝑖 · 1 − 𝑦𝑖 ∀𝑖 ∈ 𝐷
෍ 𝑦𝑖 = 1
𝑖∈𝐷
𝑦𝑖 ∈ 0,1 ∀𝑖 ∈ 𝐷
𝑀𝑖 = max ℎ𝑖 𝑥 |𝑥 𝐿 ≤ 𝑥 ≤ 𝑥 𝑈
Convex hull reformulation (using auxiliary variables vi)(often the preferred approach)
disagregatethe auxiliar
a
variabl

𝑥 − ෍O
𝑣𝑖 = 0 𝑥, 𝑣𝑖 ∈ 𝕽𝑛
replace
𝑖∈𝐷 It

praction-
𝑣
reformatte 𝑖
𝑦𝑖 ℎ𝑖 ≤ 0 ∀𝑖 ∈ 𝐷
𝑦𝑖 Trade-off: Big-M involves fewer variables but the M parameter can
෍ 𝑦𝑖 = 1 cause numerical difficulties, while convex hull tends to be
numerically more stable but requires auxiliary variables.
𝑖∈𝐷
𝑦𝑖 ∈ 0,1 ∀𝑖 ∈ 𝐷
0 ≤ 𝑣𝑖 ≤ 𝑣𝑖𝑈 𝑦𝑖 ∀𝑖 ∈ 𝐷
DPPI | 31.11.2024 | 9
Modelling with 0-1 variables
Example: reformulate the following linear disjunction
or Disjuntation
𝑥1 − 𝑥2 ≤ 1 ˅ 2𝑥1 − 𝑥2 ≤ 4
˅ 𝑥1 − 2𝑥2 ≤ 5
0 ≤ 𝑥1 , 𝑥2 ≤ 5
Big-M relaxation (where M is a
𝑥1 − 𝑥2 − 1 ≤ 𝑀 1 − 𝑦1
sufficiently large parameter)
2𝑥1 − 𝑥2 − 4 ≤ 𝑀 1 − 𝑦2
𝑥1 − 2𝑥2 − 5 ≤ 𝑀 1 − 𝑦3
𝑦1 + 𝑦2 + 𝑦3 = 1
0 ≤ 𝑥1 , 𝑥2 ≤ 5, 𝑦1 , 𝑦2 , 𝑦3 ∈ 0,1

𝑣11 − 𝑣21 − 𝑦1 ≤0 Convex hull relaxation (using vi


2𝑣12 − 𝑣22 − 4𝑦2 ≤0 auxiliary variables)
𝑣13 − 2𝑣23 − 5𝑦3 ≤0

𝑦1 + 𝑦2 + 𝑦3 = 1

𝑥1 = 𝑣11 + 𝑣12 + 𝑣13


𝑥2 = 𝑣21 + 𝑣22 + 𝑣23

0 ≤ 𝑣𝑗𝑖 ≤ 5𝑦𝑖 ∀𝑖, 𝑗, 𝑦𝑖 ∈ 0,1 ∀𝑖 | 31.11.2024 | 10


DPPI
(x , -

xz = 1) v [2x ,
-

x2[Y]v[x ,
-

2xz = 5)
0 =X /

X 25

M
reformulation
M
big positive 103
Big
=
number - M=

x, -

xz
-

1 = M(1 -

y)
nicx) = M(1 -

yi)
& 2x

X1
,

-
-

xc

2x
-

-
4 - M(1

5 = M(1
-

-
yz]
y3)

1
Zyi 7
y1 yz
>
+ + =

yz
= -

02XI

x(15 ; y: (0 1]
,

Convex buil
reformulation
Drivi Yi

/- y x*?
= X ,;
=5
0 0
= 82 = 0 x

x2-02
0x y1
>
Vi
need
-
0
3.
-

=
X
- -
-

I
= 0 0 = 0,
[5y /
0 = 021 = 5y /

2) Ji - 0 : 012 [5yz0 : 822 : 5yz


o = Viz =
5yz0
= 23 - 5y3

35[-2 50 -
Jy 2523 5yzzo
se[
- -
.

0
32 = 1 =
Dy
=
y =

+ 1
yz
+
y
=

yz
it zweg 3e
=1 + V z + Dis
Xy ,

x2 =
02 + 022 + 523
Mixed-integer linear programming
min 𝑓 𝑥, 𝑦 = 0
s. t. ℎ 𝑥, 𝑦 = 0 • Only difference compared to LP: existence of binary variables
• Any integer variable can be replaced by binary variables
𝑔 𝑥, 𝑦 ≤ 0
𝑥 ∈ ℝ𝑛
𝑦 ∈ 0,1 𝑛
MILP example: technologies selection

Design a process with minimum cost to


produce 10 kg/hr of B from feedstock A
A (maximum availability=15 kg/hr).
Process yields (0.8;0.667;0.555 kgB/kgA),
-
fixed (80;54;27 $/hr) and variable cost
~

penalty (35;30;25 $/kgA) parameters are provided


for each technology in the network.

DPPI | 31.11.2024 | 11

11
process yield

YI
XI 1 (0 .
6) fixed cost
-
(80 ; 54 ; 27$/hr)
variable cost - (35 ; 30
; 25 $/ga)
B
A XL
667)
YII
B produce 10V9/n of Creative
11 (0 .
variables : X ,, Xc , Xz =
Vy/nog A

max
15kg/h of A

available

X3 Y111 35
0
min 2 x, 30 23 + 54 + 27
111(0 555) yz
+
+
xz +
-91 y
- -

x3
- -

=
.

-
Variable cost Fixed cost

3
Y1 Ya Y3 8 Xz] 15
2 X1 +
Availability
=
=
Xz +

& PP the
O & too
many if n
* 0 .
8 +
Xz
:
0 667
.
+
Xz
.
2 . 555 = 10 <
production of B
from yield of each process

O O 1
↓ relaxation X1 15 y 20

ria&
-

,
-

Ex =0 don't and
P 1 & o Y: 11 Y ;R Xy
-

15yz = 0 :
y ,
=o -X ,
=D
pay produce

1 O O
x can take Practional values
15 yz = 0
Xy
-

round the final values


you don't pay
1 1 O

not used
I you cannot produce

13 10
fix and solve the LP
1 O 1
↓ X Y Sit 20 ,
used - > pay penalty

suboptimal optinaetio
Y
O 11 infectible you can
produce
relaxed

1 ↓
1 * don't happen
1 rMLPEMILP
Yoptimal

solution relaxed is better than MILP (feasible reagion is larger


Example Mixed-Integer Linear Programming

𝑐𝑜𝑠𝑡 = 𝑎 · 𝑦 + 𝑏 · 𝑥

I (0.8)
A 𝑎
II (0.667) B
𝑥
III (0.555)
𝑘𝑔
𝐸. 𝑔. , 𝑖𝑓 𝐼 𝑖𝑠 𝑠𝑒𝑙𝑒𝑐𝑡𝑒𝑑, 𝑖𝑡 𝑐𝑎𝑛 𝑐𝑜𝑛𝑠𝑢𝑚𝑒 𝑢𝑝 𝑡𝑜 15 𝑜𝑓 𝐴:
ℎ𝑟
𝑥1 ≤ 15
80y1+35x1+54y2+30x2+27y3+25x3 𝑎𝑛𝑑 𝑖𝑡𝑠 𝑐𝑜𝑠𝑡 𝑤𝑖𝑙𝑙 𝑏𝑒 𝑐ℎ𝑎𝑟𝑔𝑒𝑑 𝑖𝑛 𝑡ℎ𝑒 𝑂𝐹;
𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒, 𝑖𝑡𝑠 𝑖𝑛𝑝𝑢𝑡 𝑖𝑠 𝑓𝑖𝑥𝑒𝑑 𝑡𝑜 𝑧𝑒𝑟𝑜:
𝑥1 ≤ 0
𝑎𝑛𝑑 𝑛𝑜 𝑐𝑜𝑠𝑡 𝑤𝑖𝑙𝑙 𝑛𝑜𝑤 𝑏𝑒 𝑐ℎ𝑎𝑟𝑔𝑒𝑑 𝑖𝑛 𝑡ℎ𝑒 𝑂𝐹

DPPI | 31.11.2024 | 12
Solving MILPs: Exhaustive enumeration

DPPI | 31.11.2024 | 13
Solving MILPs: Rounding off to nearest integer

Rounding off is NOT a good strategy to solve MILPs, yet the


optimal solution of the relaxed problem (RMILP*)
provides a lower bound on the optimal solution of the
original problem (MILP*). This is an interesting
property that will be exploited in the branch and
bound method

RMILP* ≤ MILP*
DPPI | 31.11.2024 | 14
Branch and bound: divide and conquer
Select one binary variable at a time, and
create two child ones, in each of
which some binary variables are
fixed to either zero or one, while the
pick up just
- -

1 variable and
others are simply relaxed (i.e., they
optimized can take any fractional value
- -

between zero and one, not


necessarily integer values). Relaxed
LPs are solved at every node to
Y
provide a bound on the best

relaxed relaxed solution that could be obtained by
branching down from that node.

DPPI | 31.11.2024 | 15
Branch and bound

DPPI | 31.11.2024 | 16
Branch and bound

DPPI | 31.11.2024 | 17
Branch and bound
Lower and upper bounds are updated at
each iteration. The upper bound
corresponds to the best feasible
solution found so far. The lower
bound corresponds to the best
relaxation among the active nodes.
An active node is discarded when its

T
relaxed value is worse than the
current best feasible solution (upper
bound).

o o

DPPI | 31.11.2024 | 18
Branch and bound
The algorithm stops when the lower and
upper bounds are sufficiently close
to each other. The optimal solution
is then the best feasible point found
so far (current upper bound).

DPPI | 31.11.2024 | 19
Branch and bound

DPPI | 31.11.2024 | 20
Branch and bound

• Avoids exhaustive enumeration of all 0-1 combinations and still finds the global optimum
• Partitions the original MILP into a sequence of LP sub-problems
• Generates bounds using relaxations to eliminate combinations
• Updates bounds until the optimality gap is closed within a tolerance

DPPI | 31.11.2024 | 21
Recap

• Fundamentals of MILP.
• Modelling with binary variables.
• Relaxations and branch and bound method.

DPPI | 31.11.2024 | 22
Lecture
Process Optimization: MILP

Gonzalo Guillén-Gosálbez, Carlos


Pozo, Laureano Jiménez
DPPI | 31.11.2024 | 23
Pl
x
C
manufactured I
Pill
max
Profit based on
: PII or PIII

Xz =
?
X3 X5

B
D Process 11
X7
Purchasea P
Demand
of < is 10
tos/h
selling price :
18004/ton

Xi
C Price : A :
500$/tor
9505/to
-48 xy
Process B :
*
B
D
Process(II
Profit =
Selling) -
Cost (Fixed +
variable)
proces
X6 Xg
the
process
of
costofa
cost material
a

rou
↓ consume
↓ ↓
B
P 1300 2000 1230 500 x 950x3
1800-1900y 400x5
+

y, Ye
-
- + -

= ,
-

-
selling C
penaltys -
BdM
variable cost

Convertions

constriction on the
production

Y + Yy = 1 (select proces (111)

Xi 30
I not have a reverse
flow

You might also like