A commercial printing firm is trying to determine the best mix of printing jobs it should seek, given its current capacity constraints in its four capital-intensive departments: typesetting, camera, pressroom, and bindery. It has classified its commercial work into three classes: A, B, and C, each requiring different amounts of time in the four major departments.

The production requirements in hours per unit of product are as follows:

Class A Class B Class C
Typesetting 0 2 3
Camera 3 1 3
Pressroom 3 6 2
Bindery 5 4 0

Assuming these units of work are produced using regular time, the contribution to overhead and profit is \$200 for each unit of Class A work, \$300 for each unit of Class B work, and \$100 for each unit of Class C work.

The firm currently has the following regular-time capacity available in each department for the next time period: typesetting, 40 hours; camera, 60 hours; pressroom, 200 hours; bindery, 160 hours. In addition to this regular time, the firm could utilize an overtime shift in typesetting, which would make available an additional 35 hours in that department. The premium for this overtime (i.e., incremental costs in addition to regular time) would be \$4/hour.

Since the firm wants to find the optimal job mix for its equipment, management assumes it can sell all it produces. However, to satisfy long-established customers, management decides to produce at least 10 units of each class A,B, and at least 5 units of class C of work in each time period.

Assuming that the firm wants to maximize its contribution to profit and overhead, we can formulate the above situation as a linear program, as follows:

  • $X_{AR}$ = Number of units of Class A work produced on regular time

  • $X_{BR}$ = Number of units of Class B work produced on regular time

  • $X_{CR}$ = Number of units of Class C work produced on regular time

  • $X_{BO}$ = Number of units of Class B work produced on overtime typesetting

  • $X_{CO}$ = Number of units of Class C work produced on overtime typesetting

$$ \left.\begin{array}{rrcl} & \max & z=200X_{AR} + 300X_{BR} + 100X_{CR} + 292X_{BO} + 88X_{CO}\\ & \text {s.t.:} & & & \\ & \text{Regular Typesetting} & 2X_{BR} +3X_{CR} & \leq & 40 \\ & \text{Overtime Typesetting} & 2X_{BO} + 3X_{CO} & \leq & 35 \\ & \text{Camera} & 3X_{AR} + X_{BR} + 3x_{CR} + X_{BO} + 3X_{CO}& \leq & 60 \\ & \text{Pressroom} & 3X_{AR} + 6X_{BR} + 2x_{CR} + 6X_{BO} + 2X_{CO} & \leq & 200 \\ & \text{Bindery} & 5X_{AR} + 4X_{BR} + 4X_{BO} & \leq & 160 \\ & \text{Class A, minimum} & X_{AR} & \geq & 10 \\ & \text{Class B, minimum} & X_{BR}+X_{BO}& \geq & 10 \\ & \text{Class C, minimum} & X_{CR}+X_{CO}&\geq & 5 \\ \end{array}\right\} $$

In [10]:
using JuMP
m = Model()
# Definig variable
Classes  = ["A", "B", "C"]
Shift = ["R", "O"]
@variable(m, x[Classes, Shift] >= 0)

# Define Constraints
@constraints m begin
    2x["B","R"] + 3x["C","R"] <= 40
    2x["B","O"] + 3x["C","O"] <= 35
    3x["A","R"] +  x["B","R"] + 3x["C","R"] +  x["B","O"] + 3x["C","O"] <= 60
    3x["A","R"] + 6x["B","R"] + 2x["C","R"] + 6x["B","O"] + 2x["C","O"] <= 200
    5x["A","R"] + 4x["B","R"] + 4x["B","O"]  <= 160
     x["A","R"] >= 10
     x["B","R"] +  x["B","O"] >= 10
     x["C","R"] +  x["C","O"] >= 5
end

@objective(m, Max,  200x["A","R"] + 300x["B","R"] + 100x["C","R"] + 292x["B","O"] + 88x["C","O"])

print(m)


