Excerpted from: Dimitris Bertsimas and John N. Tsitsiklis, Introduction to Linear Optimization, Athena Scientific, 1997, Exercise 5.8. We thank the authors for permitting us to use this problem.

A pottery manufacturer can make four different types of dining room service sets: English, Currier, Primrose, and Bluetail. Furthermore, Primrose can be made by two different methods, labeled 1 and 2. Each set uses clay, enamel, dry room time, and kiln time, and results in a product shown in the table below. The rows correspond to different products abbreviated as below. [1]

  • E: Units English
  • C: Units Currier
  • P1: Units Primrose via Method 1
  • P2: Units Primrose via Method 2
  • B: Units Bluetail

The resource constraints are on

  • Clay
  • Enamel
  • Dry room usage
  • Kiln
  • Primrose

Hint: It must be the case that the Primrose created by method 1 and 2 must be equal, and should be reflected in one of the constraints.

E C P1 P2 B Total
Clay(lbs) 10 15 10 10 20 130
Enamel(lbs) 1 2 2 1 1 13
Dry room(hours) 3 1 6 6 3 45
Kiln(hours) 2 4 2 5 3 23
Profit 51 102 66 66 89

Assuming that the number of dining room service sets of each type can be fractional, formulate the product maximization problem of the manufacturer as an LP. Then click below to reveal the formulation. (This part counts for 0 points.)

Formulation

$$ \left.\begin{array}{rrcl} \max & z=51E + 102C + 66P_1 + 66P_2 +89B \\ \text {s.t.:} & & & \\ & 10E+15C+10P_1+10P_2+20B \leq 130 \\. & E+2C+2P_1+P_2+B \leq 13 \\ & 3E+C+6P_1+6P_2+3B \leq 45 \\ & 2E+4C+2P_1+5P_2+3B \leq 23\\ & P_1-P_2 = 0 \\ & E,C,P_1,P_2, B \geq 0 \\ \end{array}\right\} $$

In [22]:
using JuMP
# Define model
m = Model()

@variables m begin
    E  >= 0
    C  >= 0
    P1 >= 0
    P2 >= 0
    B  >= 0
end

@constraints m begin
    10E + 15C + 10P1 + 10P2 + 20B <= 130
      E +  2C +  2P1 +   P2 +   B <= 13 
     3E +   C +  6P1 +  6P2 +  3B <= 45 
     2E +  4C +  2P1 +  5P2 +  3B <= 23
                  P1 -   P2       == 0
end

@objective(m, Max,  51E + 102C + 66P1 + 66P2 + 89B)

solve(m)

println("Optimal Profit: ", getobjectivevalue(m))
println("English dining service set produced: ", getvalue( E))
println("Currier dining service set produced: ",getvalue( C))
println("Primrose via method 1 dining service set produced: ",getvalue(P1))
println("Primrose via method 2 dining service set produced: ",getvalue(P2))
println("Bluetail dining service set produced: ",getvalue( B))


Optimal Profit: 649.0
English dining service set produced: 0.0
Currier dining service set produced: 2.0
Primrose via method 1 dining service set produced: -0.0
Primrose via method 2 dining service set produced: 0.0
Bluetail dining service set produced: 5.0

Writing the LP in "dining.lp" file


In [23]:
writeLP(m, "dining.lp")

In [2]:
!less "dining.lp"


Maximize
 obj: 51 VAR1 + 102 VAR2 + 66 VAR3 + 66 VAR4 + 89 VAR5
Subject To
 c1: 10 VAR1 + 15 VAR2 + 10 VAR3 + 10 VAR4 + 20 VAR5 <= 130
 c2: 1 VAR1 + 2 VAR2 + 2 VAR3 + 1 VAR4 + 1 VAR5 <= 13
 c3: 3 VAR1 + 1 VAR2 + 6 VAR3 + 6 VAR4 + 3 VAR5 <= 45
 c4: 2 VAR1 + 4 VAR2 + 2 VAR3 + 5 VAR4 + 3 VAR5 <= 23
 c5: 1 VAR3 - 1 VAR4 = 0
