0% found this document useful (0 votes)
286 views41 pages

Integer and Mixed Integer Linear Programs: Center For Transportation & Logistics

The document discusses integer and mixed integer linear programs. It provides examples using a problem from Banner Chemicals that produces two grades of a product. The optimal solution from solving the linear programming relaxation allows fractional barrels produced. However, the problem requires integer solutions in multiples of 10 barrels. Enumerating all possible integer solutions reveals the true optimal solution is to produce 10 barrels of the high grade and 90 barrels of the supreme grade, yielding a maximum profit of $18,800. This is higher than rounding the LP solution or the closest feasible point found by rounding.

Uploaded by

ramchand sovani
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)
286 views41 pages

Integer and Mixed Integer Linear Programs: Center For Transportation & Logistics

The document discusses integer and mixed integer linear programs. It provides examples using a problem from Banner Chemicals that produces two grades of a product. The optimal solution from solving the linear programming relaxation allows fractional barrels produced. However, the problem requires integer solutions in multiples of 10 barrels. Enumerating all possible integer solutions reveals the true optimal solution is to produce 10 barrels of the high grade and 90 barrels of the supreme grade, yielding a maximum profit of $18,800. This is higher than rounding the LP solution or the closest feasible point found by rounding.

Uploaded by

ramchand sovani
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/ 41

Integer

 and  Mixed  Integer  


Linear  Programs

MIT Center for


Transportation & Logistics ctl.mit.edu
1
Numbers,  Numbers,  Everywhere!
N  =  Natural,  Whole,  or  Counting  Numbers  =  0,  1,  2,  3,  .  .  .

Z  =  Integers  =  .  .  .  -­‐3,  -­‐2,  -­‐1,  0,  1,  2,  3,  .  .  .

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  =  Binary  Integers  =  {0,1}    

B

Why  the  heck  do  we  care?    


MIT Center for
By  Mortalmoth (Own  work)  [Public  domain],  via  Wikimedia  Commons 2
Transportation & Logistics
Integer  Variables
• Why  use  them?
n When  its  physically  impossible  to  have  fractional  solutions
w For  example;  number  of  people  to  hire,  number  of  ships  to  make
w However,  if  dealing  with  large  numbers,  continuous  is  fine
n Allows  for  modeling  logical  conditions  (Binary)
w If  Then:    
If we  have  product  leaving  plant  A  then we  must  open  it
w Either  Or:  
We  can  either produce  ≥1000  units  or none  at  all.      
w Select  From:
We  must  select ≥4  DCs  to  open  from the  10  possible
We  must  select ≤5  products  to  make  from the  15  available
• Why  do  we  have  to  treat  them  differently?
MIT Center for
3
Transportation & Logistics
Banner  Chemicals  II:  IP  Example

MIT Center for


4
Transportation & Logistics
Motivating  Problem  – Banner  Chemicals  II
• Situation
n Banner  Chemicals  manufactures  specialty  chemicals.    One  of  their  products  
comes  in  two  grades,  high    and  supreme.   The  capacity  at  the  plant  is  110  
barrels  per  week.    
n The  high  and  supreme  grade  products  use  the  same  basic  raw  materials  but  
require  different  ratios  of  additives.    The  high  grade  requires  3  gallons  of  
additive  A  and  1  gallon  of  additive  B  per  barrel  while  the  supreme  grade  
requires  2  gallons  of  additive  A  and  3  gallons  of  additive  B  per  barrel.
n The  supply  of  both  of  these  additives  is  quite  limited.    Each  week,  this  product  
line  is  allocated  only  300  gallons  of  additive  A  per  week  and  280  gallons  of  
additive  B.    
n A  barrel  of  the  high  grade  has  a  profit  margin  of  $80  per  barrel  while  the  
supreme  grade  has  a  profit  margin  of  $200  per  barrel.      
• 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?    

MIT Center for


5
Transportation & Logistics
Banner  Chemicals Max    z(XH,  XS)  =  80XH +  200XS
s.t.
Plant XH +  XS ≤  110
Optimal  LP  Solution 3XH +  2XS ≤  300
Add.  A
XH=  25  barrels
XS =  85  barrels Add.  B XH +  3XS ≤  280
Max  Profit  =  19,000
XH ≥  0
XS

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

How  to  find  solution  to  IP? Plant


