0% found this document useful (0 votes)
68 views24 pages

Using Duality and Sensitivity Analysis To Interpret Linear Programming Solutions

Programmation linéaire

Uploaded by

Sou Tibon
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
68 views24 pages

Using Duality and Sensitivity Analysis To Interpret Linear Programming Solutions

Programmation linéaire

Uploaded by

Sou Tibon
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 24

EM 8744

PERFORMANCE EXCELLENCE April 2000


$2.50
IN THE WOOD PRODUCTS INDUSTRY

Using Duality and Sensitivity Analysis to


Interpret Linear Programming Solutions
J. Reeb and S. Leavengood

A key problem faced by managers is how to allocate scarce resources


among activities or projects. Linear programming, or LP, is a method of
allocating resources in an optimal way. It is one of the most widely used
operations research (OR) tools. It has been used successfully as a decision-
making aid in almost all industries and in financial and service organiza-
tions.
Programming refers to mathematical programming. In this context, it
refers to a planning process that allocates resources—labor, materials,
machines, and capital—in the best possible (optimal) way so that costs are
minimized or profits are maximized.
The linear part of the name refers to the following:
• The objective function (i.e., maximization or minimization) can be
described by a linear function of the decision variables, that is, a mathe-
matical function involving only the first powers of the variables with no
cross products. For example, 23X2 and 4X16 are valid decision variable
terms, while 23X22, 4X163, and (4X1 x 2X1) are not. The entire problem can
be expressed as straight lines, planes, or similar geometrical figures.
• The constraint set can be expressed as a set of linear equations.
In addition to the linear requirements, nonnegativity conditions state that
the variables cannot assume negative values. It is not possible to have
negative resources. Without these conditions, it would be mathematically
possible to use more resources than are available.
This publication will build on the example used in EM 8719, Using the
Graphical Method to Solve Linear Programs, and EM 8720, Using the
Simplex Method to Solve Linear Programming Maximization Problems.
EM 8719 introduces the graphical method for solving LP problems.
EM 8720 explains how to use the simplex method to solve maximization
problems with less-than-or-equal-to (<) constraints.
The graphical method can be used when only two products are produced
(e.g., tables and chairs). It’s possible to graph problems with three products,

James E. Reeb, Extension forest products


manufacturing specialist; and Scott
Leavengood, Extension agent, Klamath
County; Oregon State University.
OPERATIONS RESEARCH

but three-dimensional graphs quickly become cumbersome, so the


simplex method is used to solve these problems. Problems with
more than three products cannot be graphed. Most real-world
problems contain numerous constraints and potential products.
Thus, for all practical purposes, the graphical method is used only
to help explain LP solution procedures.
The simplex method is the most common procedure for solving
large LP problems. However, large LP problems would take too
long to solve by hand, and it’s difficult to solve them without
making errors. Thus, the simplex method also has limited practi-
cality in the real world.
Fortunately, many commercial LP software products are avail-
able to do the work for you. You simply state the objective function
Programming. . . and resource constraints, and the software finds the optimal solu-
“Refers to mathemati- tion.
cal programming.” All of these software products use a revised simplex method.
This method uses the same basic calculations as the regular sim-
Sensitivity analysis. . . plex method, but the entire simplex tableau is not calculated at
each step. The information needed to move from one feasible
“Involves looking at solution to another is calculated directly from the original equa-
how changes in the tions, so less computational effort and time is needed. For a
original LP problem detailed description of the revised simplex method, see Ravindran,
can affect the optimal et al.
solution.” To understand the results of computer-generated LP solutions, it
helps to understand how the original simplex method works. See
Appendices A and B or EM 8720 for a detailed explanation.
In addition to the optimal solution, LP computer programs
provide other useful information that can be used for sensitivity
analysis. This procedure involves looking at how changes in the
original LP problem can affect the optimal solution. For example,
there may be a change in resource availability, or management may
decide to add a new product. We’ll discuss sensitivity analysis later
in this publication.
First, however, we’ll illustrate how to solve an LP problem using
a computer program called LINDO.* In explaining how to inter-
pret the results, we will introduce duality theory and sensitivity
analysis.