Bounds
 0 <= VAR1 <= +inf
 0 <= VAR2 <= +inf
 0 <= VAR3 <= +inf
 0 <= VAR4 <= +inf
 0 <= VAR5 <= +inf
General
End

In [3]:
!glpsol --cpxlp dining.lp --ranges dining.sen


GLPSOL: GLPK LP/MIP Solver, v4.60
Parameter(s) specified in the command line:
 --cpxlp dining.lp --ranges dining.sen
Reading problem data from 'dining.lp'...
5 rows, 5 columns, 22 non-zeros
16 lines were read
GLPK Simplex Optimizer, v4.60
5 rows, 5 columns, 22 non-zeros
Preprocessing...
5 rows, 5 columns, 22 non-zeros
Scaling...
 A: min|aij| =  1.000e+00  max|aij| =  2.000e+01  ratio =  2.000e+01
GM: min|aij| =  5.298e-01  max|aij| =  1.887e+00  ratio =  3.562e+00
EQ: min|aij| =  2.847e-01  max|aij| =  1.000e+00  ratio =  3.513e+00
Constructing initial basis...
Size of triangular part is 5
*     0: obj =  -0.000000000e+00 inf =   0.000e+00 (4)
*     2: obj =   6.490000000e+02 inf =   0.000e+00 (0)
OPTIMAL LP SOLUTION FOUND
Time used:   0.0 secs
Memory used: 0.0 Mb (32432 bytes)
Write sensitivity analysis report to 'dining.sen'...

In [4]:
!less "dining.sen"


GLPK 4.60 - SENSITIVITY ANALYSIS REPORT                                                                         Page   1

Problem:    
Objective:  obj = 649 (MAXimum)

   No. Row name     St      Activity         Slack   Lower bound       Activity      Obj coef  Obj value at Limiting
                                          Marginal   Upper bound          range         range   break point variable
------ ------------ -- ------------- ------------- -------------  ------------- ------------- ------------- ------------
     1 c1           NU     130.00000        .               -Inf       86.25000      -1.42857     586.50000 VAR5
                                           1.42857     130.00000      153.33333          +Inf     682.33333 VAR2

     2 c2           BS       9.00000       4.00000          -Inf        6.50000     -28.20000     395.20000 c4
                                            .           13.00000       11.50000      25.00000     874.00000 c1

     3 c3           BS      17.00000      28.00000          -Inf        5.75000      -5.55556     554.55556 c1
                                            .           45.00000       30.00000       1.92308     681.69231 VAR1

     4 c4           NU      23.00000        .               -Inf       19.50000     -20.14286     578.50000 VAR2
                                          20.14286      23.00000       28.60000          +Inf     761.80000 c2

     5 c5           NS        .             .             .            -1.00000          -Inf     600.00000 VAR2
                                          49.00000        .              .               +Inf     649.00000 VAR4

GLPK 4.60 - SENSITIVITY ANALYSIS REPORT                                                                         Page   2

Problem:    
Objective:  obj = 649 (MAXimum)

   No. Column name  St      Activity      Obj coef   Lower bound       Activity      Obj coef  Obj value at Limiting
                                          Marginal   Upper bound          range         range   break point variable
------ ------------ -- ------------- ------------- -------------  ------------- ------------- ------------- ------------
     1 VAR1         NL        .           51.00000        .                -Inf          -Inf          +Inf
                                          -3.57143          +Inf        7.00000      54.57143     624.00000 VAR2

     2 VAR2         BS       2.00000     102.00000        .            -2.30769      89.50000     624.00000 VAR1
                                            .               +Inf        5.75000     118.66667     682.33333 c1

     3 VAR3         NL        .           66.00000        .              .               -Inf     649.00000 VAR4
                                         -37.57143          +Inf         .87500     103.57143     616.12500 VAR2

     4 VAR4         BS        .           66.00000        .              .               -Inf     649.00000
                                            .               +Inf         .87500     103.57143     649.00000 VAR3

     5 VAR5         BS       5.00000      89.00000        .             3.00000      76.50000     586.50000 VAR1
                                            .               +Inf        6.50000     136.00000     884.00000 c4

End of report