Graphical Sensitivity Analysis in Linear Programming
Graphical Sensitivity Analysis in Linear Programming
Luis A. Moncayo–Martı́nez
Problems based on the web page of J. E. Beasley from Brunel University (UK)
1 Two mines
The Two Mines Company own two different mines that produce an ore which, after being crushed,
is graded into three classes: high, medium and low-grade. The company has contracted to provide a
smelting plant with 12 tons of high-grade, 8 tons of medium-grade and 24 tons of low-grade ore per
week. The two mines have different operating characteristics as detailed below.
Production (ton/day)
Mine Cost per Day (x1000) High Medium Low
1 180 6 3 4
2 160 1 1 6
How many days per week should each mine be operated to fulfil the smelting plant contract?
Solution:
xi = the number of days mine i works, i = x, y
12
A
11
10
Min z = 180x1 + 160x2
9 Feasible region
subject to E
8
6x1 + x2 ≥ 12
3x1 + x2 ≥ 8 7
4x1 + 6x2 ≥ 24
x2
x1 , x2 ≥ 0 5
C
Point G is the optimum 4
H
solution which lies on the
3 D G
intersection of constraints
3x1 + x2 ≥ 8 and 2
4x1 + 6x2 ≥ 24.
1 z
O B F I
0
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 5.5 6
x1
1
dx2 d 3 3
For constrain 3x1 + x2 ≥ 8, the slope is = 8 − x1 = − and for the another is
dx1 dx1 1 1
dx2 d 24 4 4
= − x1 = − .
dx1 dx1 6 6 6
Therefore
if z = 180x1 + c2 x2 ,
if z = c1 x1 + 160x2 , dx2 d
z 180
180
= − x1 = − .
dx2 d z c1 c1 dx1 dx1 c2 c2 c2
= − x1 = − .
dx1 dx1 160 160 160
3 180 4
− ≤− ≤−
3 c1 4 1 c2 6
− ≤− ≤−
1 160 6 1 c2 6
− ≥− ≥−
3 c1 4
3 180 4
− ≤− ≤− (−160)
1 160 6
1 c2 6
− ≥− ≥− (−180)
3 180 4
480 ≥ c1 ≥ 106.66
60 ≤ c2 ≤ 270
bD = 3(1.5) + 3 = 7.5
Constraint 6x1 + x2 ≥ 12 can move from −∞ to
G(1.71, 2.86). bI = 3(6) + 0 = 18
• 10.64 ≤ b3 ≤ 29.33
2 A company
A company makes two products (x and y) using two machines (A and B). Each unit of x that
is produced requires 50 minutes processing time on machine A and 30 minutes processing time on
2
machine B. Each unit of y that is produced requires 24 minutes processing time on machine A and 33
minutes processing time on machine B.
At the start of the current week there are 33 units of x and 90 units of y in stock. Available processing
time on machine A is forecast to be 40 hours and on machine B is forecast to be 30 hours.
The demand for x in the current week is forecast to be 75 units and for y is forecast to be 95 units.
Company policy is to maximise the combined sum of the units of x and the units of y in stock at the
end of the week.
• Formulate the problem of deciding how much of each product to make in the current week as a
linear program.
Solution:
Let be x = the number of products x to produce and y = the number of products y to produce. To
solve this problems, it is necessary to compute the inventory left for each product such as inventory
already in stock + number of units to produce − forecast demand, e.g. the inventory left for product
x is 33 + x − 75 and for product y is 90 + y − 95. As a results, the model must maximise the number
of inventory left as z = (33 + x − 75) + (90 + y − 95). The model must warranty that the units to
produce must satisfy the demand, so x ≤ 75 − 33 and y ≤ 95 − 90.
100
A
90 Feasible region
Max z = x + y − 47
80
subject to 70
50x + 24y ≤ 2400 min
30x + 33y ≤ 1800 min 60
F
x ≥ 42
50
y
y≥5
z
40
x, y ≥ 0
30
Point D is the optimum
solution which lies on the C
20 H
intersection of constraints
D
50x + 24y ≤ 2400 and x ≥ 42. 10
L K E I
O J B G
0
0 5 10 15 20 25 30 35 40 45 50 55 60
x
Therefore
3
if z = x + c2 y − 47,
if z = c1 x + y − 47, dy
d z + 47 1
1
= − x =− .
dy d dx dx c2 c2 c2
= (z + 47 − c1 x) = −c1 .
dx dx
50 1
− ≤− ≤∞
50 24 c2
− ≤ −c1 ≤ ∞
24 24
− ≥ −c2 ≥ −∞
50
50
− ≤ −c1 ≤ ∞ (−1)
24
24
− ≥ −c2 ≥ −∞ (−1)
50
2.083 ≥ c1 ≥ −∞
0.48 ≤ c2 ≤ +∞
bK = 50(42) + 24(5) = 2200 Constraint 30x + 33y ≤ 1800 can move from
D(45, 6.25) to +∞.
bH = 50(42) + 24(16.36) = 2492.64
bD = 30(45) + 33(6.25) = 1556.25
• 2200 ≤ b1 ≤ 2492.64
• 1556.25 ≤ b2 ≤ +∞
zK = 1(42) + 1(5) = 47
• D2 = 0
zH = 1(42) + 1(16.36) = 58.63
58.63 − 47
• D1 = = 0.0397
2492.64 − 2200
4
It may not be possible to produce enough to meet your forecast demand for these products and each
unit of unsatisfied demand for product 1 costs $3, each unit of unsatisfied demand for product 2 costs
$1.
• Formulate the problem of deciding how much of each product to make in week 5 as a linear
program
Solution:
Be x1 is the number of units of product X and x2 of product Y. The aim is to maximise the revenue
computed as profits minus cost of unmet demand. The number of unmet demand is 37−x1 for product
X; i.e. the forecast minus the manufactured X products. For those Y, unmet demand is 14 − x2 . The
revenues are z = 10x1 + 4x2 − 3(37 − x1 ) − 1(14 − x2 )
180
A
160
Max z = 13x1 + 5x2 − 125
140 Feasible region
subject to
15x1 + 7x2 ≤ 1200 min 120
25x1 + 45x2 ≤ 900 min
x1 ≤ 37 100 C
x2
x2 ≤ 14
80
x1 , x2 ≥ 0 z
60
5
Changes in the RHS (Dual prices)
The optimum value is in the intersection of constraints 25x1 + 45x2 ≤ 900 and x2 ≥ 0; thus,
Constraint x1 ≤ 37 can move from F (36, 0) to +∞. Constraint x2 ≤ 14 can move from H(37, 0) to +∞.
bF = 36 bH = 0
• 36 ≤ b3 ≤ +∞ • 0 ≤ b4 ≤ +∞
• D3 = 0 • D4 = 0
The company has 40 hours of machine time available in the next working week but only 35 hours of
craftsman time. Machine time is costed at $10 per hour worked and craftsman time is costed at $2
per hour worked. Both machine and craftsman idle times incur no costs. The revenue received for
each item produced (all production is sold) is $20 for x and $30 for y. The company has a specific
contract to produce 10 items of X per week for a particular customer.
• Formulate the problem of deciding how much to produce per week as a linear program
Solution:
Let be x the number of products x to produce and y the ones produced of y. The objective is to
maximised
the revenues
such as profits
20x + 30y minus the machine cost of every machine in hours
13x + 19y 19x + 29y
10 +2 .
60 60
13x + 19y 19x + 29y
Hence, the objective function is to maximise z = 20x + 30y − 10 −2 .
60 60
6
140
A
C
120
y
F
z
60
x, y ≥ 0
Feasible region
O G E B
0
0 20 40 60 80 100 120 140 160 180
x
if z = 17.16x + c2 y,
if z = c1 x + 25.86y, dy d
z 17.16
17.16
= − x =− .
dy d z c1 c1 dx dx c2 c2 c2
= − x =− .
dx dx 25.86 25.86 25.86
17.16 19
−∞ ≤ − ≤−
c1 19 c2 29
−∞ ≤ − ≤−
25.86 29 c2 29
∞≥− ≥−
c1 19
17.16 19
−∞ ≤ − ≤− (−25.86)
25.86 29
c2 29
∞≥− ≥− (−17.16)
17.16 19
∞ ≥ c1 ≥ 16.94
−∞ ≤ c2 ≤ 26.20
7
Constraint 19x + 29y ≤ 2100 can move from
G(10, 0) to B(184.6, 0).
Constraint 13x + 19y ≤ 2400 can move from bG = 19(10) + 29(0) = 190
E(110.5, 0) to +∞.
bB = 19(184.6) + 29(0) = 3507.4
bE = 13(110.5) + 19(0) = 1436.5
• 190 ≤ b2 ≤ 3507.4
• 1436.5 ≤ b1 ≤ +∞
zG = 17.16(10) + 25.86(0) = 171.6
• D1 = 0
zB = 17.16(184.6) + 25.86(0) = 3167.73
3167.73 − 171.6
• D2 = = 0.9031
3507.4 − 190
bE = 110.52
• −∞ ≤ b3 ≤ 110.52
• D3 = 0
Solution:
x1 is the number of tables to produced and x2 the number of chairs. About the constraint of
proportionality, e.g. if x2 = 3x1 and x1 = 1, then x2 = 3(1) = 3 chairs. As the proportion is at
least three times as many chairs as tables, x2 ≥ 3(1) = 3.
16
C
14 F
Max z = 30x1 + 10x2
12
subject to E
3x1 − x2 ≤ 0 10 Optimum solution
1
x1 + x2 ≤ 4 tables
4 B
x2
A
x1 , x2 ≥ 0 6
8
Changes in the objective function’s coefficients
dx2 d
The slope of the two constraints in which the optimum solution E lies is = (4 × 4 − 4x1 ) = −4
dx1 dx1
dx2 d 40 6 6
and = − x1 = − .
dx1 dx1 3 3 3
if z = 30x1 + c2 x2 ,
if z = c1 x1 + 10x2 , dx2 d
z 30
30
= − x1 = − .
dx2 d z c1 c1 dx1 dx1 c2 c2 c2
= − x1 = − .
dx1 dx1 10 10 10
30 6
−4 ≤ − ≤ −
c1 6 c2 3
−4 ≤ − ≤ −
10 3 1 c2 3
− ≥− ≥−
c1 6
4 30 6
−4 ≤ − ≤ − (−10)
10 3
1 c2 3
− ≥− ≥− (−30)
4 30 6
40 ≥ c1 ≥ 20
7.5 ≤ c2 ≤ 15
bC = 6(0) + 3(16) = 48
• 34.23 ≤ b2 ≤ 48
9
TV advertising campaign and has decided to purchase 1-minute commercial spots on two types of
programs: comedy shows and football games.
Each comedy commercial is seen by 7 million high-income women and 2 million high-income men.
Each football commercial is seen by 2 million high-income women and 12 million high-income men.
A 1-minute comedy ad costs $50,000, and a 1-minute football ad costs $100,000. Dorian would like
the commercials to be seen by at least 28 million high-income women and 24 million high-income men.
Use linear programming to determine how Dorian Auto can meet its advertising requirements at
minimum cost.
Solution:
10 A
subject to
7x1 + 2x2 ≥ 28
6 Feasible region
2x1 + 12x2 ≥ 24
x2
x1 , x2 ≥ 0
4
Point C is the optimum
solution which lies on the
D
intersection of the two 2 C
constraints.
O B z E
0
0 1 2 3 4 5 6 7 8 9 10 11 12
x1
10
Changes in the RHS (Dual prices)
The optimum value is in the intersection of constraints 7x1 + 2x2 ≥ 28 and 2x1 + 12x2 ≥ 24; thus,
Constraint 7x1 + 2x2 ≥ 28 can move from D(0, 2) Constraint 2x1 + 12x2 ≥ 24 can move from B(4, 0)
to E(12, 0). to A(0, 14).
• 4 ≤ b1 ≤ 84 • 8 ≤ b2 ≤ 168
7 Leary Chemical
Leary Chemical manufactures three chemicals: A, B, and C. These chemicals are produced via two
production processes: 1 and 2. Running process 1 for an hour costs $4 and yields 3 units of A, 1 of
B, and 1 of C. Running process 2 for an hour costs $1 and produces 1 unit of A and 1 of B. To meet
customer demands, at least 10 units of A, 5 of B, and 3 of C must be produced daily. Graphically
determine a daily production plan that minimizes the cost of meeting Leary Chemical’s daily demands.
Solution:
A
10
Min z = 4x1 + x2 8
subject to 7
z
3x1 + x2 ≥ 10
6 Feasible region
x1 + x2 ≥ 5
E
x2
x1 ≥ 3 5
x1 , x2 ≥ 0 4
bD = 3 + 1 = 4
• 4 ≤ b2 ≤ +∞ – This IS true
Constraint 3x1 + x2 ≥ 10 can move from −∞ to Could you figure it out why?
G(3, 2).
The true value is:
bG = 3(3) + 2 = 11 Constraint x1 + x2 ≥ 5 can move from D(3, 1) to
any point on constraint x1 ≥ 3, to compute the
• −∞ ≤ b1 ≤ 11
dual the point G(3, 2) is selected.
• D1 = 0
bD = 3 + 1 = 4
bG = 3 + 2 = 5
zD = 4(3) + 1 = 13
zG = 4(3) + 2 = 14
14 − 13
• D2 = =1
5−4
Constraint x1 ≥ 3 can move from C(2.5, 2.5) to
F (5, 0).
bC = 2.5
bF = 5
• 2.5 ≤ b3 ≤ 5
zF = c4(5) + 0 = 20
20 − 12.5
• D3 = =3
5 − 2.5
12