7/25/2019 01e Sensitivity Analysis and Duality
1/42
Sensitivity Analysis and Duality
1Sasadhar Bera, IIM Ranchi
7/25/2019 01e Sensitivity Analysis and Duality
2/42
Standard form of Linear Programming (LP)
2Sasadhar Bera, IIM Ranchi
Objective function = ZMin= Minimum (c1 x1+ c2x2+ . . . . +cn xn)
subject to
a11x1 + a12 x2+ . . . + a1n xn = b1
a21x1 + a22 x2 + . . . + a2n xn = b2
. . . . . . .
. . . . . . .
am1x1 + am2 x2 + . . . + amn xn= bmx1, x2, x3, .., xn0
Notation: c1, c2, . . .,cn are cost coefficients.
b1, b2, . . .,bm are available resources.
a11, a12, . . ., amn are technological coefficients.
In matrix notation:
ZMin= C1nXn1
subject to
AmnXn1= bm1
Xn1 0
Minimization Problem
7/25/2019 01e Sensitivity Analysis and Duality
3/42
Revisiting Product Mix Problem
3
A company wishes to schedule the production of a kitchen
appliance that requires two resources, labor and material.The company is considering 3 models (A, B, and C) and its
production engineering department has furnished the
data given below. Formulate the following problem and
solve.
Model
Resource
Resource
requirement
Availability
A B C
Labour (Hrs/Unit)
7
3
6
150 Hrs
Material (Kg/Unit)
4
4
5
200 Kg
Profit (Rs. /Unit) 4 2 3
Sasadhar Bera, IIM Ranchi
7/25/2019 01e Sensitivity Analysis and Duality
4/42
Revisiting Product Mix Problem (contd.)
4
Decision Variables
X1 = Number of A type model producedX2 = Number of B type model produced
X3 = Number of C type model produced
Objective function: Total profit maximization (ZMAX.)
ZMax.= 4X1+2X2+3X3
Subject to
7X1+3X
2+6X
3150
4X1+4X2+5X3200
X1, X2, X30
Objective function
Labour constraint
Material constraint
Boundary Constraint
Sasadhar Bera, IIM Ranchi
7/25/2019 01e Sensitivity Analysis and Duality
5/42
Revisiting Product Mix Problem (contd.)
5
Primal Problem:
ZMax.= 4 X1+2X2+3X3
Subject to
7 X1+3 X2+6 X3 150
4 X1+4 X2+5X3 200
X1, X2, X30
X1, X2, X3 are decision variables
Sasadhar Bera, IIM Ranchi
RHS of a constraint
oravailable resources
Profit coefficients
Technological coefficients
7/25/2019 01e Sensitivity Analysis and Duality
6/42
Standard Form of Product Mix Problem (contd.)
6
Objective function: Total profit maximization (ZMAX.)
ZMax.= 4X1+2X2+3X3
Subject to
7X1+3X2+6X3150
4X1+4X2+5X3200
X1, X2, X30
Standard form of above LP:
ZMax= 4x1+ 2x2+ 3x3
subject to
7x1 + 3x2 + 6x3 + s1 = 1504x1 + 4x2+ 5x3 + s2= 200
x1, x2, x3, s1, s2 0
s1,s2 are called slack variables
Sasadhar Bera, IIM Ranchi
7/25/2019 01e Sensitivity Analysis and Duality
7/42
MS Excel Output
7Sasadhar Bera, IIM Ranchi
Target Cell (Max)
Cell Name Original Value Final Value
$D$7 Total Profit 12 100
Adjustable Cells
Cell Name Original Value Final Value
$E$5 Nos of Production A 1 0
$F$5 Nos of Production B 1 50
$G$5 Nos of Production C 2 0
Constraints
Cell Name Cell Value Formula Status Slack
$I$10 Labour Constraint 150 $I$10
7/25/2019 01e Sensitivity Analysis and Duality
8/42
MS Excel Output (contd.)
8Sasadhar Bera, IIM Ranchi
For first constraint:
7X1+3X2+6X3= 7*0 + 3*50 + 6*0 = 150 = RHS value of firstconstraint. Hence total labour resource is fully utilized. It is
called binding constraint.
For second constraint:4X1+4X2+5X3= 4*0 + 4*50 + 5*0 = 200 = RHS value of second
constraint. Hence total raw material is fully utilized. It is also a
binding constraint.
In case of nonbinding constraint LHS value is not equal to RHS
value.
7/25/2019 01e Sensitivity Analysis and Duality
9/42
MS Excel Output
9Sasadhar Bera, IIM Ranchi
Adjustable Cells
Final Reduced Objective Allowable Allowable
Cell Name Value Cost Coefficient Increase Decrease
$E$5 Nos of Production A 0 -0.667 4 0.667 Infinity
$F$5 Nos of Production B 50 0 2 Infinity 0.286
$G$5 Nos of Production C 0 -1 3 1 Infinity
Constraints
Final Shadow Constraint Allowable Allowable
Cell Name Value Price R.H. Side Increase Decrease
$I$10 Labour Constraint 150 0.667 150 0 150
$I$11 Material Constraint 200 0 200 infinity 0
Sensitivity Analysis Output
7/25/2019 01e Sensitivity Analysis and Duality
10/42
MS Excel Output Illustration
10Sasadhar Bera, IIM Ranchi
Reduced cost: The reduced cost indicates how much each
objective function coefficient has to improve (increase for
maximization problem and decrease for minimization
problem) before the corresponding decision variable could
assume apositive value in optimal solution.
Physical interpretation of reduced cost: The reduced cost
for each variable (here each product) equals its per unit
marginal profit minus the per unit cost of the resources it
consumes.
Increasing or decreasing the objective function coefficient of
a decision variable equal to reduced cost has resulted an
alternative solution.
What is Reduced Cost?
7/25/2019 01e Sensitivity Analysis and Duality
11/42
MS Excel Output Illustration
11Sasadhar Bera, IIM Ranchi
The sensitivity analysis output table shows that the Final
Value of X2 already has positive value. Thus the reduced
cost is zero.
What is Reduced Cost? (contd.)
Adjustable Cells
Final Reduced Objective Allowable AllowableCell Name Value Cost Coefficient Increase Decrease
$E$5 Nos of Production A 0 -0.667 4 0.667 Infinity
$F$5 Nos of Production B 50 0 2 Infinity 0.286
$G$5 Nos of Production C 0 -1 3 1 Infinity
7/25/2019 01e Sensitivity Analysis and Duality
12/42
MS Excel Output Illustration
12Sasadhar Bera, IIM Ranchi
In case of X1 and X3, FinalValueare zero. Thus the reduced
cost is non-zero.
For X1, it means that unless the profit contribution (c1) of A
type of model is increased to (4+0.667 =) 4.667 or more, the
value of X1will not come as nonzero in optimal solution. If c1is exactly increased to 4.667, then there will have an
alternative solution.
Similarly, for X3, it means that unless the profit contribution(c3) of C type of model is increased to (3+1 =) 4 or more,
the value of X3will not come as nonzero in optimal solution.
If c3 is exactly increased to 4, then there will have an
alternative solution.
What is Reduced Cost? (contd.)
7/25/2019 01e Sensitivity Analysis and Duality
13/42
MS Excel Output Illustration
13Sasadhar Bera, IIM Ranchi
Range of Optimality
The range of optimality is calculated using Allowable
Increase and Allowable Decrease columns in AdjustmentCellsof sensitivity output table.
Range of optimality: The range of value for each coefficient
of an objective function over which the solution will remain
optimal (i.e. optimal values of the decision variableswould
not change).
100% rule: There may be simultaneous change of more than
one objective function coefficients. If the sum of theabsolute percent change (with respect to allowable change)
of all the coefficients does not exceed 100%, then the
original optimal solution was still be optimal. If it changes by
more than 100%, we cannot be sure.
7/25/2019 01e Sensitivity Analysis and Duality
14/42
MS Excel Output Illustration
14Sasadhar Bera, IIM Ranchi
Range of Optimality (contd.)
For above output table, optimum value for X1 (Model type A)
is 0, the objective coefficient is 4, allowable increase is
0.667, and allowable decrease is . Hence the range ofoptimality of c1is: c1(4+0.667)
Similarly, the range of optimality for c2(model type B) is:
(2-0.286) c2 +
Adjustable Cells
Final Reduced Objective Allowable Allowable
Cell Name Value Cost Coefficient Increase Decrease
$E$5 Nos of Production A 0 -0.667 4 0.667 Infinity
$F$5 Nos of Production B 50 0 2 Infinity 0.286
$G$5 Nos of Production C 0 -1 3 1 Infinity
7/25/2019 01e Sensitivity Analysis and Duality
15/42
MS Excel Output Illustration
15Sasadhar Bera, IIM Ranchi
Range of Optimality (contd.)
Similarly, the range of optimality for c3(model type C) is:
c3 (3+1)
Range of insignificance: The range in value over which an
objective function coefficient can change without causing
the corresponding decision variable to take a nonzero value.
7/25/2019 01e Sensitivity Analysis and Duality
16/42
MS Excel Output Illustration
16
Shadow Price: The shadow price of a constraint indicates
the change in the optimal value of the objective function
when the right hand side (RHS) of the same constraint
changes by one unit, assuming all other coefficients
remain constant. Shadow price may be positive or
negative.
Range of Feasibility: The range of feasibility for RHS of a
constraint is the range for which the shadow priceremains unchanged for that particular constraint.
Sasadhar Bera, IIM Ranchi
Shadow Price and Range of Feasibility
7/25/2019 01e Sensitivity Analysis and Duality
17/42
MS Excel Output Illustration
17Sasadhar Bera, IIM Ranchi
Shadow Price (contd.)
The FinalValuecolumn represents the Final LHS of labour
and material constraint each separately.
The Shadow Price column provides the shadow price of
each constraint.
The Constraint R.H. Side column provides available
resources for labour and material.
Constraints
Final Shadow Constraint Allowable Allowable
Cell Name Value Price R.H. Side Increase Decrease
$I$10 Labour Constraint 150 0.667 150 0 150
$I$11 Material Constraint 200 0 200 infinity 0
7/25/2019 01e Sensitivity Analysis and Duality
18/42
MS Excel Output Illustration
18
For first constraint, shadow price is +0.667, which indicates
that if we decreases number of labour (b1) from 150 to 149
then the objective function value (profit) decreases to 100
to 99.333. (i.e. 100 -1*(+0.667) = 99.333)
For second constraint, shadow price is 0, which indicates
that if number of material unit (b2) increases from 200 to
201 then there will be no change in the objective function
value (profit).
Sasadhar Bera, IIM Ranchi
Shadow Price (contd.)
7/25/2019 01e Sensitivity Analysis and Duality
19/42
MS Excel Output Illustration
19Sasadhar Bera, IIM Ranchi
Some software (LINGO) provides dual price which is used todescribe the shadow price. Shadow price and Dual price are
same in sign for maximization problem. In case of
minimization problem, Shadow price and Dual price are in
opposite sign.
It is to be noted that shadow price of a non-binding
constraintis zero.
Shadow Price (contd.)
7/25/2019 01e Sensitivity Analysis and Duality
20/42
MS Excel Output Illustration
20Sasadhar Bera, IIM Ranchi
The range of feasibility is calculated using Allowable Increaseand Allowable Decrease columns of above sensitivity output
table.
For labour constraint, range of feasibility:
Lower bound = 150 - 150 = 0, Upper bound = 150 + 0 = 1500 b1 150
For material constraint, range of feasibility:
Lower bound = 2000 = 200, Upper bound= Infinity
200 b2 +
Range of Feasibility
Constraints
Final Shadow Constraint Allowable Allowable
Cell Name Value Price R.H. Side Increase Decrease
$I$10 Labour Constraint 150 0.667 150 0 150
$I$11 Material Constraint 200 0 200 infinity 0
7/25/2019 01e Sensitivity Analysis and Duality
21/42
Sensitivity Analysis
21Sasadhar Bera, IIM Ranchi
Sensitivity analysis is the study of how the optimal solution
will be impacted with the changes in the different
coefficients of a linear program. Using the sensitivityanalysis we can answer how optimal solution affect under
the following conditions:
1. Change in the objective function coefficient (ci
)
2. Change in resources (RHS of a constraint) (bi)
3. Change in technological coefficients (aij)
4. Addition of a new decision variable5. Addition of a new constraint
Sensitivity analysis is also referred to as postoptimality
analysis.
7/25/2019 01e Sensitivity Analysis and Duality
22/42
Why Sensitivity Analysis is Important?
22Sasadhar Bera, IIM Ranchi
1) Values of LP parameters might change
If a parameter changes, sensitivity analysis shows
whether is it necessary to re-solve the problem
again?
2) Uncertainty about LP parameters
Even if demand is uncertain, manager of a
company can be fairly confident that it can still
produce optimal amounts of products.
7/25/2019 01e Sensitivity Analysis and Duality
23/42
Sensitivity Analysis
23Sasadhar Bera, IIM Ranchi
Range of optimality of each coefficients of an objective
function provides us the sensitivity of objective function
coefficient.
Values in the AllowableIncreaseand AllowableDecrease
columns in adjustment Cells of sensitivity analysis reportindicate the amounts by which an objective function
coefficient can be changed without changing the optimal
solution, assuming all other coefficients remain constant.
It is to be noted that the objective function value (Z) would
change due to change in profit (or cost ) coefficient within
the range of optimality.
Change in only one coefficient (ci) of a objective function
7/25/2019 01e Sensitivity Analysis and Duality
24/42
Sensitivity Analysis
24Sasadhar Bera, IIM Ranchi
You would like to know what would happen to your optimal
solution when multiple profit (or cost) coefficients are
different than what you expected.
In the above situation, 100% rule is applicable. This rule says
that if the sum of the absolute percent change (with respect
to allowable increase or decease) of all the coefficients does
not exceed 100%, then the original optimal solution will still
be optimal. If it changes by more than 100%, we cannot be
sure.
Change in more than one coefficient (ci) simultaneously
7/25/2019 01e Sensitivity Analysis and Duality
25/42
Sensitivity Analysis
25Sasadhar Bera, IIM Ranchi
The percentage change for a coefficient value can be
calculated as:
Absolute[(New Value Old Value) / Allowable increase or
decrease]
For example: when coefficient value 300 changes to 600
and the allowable increase is 900 you get a proportional
change of (600-300)/900 which equals approximately
33.33%.
Calculating a Percentage Change
7/25/2019 01e Sensitivity Analysis and Duality
26/42
Sensitivity Analysis
26Sasadhar Bera, IIM Ranchi
The RHS value of a constraint represents the resources
available to the firm. The resources could be labour hours,
machine hours, money, and material etc.
Sensitivity analysis of these resources help to answer howadditional resources could be used to realize higher profit.
If the RHS of a constraint is changed, the feasible region
will change (unless the constraint is redundant) and oftenoptimal solution changes.
Change in resources (RHS of a constraint) (bi)
7/25/2019 01e Sensitivity Analysis and Duality
27/42
Sensitivity Analysis
27Sasadhar Bera, IIM Ranchi
Shadow prices (or dual price) only indicates the change
that occur in the objective function value that results from
one unit change in RHS value of a constraint.
Shadow prices for nonbinding constraints are always
zero.
Changing a RHS value for a binding constraint also
changes the feasible region and the optimal solution.
To find the optimal solution after changing a binding
RHS value, we must re-solve the problem.
Change in resources (RHS of a constraint) (bi) (contd.)
7/25/2019 01e Sensitivity Analysis and Duality
28/42
Sensitivity Analysis
28Sasadhar Bera, IIM Ranchi
Technological coefficients reflect changes in coefficients in
the LHS of a constraint because of labour, raw material andtechnology etc. Changes of technological coefficients can
significantly changes the shape of the feasible region and
hence in optimal profit or cost value (Z) .
The changes of technological coefficient can be two types:
1) Change of aij coefficient in nonbasic columns
2) Change of aij coefficient in basic columns
Refer book Operations Research by H. M. Taha for above two
types of sensitivity analysis.
Change in Technological Coefficient (aij)
7/25/2019 01e Sensitivity Analysis and Duality
29/42
Sensitivity Analysis
29Sasadhar Bera, IIM Ranchi
After addition of a column vector with a new decision
variable (Xn+1) we have to calculate the (zjcj) in 0throw for
(n+1)th variable. If (zj cj) 0 for minimization problem
then the current solution is optimal. On the other hand, if
(zj cj) 0 then Xn+1 is introduced into the basis and the
simplex method continues to find the new optimalsolution.
For understanding of (zjcj) value and 0throw refer to Operations
Research by H. M. Taha.
Adding a new decision variable or activity
l
7/25/2019 01e Sensitivity Analysis and Duality
30/42
Sensitivity Analysis
30Sasadhar Bera, IIM Ranchi
If the optimal solutions satisfy the new constraint then
current optimal solution is still be best solution.
If the optimal solutions does not satisfy the new constraint
then dual simplex method is used to find the new optimalsolution to an LP with added constraint.
For dual simplex method refer Operations Research by H. M.
Taha.
Adding a new constraint
i i i l i i i f l
7/25/2019 01e Sensitivity Analysis and Duality
31/42
Sensitivity Analysis using Microsoft Solver
31Sasadhar Bera, IIM Ranchi
Microsoft solvers sensitivity analysis report performs
two types of sensitivity analysis:
i. On the coefficient of the objective function
ii. On the right hand side of a constraint
7/25/2019 01e Sensitivity Analysis and Duality
32/42
Duality
32Sasadhar Bera, IIM Ranchi
Every linear programming (LP) problem can have two
forms:
1) Primal
2) Dual
The original formulation of a linear programming problem
is called Primal or Primal Problem.
Another linear program associated with Primal is called its
dual which is involving a different set of variables, butsharing the same data.
P i l d D l
7/25/2019 01e Sensitivity Analysis and Duality
33/42
Primal and Dual
33Sasadhar Bera, IIM Ranchi
Primal: ZMax= c1 x1+ c2 x2+ . . .+cn xn
subject to
a11x1 + a12 x2+ . . . + a1n xn b1a21x1 + a22 x2 + . . . + a2n xn b2
. . . . . . .
am1x1 + am2 x2 + . . . + amn xnbm
x1, x2, .., xn0
Dual: YMin= w1 b1+ w2 b2+ . . .+ wm bm
subject to
a11w1 + a21 w2+ . . . + am1 wm c1
a12
w1
+ a22
w2
+ . . . + am2
wm
c2
. . . . . . .
a1nw1 + a2n w2 + . . . + amn wncn
w1, w2, .., wm0
wi indicates price paid for per unit of ithresource
Profit per unit
Resources
Dual variable
E i I i f D l
7/25/2019 01e Sensitivity Analysis and Duality
34/42
Economic Interpretation of Dual
34Sasadhar Bera, IIM Ranchi
Primal objective function: Maximization of profit subject to
availability of limited resources.
Dual objective function: Minimization of the total implicit
value of resources consumed by the different activities.
xj: Quantity of jthtype product, j = 1, 2, . .,n.
wi: Price paid for per unit of ithresource, i = 1, 2, . .,m.
The dual variables are interpreted as thecontribution to profit
per unit of resource. For this reason, dual variables are often
referred to as resource shadow prices.
Dual variables are used to determine the marginal values of
resources i. e. how much profit for one unit of each resource is
equivalent to.
7/25/2019 01e Sensitivity Analysis and Duality
35/42
Economic Interpretation of Dual (contd.)
35Sasadhar Bera, IIM Ranchi
Meaning of primal constraint:
(ai1 x1 + ai2 x2 + . . . + ain xn) bi represents totalconsumed resources should be at most available resource,
where i = 1, 2, . .,m.
Meaning of dual constraint:
(a1j w1 + a2j w2 + . . . + amj wm) cj represents the
minimum cj unit profit should be paid for the resources
needed to produce the jth type of product.
7/25/2019 01e Sensitivity Analysis and Duality
36/42
Formulation of Dual
36Sasadhar Bera, IIM Ranchi
If Primal is Minimization problem then dual is Maximization
Problem and vice versa.
There is exactly one dual variable for each primal constraint
and exactly one dual constraint for each primal variable.
Primal-dual relationship table (shown in next slide) is useful
to put dual variable restriction and inequality sign (,or = )
in each constraint.
7/25/2019 01e Sensitivity Analysis and Duality
37/42
Primal and Dual Relationship
37Sasadhar Bera, IIM Ranchi
Minimization
Problem
Maximization
Problem
Variables
0
Constraints0
Unrestricted =
Constraints
0
Variables 0
=
Unrestricted
7/25/2019 01e Sensitivity Analysis and Duality
38/42
Formulation of Dual (contd.)
38Sasadhar Bera, IIM Ranchi
Ex1:
Primal: Maximize 6x1 + 8x2
subject to 3x1+ x2 4
5x1+ 2x27
x1, x20
Dual: Minimize 4w1+ 7w2
subject to 3w1 + 5w2 6
w1 + 2w2 8w1, w20
7/25/2019 01e Sensitivity Analysis and Duality
39/42
Formulation of Dual(contd.)
39Sasadhar Bera, IIM Ranchi
EX2:
Primal: Minimize 6x1+ 8x2
subject to 3x1 + x2 - x3 = 4
5x1 + 2x2 - x4 = 7
x1, x2, x3, x4 0
Dual: Maximize 4w1+ 7w2
subject to 3w1 + 5w26
w1 + 2w28- w1 0
- w2 0
w1, w2 unrestricted
Formulation of Dual
7/25/2019 01e Sensitivity Analysis and Duality
40/42
Formulation of Dual (contd.)
40Sasadhar Bera, IIM Ranchi
EX3:
Primal: Minimize -12 x1+ 13 x2+ 15 x3
subject to-2x1 + x2 + 3x3 + x4 15
2x1 + x3 +3x4 14
+2x2 + x3 + x4 = 16
x10 x
2, x
30, x
4unrestricted
Dual: Maximize 15 w1+ 14 w2+ 16 w3
subject to
-2w1 + 2w2 -12
w1 + 2w3 13
3w1 + w2 + w3 15
w1 + 3w2 + w3 = 0
w10 w20, w3unrestricted
Ad t f D l Li P i
7/25/2019 01e Sensitivity Analysis and Duality
41/42
Advantages of Dual Linear Programming
41Sasadhar Bera, IIM Ranchi
The optimal value of the objective function of the primal
problem equals the optimal value of the objective function
of the dual problem.
Solving the dual might be computationally more efficient
when the primal has large number of constraints and few
variables.
EX: Let us consider a Primal Linear Programming problem
has 8 variables and 800 constraints. Maximum number of
iterations required to solve Primal is high as the number of
constraints is large. In such situation, Dual LP converts thesame optimization problem with 800 variables and 8
constraints. Hence, computational time is less for dual LP as
it has fewer constraints.
7/25/2019 01e Sensitivity Analysis and Duality
42/42
Advantages of Dual LP (contd.)
Lets consider a situation where an analyst has overlooked
a constraint in the model during problem formulationstage. In the solution development stage, analyst wants to
incorporate this new constraint. In such instances, it is
sometimes difficult to find a starting basic solution that is
feasible to linear programming. Using dual LP, it is oftenpossible to find out optimal solution.