*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

An example: Production of wooden tables,


chairs, and benches
A manufacturer produces wooden tables, chairs, and benches.
The company wishes to allocate resources so as to maximize
profits. Because there are three products (tables, chairs, and
benches), it’s not practical to use the graphical method to find the
optimal solution.
Wood and labor are the two resources used to produce tables,
chairs, and benches. It takes 30 board feet (bf) of wood and
5 hours of labor to make a table, 20 bf of wood and 10 hours of
labor to make a chair, and 25 bf of wood and 7 hours of labor to
make a bench. There are 300 bf of wood available and 110 hours
of labor available. Unit profit is $6 for a table, $8 for a chair, and
$7 for a bench.
Because demand is high for benches, management decides that
at least two benches must be made. This introduces a new con-
straint into the problem.
Let X1 represent tables, X2 represent chairs, and X3 represent
benches. Z represents profit. The LP problem can be formulated
as:
Maximize: Z = 6X1 + 8X2 + 7X3 (objective function: maximize profit)

Subject to: 30X1 + 20X2 + 25X3 < 300 (wood constraint: 300 bf available)

5X1 + 10X2 + 7X3 < 110 (labor constraint: 110 hours available)

X3 > 2 (bench demand)

X1, X2, X3 > 0 (nonnegativity conditions)

The LP problem in EM 8720 included slack variables. This new Tip . .


problem also uses surplus and artificial variables. The computer
software will add these variables as needed, so we don’t need to In our example,
worry about them. For a definition of surplus and artificial vari- X1 refers to tables,
ables and the hand solution to this problem, see Appendix B. X2 refers to chairs,
X3 refers to benches,
Computer solution and Z refers to profit.
In the following example, we will set up the above LP problem
for a software solution, using LINDO as an example. Then, we can
look at the results and examine the problem in different ways by
using sensitivity analysis.

3
OPERATIONS RESEARCH

In the EDIT box of LINDO, state the LP as:


MAX 6X1 + 8X2 + 7X3
SUBJECT TO
30X1 + 20X2 + 25X3 <= 300
5X1 + 10X2 + 25X3 <= 110
X3 >= 2

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

OBJECTIVE FUNCTION VALUE


1) 98.18182

VARIABLE VALUE REDUCED COST


X1 0.000000 0.545455
X2 5.909091 0.000000
X3 7.272727 0.000000

ROW SLACK OR SURPLUS DUAL PRICES


2) 0.000000 0.127273
3) 0.000000 0.545455
4) 5.272727 0.000000

NO. ITERATIONS = 4

It took four iterations or pivots to find the optimal solution as


$98.18182. The VALUE column shows the value of each product
(tables, chairs, and benches) in the optimal solution. It will be most
profitable to produce 0.0 X1 (tables), 5.909091 X2 (chairs), and
7.272727 X3 (benches). Therefore, the optimal solution is:
$6(0) + $8(5.909091) + $ 7(7.272727) = $98.18

The value in the REDUCED COST column can be interpreted in


two ways. For X1 (tables) to be profitable in the optimal solution,
its profit would need to increase by $0.545455. Thus, if the profit
for tables increases from $6 to $6.545455, tables will appear in the
final solution. All products in the final solution automatically have
a reduced cost of 0.
The reduced cost also can be interpreted as the penalty you
would pay to introduce a product into the solution. In this problem,

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.

Duality and sensitivity analysis


Sensitivity analysis is used to determine how minor variations in
an LP problem affect the final solution. Most real-world LP prob-
lems are large, and many of the values in the model are estimates

5
OPERATIONS RESEARCH

of future conditions. It is important to study what will happen to


