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]
The resource constraints are on
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.)
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))
Writing the LP in "dining.lp" file
In [23]:
writeLP(m, "dining.lp")
In [2]:
!less "dining.lp"
In [3]:
!glpsol --cpxlp dining.lp --ranges dining.sen
In [4]:
!less "dining.sen"