Max 200 x[A,R] + 300 x[B,R] + 100 x[C,R] + 292 x[B,O] + 88 x[C,O]
Subject to
 2 x[B,R] + 3 x[C,R] <= 40
 2 x[B,O] + 3 x[C,O] <= 35
 3 x[A,R] + x[B,R] + 3 x[C,R] + x[B,O] + 3 x[C,O] <= 60
 3 x[A,R] + 6 x[B,R] + 2 x[C,R] + 6 x[B,O] + 2 x[C,O] <= 200
 5 x[A,R] + 4 x[B,R] + 4 x[B,O] <= 160
 x[A,R] >= 10
 x[B,R] + x[B,O] >= 10
 x[C,R] + x[C,O] >= 5
 x[i,j] >= 0 for all i in {A,B,C}, j in {R,O}

PART A

Find the optimal solution and value.


In [11]:
solve(m)
println("Optimal Profit: ", getobjectivevalue(m))
println(getvalue(x))


Optimal Profit: 6980.0
x: 2 dimensions:
[A,:]
  [A,R] = 10.0
  [A,O] = 0.0
[B,:]
  [B,R] = 15.0
  [B,O] = 0.0
[C,:]
  [C,R] = 3.333333333333332
  [C,O] = 1.6666666666666679


In [12]:
writeLP(m, "printing.lp")

Change Kernel to Python


In [1]:
!less printing.lp


Maximize
 obj: 200 VAR1 + 300 VAR3 + 100 VAR5 + 292 VAR4 + 88 VAR6
Subject To
 c1: 2 VAR3 + 3 VAR5 <= 40
 c2: 2 VAR4 + 3 VAR6 <= 35
 c3: 3 VAR1 + 1 VAR3 + 3 VAR5 + 1 VAR4 + 3 VAR6 <= 60
 c4: 3 VAR1 + 6 VAR3 + 2 VAR5 + 6 VAR4 + 2 VAR6 <= 200
 c5: 5 VAR1 + 4 VAR3 + 4 VAR4 <= 160
 c6: 1 VAR1 >= 10
 c7: 1 VAR3 + 1 VAR4 >= 10
 c8: 1 VAR5 + 1 VAR6 >= 5
Bounds
 0 <= VAR1 <= +inf
 0 <= VAR2 <= +inf
 0 <= VAR3 <= +inf
 0 <= VAR4 <= +inf
 0 <= VAR5 <= +inf
 0 <= VAR6 <= +inf
General
End

In [2]:
!glpsol --cpxlp printing.lp --ranges printing.sen


GLPSOL: GLPK LP/MIP Solver, v4.60
Parameter(s) specified in the command line:
 --cpxlp printing.lp --ranges printing.sen
Reading problem data from 'printing.lp'...
8 rows, 6 columns, 22 non-zeros
20 lines were read
GLPK Simplex Optimizer, v4.60
8 rows, 6 columns, 22 non-zeros
Preprocessing...
7 rows, 5 columns, 21 non-zeros
Scaling...
 A: min|aij| =  1.000e+00  max|aij| =  6.000e+00  ratio =  6.000e+00
Problem data seem to be well scaled
Constructing initial basis...
Size of triangular part is 7
      0: obj =   2.000000000e+03 inf =   1.500e+01 (2)
      2: obj =   5.500000000e+03 inf =   0.000e+00 (0)
*     4: obj =   6.980000000e+03 inf =   0.000e+00 (0)
OPTIMAL LP SOLUTION FOUND
Time used:   0.0 secs
Memory used: 0.0 Mb (41035 bytes)
Write sensitivity analysis report to 'printing.sen'...

In [3]:
!less printing.sen


GLPK 4.60 - SENSITIVITY ANALYSIS REPORT                                                                         Page   1