Opportunity cost. . . the optimal solution if other conditions occur. For example, it may
be possible to purchase more resources, or management may need
“Represents the cost to decide whether to add a new product. You can conduct these
of employing a types of analysis without rerunning the entire LP.
resource for one use To understand sensitivity analysis, it’s important to understand
instead of another.” the concept of opportunity cost. Opportunity cost represents the
cost of employing a resource for one use instead of another. In
Duality theory. . .
other words, if you give up $0.50 of profit by using a unit of wood
“Every primal has an to produce a table instead of a chair, the opportunity cost of the
associated LP prob- wood is $0.50.
lem called a dual. If Another part of sensitivity analysis is duality theory. An LP
the primal LP objec- problem like the one we solved using LINDO is called a primal.
tive function is maxi- Every primal has an associated LP problem called a dual. If the
mized, the dual LP primal LP objective function is maximized, the dual LP objective
objective function is function is minimized. In other words, when the objective of the
minimized.” primal is profit maximization, the objective of the dual is resource
minimization at a certain level of profit. Solving the original LP
problem also provides a solution to its dual. The dual prices
(shadow prices) in our LINDO example come from the optimal
solution for the dual problem.

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)

5X1 + 10X2 < 110 (labor constraint: 110 hours)

X1, X2, > 0 (nonnegativity conditions)

As solved in EM 8719, the maximum value of the objective


function for the primal is:
Z = $6(4) + $8(9) = $96

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

represent the opportunity cost of a unit of labor, we can rewrite the


objective function as:
Minimize R = 300O1 + 110O2

This equation states that we want to minimize total cost (R),


which is equal to 300 units of wood times the opportunity cost of a
unit of wood plus 110 units of labor times the opportunity cost of a
unit of labor.
To find the dual’s constraints, we transpose the coefficients used
on the left-hand side of the primal constraints. These coefficients
are shown in Table 1.

Table 1.—Primal LP equations and coefficients.


Equations Coefficients
30X1 + 20X2 < 300 30 20
5X1 + 10X2 < 110 5 10

Place the primal coefficients in a matrix, which we’ll call Matrix


A:
A = 30 20

5 10

Now create a new matrix called Matrix AT by transposing the


values in A so that the first column of A becomes the first row of
AT. The second column of A becomes the second row of AT, and so
on, if there are more columns.
AT = 30 5

20 10

The values in the rows of AT will become the coefficients on the


left-hand side of the dual’s constraints.
The dual’s constants (right-hand side) are obtained from the
objective function of the primal (Z = 6X1 + 8X2). Thus, the con-
stants are 6 and 8.
If the primal is a maximization problem and the constraints are
<, the dual is a minimization problem and the constraints become
>. Thus, we can write the constraints as:
30O1 + 5O2 > 6

20O1 + 10O2 > 8

The first constraint states that the amount of wood needed to


produce a table (30 bf) multiplied by the opportunity cost of using
the wood to make tables (O1) plus the amount of labor needed to
7
OPERATIONS RESEARCH

make a table (5 hours) multiplied by the opportunity cost of using


the labor to make tables (O2) must be greater than or equal to $6.
The $6 is the net profit for a table. If the opportunity cost of pro-
ducing tables is equal to the net profit, tables will be produced. If it
is greater than the net profit, no tables will be produced, and the
units of wood and labor will be used elsewhere to attain higher
profits.
The second constraint can be interpreted in the same manner.
The amount of wood needed to produce a chair (20 bf) times the
opportunity cost of using the wood to make chairs (O1) plus the
amount of labor needed to make a chair (10 hours) times the
opportunity cost of using the labor to make chairs (O2) must be
greater than or equal to $8. The $8 is the net profit for a chair. If
the opportunity cost of producing chairs is equal to the net profit,
chairs will be produced. If it is greater than the net profit, no chairs
will be produced, and the units will be used elsewhere to attain
higher profits.
Therefore, we can formulate the dual as:
Minimize: R = 300O1 + 110O2

Subject to: 30O1 + 5O2 > 6 (tables)

20O1 + 10O2 > 8 (chairs)

where: O1, O2 > 0

Graphing the dual LP


We can graph the dual LP problem. In
this example, we won’t show every
step. For a more detailed explanation
of how to solve LP problems graphi-
cally, see EM 8719 or one of the
sources listed under “For more infor-
mation.”
Let the x axis represent wood, and the y axis
represent labor. Refer to Figure 1 as we briefly go
through the steps of graphically solving the dual.

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

