Chapter 4 Duality & sensitivity analysis hand out last .pdf
1. 4/28/2020 Duality and Sensitivity Analysis
Compiled by Tsegay Berhe [ MSc in production engineering & Management ]
MEKELLE UNVERISTY
2. COMPILED BY TSEGAY BERHE [ MSC IN PRODUCTION ENGINEERING & MANAGEMENT ] 1
Contents
4. Duality and Sensitivity Analysis .............................................................................................. 2
4.1. Primal-dual relationship;................................................................................................. 2
4.2. Rules for Constructing the Dual Problem........................................................................ 3
4.3. Economic interpretation of duality .................................................................................. 4
4.4. Simple way of solving dual problems [optimal Dual solution]........................................ 6
4.5. Post-optimal [Simplex method sensitivity Analysis] ........................................................ 8
3. COMPILED BY TSEGAY BERHE [ MSC IN PRODUCTION ENGINEERING & MANAGEMENT ] 2
4. Duality and Sensitivity Analysis
The dual problem is defined systematically from the primal (or original) LP model. The two
problems are closely related, in the sense that the optimal solution of one problem automatically
provides the optimal solution to the other. As such, it may be advantageous computationally in
some cases to determine the primal solution by solving the dual.
The term 'Duality' implies that every linear programming problem, whether of maximization or
minimization, is associated with another linear programming problem based on the same data
which is called dual.
The primal problem is dealing with determining the number of units of the products, time etc.
While the dual problem deals with determining the unit worth (price) of the resource.
When taking the dual of a given LP, we refer to the given LP as the primal. If the primal is a max
problem, then the dual will be a min problem, and vice versa. For convenience, we define the
variables for the max problem to be Z, X1, X2, ..., Xn and the variables for the min problem to be
W, Y1, Y2, . . ., YM.
To find the dual to a max problem in which all the variables are required to be nonnegative and
all the constraints are โค constraints (called normal max problem) the problem may be written as:
4.1. Primal-dual relationship;
Primal Dual problem
๐๐๐ก๐๐๐๐ง๐(๐๐๐ฅ ๐๐ ๐๐๐), ๐ = โ ๐ถ๐ โ ๐๐
๐
๐
๐๐๐ก๐๐๐๐ง๐(๐๐๐๐ ๐๐ ๐๐๐ฅ), ๐ = โ ๐๐ โ ๐ฆ๐
๐
๐
๐. ๐ก
{
๐11๐1 + ๐12๐2 + . . . + ๐1๐๐๐ (โค, =, โฅ)๐1
๐21๐1 + ๐22๐2 + . . . + ๐2๐๐๐ (โค, =, โฅ)๐2
๐31๐1 + ๐32๐2 + . . . + ๐3๐๐๐ (โค, =, โฅ)๐3
.
.
.
.
๐๐1๐1 + ๐๐2๐2 + . . . + ๐๐๐๐๐ (โค, =, โฅ)๐๐
๐. ๐ก
{
๐11๐1 + ๐21๐2 + . . . + ๐๐1๐๐ (โฅ, =, โค)๐ถ1
๐12๐1 + ๐22๐2 + . . . + ๐๐๐๐๐ (โฅ, =, โค)๐ถ2
๐13๐1 + ๐23๐2 + . . . + ๐๐๐๐๐ (โฅ, =, โค)๐ถ3
.
.
.
.
๐1๐๐1 + ๐2๐๐2 + . . . + ๐๐๐๐๐ (โฅ, =, โค)๐ถ๐
The following is a summary of how the dual is constructed from the (equation form) primal:
I. A dual variable is assigned to each primal (equation) constraint and a dual constraint is
assigned to each primal variable.
II. The right-hand sides of the primal constraints provide the coefficients of the dual objective
function.
Table 4.1
4. COMPILED BY TSEGAY BERHE [ MSC IN PRODUCTION ENGINEERING & MANAGEMENT ] 3
Rules for constructing the dual problem
Primal problem objective
Dual problem
objective Constraint type Variable sign
Maximization Minimization โฅ Unrestricted
Minimization Maximization โค Unrestricted
โ All primal constraints are equations with nonnegative right-hand sides, and all the
variables are nonnegative.
โ A convenient way to remember the constraint type (โค or โฅ) in the dual is that if the dual
objective is a โpointing-downโ minimization, then all the constraints are โpointing-upโ
(โฅ) inequalities. The opposite applies when the dual objective is maximization.
III. The dual constraint corresponding to a primal variable is constructed by transposing the
primal variable column into a row with;
a. the primal objective coefficient becoming the dual right-hand side and
b. the remaining constraint coefficients comprising the dual left-hand side
coefficients.
IV. The sense of optimization, direction of inequalities, and the signs of the variables in the
dual are governed by the rules in Table 4.1
4.2. Rules for Constructing the Dual Problem
Maximization Problem Minimization Problem
constraints Variables
โฅ โค
โค โฅ
= Unrestricted
Variables constraints
โฅ โฅ
โค โค
Unrestricted =
Primal Dual
Objective is minimization Objective is maximization & vice versa
โฅ type constraints โค type constraints
Number of columns Number of rows
Number of rows Number of columns
Number of decision variables Number of constraints
Number of constraints Number of decision variables
Coefficient of objective function RHS value
RHS values Coefficient of objective function
6. COMPILED BY TSEGAY BERHE [ MSC IN PRODUCTION ENGINEERING & MANAGEMENT ] 5
Interpreting the Dual of the Dakota (Max) Problem;
The primal;
๐๐๐ฅ ๐ = 60๐1 + 30๐2 + 20๐3
8๐1 + 6๐2 + ๐3 โค 48 (Timber constriants)
4๐1 + 2๐2 + 1.5๐3 โค 20(Finishing constriants)
2๐1 + 1.5๐2 + 0.5๐3 โค 8 (Carpentry constriants)
๐1, ๐2, ๐3 โฅ 0
The dual;
Min w = 48Y1 + 20Y2 + 8Y3
8Y1 + 6Y2 + 2Y3 โฅ 60 (Desk constriants)
6Y1 + 2Y2 + 1.5Y3 โฅ 30(Table constriants)
Y1 + 1.5Y2 + 0.5Y3 โฅ 8 (Chair constriants)
Y1, Y2, Y3 โฅ 0
The first dual constraint is associated with desks, the second with tables, and the third with chairs.
Decision variable y1 is associated with Timber, y2 with finishing hours, and y3 with carpentry
hours. Suppose an entrepreneur wants to purchase all of Dakotaโs resources. The entrepreneur
must determine the price he or she is willing to pay for a unit of each of Dakotaโs resources.
To determine these prices, we define:
โข y1 = price paid for 1 boards ft of lumber
โข y2 = price paid for 1 finishing hour
โข y3 = price paid for 1 carpentry hour
The resource prices y1, y2, and y3 should be determined by solving the Dakota dual.
The total price that should be paid for these resources is 48 y1 + 20y2 + 8y3. Since the cost of
purchasing the resources is to minimized:
Min w = 48y1 + 20y2 + 8y3 is the objective function for Dakota dual.
In setting resource prices, the prices must be high enough to induce Dakota to sell.
For example, the entrepreneur must offer Dakota at least $60 for a combination of resources
that includes 8 board feet of timber, 4 finishing hours, and 2 carpentry hours because Dakota
could, if it wished, use the resources to produce a desk that could be sold for $60. Since the
entrepreneur is offering 8y1 + 4y2 + 2y3 for the resources used to produce a desk, he or she must
choose y1, y2, and y3 to satisfy: 8y1 + 4y2 + 2y3 โฅ 60. Similar reasoning shows that at least $30
must be paid for the resources used to produce a table.
Thus y1, y2, and y3 must satisfy: 6y1 + 2y2 + 1.5y3 โฅ 30
Likewise, at least $20 must be paid for the combination of resources used to produce one chair.
Thus y1, y2, and y3 must satisfy: y1 + 1.5y2 + 0.5y3 โฅ 20. The solution to the Dakota dual yields
prices for timber, finishing hours, and carpentry hours.
7. COMPILED BY TSEGAY BERHE [ MSC IN PRODUCTION ENGINEERING & MANAGEMENT ] 6
4.4. Simple way of solving dual problems [optimal Dual solution]
The primal and dual solutions are closely related, in the sense that the optimal solution of either
problem directly yields the optimal solution to the other, as is explained subsequently. Thus, in an
LP model in which the number of variables is considerably smaller than the number of constraints,
computational savings may be realized by solving the dual because the amount of computations
associated with determining the inverse matrix primarily increases with the number of constraints.
Notice that the rule addresses only the amount of computations in each iteration but says nothing
about the total number of iterations needed to solve each problem.
This section provides two methods for determining the dual values.
Method 1.
(
๐๐๐ก๐๐๐๐ ๐ฃ๐๐๐ข๐ ๐๐ ๐๐ข๐๐
๐ฃ๐๐๐๐๐๐๐ ๐๐
) = (
๐๐๐ก๐๐๐๐ ๐๐๐๐๐๐ ๐ ๐๐๐๐๐๐๐๐๐๐๐ก ๐๐ ๐ ๐ก๐๐๐ก๐๐๐ ๐๐๐ ๐๐ ๐ฃ๐๐๐๐๐๐๐ ๐๐
+
๐๐๐๐๐๐๐ ๐๐๐๐๐๐ก๐๐ฃ๐ ๐๐๐๐๐๐๐๐๐๐๐ก ๐๐ ๐๐
)
Example 1
๐๐๐ฅ ๐ = 2๐1 + 2๐2 + 5๐3 + 4๐4
S. t
๐1 + 3๐2 + 4๐3 + 3๐4 โค 10
4๐1 + 2๐2 + 6๐3 + 8๐4 โค 25
(
๐๐๐ก๐๐๐๐ ๐ฃ๐๐๐ข๐ ๐๐ ๐๐ข๐๐
๐ฃ๐๐๐๐๐๐๐ ๐1
) = (
4
5
+ 0 ) =
4
5
(
๐๐๐ก๐๐๐๐ ๐ฃ๐๐๐ข๐ ๐๐ ๐๐ข๐๐
๐ฃ๐๐๐๐๐๐๐ ๐2
) =
3
10
+ 0 =
3
10
Method 2
(
๐๐๐ก๐๐๐๐ ๐ฃ๐๐๐ข๐ ๐๐
๐๐ข๐๐ ๐ฃ๐๐๐๐๐๐๐๐
) = (
๐ ๐๐ค ๐ฃ๐๐๐ก๐๐ ๐๐
๐๐๐๐๐๐๐ ๐๐๐๐๐๐ก๐๐ฃ๐ ๐๐๐๐๐๐๐๐๐๐๐ก๐
๐๐ ๐๐๐ก๐๐๐๐ ๐๐๐๐๐๐ ๐๐๐ ๐๐ ๐ฃ๐๐๐๐๐๐๐๐
) โ (
๐๐๐ก๐๐๐๐ ๐๐๐๐๐๐
๐๐๐ฃ๐๐๐ ๐
)
Cj 2 2 5 4 0 0
C.B.V B.V X1 X2 X3 X4 S1 S2 solution
5 X3 0 1 1 2/5 2/5 - 1/10 1.5
2 X1 1 -1 0 1.4 - 3/5 2/5 4
Zj 2 3 5 24/5 4/5 3/10
Zj-Cj 0 1 0 4/5 4/5 3/10
Optimal table B
-1
9. COMPILED BY TSEGAY BERHE [ MSC IN PRODUCTION ENGINEERING & MANAGEMENT ] 8
(
๐๐๐ก๐๐๐๐ ๐ฃ๐๐๐ข๐ ๐๐ ๐๐ข๐๐
๐ฃ๐๐๐๐๐๐๐ ๐2
) = 1 + 0 = 1
(
๐๐๐ก๐๐๐๐ ๐ฃ๐๐๐ข๐ ๐๐ ๐๐ข๐๐
๐ฃ๐๐๐๐๐๐๐ ๐3
) = 0 + 0 = 0
Method 2;
(
๐๐๐ก๐๐๐๐ ๐ฃ๐๐๐ข๐ ๐๐
๐๐ข๐๐ ๐ฃ๐๐๐๐๐๐๐๐
) = (
๐ ๐๐ค ๐ฃ๐๐๐ก๐๐ ๐๐
๐๐๐๐๐๐๐ ๐๐๐๐๐๐ก๐๐ฃ๐ ๐๐๐๐๐๐๐๐๐๐๐ก๐
๐๐ ๐๐๐ก๐๐๐๐ ๐๐๐๐๐๐ ๐๐๐ ๐๐ ๐ฃ๐๐๐๐๐๐๐๐
) โ (
๐๐๐ก๐๐๐๐ ๐๐๐๐๐๐
๐๐๐ฃ๐๐๐ ๐
)
(๐1 ๐2 ๐3) = (๐1 ๐2 ๐3) โ (
0.19 โ0.13 0
โ0.44 0.63 0
1.38 โ2.25 1
)
(๐1 ๐2 ๐3) = (22 6 0) โ (
0.19 โ0.13 0
โ0.44 0.63 0
1.38 โ2.25 1
)
(๐1 ๐2 ๐3) = (1.5 1 0)
Max z=Min W
222=100*1.5+72*1+0*80
222=222
4.5. Post-optimal [Simplex method sensitivity Analysis]
While solving a linear programming problem for optimal solution, we assume that:
a. Technology is fixed,
b. Fixed prices,
c. Fixed levels of resources or requirements,
d. The coefficients of variables in structural constraints (i.e. time required by a product
on a particular resource) are fixed,
e. profit contribution of the product will not vary during the planning period.
The condition in the real world however, might be different from those that are assumed by the
model. It is, therefore, desirable to determine how sensitive the optimal solution is to different
types of changes in the problem data and parameters.
Why we use sensitivity analysis?
(a) Sensitivity analysis allow us to determine how "sensitive" the optimal solution is to
changes in data values.
(b) Sensitivity analysis is important to the manager who must operate in a dynamic
environment with imprecise estimates of the coefficients.
(c) Sensitivity analysis is used to determine how the optimal solution is affected by changes,
within specified ranges, in:
i. the objective function coefficients (cj ), which include:
โ Coefficients of basic variables.
10. COMPILED BY TSEGAY BERHE [ MSC IN PRODUCTION ENGINEERING & MANAGEMENT ] 9
โ Coefficients of non-basic variables.
ii. the right-hand side (RHS) values (bi ), (i.e. resource or requirement levels).
iii. Change in the consumption rate (Technological coefficients)
The above changes may result in one of the following three cases
Case I. The optimal solution remains unchanged, that is the basic variables and
their values remain essentially unchanged.
Case II. The basic variables remain the same but their values are changed.
(d)
Case III. The basic solution changes completely.
๐๐๐๐๐๐ก๐๐ฃ๐ ๐๐ข๐๐๐ก๐๐๐(๐๐๐ฅ๐๐๐๐ง๐๐ก๐๐๐ ๐๐ ๐๐๐๐๐๐๐ง๐๐ก๐๐๐), ๐ = ๐ถ1๐1+๐ถ2๐2+ . . . . . . . . +๐ถ๐๐๐
๐. ๐ก
{
๐11๐1 + ๐12๐2 + . . . + ๐1๐๐๐ (โค, =, โฅ)๐1
๐21๐1 + ๐22๐2 + . . . + ๐2๐๐๐ (โค, =, โฅ)๐2
๐31๐1 + ๐32๐2 + . . . + ๐3๐๐๐ (โค, =, โฅ)๐3
.
.
.
๐๐1๐1 + ๐๐2๐2 + . . . + ๐๐๐๐๐ (โค, =, โฅ)๐๐
๐1, ๐2, , , ๐๐ โฅ 0
โข Sensitivity of the optimal solution to the changes in the available resources, (i.e. the right
hand side RHS of the constraints bij)
โข Sensitivity of the optimal solution to the changes in the unit profit or unit cost, (i.e. the
coefficient of the objective function Cij)
โข Change in the consumption rate (Technological coefficients)
The right hand side of the constraint denotes present level of availability of resources (or
requirement in minimization problems). When this is increased or decreased, it will have effect
on the objective function and it may also change the basic variable in the optimal solution.
Example 1
๐๐๐ฅ ๐ = 2๐1 + 2๐2 + 5๐3 + 4๐4
S. t
๐1 + 3๐2 + 4๐3 + 3๐4 โค 10, ๐๐๐ โ โ๐๐ข๐๐ ๐๐๐๐ ๐ก๐๐๐๐๐ก๐
4๐1 + 2๐2 + 6๐3 + 8๐4 โค 25, ๐๐๐โ๐๐๐ โ๐๐ข๐๐
๐ij โฅ 0
11. COMPILED BY TSEGAY BERHE [ MSC IN PRODUCTION ENGINEERING & MANAGEMENT ] 10
Optimal table
Cj 2 2 5 4 0 0
C.B.V B.V X1 X2 X3 X4 S1 S2 solution
5 X3 0 1 1 2/5 2/5 - 1/10 3/2
2 X1 1 -1 0 7/5 - 3/5 2/5 4
Zj 2 3 5 24/5 4/5 3/10
Zj-Cj 0 1 0 4/5 4/5 3/10
N.B. From this optimal table
โข {X1, X3} are Basic variables (B.V) because there are in the solution
โข {X2, X3} are Non Basic variables (N.B.V) because there are not in the solution
Solution X1 = 4; X2 = 0; X3 = 1.5; S1 = 0; S2 = 0; ) Z = 15.5
โข Man-hours are completely utilized hence S1 = 0.
Machine hours are completely utilized, hence S2 = 0
I. The shadow price of the man-hours resource is $4/5. Hence it means to say that as we go
on increasing one hour of man-hour resource, the objective function will go on increasing
by $4/5 per hour.
II. Similarly, the shadow price per unit of machine hour is $3/10. Similar reasoning can be
given, that is every unit increase in machine hour resource will increase the objective
function by $3/10.
If the management want to increase the capacity of both man-hours and machine-hours, which
one should receive priority?
โข The answer is man-hours, since it is shadow price is greater than the shadow price of
machine-hours.
If the management considers to increase man-hours by 10 hours i.e., from 10 hours to 20 hours
and machine hours by 20 hours i.e., 25 hours to 45 hours will the optimal solution remain
unchanged?
Use example 1 for more illustration
1. Change in the coefficient of objective function (Ci)
Case 1;Change in the coefficient of objective Non basic variable(N.B.V)
ฮ Coeff of
Objective.
Function
Case 2;Change in the coefficient of objective basic variable(B.V)
Case 1; Change in the coefficient of objective Non basic variable (N.B.V)
a. Change in the coefficient of objective of X2 [C2]
12. COMPILED BY TSEGAY BERHE [ MSC IN PRODUCTION ENGINEERING & MANAGEMENT ] 11
2+ฮ2
C2
2-ฮ2
If the coefficient of X2 is changed then only Z2-C2 will change be changed and the other Zj-Cj along
the column are still constant. In addition, in order to do the sensitivity analysis, the current optimal
table should be optimal. So the optimal table is still optimal if Z2-C2 โฅ0.
Case 1: Then if C2 =2+ฮ2 [Maximum Increment]
then
๐2 โ ๐ถ2 โฅ 0
๐ โ [๐ + ๐ฅ2] โฅ 0
๐ โ ๐ฅ2 โฅ 0
๐๐ = ๐
๐๐ ๐ฅ2 โฅ 1, ๐กโ๐๐ ๐2 โ ๐ถ2 ๐ค๐๐๐ ๐๐ ๐๐๐๐๐ก๐๐ฃ๐, ๐กโ๐๐ ๐๐๐๐๐๐๐ก๐๐ ๐กโ๐ ๐๐๐๐๐ ๐ก๐๐๐๐ ๐๐ ๐๐๐ก ๐๐๐ก๐๐๐๐
๐ถ2 = ๐ + ๐ฅ2 = 2 + 1 = 3 , ๐กโ๐๐ ๐๐ ๐กโ๐ ๐๐๐ฅ๐๐๐ข๐ ๐๐๐๐๐๐๐๐๐ก
Case 2: Then if C2 =2-ฮ2
๐2 โ ๐ถ2 โฅ 0
๐ โ [๐ โ ๐ฅ2] โฅ 0
๐ + ๐ฅ2 โฅ 0
๐ฅ2 โฅ โ1,
๐ผ๐ ๐๐๐๐๐ ๐ก๐ ๐๐ ๐กโ๐ ๐ ๐๐๐ ๐ก๐๐ฃ๐๐ก๐ฆ ๐๐๐๐๐ฆ๐ ๐๐ ๐กโ๐ ๐๐๐ก๐๐๐๐ ๐ก๐๐๐๐ ๐ โ๐๐ข๐๐ ๐๐ ๐๐๐๐๐๐ ๐๐๐ก๐๐๐๐, ๐กโ๐๐
๐ฅ2 = โ
Then
๐ช๐ = ๐ โ โ = โโ
Then the range of optimality for the coefficient of non-basic variable X2 which is C2.
โโ โค ๐ช๐ โค ๐
b. Change in the coefficient of objective of X4 [C4]
4+ฮ4
C4
4-ฮ4
Case 1: Then if C2 =4+ฮ4 [Maximum Increment]
13. COMPILED BY TSEGAY BERHE [ MSC IN PRODUCTION ENGINEERING & MANAGEMENT ] 12
then
๐4 โ ๐ถ4 โฅ 0
๐๐
๐
โ [๐ + ๐ฅ4] โฅ 0
๐
๐
โ ๐ฅ4 โฅ 0
๐๐ =
๐
๐
๐๐ ๐ฅ24 โฅ
4
5
, ๐กโ๐๐ ๐4 โ ๐ถ4 ๐ค๐๐๐ ๐๐ ๐๐๐๐๐ก๐๐ฃ๐, ๐กโ๐๐ ๐๐๐๐๐๐๐ก๐๐ ๐กโ๐ ๐๐๐๐๐ ๐ก๐๐๐๐ ๐๐ ๐๐๐ก ๐๐๐ก๐๐๐๐
๐ช๐ = ๐ +
๐
๐
=
๐๐
๐
, ๐๐๐๐ ๐๐ ๐๐๐ ๐๐๐๐๐๐๐ ๐๐๐๐๐๐๐๐๐
Case 2: Then if C4 =4-ฮ4
๐4 โ ๐ถ4 โฅ 0
24
5
โ [4 โ ๐ฅ2] โฅ 0
4
5
+ ๐ฅ4 โฅ 0
๐๐ โฅ โ
๐
๐
,
๐ผ๐ ๐๐๐๐๐ ๐ก๐ ๐๐ ๐กโ๐ ๐ ๐๐๐ ๐ก๐๐ฃ๐๐ก๐ฆ ๐๐๐๐๐ฆ๐ ๐๐ ๐กโ๐ ๐๐๐ก๐๐๐๐ ๐ก๐๐๐๐ ๐ โ๐๐ข๐๐ ๐๐ ๐๐๐๐๐๐ ๐๐๐ก๐๐๐๐, ๐กโ๐๐
๐ฅ4 = โ
Then
๐ช๐ = ๐ โ โ = โโ
Then the range of optimality for the coefficient of non-basic variable X4 which is C4;
โโ โค ๐ช๐ โค
๐๐
๐
Case 2; Change in the coefficient of objective basic variable (B.V)
From the above optimal table, the basic variables are X1, X3, because these variables are within
the solution with the value of 4,3/2 respectively.
a. Change in the coefficient of X1,
2+ฮ1
C1
2-ฮ1
N.B. if the coefficient of the basic variable is changed, then the whole Zj-Cj value will be also
changed. Though a new value of Zj-Cj should be determined using the current optimal table.
24. COMPILED BY TSEGAY BERHE [ MSC IN PRODUCTION ENGINEERING & MANAGEMENT ] 23
Exercise
๐๐๐ฅ ๐ = 12๐1 + 3๐2 + ๐3
S. t
10๐1 + 2๐2 + ๐3+โค 100
7๐1 + 3๐2 + 2๐3 โค 77
2๐1 + 4๐2 + ๐3 โค 80
๐1, ๐2, ๐3 โฅ 0
Optimal table
Cj 12 3 1 0 0 0
C.B. V B. V X1 X2 X3 S1 S2 S3 SOLUTION
12 X1 1 0 - 1/16 3/16 - 1/8 0 73/8
3 X2 0 1 13/16 - 7/16 5/8 0 35/8
0 S3 0 0 -2 11/8 -9/4 1 177/4
Zj 12 3 27/16 15/16 3/8 0
Zj-Cj 0 0 18/16 15/16 3/8 0
i. Determine the dual values
ii. Determine the range of optimality of C1, C2 and C3 (change in the objective function
coefficient)
iii. Determine the range of feasibility b1 (change in the RHS constraints)
iv. Determine the range of optimality of the consumption rate (a11)