s.t.
XH +  XS ≤  110
3XH +  2XS ≤  300
• Let’s  try  “rounding”  the  solution  to   Add.  A

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  

Each  cell  shows  z  = 80XH +  200XS


x  indicates  infeasible  solution

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

Max    z(XHL,  XSL)  =  800XHL +  2000XSL


s.t.
Plant XHL +  XSL ≤  11
Add.  A 3XHL +  2XSL ≤  30

Add.  B XHL +  3XSL ≤  28


XHL,  XSL ≥  0  Integers

MIT Center for


9
Transportation & Logistics
1

GoNuts Juice  Company:  Model  1

MIT Center for


10
Transportation & Logistics
GoNuts Juice  Company 1

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 Ginko Kola Capacity Units/Month Demand Units/Month


Ethiopia ¥21.00   ¥22.50   Ethiopia 425 Ginko 550
Tanzania ¥22.50   ¥24.50   Tanzania 400 Kola 450
Nigeria ¥23.00   ¥25.50   Nigeria 750

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 11
Transportation & Logistics
Formulating  GoNuts 1

Step  1.    Determine  Decision  Variables


xG,E =  Number  of  Ginko Juice  units  made  in  Ethiopia  plant
xK,E =  Number  of  Kola  Juice  units  made  in  Ethiopia  plant
xG,T =  Number  of  Ginko Juice  units  made  in  Tanzania  plant
xK,T =  Number  of  Kola  Juice  units  made  in  Tanzania  plant
xG,N =  Number  of  Ginko Juice  units  made  in  Nigeria  plant
xK,N =  Number  of  Kola  Juice  units  made  in  Nigeria  plant

xij =  Number  of  units  of  product  i made  in  plant  j


xij ≥  0   for  all  i,j

Step  2.    Formulate  Objective  Function


Minimize  z  =  Cost  =  21xG,E +  22.5xK,E  +  22.5xG,T  +  24.5xK,T +  23xG,N +  25.5xK,N

Min z =∑ ∑ cij xij


i j
where:  
xij =  Number  of  units  of  product  i made  in  plant  j
MIT Center for
cij =  Cost  per  unit  of  product  i made  at  plant  j
12
Transportation & Logistics
Formulating  GoNuts 1

Step  3.    Formulate  Constraints


Plant  Capacity

xG,E +  xK,E ≤    425 ∑x i ij


≤Cj ∀j
xG,T +  xK,T ≤    400 where:  
xG,N +  xK,N ≤  750   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 ∀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

Minimize  z  =  Cost  =  21xG,E +  22.5xK,E  +  22.5xG,T  +  24.5xK,T +  23xG,N +  25.5xK,N


subject  
to xG,E +  xK,E ≤    425
xG,T +  xK,T ≤    400 Capacity Cj
xG,N +  xK,N ≤  750   cij i=1 i=2 j=1 425
xG,E +  xG,T +  xG,N ≥    550 j=1 ¥21.00   ¥22.50   j=2 400
xK,E +  xK,T +  xK,N ≥ 450   j=2 ¥22.50   ¥24.50   j=3 750
xG,E,  xK,E,    xG,T,  xK,T,  xG,N,  xK,N ≥  0   j=3 ¥23.00   ¥25.50   Demand Di
i=1 550
Min z =∑ ∑ cij xij i=2 450
i j

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 Juice  Company:  Model  2

MIT Center for


15
Transportation & Logistics
GoNuts Juice  Company:  Model  2 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

Step  1.    Determine  Decision  Variables


xij =  Number  of  units  of  product  i made  in  plant  j
yj =  1  if  plant  j  is  opened;  =  0  otherwise

Step  2.    Formulate  Objective  Function


Min  z  =    21xG,E +  22.5xK,E  +  22.5xG,T  +  24.5xK,T +  23xG,N +  25.5xK,N +  1500yE +  2000yT +  3000yN

Min z =∑ ∑ cij xij + ∑ f j y j


i j 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
fj =  Fixed  cost  per  month  if  plant  j  is  used

MIT Center for


17
Transportation & Logistics
Formulating  GoNuts 2   2

Step  3.    Formulate  Constraints


xG,E +  xK,E ≤    425
Demand Capacity

xG,T +  xK,T ≤    400