Figure 1.—Table and chair graphical solution.

First, we can determine the two constraint lines:


For the table constraint: When O1 = 0, O2 = 6/5 or 1.2

When O2 = 0, O1 = 6/30 or 0.2

Plot the table constraint line using the intercepts O1 = 0.2


and O2 = 1.2.
For the chair constraint: When O1 = 0, O2 = 8/10 or 0.8

When O2 = 0, O1 = 8/20 or 0.4


Plot the chair constraint line using the intercepts O1 = 0.4
and O2 = 0.8.
Next, we can determine the valid side of the constraint lines by
substituting the origin (0,0) into the table constraint equation. We
get 30(0) + 5(0) > 6. This statement is false, so we know the valid
side of the table constraint line is away from the origin. In the same
9
OPERATIONS RESEARCH

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 = 300O1 + 110O2 110 = 300O1 + 110O2

Set O2 = 0 and solve for O1 Set O2 = 0 and solve for O1

165 = 300O1+ 110(0) 110 = 300O1 + 110(0)

165 = 300O1 110 = 300O1

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 = 300(0) + 110O2 110 = 300(0) + 110O2

165 = 110O2 110 = 110O2

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

Because we cannot read it exactly, we instead will solve the equa-


tions simultaneously to determine the exact coordinates:
30O1 + 5O2 =6
-0.5 (20O1 + 10O2) =8

20O1 + 0O2 =2

therefore: O1 = 2/20 = (0.10 or $0.10 per board foot of wood)

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

O2 = 3/5 = (0.60 or $0.60 per hour of labor)

The final step is to calculate the minimum value of the objective


function:
R = 300($0.10) + 110($0.60) = $96

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

The dual price associated with a particular LP constraint remains


Nonbinding. . . constant until the constraint becomes nonbinding. In other words,
“It no longer con- it no longer constrains the optimal solution. For example, adding
strains the optimal units of wood at first improves profit. Eventually, however, you
solution.” will find that adding wood no longer improves profit because you
can utilize no more wood without also adding more labor.
When a constraint is nonbinding, the dual price takes on a value
of zero. If graphed, the constraint line would lie outside the fea-
sible region. The feasible region is bounded by other constraints,
and the optimal solution is found at one or more corners of the
feasible region.
Most LP computer programs have a command that lets you view
the valid range of dual price values. In LINDO, the command is
RANGE.

Comparing the primal and dual


simplex tableaus
Table 2 illustrates the final tableau for solving the primal using
the simplex method, and Table 3 shows the final tableau for the
dual. For more information on the simplex method, see EM 8720
or Appendices A and B.

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

6 X1 1 0 1/20 -1/10 4 Nonbasic:


8 X2 0 1 -1/40 3/20 9 SW = 0, SL = 0

Sacrifice 6 8 1/10 6/10 96


Improvement 0 0 -1/10 -6/10 —

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

300 O1 1 0 -1/20 1/40 0.10 Nonbasic:


110 O2 0 1 1/10 -3/20 0.60 UT = 0, UC = 0

Sacrifice 300 110 -4 -9 96


Improvement 0 0 4 9 —

12
USING DUALITY AND SENSITIVITY ANALYSIS TO INTERPRET LINEAR PROGRAMMING SOLUTIONS

To be complete, the dual tableau also would have two artificial