Problem:    
Objective:  obj = 6980 (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      40.00000        .               -Inf       15.00000      -4.00000    6880.00000 VAR3
                                           4.00000      40.00000       45.00000          +Inf    7000.00000 VAR4

     2 c2           BS       5.00000      30.00000          -Inf         .         -112.66667    6416.66667 c6
                                            .           35.00000       30.00000       4.00000    7000.00000 c1

     3 c3           NU      60.00000        .               -Inf       57.50000    -292.00000    6250.00000 VAR4
                                         292.00000      60.00000       71.66667          +Inf   10386.66667 c4

     4 c4           BS     130.00000      70.00000          -Inf      117.50000     -45.06667    1121.33333 c6
                                            .          200.00000      130.00000          +Inf          +Inf

     5 c5           BS     110.00000      50.00000          -Inf       90.00000     -65.66667    -243.33333 c8
                                            .          160.00000      110.00000          +Inf          +Inf

     6 c6           NL      10.00000        .           10.00000        5.33333          -Inf   10134.66667 c4
                                        -676.00000          +Inf       10.83333     676.00000    6416.66667 VAR4

     7 c7           BS      15.00000      -5.00000      10.00000       12.50000    -225.33333    3600.00000 c6
                                            .               +Inf       15.00000          +Inf          +Inf

     8 c8           NL       5.00000        .            5.00000         .83333          -Inf   10263.33333 c5
                                        -788.00000          +Inf        6.66667     788.00000    5666.66667 c7

GLPK 4.60 - SENSITIVITY ANALYSIS REPORT                                                                         Page   2

Problem:    
Objective:  obj = 6980 (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         BS      10.00000     200.00000        .            10.00000          -Inf          -Inf
                                            .               +Inf       10.83333     876.00000   13740.00000 c6

     2 VAR3         BS      12.50000     300.00000        .            -2.50000     292.00000    6880.00000 c1
                                            .               +Inf       15.00000     300.00000    6980.00000 VAR6

     3 VAR5         BS       5.00000     100.00000        .             3.33333     100.00000    6980.00000 VAR6
                                            .               +Inf        6.66667     888.00000   10920.00000 c8

     4 VAR4         BS       2.50000     292.00000        .            -5.00000     292.00000    6980.00000 VAR6
                                            .               +Inf       15.00000     300.00000    7000.00000 c1

     5 VAR6         NL        .           88.00000        .            -8.33333          -Inf    6980.00000 VAR3
                                            .               +Inf        1.66667      88.00000    6980.00000 VAR4

     6 VAR2         NL        .             .             .                -Inf          -Inf    6980.00000
                                            .               +Inf           +Inf        .         6980.00000

End of report

PART B

Is there any unused production capacity?

Answer: We can see from sensetivity report that the constraint C2, C4, C5 and C7 are inactive, out of which C2, C4 and C5 are overtime typesetting, pressroom and bindery are not used.

PART C

Is there a unique optimum solution for the LP?

No. There are three items in the sensitivity report that lead to this conclusion. First of all, consider the allowable increase in the profit coefficient of BO. In an optimal solution BO = 0. The sensitivity report (SR) says that the optimal solution will change if the profit coefficient of BO increases by more than 0. This means that if the unit profit of BO increases from 292 to 293 +ϵ, the optimal solution will change, even if ϵ is arbitrarily close to 0. This could only occur if there is an alternative optimal solution in which BO is strictly greater than 0. A second item in the sensitivity report that implies multiple optimal solutions is the allowable decrease of the profit coefficient of BR, which is 0. This means that if the profit coefficient decreases from 300 to 300−ϵ, the optimal solution will change. This could only occur if there is an alternative optimal solution in which BR is less than 15 (its value in the current optimal solution.) There is one more item that implies that there are alternative optimal solutions, the reduced cost of BO. In an optimal solution BO = 0, and its reduced cost is 0. This means that if we were to add a constraint requiring that BO ≥ϵ, where ϵ is positive and very close to 0, the change in the optimal objective value would be 0. This can only happen if there is an alternative optimal solution in which BO is strictly positive. And we can be sure that to be able to choose a value of ϵ that is strictly positive because of the 100% rule used in conjunction with pricing out BO. (We leave that exercise to the readers. There is a concept in linear programming known as "degeneracy." If a linear programming solution is degenerate, it could possibly mess up the conclusion based on the first two arguments above, but it would not invalidate the 3rd argument. In fact, the optimal solution of the SR can be shown to be non-degenerate. But if degeneracy was a concern to you, you know much more about linear programming than we are teaching you in this course.

PART D

If the printing firm has a chance to sell a new type of work that requires 0 hours of typesetting, 2 hours of camera, 2 hours of pressroom, and 1 hour of bindery, what contribution is required to make it attractive?

Answer: Only overtime camera is consumed completely, other resource are already avilable. Cost of overtime camera in per unit production of new product = 2 x (Shdadow Price) = 2 x 292 = 584.