∑x i ij
≤Cj ∀j
xG,N +  xK,N ≤  750  
∑x j ij
≥ Di ∀i
xG,E +  xG,T +  xG,N ≥ 550 where:  
xK,E +  xK,T +  xK,N ≥ 450   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

• Is  this  enough?    Try  solving  it!


n You  need  to  ensure  that  if a  plant  produces  product,  then
it  is  actually  opened!
n If  Then  conditions  require  both  a
w Binary  Variable  
w Linking  Constraint
MIT Center for
18
Transportation & Logistics
If  Then  Conditions

MIT Center for


19
Transportation & Logistics
If-­‐Then  Condition yN

Feasible  Values
Looking  at  the  Nigeria  Plant  .  .  . 1

• How  do  yN,  xGN and  xKN interact?


0
0 CN xGN +  xKN
IF  .  .  .   THEN
xGN+xKN yN =  0 yN =  1
=  0 YES YES
xGN +  xKN ≤  750  yN
>0  and ≤  CN NO YES IF  xGN+xKN = THEN  yN =

0 0  or  1 0  ≤  750  yN

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

Step  3.    Formulate  Constraints


xG,E +  xK,E ≤    425
Linking Demand Capacity

xG,T +  xK,T ≤    400


xG,N +  xK,N ≤  750  
∑ x ≤Ci ij j
∀j
xG,E +  xG,T +  xG,N ≥ 550
xK,E +  xK,T +  xK,N ≥ 450   ∑ x ≥Dj ij i
∀i

xG,E +  xK,E -­‐ 425yE ≤  0 ∑ x − My


i ij j
≤ 0 ∀j
xG,T +  xK,T -­‐ 400yT ≤  0 where:  
xG,N +  xK,N -­‐ 750yN ≤  0 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

MIT Center for


21
Transportation & Logistics
2

GoNuts Juice  Company  Model  2:  


With  If  Then  Conditions

MIT Center for


22
Transportation & Logistics
Formulation  of  GoNuts Model  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

xij =  Number  of  units  of  product  i made  in  plant  j


Demand Di
yj =  1  if  plant  j  is  opened;  =  0  o.w.
i=1 550 cij =  Cost  per  unit  of  product  i made  at  plant  j
i=2 450 Cj =  Capacity  in  units  at  plant  j
Di =  Demand  for  product  i in  units
Capacity Cj fj cij i=1 i=2
M  =  a  big  number  (such  as  Cj in  this  case)
j=1 425 1500 j=1 ¥21.00   ¥22.50  
j=2 400 2000 j=2 ¥22.50   ¥24.50  
MIT Center for
j=3 750 &3000
Transportation Logistics j=3 ¥23.00   ¥25.50   23
Solution:  GoNuts Models  1  &  2
Model  1 – only  variable  costs Model  2  – with  fixed  plant  costs
z*=  ¥  22,637.50 z*=  ¥  27,350.00
Ginko Kola Ginko Kola
Ethiopia 0 425 Ethiopia 0 425
Tanzania 375 25 Tanzania 0 0
Nigeria 175 0 Nigeria 550 25

MIT Center for


24
Transportation & Logistics
3

GoNuts Juice  Company:  Model  3


Adding  Either  Or  Conditions

MIT Center for


25
Transportation & Logistics
GoNuts Juice  Company:  Model  3 3

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

Step  1.    Determine  Decision  Variables No  Change!


xij =  Number  of  units  of  product  i made  in  plant  j
yj =  1  if  plant  j  is  opened;  =  0  otherwise

Step  2.    Formulate  Objective  Function No  Change!


Min  z  =    21xG,E +  22.5xK,E  +  22.5xG,T  +  24.5xK,T +  23xG,N +  25.5xK,N +  1500yE +  2000yT +  3000yN

Min z =∑ ∑ cij xij + ∑ f j y j


i j 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
fj =  Fixed  cost  per  month  if  plant  j  is  used

MIT Center for


27
Transportation & Logistics
Formulating  GoNuts 3   3

Step  3.    Formulate  Constraints


xG,E +  xK,E ≤    425
∑ x ≤C
Linking Demand Capacity

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
where:  
xG,E +  xK,E -­‐ 425yE ≤  0 xij =  Number  of  units  of  product  i made  in  plant  j
xG,T +  xK,T -­‐ 400yT ≤  0 yj =  1  if  plant  j  is  opened;  =  0  o.w.
xG,N +  xK,N -­‐ 750yN ≤  0 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