variable columns, but they are not shown because they add nothing
to the interpretation and it is easier to compare the two tableaus
without them.
In the primal tableau (Table 2), SW represents unused wood, and
SL represents unused labor. The -1/10 and -6/10 in the Improve-
ment row show that a unit increase in unused wood decreases
profits by $0.10 per board foot, and a unit increase in unused labor
reduces profits by $0.60 per hour. Increasing the amount of unused
resource has the same effect as reducing the available resource.
Conversely, if more resource can be made available, profit will
increase by $0.10 for each additional board foot of wood and by
$0.60 for each additional hour of labor.
The 4 under UT and the 9 under UC in the Improvement row of
the dual (Table 3) are the optimal production of tables and chairs
found by solving the primal LP. The zero improvements for O1 and
O2 are the optimal values for the primal slack variables, that is,
SW = 0 and SL = 0.
The same exchange coefficients for the nonbasic variable col-
umns are present in each tableau with reversed signs and trans-
posed positions. Thus, the columns of one are the rows of the
other.
As you can see from this example, either the primal or the dual
can be solved using the simplex method. The other LP problem’s
final tableau then can be constructed from the solved problem’s
Complementary
final tableau.
slackness. . .
Complementary slackness “The relationship
Complementary slackness is the relationship between the slack between the slack
variables in the primal LP problem and the opportunity costs in the variables in the primal
dual. If a primal resource such as wood or labor has positive slack, LP problem and the
it is not binding on the optimal solution. Making more of this opportunity costs in
resource available will not improve profits. At the same time, the dual.”
because all of the resource is not being used, it has an opportunity
cost of 0. If we use more of it to make tables or chairs, we do not Binding constraint. . .
sacrifice any profit from another use. If, on the other hand, the “A resource with 0
resource has 0 slack, it is called a binding constraint. All of the slack. Making more of
resource is being used, and making more of it available will it available will
improve profit by allowing more production. However, it will have improve profit by
a positive opportunity cost because the additional units will have to allowing more pro-
be taken from some other use. duction.”

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

Surplus product If production is 0 for a given product, it means the resources


opportunity cost. . . necessary to make it can be used more profitably elsewhere. In this
case, the opportunity cost of the resources exceeds the unit profit
“The opportunity cost
of the product so there is surplus product opportunity cost. If, on
of the resources
the other hand, the product is produced, then the opportunity costs
exceeds the unit profit
of the resources must equal its unit profit. The resources are just as
of the product.”
valuable when used to make this product as they would be if used
Primal main. . . elsewhere. Therefore, the surplus product opportunity cost is 0.
Again, we can see that multiplying the production quantity of the
“Production quanti- primal times the surplus opportunity cost of the dual always gives
ties.” an answer of 0 because one of them always has a value of 0. In the
equation below, production quantities are called the primal main,
Dual surplus. . .
and surplus opportunity costs are called the dual surplus. Comple-
“Surplus opportunity mentary slackness indicates that for every product item:
costs.” primal main x dual surplus = 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

Evaluating new products


What if the marketing group suggests adding two more items to
the company’s product line? Based on a market study, management
agrees that enough demand exists to add wooden benches and
stools to the product line. The business team calculates that the
per-unit profit on benches will be $7 and the per-unit profit on
stools will be $2. Engineering estimates that a bench will require

14
USING DUALITY AND SENSITIVITY ANALYSIS TO INTERPRET LINEAR PROGRAMMING SOLUTIONS

25 bf of wood and 7 hours of labor, and a stool will require 10 bf


of wood and 2 hours of labor.
Using the dual values for wood and labor, the opportunity cost
of a bench and a stool can be calculated as:
Opportunity cost of manufacturing a bench = 25(0.10) + 7(0.60) = $6.70

Opportunity cost of manufacturing a stool = 10(0.10) + 2(0.60) = $2.20

The $6.70 opportunity cost of a bench is less than the profit of


$7 per bench, so the company should make benches. That is, wood
and labor can earn less elsewhere than they can by being used to
make benches.
The $2.20 opportunity cost of a stool is greater than the profit of
$2 per stool, however. Thus, each stool consumes resources in
excess of the profit it will earn. Using the resources to make stools
is not as profitable as using the resources somewhere else. Thus,
the company should not produce stools.

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

a minimization problem must be >. Such problems are called


symmetric dual linear problems.
As with most modeling exercises, the most important (and
usually most difficult) part of using LP for decision making is
problem formulation. Expect to spend most of your effort on this
step. If data are incorrect and/or the formulation of the LP problem
is wrong, LP software will generate a solution that can lead to
unprofitable decisions.

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

maximization problem. To convert it to standard form, multiply the


constraint by -1. This transforms the bench demand to:
-X3 < -2 (bench demand)

If an LP problem has an equality constraint such as X4 = 10,


