Using Duality and Sensitivity Analysis To Interpret Linear Programming Solutions
Using Duality and Sensitivity Analysis To Interpret Linear Programming Solutions
*Solver Suite: LINDO, LINGO, WHAT’S BEST. LINDO Systems Inc., Chicago.
382 pp. This product is mentioned as an illustration only. The Oregon State
University Extension Service neither endorses this product nor intends to
discriminate against products not mentioned.
2
USING DUALITY AND SENSITIVITY ANALYSIS TO INTERPRET LINEAR PROGRAMMING SOLUTIONS
Subject to: 30X1 + 20X2 + 25X3 < 300 (wood constraint: 300 bf available)
5X1 + 10X2 + 7X3 < 110 (labor constraint: 110 hours available)
3
OPERATIONS RESEARCH
That’s it! The software will solve the problem. It will add slack,
surplus, and artificial variables when necessary.
After the LP problem is solved, the output appears as:
LP OPTIMUM FOUND AT STEP 4
NO. ITERATIONS = 4
4
USING DUALITY AND SENSITIVITY ANALYSIS TO INTERPRET LINEAR PROGRAMMING SOLUTIONS
if you force one table into the final solution, you will be penalized
by $0.545455. In other words, the optimal solution (profit) will
decrease by $0.545455.
In a model that seeks to minimize cost, the optimal solution
would increase by the amount of the penalty. For example, if you
force in one unit of a product with a reduced cost of $10, the
optimal solution (total cost) will increase by $10.
The SLACK OR SURPLUS column tells you how close you are
to satisfying a constraint as an equality. For < constraints, this
quantity is known as a slack variable. For > constraints, it is known
as a surplus variable. If a constraint is satisfied exactly, the slack or
surplus value is 0.
The positive value of 5.272727 in row 4 of our example means
that the constraint X3 ≥ 2 (bench demand) is 5.272727 units from
being satisfied as an equality. Because the optimal solution resulted
in production of 7.272727 benches, and the minimum acceptable
number of benches is 2, there are 5.272727 more benches than
needed to satisfy the constraint X3 ≥ 2 as an equality.
If a slack or surplus value is negative, the solution is infeasible
and the LP problem has been formulated incorrectly. By noting
which variable has a negative value, you can identify the
misformulated constraint.
The DUAL PRICES figure represents the amount the optimal
solution would change (increase for a maximization model or
decrease for a minimization model) given a unit of increase on the
right-hand side of the constraint. For example, the dual price of Dual prices (also
0.127273 in row 2 means that by raising the right-hand side of the known as shadow
wood constraint by 1 bf, to 301 bf, we could improve the solution prices) indicate how
by 0.127273 or about $0.13. much one would be
Dual prices (also known as shadow prices) indicate how much willing to pay for
one would be willing to pay for additional units of a resource. In additional units of a
our example, if we could buy a unit of wood for less than $0.13, it resource.
would be worth doing so because it would increase profit by $0.13.
Dual prices are very important in economic sensitivity analysis, as
will be discussed in the following section.
5
OPERATIONS RESEARCH
Constructing a dual LP
Let’s simplify our primal LP problem to include only tables and
chairs. This problem was graphed and solved in EM 8719. It can
be formulated as:
Maximize: Z = 6X1 + 8X2 (objective function: maximize profit)
Subject to: 30X1 + 20X2 < 300 (wood constraint: 300 board feet)
In other words, the company would produce four tables and nine
chairs for a profit of $96.
The right-hand values of the primal constraints (300 bf and
110 hours) become the coefficients of the dual objective function.
For this example, there are 300 board feet of wood available and
110 hours of labor available. Using R to represent cost, O1 to
represent the opportunity cost of a unit of wood, and O2 to
6
USING DUALITY AND SENSITIVITY ANALYSIS TO INTERPRET LINEAR PROGRAMMING SOLUTIONS
5 10
20 10
8
USING DUALITY AND SENSITIVITY ANALYSIS TO INTERPRET LINEAR PROGRAMMING SOLUTIONS
R=
165
R=
110
➔ ➔
Ch
air
Table C
Line
R=
Co
nst
para = 165
110,
onstrain
rain
llel t
R
t
o
t
manner, 20(0) + 10(0) > 8 is false, so the valid side of the chair
constraint line also is away from the origin. Place small arrows on
both constraint lines pointing away from the origin. Any point on
the nonorigin side of the table and chair constraint lines represents
a feasible solution. Draw a heavy line to show the boundary of the
feasible region.
Plot two objective function lines to determine the direction of
improvement.
Let R = 165 Let R = 110
165/300 = O1 110/300 = O1
O1 = 0.55 O1 = 0.37
Next:
Set O1 = 0 and solve for O2 Set O1 = 0 and solve for O2
165/110 = O2 110/110 = O2
O2 = 1.5 O2 = 1
,,,,,,
We can see from the two objective function lines that R
decreases as we move toward the origin (0,0). We want to mini-
,,,,,,
mize R, so we will draw a line parallel to the objective function
lines that touches the corner in the feasible region that is closest to
,,,,,,
the origin. This point is the most attractive corner and the optimal
solution to the problem. It is where the table and chair constraint
lines intersect.
,,,,,,
If our graph were drawn perfectly and we could read it
perfectly, we could determine the optimal amounts of
,,,,,,
tables and chairs from the corresponding coordinates.
,,,,,,
10
USING DUALITY AND SENSITIVITY ANALYSIS TO INTERPRET LINEAR PROGRAMMING SOLUTIONS
20O1 + 0O2 =2
Substitute 0.10 into either of the equations to find the value of O2:
30(0.10) + 5O2 = 6
3 + 5O2 = 6
5O2 = 6 - 3
5O2 = 3
This is the same value that was obtained when maximizing the
objective function of the primal.
The $0.10 represents the actual worth of 1 unit (board foot) of
wood to the manufacturing operation. That is, 1 more board foot of
wood could be used to produce more furniture sold for a $0.10
profit. If 1 more board foot of wood were available (301 board feet),
total profit would increase by $0.10. The $0.10 also can be viewed
as the lost potential profit as a result of not having an additional
board foot of wood.
Likewise, an additional hour of labor will increase profit by $0.60.
An additional 2 hours of labor will increase profit by 2 x $0.60 or
$1.20.
These values are the dual prices, or shadow prices, reported by
LINDO in our example. They help the company decide whether to
buy more wood or labor to increase production. If it can purchase
additional wood at $0.08 per board foot, it will realize a net gain of
$0.02 for each additional board foot of wood acquired. If it can buy
an hour of labor for $0.40, it will realize a net gain of $0.20 for each
additional hour of labor.
11
OPERATIONS RESEARCH
Table 2.—Final simplex tableau for the tables and chairs LP primal.
Unit
profit 6 8 0 0
Basic mix X1 X2 SW SL Solution
Table 3.—Final simplex tableau for the tables and chairs LP dual.
Unit
profit 300 110 0 0
Basic mix O1 O2 UT UC Solution
12
USING DUALITY AND SENSITIVITY ANALYSIS TO INTERPRET LINEAR PROGRAMMING SOLUTIONS
13
OPERATIONS RESEARCH
We can see that multiplying the primal slack times the dual
opportunity cost always gives an answer of 0 because one of them
always has a value of 0. In the equation below, opportunity costs
are called the dual main:
primal slack x dual main = 0
For example, the primal slack variables and their values for the
tables and chairs LP are: SW = 0 (board feet of wood) and SL = 0
(hours of labor). The dual main costs and their values are O1 = 0.10
($ per board foot of wood) and O2 = 0.60 ($ per hour of labor).
Because there is no slack, there must be a positive opportunity
cost. Therefore:
SW x O1 = 0 x 0.60 = 0 and SL x O2 = 0 x 0.60 = 0
For example, the primal main values for the tables and chairs LP
are: X1 = 4 (tables produced) and X2 = 9 (chairs produced). The
dual surplus values are: UT = 0 ($ per table) and UC = 0 ($ per
chair). Therefore:
X1 x UT = 4 x 0 = 0 and X2 x UC = 9 x 0 = 0
14
USING DUALITY AND SENSITIVITY ANALYSIS TO INTERPRET LINEAR PROGRAMMING SOLUTIONS
Summary
It is obvious that solving an LP problem yields much more
information than the optimal solution alone. Through sensitivity
analysis, we can use the output of the LP solution to help us make
production decisions. Much of this information is based on the
relationship between the primal LP problem and its dual. For
example:
1. The objective function coefficients of the primal LP become the
right-hand side constants of the dual. Likewise, the right-hand
side constants of the primal are the cost coefficients of the dual’s
objective function.
2. The constraint inequalities are reversed.
3. The primal’s objective function is maximization; that of the dual
is minimization.
4. Each column in the primal corresponds to a constraint row in the
dual. Therefore, the number of dual constraints is equal to the
number of primal variables.
5. Each constraint row in the primal corresponds to a column
in the dual. Therefore, there is one dual variable for every
primal constraint.
6. The dual of the dual is the primal.
7. For both the primal LP and its dual, the variables are
nonnegative, and the constraints are inequalities. The inequali-
ties in a maximization problem must be <, and the inequalities in
15
OPERATIONS RESEARCH
APPENDIX A
Definition of the simplex method
Simplex is a mathematical term. In one dimension, a simplex is
a line segment connecting two points. In two dimensions, a sim-
plex is a triangle formed by joining three points. A three-dimen-
sional simplex is a four-sided pyramid having four corners. The
underlying concepts are geometrical, but the solution algorithm,
developed by George Dantzig in 1947, is basically an algebraic
procedure. As with the graphical method, the simplex method finds
the most attractive corner of the feasible region to solve the LP
problem. Remember, any LP problem having a solution must have
an optimal solution that corresponds to a corner, although there
may be multiple, also known as alternative, optimal solutions.
The simplex method examines corners in a systematic manner to
find the optimum. For example, a moderately sized LP with 10
products and 10 resource constraints would involve nearly 200,000
corners. An LP problem 10 times this size would have over a
trillion corners. The search procedure for the simplex method is
efficient enough that only about 20 of the 200,000 corners must be
searched to find the optimal solution.
APPENDIX B
Hand solution for the tables, chairs, and benches problem
Definition of a standard form problem
In a standard form maximization LP problem, all constraints are
less-than-or-equal-to (≤) constraints, and all variables are nonnega-
tive. In a standard form minimization LP problem, all constraints
are greater-than-or-equal-to (≥) constraints, and again all variables
are nonnegative.
Because bench demand is represented as a > constraint in our
problem, this LP problem does not meet the requirements for a
16
USING DUALITY AND SENSITIVITY ANALYSIS TO INTERPRET LINEAR PROGRAMMING SOLUTIONS
X4 < 10
X4 < 10
The two constraints are equal to, and take the place of, the
equality (=) constraint. These constraints now meet the require-
ments for a standard form maximization LP problem.
These rules are important for establishing duality relations.
However, when actually solving an LP problem that includes
nonstandard constraints, we keep the constraints in their original
form and add surplus and artificial variables.
Subject to: 30X1 + 20X2 + 25X3 + 1SW + 0SL + 0UB + 0aB = 300 (wood constraint)
5X1 + 10X2 + 7X3 + 0SW + 1SL + 0UB + 0aB = 110 (labor constraint)
18
USING DUALITY AND SENSITIVITY ANALYSIS TO INTERPRET LINEAR PROGRAMMING SOLUTIONS
➔
0 SW 30 20 25 1 0 0 0 300 300/25 = 12
0 SL 5 10 7 0 1 0 0 110 110/7 = 15.71
➔
-M aB 0 0 1 0 0 -1 1 2 2/1 = 2
Sacrifice 0 0 -M 0 0 M -M -2M
Improvement 6 8 7+M 0 0 -M 0 —
19
OPERATIONS RESEARCH
For example, in Table A-2, the new SW row values are calculated
as:
30 - 25(0) = 30
20 - 25(0) = 20
25 - 25(1) = 0
1 - 25(0) = 1
0 - 25(0) = 0
0 - 25(-1) = 25
0 - 25(1) = -25
Use the same method for calculating the new SL row values.
The new tableau is shown in Table A-2. It will take three more
simplex tableaus to find the optimal solution. These tableaus are
shown in Tables A-3, A-4, and A-5.
20
USING DUALITY AND SENSITIVITY ANALYSIS TO INTERPRET LINEAR PROGRAMMING SOLUTIONS
0 SW
➔ 20 0 0 1 -2 11 -11 58.0 58/20 = 2.9
8 X2 1/2 1 0 0 1/10 7/10 -7/10 9.6 9.6/.5 = 19.2
7 X3 0 0 1 0 0 -1 1 2.0 2/0 = ∞
Sacrifice 4 8 7 0 0.8 -1.4 1.4 90.8
Improvement 2 0 0 0 -.8 1.4 -M-1.4 —
21
OPERATIONS RESEARCH
➔
6 X1
➔ 1 0 0 1/20 -1/10 11/20 -11/20 2.9 2.9/(11/20) = 5.27
8 X2 0 1 0 -1/40 3/20 17/40 -17/40 8.15 8.15/(17/40) = 19.18
7 X3 0 0 1 0 0 -1 1 2.0 2/-1 = -2
Sacrifice 6 8 7 0.1 0.6 -0.3 0.3 96.6
Improvement 0 0 0 -0.1 -0.6 0.3 -M-0.3 —
X2 = 65/11 = 5.9 SL = 0
22
USING DUALITY AND SENSITIVITY ANALYSIS TO INTERPRET LINEAR PROGRAMMING SOLUTIONS
23
Institute for Operations Research and the Management Sciences,
901 Elkridge Landing Road, Suite 400, Linthicum, MD.
Lapin, L.L. Quantitative Methods for Business Decisions with
Cases, third edition (Harcourt Brace, Jovanovich, Publishers,
San Diego, 1985). 780 pp.
Ravindran, A., D.T. Phillips, and J.J. Solberg. Operations
Research: Principles and Practice, second edition (John Wiley
& Sons, New York, 1987). 637 pp.
PERFORMANCE EXCELLENCE
IN THE WOOD PRODUCTS INDUSTRY