We need to add a constraint that ensures that if we DO use plant j, that


the volume is between the minimum allowable level, Lj, and the maximum
capacity, Cj. This is sometimes called an Either-­‐Or condition.

MIT Center for


28
Transportation & Logistics
Either  Or  Condition yN
Feasible  
Values

Looking  at  the  Nigeria  Plant  .  .  . 1

• How  do  yN,  xGN and  xKN interact?


0
IF  .  .  .   THEN 0 LN CN xGN +  xKN
600 750
xGN+xKN yN =  0 yN =  1
=  0 YES NO
IF   THEN  yN THEN  yN
>0  and  <  LN NO NO xGN+xKN ≤750yN ≥600yN
≥  LN and  ≤CN NO YES
0 0  or  1 0

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

xK,E +  xK,T +  xK,N ≥ 450   ∑x j ij


≥ Di ∀i

xG,E +  xK,E -­‐ 425yE ≤  0 ∑x i ij


− My j ≤ 0 ∀j
xG,T +  xK,T -­‐ 400yT ≤  0
xG,N +  xK,N -­‐ 750yN ≤  0  
∑x i ij
− Lj y j ≥ 0 ∀j
xij ≥ 0 ∀ij
xG,E +  xK,E -­‐ 100yE ≥  0
y j = {0,1}
xG,T +  xK,T -­‐ 250yT ≥  0
xG,N +  xK,N -­‐ 600yN ≥  0   where:  
xij =  Number  of  units  of  product  i made  in  plant  j
Products Di xG,E,  xK,E,    xG,T,  xK,T , yj =  1  if  plant  j  is  opened;  =  0  o.w.
i=1 550 xG,N,  xK,N ≥  0   cij =  Cost  per  unit  of  product  i made  at  plant  j
i=2 450 yE,  yT,  yN =  {0,  1} Cj =  Maximum  capacity  in  units  at  plant  j
Lj =  Minimum  level  of  production  at  plant  j
cij i=1 i=2 Plants Cj Lj fj
Di =  Demand  for  product  i in  units
j=1 ¥21.00   ¥22.50   j=1 425 100 1500 M  =  a  big  number  (such  as  C in  this  case)
j
j=2 ¥22.50   ¥24.50   j=2 400 250 2000
MIT Center for
j=3 ¥23.00  Transportation
¥25.50  
& Logistics j=3 750 600 3000 30
Solution:  GoNuts Models  1,  2,  &  3
Model  1 – only  variable  costs Model  2  – with  fixed  plant  costs
z*=  ¥  22,637.50 z*=  ¥  27,350.00
Ginko Kola Ginko Kola
Ethiopia 0 425 Ethiopia 0 425
Tanzania 375 25 Tanzania 0 0
Nigeria 175 0 Nigeria 550 25

Model  3  – with  fixed  plant  costs  


and  minimum  production  levels
z*=  ¥  27,425.00
Ginko Kola
Ethiopia 0 400
Tanzania 0 0
Nigeria 550 50

MIT Center for


31
Transportation & Logistics
4

GoNuts Juice  Company:  Model  4


Adding  Select  From  Conditions

MIT Center for


32
Transportation & Logistics
GoNuts Juice  Company:  Model  4 4

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 Ginko Kola Capacity   Max   Demand Units/Month


Ethiopia ¥21.00   ¥22.50   (units/Month) Capacity Ginko 550
Tanzania ¥22.50   ¥24.50   Ethiopia 425 Kola 450
Nigeria ¥23.00   ¥25.50   Tanzania 400
Nigeria 750

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

Step  1.    Determine  Decision  Variables No  Change!


xij =  Number  of  units  of  product  i made  in  plant  j
yj =  1  if  plant  j  is  opened;  =  0  otherwise

Step  2.    Formulate  Objective  Function Slight  Change!


Min  z  =    21xG,E +  22.5xK,E  +  22.5xG,T  +  24.5xK,T +  23xG,N +  25.5xK,N

Min z =∑ ∑ cij xij


i 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

MIT Center for


34
Transportation & Logistics
Formulating  GoNuts 4   4

Step  3.    Formulate  Constraints


