Professional Documents
Culture Documents
ctl.mit.edu
Integer
Variables
Why
use
them?
n
Question
n
How
many
barrels
of
High
and
Supreme
grade
should
Banner
Chemicals
produce
each
week
assuming
you
can
only
produce
in
10
barrel
lots?
Banner
Chemicals
Optimal
LP
Solution
XH=
25
barrels
XS =
85
barrels
Max
Profit
=
19,000
XH + XS 110
Add. A
Add. B
XH + 3XS 280
XS
XH
0
XS
0
What
is
the
optimal
solution
with
10
barrel
lots?
XH
Notes:
XH + XS 110
Add. A
Add. B
XH + 3XS 280
LP
Solution:
w XH=25
barrels
XS=
85
barrels
3.
XS 0
XH 0
Mass
Enumeration
of
Banner
Chemical
Optimal
IP
Solution
XH=
10
barrels
XS =
90
barrels
Max
Profit
=
18,800
Optimal
LP
Solution
XH=
25
barrels
XS =
85
barrels
Max
Profit
=
19,000
Closest
rounded
LP
Solution
XH=
30
barrels
XS =
80
barrels
Max
Profit
=
18,400
Plant
XH + XS 110
Add. A
Add. B
XH +
3XS
280
XH
0
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
Center
IPs
forare
much,
much,
much
harder
to
solve
than
LPs!
Transportation & Logistics
XH + XS 110
Add. A
Add. B
XH +
3XS
280
XH
0
XS
0
XHL + XSL 11
Add. A
3XHL + 2XSL 30
Add. B
XHL +
3XSL
28
XHL,
XSL
0
Integers
10
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.
Cost/Unit
Ethiopia
Tanzania
Nigeria
Ginko
21.00
22.50
23.00
Kola
22.50
24.50
25.50
Capacity Units/Month
Ethiopia
425
Tanzania
400
Nigeria
750
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
Transportation & Logistics
11
Formulating GoNuts
Min
where:
MIT Center for
Transportation & Logistics
z =
cij xij
12
Formulating GoNuts
x
i
ij
Cj
where:
xij =
Number
of
units
of
product
i made
in
plant
j
Cj =
Capacity
in
units
at
plant
j
Product
Demand
xG,E +
xG,T +
xG,N 550
xK,E +
xK,T +
xK,N 450
xij Di
where:
xij =
Number
of
units
of
product
i made
in
plant
j
Di =
Demand
for
product
i in
units
MIT Center for
Transportation & Logistics
13
Formulating GoNuts
z =
Cj
425
400
750
Demand Di
i=1 550
i=2 450
cij xij
s.t.
x
x
i
ij
Cj
ij
Di
xij 0
ij
where:
xij =
Number
of
units
of
product
i made
in
plant
j
cij =
Cost
per
unit
of
product
i made
at
plant
j
Cj =
Capacity
in
units
at
plant
j
MIT Center for
Di =
Demand
for
product
i in
units
Transportation & Logistics
Optimal
Solution
Ethiopia
Tanzania
Nigeria
Ginko
0
375
175
Kola
425
25
0
15
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
Ethiopia
Tanzania
Nigeria
Ginko
21.00
22.50
23.00
Kola
22.50
24.50
25.50
Capacity
Units/Month
Ethiopia
425
Tanzania
400
Nigeria
750
Fixed
(/Month)
1,500
2,000
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
Transportation & Logistics
16
Formulating GoNuts 2
Min
where:
z =
cij xij + f j y j
j
17
Formulating GoNuts 2
x
x
i
ij
Cj
ij
Di
where:
xij =
Number
of
units
of
product
i made
in
plant
j
Cj =
Capacity
in
units
at
plant
j
Di =
Demand
for
product
i in
units
18
If Then Conditions
19
If-Then
Condition
Looking
at
the
Nigeria
Plant
.
.
.
yN
Feasible
Values
1
IF . . .
THEN
xGN+xKN
yN = 0 yN = 1
CN
= 0
YES
YES
>0 and CN
NO
YES
IF xGN+xKN =
x
i
ij
My j
where:
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)
MIT Center for
Transportation & Logistics
xGN + xKN
THEN yN =
0 or 1
0 750 yN
99
99 750 yN
1 750 yN
Formulating GoNuts 2
x C
x D
x My
i
ij
ij
ij
0 j
where:
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)
Cj =
Capacity
in
units
at
plant
j
Di =
Demand
for
product
i in
units
21
22
Min
z
=
21xG,E +
22.5xK,E
+
22.5xG,T
+
24.5xK,T +
23xG,N +
25.5xK,N +
1500yE +
2000yT +
3000yN
subject
to
Demand Di
i=1 550
i=2 450
Capacity
j=1
j=2
j=3
Cj
fj
425 1500
400 2000
MIT Center for
750 &3000
Transportation
Logistics
cij
j=1
j=2
j=3
i=1
21.00
22.50
23.00
Min
z = cij xij + f j y j
i
s.t.
x
x
x
i
ij
Cj
ij
Di
ij
My j 0
xij 0
y = {0,1}
ij
j
where:
xij =
Number
of
units
of
product
i made
in
plant
j
yj =
1
if
plant
j
is
opened;
=
0
o.w.
cij =
Cost
per
unit
of
product
i made
at
plant
j
Cj =
Capacity
in
units
at
plant
j
Di =
Demand
for
product
i in
units
i=2
M
=
a
big
number
(such
as
Cj in
this
case)
22.50
24.50
23
25.50
Ginko
0
375
175
Kola
425
25
0
Ethiopia
Tanzania
Nigeria
Ginko
0
0
550
Kola
425
0
25
24
25
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.
Cost/Unit
Ethiopia
Tanzania
Nigeria
Ginko
21.00
22.50
23.00
Kola
22.50
24.50
25.50
Capacity
Max
Min
(units/Month) Capacity Capacity
Ethiopia
425
100
Tanzania
400
250
Nigeria
750
600
Demand Units/Month
Ginko
550
Kola
450
Fixed
(/Month)
1,500
2,000
3,000
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
Transportation & Logistics
26
Formulating
GoNuts 3
Step
1.
Determine
Decision
Variables
No Change!
Min
where:
z =
cij xij + f j y j
j
27
Formulating GoNuts 3
x C
x D
x My
i
ij
ij
ij
0 j
where:
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)
Cj =
Maximum
capacity
in
units
at
plant
j
Lj =
Minimum
level
of
production
at
plant
j
Di =
Demand
for
product
i in
units
28
Either
Or
Condition
Looking
at
the
Nigeria
Plant
.
.
.
yN
Feasible
Values
IF . . .
THEN
xGN+xKN
yN = 0 yN = 1
= 0
YES
NO
NO
NO
LN and CN
NO
YES
ij
My j
ij
Lj y j
x
x
i
i
where:
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)
MIT Center for level
of
production
at
plant
j
Lj =
Minimum
Transportation & Logistics
LN
600
CN
750
xGN + xKN
IF
xGN+xKN
THEN
yN
750yN
THEN
yN
600yN
0 or 1
200
600
0 or 1
Formulating GoNuts 3
Min
z
=
21xG,E +
22.5xK,E
+
22.5xG,T
+
24.5xK,T +
23xG,N +
25.5xK,N +
1500yE +
2000yT +
3000yN
subject
to
Plants
i=1
i=2
j=1
21.00
22.50
j=2
22.50
24.50
MIT Center for
j=3
& Logistics
23.00
Transportation
25.50
Min
z = cij xij + f j y j
i
s.t.
x
x
x
x
i
ij
Cj
ij
Di
ij
My j 0
ij
Lj y j 0
xij 0
ij
y j = {0,1}
where:
xij =
Number
of
units
of
product
i made
in
plant
j
yj =
1
if
plant
j
is
opened;
=
0
o.w.
cij =
Cost
per
unit
of
product
i made
at
plant
j
Cj =
Maximum
capacity
in
units
at
plant
j
Lj =
Minimum
level
of
production
at
plant
j
Cj
Lj
fj
Di =
Demand
for
product
i in
units
425 100 1500 M
=
a
big
number
(such
as
C in
this
case)
j
400 250 2000
750 600 3000
30
Ginko
0
375
175
Kola
425
25
0
Ethiopia
Tanzania
Nigeria
Ginko
0
0
550
Kola
425
0
25
Ginko
0
0
550
Kola
400
0
50
31
32
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.
Cost/Unit
Ethiopia
Tanzania
Nigeria
Ginko
21.00
22.50
23.00
Kola
22.50
24.50
25.50
Capacity
Max
(units/Month) Capacity
Ethiopia
425
Tanzania
400
Nigeria
750
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
Transportation & Logistics
33
Formulating GoNuts 4
No Change!
Min
where:
z =
cij xij
34
Formulating GoNuts 4
Max
Plants
x C
x D
x My
y N
i
ij
ij
ij
0 j
where:
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)
Cj =
Maximum
capacity
in
units
at
plant
j
N
=
Number
of
plants
allowed
to
be
opened
Di =
Demand
for
product
i in
units
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
MIT Center for
Binary Variables
must not exceed N. This is sometimes called an Select-From condition.
Transportation & Logistics
35
Formulating GoNuts 4
N = 2
Plants
i=1
i=2
j=1
21.00
22.50
j=2
22.50
24.50
MIT Center for
j=3
& Logistics
23.00
Transportation
25.50
Cj
425
400
750
Min
z = cij xij
i
s.t.
x C
x D
x My
y N
i
ij
ij
ij
xij 0
ij
y = {0,1}
j
where:
xij =
Number
of
units
of
product
i made
in
plant
j
yj =
1
if
plant
j
is
opened;
=
0
o.w.
cij =
Cost
per
unit
of
product
i made
at
plant
j
Cj =
Maximum
capacity
in
units
at
plant
j
Di =
Demand
for
product
i in
units
M
=
a
big
number
(such
as
Cj in
this
case)
N
=
Number
of
plants
allowed
to
be
opened
36
Ginko
0
375
175
z*=
27,350.00
Kola
425
25
0
Ginko
0
0
550
Ethiopia
Tanzania
Nigeria
Ginko
0
0
550
Kola
425
0
25
Kola
400
0
50
Ethiopia
Tanzania
Nigeria
Ginko
0
0
550
Kola
425
0
25
37
38
guarantee solvability
39
x
i
My j 0 j
x
i
ij
ij
My j 0 j
x
i
ij
L j y j 0 j
x
i
ij
My j 0 j
yj N
40
caplice@mit.edu
ctl.mit.edu