replace the constraint with two equivalent inequality constraints:
X4 > 10

X4 < 10

Next, convert the > constraint into a < constraint by multiplying


by -1.
-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.

Surplus and artificial variables Surplus variable. . .


To use the simplex method to solve an LP problem, we must
state the inequalities as equalities. In EM 8720, we used slack “Represents the
variables (designated by S) to represent unused resources so that number of pieces
we could change the < inequalities to equalities. In our current produced over those
problem, bench demand is a > inequality. We will use a surplus needed to meet
variable (designated by U) to represent the number of benches demand.”
produced over the two needed to meet demand.
We can represent bench demand algebraically as: Artificial variable. . .
X3 - UB = 2 “Has no economic
meaning but is used
This equation states that the number of benches produced minus only to satisfy the
any surplus benches produced must equal 2 benches. Surplus requirements of the
variables, like all simplex variables, must be nonnegative. simplex method.”
Surplus variables cannot be in the initial basic mix. For example,
if we zeroed out the X3 term in the above equation, we would have:
0 - UB = 2 or UB = -2

Clearly, we cannot produce -2 benches.


To use the simplex method with > constraints, one more type of
variable must be introduced—an artificial variable. The artificial
variable has no economic meaning but is used only to satisfy the
17
OPERATIONS RESEARCH

requirements of the simplex method. We will use a lower-case a to


represent artificial variables.
Using surplus and artificial variables, we now can state bench
demand as:
X3 - UB + aB = 2

Surplus and slack variables contribute nothing to profit. There-


Surplus and slack fore, their coefficients equal 0 in the objective function.
variables contribute In order not to violate the underlying production requirement,
nothing to profit. the artificial variable must have a value of 0. This ensures that it
does not appear in the final basic mix. To accomplish this, we
assign it a very large negative value per unit profit. (For a minimi-
zation problem, we would assign it a very large positive value per
unit cost.) The exact value is unimportant as long as it is suffi-
ciently large to make the artificial variable unprofitable during
problem solving. We’ll represent this number by -M (M for a
minimization problem). This procedure is known as the big-M
method.
We now are ready to formulate the LP problem using slack,
surplus, and artificial variables. As before, we list all variables in
all equations to arrive at:
Maximize: Z = 6X1 + 8X2 + 7X3 + 0SW + 0SL + 0UB - MaB (objective function)

Subject to: 30X1 + 20X2 + 25X3 + 1SW + 0SL + 0UB + 0aB = 300 (wood constraint)

5X1 + 10X2 + 7X3 + 0SW + 1SL + 0UB + 0aB = 110 (labor constraint)

0X1 + 0X2 + 1X3 + 0SW + 0SL - 1UB + 1aB = 2 (bench demand)

X1, X2, X3, SW, SL, UB, aB > 0 (nonnegativity conditions)

The initial simplex tableau is shown in Table A-1. A step-by-step


procedure for generating the second simplex tableau will be
described. The remaining simplex tableaus will be shown, and an
explanation of the final tableau will follow. For more detail on the
simplex method, please see EM 8720 or one of the sources listed
under “For more information.”
The basic mix consists of the slack variables and the artificial
variable. There is a 1 in their row and 0s elsewhere. The unit profit
for the basic mix variables is brought down into the unit profit
column to the left of the tableau (Table A-1).

18
USING DUALITY AND SENSITIVITY ANALYSIS TO INTERPRET LINEAR PROGRAMMING SOLUTIONS

Table A-1.—Initial simplex tableau.


Unit
profit 6 8 7 0 0 0 -M Exchange
ratios
Basic mix X1 X2 X3 SW SL UD aB Solution


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 —

To calculate the sacrifice row, multiply each basic mix unit


profit by each number in its tableau row. Then add the answers for
each column. For example, the sacrifice value for the X1 column is
calculated as:
0 x 30 = 0 and for the X3 column: 0 x 25 = 0
0x5=0 0x7=0
+ (-M x 0) = 0 + (-M x 1) = -M
0 -M
Do this for each column in the tableau and also for the solution
column.
To get the improvement values, subtract the sacrifice value from
the unit profit listed at the top of each column. For example, the
improvement value for the X1 column is calculated as:
6-0=6

