Integer and Mixed Integer Linear Programs: Center For Transportation & Logistics
Integer and Mixed Integer Linear Programs: Center For Transportation & Logistics
Q = Rational Numbers = any fraction of Integers, 1/2 , -‐5/9, 0/22, . . . etc.
R = Real Numbers = all Rational and Irrational numbers, i.e, π, √2, e, . . . etc.
B
XS ≥
0
What
is
the
optimal
solution
with
10
barrel
lots?
XH
Notes:
• Feasible
region
becomes
a
collection
of
points,
no
longer
a
convex
hull
• We
cannot
rely
on
“corner”
solutions
anymore
– solution
space
is
much
bigger!
MIT Center for
Transportation & Logistics
6
Max
z(XH,
XS)
=
80XH +
200XS
XH +
3XS ≤
280
the
closest
acceptable
integer
values? Add.
B
XH ≥
0
n LP
Solution:
XS ≥
0
w XH=25
barrels
XS=
85
barrels
n Rounding
to
closest
“10
barrel”
solution
for
(XH,
XS):
1. zLOT(30,
90)
=
$20,400
but
it
is
infeasible
(Plant
constraint)
2. zLOT(30,
80)
=
$18,400
feasible
3. zLOT(20,
90)
=
$19,600
but
it
is
infeasible
(Additive
B
constraint)
n So,
using
this
approach
z*LOT=
$18,400
with
XH=30,
XS=80
n But,
is
it
the
best?
• Let’s
solve
all
of
the
points
to
make
sure!
This
approach
is
called
Mass
Enumeration.
MIT Center for
7
Transportation & Logistics
Mass
Enumeration
Max
z(XH,
XS)
=
80XH +
200XS
s.t.
of
Banner
Chemical
Plant XH +
XS ≤
110
Add.
A 3XH +
2XS ≤
300
Optimal
IP
Solution Optimal
LP
Solution Closest
“rounded”
XH +
3XS ≤
280
Add.
B
XH=
10
barrels XH=
25
barrels LP
Solution
XS =
90
barrels XS =
85
barrels XH=
30
barrels XH ≥
0
Max
Profit
=
18,800 Max
Profit
=
19,000 XS =
80
barrels
Max
Profit
=
18,400 XS ≥
0
Notes:
• Rounding
the
optimal
LP
solution
will
not
always
lead
to
an
optimal
IP
solution
• Mass
enumeration
is
very
time
consuming
– not
always
possible
for
real
problems!
• IP
solution
can
never be
better
than
the
LP
solution!
MIT IPs
forare
much,
much,
much
harder
to
solve
than
LPs!
• Center 8
Transportation & Logistics
Formulation
Changes
.
.
.
not
much!
Max
z(XH,
XS)
=
80XH +
200XS • In
order
to
solve
in
integer
values
of
s.t. “lots
of
ten”,
we
need
to:
Plant XH +
XS ≤
110
n Convert
Decision
Variables
Add.
A 3XH +
2XS ≤
300
w XHL =
XH /10
XSL =
XS /10
XH +
3XS ≤
280
Add.
B n Scale
the
coefficients
and
constraint
RHS
XH ≥
0 w e.g.
110
barrels
becomes
11
lots
of
ten
XS ≥
0
n Indicate
that
the
new
DVs
are
Integers
GoNuts manufactures
different
juices
made
entirely
of
various
exotic
nuts.
Their
primary
market
is
China
and
they
operate
three
plants
located
in
Ethiopia,
Tanzania,
and
Nigeria.
You
have
been
asked
to
help
them
determine
where
to
manufacture
the
two
newest
juices
they
offer,
Gingko
Nut
and
Kola
Nut.
Each
plant
has
a
different
variable
cost
structure
and
capacity
for
manufacturing
the
different
juices.
Also,
each
juice
has
an
expected
demand.
How
much
of
each
juice
should
be
made
at
each
plant
in
order
to
minimize
total
cost
while
meeting
demand
and
adhering
to
plant
capacity?
Product Demand
∑ xij ≥ Di ∀i
j
where:
xij =
Number
of
units
of
product
i made
in
plant
j
Di =
Demand
for
product
i in
units
MIT Center for
13
Transportation & Logistics
Formulating
GoNuts 1
s.t.
∑x ij
≤Cj ∀j Optimal
Solution
i
∑x ≥ Di ∀i Ginko Kola
j ij
Ethiopia 0 425
xij ≥ 0 ∀ij Tanzania 375 25
where:
Nigeria 175 0
xij =
Number
of
units
of
product
i made
in
plant
j
cij =
Cost
per
unit
of
product
i made
at
plant
j Total
min
cost
=
¥
22,637.50
Cj =
Capacity
in
units
at
plant
j
Di =
Demand
for
product
i in
units
MIT Center for
Transportation & Logistics
14
2
GoNuts manufactures
different
juices
made
entirely
of
various
exotic
nuts.
Their
primary
market
is
China
and
they
operate
three
plants
located
in
Ethiopia,
Tanzania,
and
Nigeria.
You
have
been
asked
to
help
them
determine
where
to
manufacture
the
two
newest
juices
they
offer,
Gingko
Nut
and
Kola
Nut.
Each
plant
has
a
different
fixed and
variable
cost
structure
and
capacity
for
manufacturing
the
different
juices.
The
fixed
cost
only
applies
if
the
plant
produces
any
juice.
Also,
each
juice
has
an
expected
demand.
Cost/Unit Ginko Kola Capacity Units/Month Fixed
(¥/Month)
Ethiopia ¥21.00
¥22.50
Ethiopia 425 ¥1,500
Tanzania ¥22.50
¥24.50
Tanzania 400 ¥2,000
Nigeria ¥23.00
¥25.50
Nigeria 750 ¥3,000
Demand Units/Month
Ginko 550
Kola 450
How
much
of
each
juice
should
be
made
at
each
plant
in
order
to
minimize
total
cost
while
meeting
demand
and
adhering
to
plant
capacity?
MIT Center for
Image
CC0
Public
Domain
from
https://pixabay.com 16
Transportation & Logistics
Formulating
GoNuts 2 2
Feasible
Values
Looking
at
the
Nigeria
Plant
.
.
. 1
99 1 99
≤
750
yN
∑x i ij
≤ My j ∀j
where:
1 1 1
≤
750
yN
xij =
Number
of
units
of
product
i made
in
plant
j
yj =
1
if
plant
j
is
opened;
=
0
o.w.
M
=
a
big
number
(such
as
Cj in
this
case) If
the
X
values
>0,
then
Y
MUST
be
equal
to
1!
Otherwise,
it
would
violate
the
constraint.
MIT Center for
20
Transportation & Logistics
Formulating
GoNuts 2
2
Min
z
=
21xG,E +
22.5xK,E
+
22.5xG,T
+
24.5xK,T +
23xG,N +
25.5xK,N +
1500yE +
2000yT +
3000yN
subject
to
xG,E +
xK,E ≤
425 Min z = ∑ ∑ cij xij + ∑ f j y j
i j j
xG,T +
xK,T ≤
400
xG,N +
xK,N ≤
750
s.t.
xG,E +
xG,T +
xG,N ≥ 550 ∑x ij
≤Cj ∀j
i
xK,E +
xK,T +
xK,N ≥ 450
xG,E +
xK,E -‐ 425yE ≤
0 ∑x j ij
≥ Di ∀i
xG,T +
xK,T -‐ 400yT ≤
0
xG,N +
xK,N -‐ 750yN ≤
0
∑x i ij
− My j ≤ 0 ∀j
xG,E,
xK,E,
xG,T,
xK,T,
xG,N,
xK,N ≥
0
xij ≥ 0 ∀ij
yE,
yT,
yN =
{0,
1} y = {0,1}
where:
j
GoNuts manufactures
different
juices
made
entirely
of
various
exotic
nuts.
Their
primary
market
is
China
and
they
operate
three
plants
located
in
Ethiopia,
Tanzania,
and
Nigeria.
You
have
been
asked
to
help
them
determine
where
to
manufacture
the
two
newest
juices
they
offer,
Gingko
Nut
and
Kola
Nut.
Each
plant
has
a
different
fixed
and
variable
cost
structure
and
both
minimum
and
maximum
capacities
for
manufacturing
the
different
juices
if
the
plant
opens.
The
fixed
cost
only
applies
if
the
plant
produces
any
juice.
Also,
each
juice
has
an
expected
demand.
Capacity
Max
Min
Fixed
Cost/Unit Ginko Kola (units/Month) Capacity Capacity (¥/Month)
Ethiopia ¥21.00
¥22.50
Ethiopia 425 100 ¥1,500
Tanzania ¥22.50
¥24.50
Tanzania 400 250 ¥2,000
Nigeria ¥23.00
¥25.50
Nigeria 750 600 ¥3,000
Demand Units/Month
If
the
Nigeria
plant
opens,
it
Ginko 550 must
produce
at
least
600
units
Kola 450
How
much
of
each
juice
should
be
made
at
each
plant
in
order
to
minimize
total
cost
while
meeting
demand
and
adhering
to
plant
capacity?
MIT Center for
Image
CC0
Public
Domain
from
https://pixabay.com 26
Transportation & Logistics
Formulating
GoNuts 3 3
ij j
∀j
xG,T +
xK,T ≤
400 i
200 1 0
∑x i ij
≤ My j ∀j
600 1 0
or
1
∑x i ij
≥ Lj y j ∀j
where:
xij =
Number
of
units
of
product
i made
in
plant
j If
the
X
values
>0,
then
they
must
be
yj =
1
if
plant
j
is
opened;
=
0
o.w. ≥L,
the
lower
limit,
and
≤C,
the
M
=
a
big
number
(such
as
Cj in
this
case) maximum
capacity!
Lj =
Minimum
MIT Center for level
of
production
at
plant
j
Transportation & Logistics
29
Formulating
GoNuts 3 3
Min
z
=
21xG,E +
22.5xK,E
+
22.5xG,T
+
24.5xK,T +
23xG,N +
25.5xK,N +
1500yE +
2000yT +
3000yN
subject
to
xG,E +
xK,E ≤
425 Min z = ∑ ∑ cij xij + ∑ f j y j
i j j
xG,T +
xK,T ≤
400 s.t.
xG,N +
xK,N ≤
750
xG,E +
xG,T +
xG,N ≥ 550
∑x i ij
≤Cj ∀j
GoNuts manufactures
different
juices
made
entirely
of
various
exotic
nuts.
Their
primary
market
is
China
and
they
operate
three
plants
located
in
Ethiopia,
Tanzania,
and
Nigeria.
You
have
been
asked
to
help
them
determine
where
to
manufacture
the
two
newest
juices
they
offer,
Gingko
Nut
and
Kola
Nut.
Each
plant
has
a
different
variable
cost
structure
and
a
maximum
capacity.
GoNuts
can
only
operate
2
plants
at
a
maximum.
Also,
each
juice
has
an
expected
demand.
How
much
of
each
juice
should
be
made
at
each
plant
in
order
to
minimize
total
cost
while
meeting
demand
and
adhering
to
plant
capacity?
MIT Center for
Image
CC0
Public
Domain
from
https://pixabay.com 33
Transportation & Logistics
Formulating
GoNuts 4 4
ij j
∀j
xG,T +
xK,T ≤
400 i
xG,N +
xK,N ≤
750
∑ x ≥D ∀i
j ij i
xG,E +
xG,T +
xG,N ≥ 550
xK,E +
xK,T +
xK,N ≥ 450
∑ x − My
i ij j
≤ 0 ∀j
We need to add a constraint that ensures that only N plants are used! We will use the
Binary Variables, yj, the Linking Constraints, and a new constraint that says the sum of the
Binary Variables must not exceed N. This is sometimes called an Select-‐From condition.
MIT Center for
Transportation & Logistics
35
Formulating
GoNuts 4 4
Model
3
– with
fixed
plant
costs
Model
4
– only
variable
costs
but
and
minimum
production
levels with
maximum
number
of
plants
allowed
z*=
¥
27,425.00 z*=
¥
22,850.50
Ginko Kola Ginko Kola
Ethiopia 0 400 Ethiopia 0 425
Tanzania 0 0 Tanzania 0 0
Nigeria 550 50 Nigeria 550 25
∑x i ij
− My j ≤ 0 ∀j ∑xi ij
− L j y j ≥ 0 ∀j
n Select From – picks the best X of Y choices (min or max)
∑x i ij
− My j ≤ 0 ∀j ∑ j
yj ≤ N