xG,E +  xK,E ≤    425
∑ x ≤C
Linking Demand Capacity

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

xG,E +  xK,E -­‐ 425yE ≤  0 ∑ y ≤Nj j


xG,T +  xK,T -­‐ 400yT ≤  0 where:  
xG,N +  xK,N -­‐ 750yN ≤  0 xij =  Number  of  units  of  product  i made  in  plant  j
yj =  1  if  plant  j  is  opened;  =  0  o.w.
Plants
Max  

yE +  yT +  yN ≤  2   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
Binary Variables must not exceed N. This is sometimes called an Select-­‐From condition.
MIT Center for
Transportation & Logistics
35
Formulating  GoNuts 4 4

Min  z  =    21xG,E +  22.5xK,E  +  22.5xG,T  +  24.5xK,T +  23xG,N +  25.5xK,N


subject  to
xG,E +  xK,E ≤    425 Min z = ∑ ∑ cij xij
i j
xG,T +  xK,T ≤    400
s.t.
xG,N +  xK,N ≤  750  
xG,E +  xG,T +  xG,N ≥ 550 ∑ x ≤C
i ij j
∀j
xK,E +  xK,T +  xK,N ≥ 450  
∑ x ≥D
j ij i
∀i
xG,E +  xK,E -­‐ 425yE ≤  0
xG,T +  xK,T -­‐ 400yT ≤  0 ∑ x − My
i ij j
≤0 ∀j
xG,N +  xK,N -­‐ 750yN ≤  0  
yE +  yT +  yN ≤  2  
∑ y ≤N
j 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} j
where:  
Products Di xij =  Number  of  units  of  product  i made  in  plant  j
i=1 550 yj =  1  if  plant  j  is  opened;  =  0  o.w.
N  =  2
i=2 450 cij =  Cost  per  unit  of  product  i made  at  plant  j
Cj =  Maximum  capacity  in  units  at  plant  j
cij i=1 i=2 Plants Cj
Di =  Demand  for  product  i in  units
j=1 ¥21.00   ¥22.50   j=1 425 M  =  a  big  number  (such  as  Cj in  this  case)
j=2 ¥22.50   ¥24.50   j=2 400 N  =  Number  of  plants  allowed  to  be  opened
MIT Center for
j=3 ¥23.00  Transportation
¥25.50  
& Logistics j=3 750 36
Solution:  GoNuts All  Models
Model  1 – only  variable  costs Model  2  – with  fixed  plant  costs
z*=  ¥  22,637.50 z*=  ¥  27,350.00
Ginko Kola Ginko Kola
Ethiopia 0 425 Ethiopia 0 425
Tanzania 375 25 Tanzania 0 0
Nigeria 175 0 Nigeria 550 25

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

MIT Center for


37
Transportation & Logistics
Key  Points  from  Lesson

MIT Center for


38
Transportation & Logistics
Key  Points  from  Lesson  (1/2)
• IPs  and  MILPs  are  different  from  LPs
n Much  harder  to  solve  since  solution  space  expands!
n Formulations
w LPs  a  correct  formulation  is  generally  a  good  formulation
w For  IPs  a  correct  formulation  is  necessary  but  not  sufficient  to  
guarantee  solvability
n IPs  require  solving  multiple  LPs  to  establish  bounds  –
relaxing  the  Integer  constraints
n Can’t  just  “round”  the  LP  solution  – might  not  be  feasible
• When  using  integer  (not  binary)  variables,  solve  the  
LP  first  to  see  if  it  is  sufficient.    

MIT Center for


39
Transportation & Logistics
Key  Points  from  Lesson  (2/2)
• Binary  variables  are  very  powerful  and  can  be  used  for  
modeling  logical  conditions
n If  Then  – links  continuous  to  binary  variables  
∑xi ij
− My j ≤ 0 ∀j

n Either  Or – ensures  a  minimum  level  if  used  at  all  

∑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

MIT Center for


40
Transportation & Logistics
Questions,  Comments,  Suggestions?
Use  the  Discussion  Forum!

“Athena  – before  and  after  completing  the  MITx  MicroMasters  Credential.    


(photos  courtesy  of  Lana  Scott)  

MIT Center for [email protected]


MIT Center for Transportation & Logistics ctl.mit.edu
Transportation & Logistics

You might also like