For the X3 column, it is:


7 - (-M) = 7 + M

Do this for each column in the tableau except the solution


column.
Determine the entering variable by finding the greatest improve-
ment that can be made. Because 7 + M is the largest positive
number, X3 is the entering variable. Mark this column with an
arrow pointing down. If no improvement can be found (all of the
values in the Improvement row are 0 or a negative number), the
optimal solution is represented by the current tableau.
Apply the exit criterion. First, divide each solution value by the
value in the same row of the entering variable’s column (the X3
column). If the divisor is 0, the product is infinity, which you can

19
OPERATIONS RESEARCH

treat as a very large positive number. The resulting values are


Pivot element . . . called exchange ratios. They are calculated as:
“The value found at 300/25 = 12
the intersection of the 110/7 = 15.71
entering variable
column and the 2/1 = 2
exiting variable row.” Choose the smallest nonnegative exchange ratio. This represents
the exiting variable, which in this case is aB. Mark the exiting
variable row with an arrow pointing left.
Construct a new simplex tableau. The entering variable, X3,
replaces the exiting variable, aB. Circle the pivot element—the
value found at the intersection of the entering variable column and
the exiting variable row. For the first tableau it is 1, located where
the X3 entering variable column meets the aB exiting variable row.
Calculate the values for the new entering variable row (X3) in the
second tableau by dividing the entries in the old exiting variable
row (aB) by the pivot element. Because the pivot element is 1, there
is no change, and the values can be brought down into the new
row.
The other new row values can be calculated by:
(old value) - (value in that row and in the pivot column X new entering
variable value found in the old value column)

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

Practice using the shortcuts from EM 8720 when constructing


the remaining simplex tableaus. As a reminder, they are:
• In the new tableau, only the columns for the nonbasic and
exiting variables change. Move the values for all other basic
variables directly into the new tableau.
• When 0 is found in the pivot column, that row always is the
same in the new tableau. When 0 is found in the pivot row, that
column always is the same in the new tableau.
• With two exceptions, the newly entered basic variable’s column
will contain a 0 in all locations. A 1 will go in the same location
as the pivot element in the preceding tableau, and the per-unit
profit or loss for this variable will appear in the sacrifice row.

Table A-2.—Second simplex tableau.


Unit
profit 6 8 7 0 0 0 -M Exchange
ratios
Basic mix X1 X2 X3 SW SL UD aB Solution

0 SW 30 20 0 1 0 25 -25 250 50/20 = 12.25


➔ 96/10 = 9.6
0 SL 5 10 0 0 1 7 -7 96
7 X3 0 0 1 0 0 -1 1 2 2/0 = ∞
Sacrifice 0 0 7 0 0 -7 7 14
Improvement 6 8 0 0 0 7 -M-7 —

Table A-3.—Third simplex tableau.


Unit
profit 6 8 7 0 0 0 -M Exchange
ratios
Basic mix X1 X2 X3 SW SL UD aB Solution

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

Table A-4.—Fourth simplex tableau.


Unit
profit 6 8 7 0 0 0 -M Exchange
ratios
Basic mix X1 X2 X3 SW SL UD aB Solution


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 —

Table A-5.—Final simplex tableau.


Unit
profit 6 8 7 0 0 0 -M Exchange
ratios
Basic mix X1 X2 X3 SW SL UD aB Solution
0 UD 20/11 0 0 1/11 -2/11 1 -1 58/11 58/11
8 X2 -17/22 1 0 -7/110 5/22 0 0 65/11 65/11
7 X3 20/11 0 1 1/11 -2/11 0 0 80/11 80/11
Sacrifice 72/11 8 7 7/55 6/11 0 0 1080/11
Improvement -6/11 0 0 -7/55 -6/11 0 -M —

In Table A-5, there is no positive number in the Improvement


row. Thus, no improvement can be made, and this tableau repre-
sents the optimal solution to the LP problem. The optimal solution
is:
X1 = 0 SW = 0

