Prev Next Top Problem1_6

Meat Packing Plant Problem 1.6

Problem Statement

Number Produced
A meat packing plant produces the following number of items (hams, bellies, and picnic hams) each day:
  Hams     Bellies     Picnics  
480 400 230

Smoking Limits
The following number of items (hams plus bellies plus picnic hams) can be smoked per day during regular working hours and overtime hours:
Smoke Regular Time    Smoke Overtime
420 250

Net Profit
The net profit per item per day that is fresh, smoked on regular item, or smoked on overtime is
  Item     Fresh     Smoke Regular Time     Smoke Overtime  
  Ham   $8 $14 $11
  Belly   $4 $12 $7
  Picnic   $4 $13 $9

Notation
 480 - x1 - x2  fresh hams per day
 x1 hams per day smoked on regular time
 x2 hams per day smoked on overtime
 400 - x3 - x4  fresh bellies per day
 x3 bellies per day smoked on regular time
 x4 bellies per day smoked on overtime
 230 - x5 - x6  fresh picnics per day
 x5 picnics per day smoked on regular time
 x6 picnics per day smoked on overtime

Relations

Profits
The net profit per day  p is
     p = 8 * (480 - x1 - x2) + 14 * x1 + 11 * x2
       + 4 * (400 - x3 - x4) + 12 * x3 +  7 * x4
       + 4 * (230 - x5 - x6) + 13 * x5 +  9 * x6

     p = 6360 + 6 * x1 + 3 * x2 + 8 * x3 + 3 * x4 + 9 * x5 + 5 * x6

Production Constraints
The production constraints are
     x1 + x2 <= 480
     x3 + x4 <= 400
     x5 + x6 <= 230

Smoking Constraints
     x1 + x3 + x5 <= 420
     x2 + x4 + x6 <= 250

Primal Solution
The Neos Clp run results below claim that the solution is
        x1 = 0, x2 =  40, x3 = 400, x4 = 0, x5 =  20, x6 = 210
(a solution can also be found in section Tableau1_6 ). We will check this solution to see if it is correct.

Check Primal Feasible
All the components of  x are greater than or equal zero so we only need check.
     x1 + x2 = 40       <= 480
     x3 + x4 = 400      <= 400
     x5 + x6 = 230      <= 230
     x1 + x3 + x5 = 420 <= 420
     x2 + x4 + x6 = 250 <= 250

Dual Solution
By the Complementary Slackness theorem (5.3 in the text), the dual solution has  y1 = 0. It follows from the fact that  x2,  x3,  x5 and  x6 are not zero
     y2 * A22 + y3 * A32 + y4 * A42 + y5 * A52 = c2 
     y2 * A23 + y3 * A33 + y4 * A43 + y5 * A53 = c3 
     y2 * A25 + y3 * A35 + y4 * A45 + y5 * A55 = c5 
     y2 * A26 + y3 * A36 + y4 * A46 + y5 * A56 = c6 

     y2 * 0   + y3 * 0   + y4 * 0   + y5 * 1   = 3  
     y2 * 1   + y3 * 0   + y4 * 1   + y5 * 0   = 8  
     y2 * 0   + y3 * 1   + y4 * 1   + y5 * 0   = 9  
     y2 * 0   + y3 * 1   + y4 * 0   + y5 * 1   = 5  


     y5      = 3  
     y2 + y4 = 8   y2 = 8 - y4 = 1
     y3 + y4 = 9   y4 = 9 - y3 = 7  
     y3 + y5 = 5   y3 = 5 - y5 = 2  
(see definition of the matrix  A below).

Check Dual Feasible
The dual vector above is feasible because  y >= 0 and  A^T * y >= c as shown below:  
y^T * A =
                     [  1    1    0    0    0    0 ]
                     [  0    0    1    1    0    0 ]
 = (0, 1, 2, 7, 3) * [  0    0    0    0    1    1 ]
                     [  1    0    1    0    1    0 ]
                     [  0    1    0    1    0    1 ]
 = (7, 3, 8, 4, 9, 5)

>= (6, 3, 8, 3, 9, 5) 

Check Objective are Equal
If the dual and primal objectives are equal, then this must be the solution (theorem 5.1);
c^T * x = (6, 3, 8, 3, 9, 5) * (0, 40, 400, 0, 20, 210)^T = 4550
b^T * y = (480, 400, 230, 420, 250) * (0, 1, 2, 7, 3)^T   = 4550

Neos Input
You may find that problem1_6.htm gives better copy and paste results than problem1_6.xml :
<document>

<category>lp</category>
<solver>Clp</solver>
<inputMethod>MPS</inputMethod>

<comments><![CDATA[
Problem 1.6 in Vasek Chvatal's book: Linear Programming
     maximize     c^T * x       w.r.t x >= 0
     subject to     A * x <= b

             x1   x2   x3   x4   x5   x6
z  c^T =   (  6    3    8    3    9    5 )

r1         [  1    1    0    0    0    0 ]       [ 480 ]
r2         [  0    0    1    1    0    0 ]       [ 400 ]
r3   A =   [  0    0    0    0    1    1 ]   b = [ 230 ]
r4         [  1    0    1    0    1    0 ]       [ 420 ]
r5         [  0    1    0    1    0    1 ]       [ 250 ]
]]></comments>

<MPS><![CDATA[*
*Op Name0---  Name1---  Value1------   Name2---  Value2------
*23 56789012  56789012  567890123456   01234567  012345678901
NAME          CE-2.1
ROWS
 N  z
 L  r1
 L  r2
 L  r3
 L  r4
 L  r5 
COLUMNS
    x1        z          6
    x1        r1         1
    x1        r4         1
*
    x2        z          3
    x2        r1         1
    x2        r5         1
*
    x3        z          8
    x3        r2         1
    x3        r4         1
*
    x4        z          3
    x4        r2         1
    x4        r5         1
*
    x5        z          9
    x5        r3         1
    x5        r4         1
*
    x6        z          5
    x6        r3         1
    x6        r5         1
RHS
    b         r1         480
    b         r2         400
    b         r3         230
    b         r4         420
    b         r5         250
ENDATA
*]]></MPS>

<param><![CDATA[
maximize
primalSimplex
solution -
]]></param>

</document>

Neos Output
%%%%%%%%%%%%%%%%%%%% CLP Results %%%%%%%%%%%%%%%%%%%%

Load Avg: ( 3.2 , 3.27 , 3.49 )
Coin LP version 1.02.02, build Mar 20 2006
command line - /home/neos/neos-bin/clp clp.mps - 
At line 4 NAME          CE-2.1
At line 5 ROWS
At line 12 COLUMNS
At line 36 RHS
At line 42 ENDATA
Problem CE-2.1 has 5 rows, 6 columns and 12 elements
Model was imported from ./clp.mps in 0 seconds
Switching to line mode
Clp:Clp:Clp:Presolve 5 (0) rows, 6 (0) columns and 12 (0) elements
Perturbing problem by 0.001 % of 356 - largest nonzero change 7.76324e-05 (% 3.314e-05) - largest zero change 0
0  Obj -0 Dual inf 34 (6)
5  Obj 4550
Optimal - objective value 4550
Optimal objective 4550 - 5 iterations time 0.002
Clp:
      0 x1                    0                     -1
      1 x2                   40                     -0
      2 x3                  400                     -0
      3 x4                    0                     -1
      4 x5                   20                     -0
      5 x6                  210                     -0
Clp:

%%%%%%%%%%%%%%%%%%%% CLP Results %%%%%%%%%%%%%%%%%%%%

Input File: Problem1_6.omh