X2 = 65/11 = 5.9 SL = 0

X3 = 80/11 = 7.3 UD = 58/11 = 5.3


The company should make 0 tables, 5.9 chairs, and 7.3 benches.
Total profit will be $98.30:
6(0) + 8(5.9) + 7(7.3) = $98.30

The total profit we found by hand is slightly different than the


profit of $98.18 found by LINDO because of rounding in the hand
solution.
The optimal solution shows that it no longer is profitable to
make tables while making benches. The surplus variable is greater
than 0; UD = X3 - 2 = 5.3. Thus, 5.3 more benches should be pro-
duced than the minimum of 2.

22
USING DUALITY AND SENSITIVITY ANALYSIS TO INTERPRET LINEAR PROGRAMMING SOLUTIONS

There is no guarantee of an integer (whole number) solution.


Obviously, the company cannot sell 0.9 of a chair or 0.3 of a
bench. We can think of this fractional part as work in progress or
we can round up or down. An optimal solution for another problem
might be to buy 6.75 trucks. Obviously, you can buy either 6 or 7 There is no guarantee
trucks, but not 0.75 of a truck. In this case, rounding up (and for of an integer (whole
many noninteger answers, rounding either up or down) offers a number) solution.
practical solution. However, if you’re studying the possibility of
building a new plant addition, a variable can have only a value of 0
or 1, so a fractional answer is useless. Either you build the addition
or you don’t. Fortunately, methods called integer programming can
handle these types of problems.

For more information


Bierman, H., C.P. Bonini,
and W.H. Hausman.
Quantitative Analysis for
Business Decisions PERFORMANCE EXCELLENCE
(Richard D. Irwin, Inc., IN THE WOOD PRODUCTS INDUSTRY
Homewood, IL, 1977).
642 pp.
Dykstra, D.P. Mathematical
Programming for Natu-
ral Resource Manage- Using the Graphical Method to Solve Linear Programs,
ment (McGraw-Hill, EM 8719 (October 1998). $2.50
Inc., New York, 1984). Using the Simplex Method to Solve Linear Programming
318 pp. Maximization Problems, EM 8720 (October 1998). $3.00
Hillier, F.S. and G.J. To order copies of the above publications or additional copies
Lieberman. Introduction of this publication, send the complete title and series number,
to Operations Research, along with a check or money order for the amount listed, to:
sixth edition (McGraw-
Publication Orders
Hill, Inc., New York,
Extension & Station Communications
1995). 998 pp.
Oregon State University
Ignizio, J.P., J.N.D. Gupta,
422 Kerr Administration
and G.R. McNichols.
Corvallis, OR 97331-2119
Operations Research in
Fax: 541-737-0817
Decision Making (Crane,
Russak & Company, We offer discounts on orders of 100 or more copies of a
Inc., New York, 1975). single title. Please call 541-737-2513 for price quotes.
343 pp. You can view our Publications and Videos catalog and many
of our publications on the Web (eesc.orst.edu).

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

ABOUT THIS SERIES


This publication is part of a series, Performance
Excellence in the Wood Products Industry. The various
publications address topics under the headings of wood
technology, marketing and business management,
production management, quality and process control,
and operations research.
For a complete list of titles in print, contact OSU
Extension & Station Communications (address on page 23)
or visit the OSU Wood Products Extension Web site at
http://wood.orst.edu/

© 2000 Oregon State University


This publication was produced and distributed in furtherance of the Acts of Congress of May 8 and June 30, 1914. Extension work is a cooperative
program of Oregon State University, the U.S. Department of Agriculture, and Oregon counties. Oregon State University Extension Service offers
educational programs, activities, and materials—without regard to race, color, religion, sex, sexual orientation, national origin, age, marital status,
disability, and disabled veteran or Vietnam-era veteran status—as required by Title VI of the Civil Rights Act of 1964, Title IX of the Education
Amendments of 1972, and Section 504 of the Rehabilitation Act of 1973. Oregon State University Extension Service is an Equal Opportunity
Employer.
Published April 2000.

You might also like