You are on page 1of 42

# Sensitivity Analysis and Duality

## Standard form of Linear Programming (LP)

Minimization Problem
Objective function = ZMin = Minimum (c1 x1 + c2 x2 + . . . . +cn xn)
subject to
a11 x1 + a12 x2 + . .
a21 x1 + a22 x2 + . .
.
.
. .
.
.
. .
am1 x1 + am2 x2 + . .
x1 , x2 , x3, .., xn 0

. + a1n xn = b1
. + a2n xn = b2
.
.
.
.
.
.
. + amn xn = bm

## Notation: c1, c2, . . .,cn are cost coefficients.

b1, b2, . . .,bm are available resources.
a11, a12, . . ., amn are technological coefficients.
In matrix notation:
ZMin = C1n Xn1

subject to
Amn Xn1 = bm1
Xn1 0

## Revisiting Product Mix Problem

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
Availability
requirement
Resource
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

## Revisiting Product Mix Problem (contd.)

Decision Variables
X1 = Number of A type model produced
X2 = Number of B type model produced
X3 = Number of C type model produced

## Objective function: Total profit maximization (ZMAX.)

ZMax. = 4X1 +2X2 +3X3
Objective function
Subject to
Labour constraint
7X1 +3X2 +6X3 150
Material constraint
4X1 +4X2 +5X3 200
X1 , X2, X3 0
Boundary Constraint
Sasadhar Bera, IIM Ranchi

## Revisiting Product Mix Problem (contd.)

Primal Problem:
Profit coefficients
Technological coefficients

## ZMax. = 4 X1 +2X2 +3X3

Subject to

RHS of a constraint
or
available resources

7 X1 +3 X2 +6 X3 150
4 X1 +4 X2 +5X3 200
X1 , X2, X3 0

## X1 , X2 , X3 are decision variables

Sasadhar Bera, IIM Ranchi

## Standard Form of Product Mix Problem (contd.)

Objective function: Total profit maximization (ZMAX.)
ZMax. = 4X1 +2X2 +3X3
Subject to
7X1 +3X2 +6X3 150
4X1 +4X2 +5X3 200
X1 , X2 , X 3 0

## Standard form of above LP:

ZMax = 4x1 + 2x2 + 3x3
subject to
7x1 + 3x2 + 6x3 + s1 = 150
4x1 + 4x2 + 5x3 + s2 = 200
x1, x2, x3 , s1, s2 0
s1 ,s2 are called slack variables
Sasadhar Bera, IIM Ranchi

MS Excel Output
Target Cell (Max)
Cell

\$D\$7
Adjustable Cells
Cell

Name

Total Profit
Name

12

100

## Original Value Final Value

\$E\$5
\$F\$5
\$G\$5

Nos of Production A
Nos of Production B
Nos of Production C

1
1
2

Cell
\$I\$10
\$I\$11

Name
Labour Constraint
Material Constraint

Cell Value
150
200

0
50
0

Constraints
Formula
Status Slack
\$I\$10<=\$K\$10 Binding 0
\$I\$11<=\$K\$11 Binding 0

## Total Profit = ZMax = 100,

Optimal numbers of model A : X1 = 0,
Optimal numbers of model B: X2 = 50,
Optimal numbers of model C: X3 = 0
Output tells us that company should not produce model A and
model C.
Sasadhar Bera, IIM Ranchi

## MS Excel Output (contd.)

For first constraint:
7X1 +3X2 +6X3 = 7*0 + 3*50 + 6*0 = 150 = RHS value of first
constraint. 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.
Sasadhar Bera, IIM Ranchi

MS Excel Output
Sensitivity Analysis Output
Adjustable Cells
Cell

Final
Value

Name

## Reduced Objective Allowable Allowable

Cost Coefficient Increase Decrease

-0.667

0.667

Infinity

50

Infinity

0.286

-1

Infinity

Constraints

Cell

Name

Final
Value

## Shadow Constraint Allowable Allowable

Price
R.H. Side Increase Decrease

\$I\$10

Labour Constraint

150

0.667

150

150

200

200

infinity

## MS Excel Output Illustration

What is Reduced Cost?

## 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 a positive 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.
10
Sasadhar Bera, IIM Ranchi

## MS Excel Output Illustration

What is Reduced Cost? (contd.)
Adjustable Cells
Final Reduced Objective Allowable Allowable
Value
Cost Coefficient Increase Decrease

Cell

Name

\$E\$5

Nos of Production A

-0.667

0.667

Infinity

\$F\$5

Nos of Production B

50

Infinity

0.286

-1

Infinity

## The sensitivity analysis output table shows that the Final

Value of X2 already has positive value. Thus the reduced
cost is zero.

11
Sasadhar Bera, IIM Ranchi

## MS Excel Output Illustration

What is Reduced Cost? (contd.)

In case of X1 and X3, Final Value are 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 X1 will not come as nonzero in optimal solution. If c1
is 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 X3 will not come as nonzero in optimal solution.
If c3 is exactly increased to 4, then there will have an
alternative solution.
Sasadhar Bera, IIM Ranchi

12

## MS Excel Output Illustration

Range of Optimality

## The range of optimality is calculated using Allowable

Increase and Allowable Decrease columns in Adjustment
Cells of 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 variables would
not change).

## 100% rule: There may be simultaneous change of more than

one objective function coefficients. If the sum of the
absolute 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.
13
Sasadhar Bera, IIM Ranchi

## MS Excel Output Illustration

Range of Optimality (contd.)
Adjustable Cells
Final Reduced Objective Allowable Allowable
Value
Cost Coefficient Increase Decrease

Cell

Name

\$E\$5

Nos of Production A

-0.667

0.667

Infinity

\$F\$5

Nos of Production B

50

Infinity

0.286

-1

Infinity

## 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 of
optimality of c1 is: c1 (4+0.667)
Similarly, the range of optimality for c2 (model type B) is:
(2-0.286) c2 +
Sasadhar Bera, IIM Ranchi

14

## MS Excel Output Illustration

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.

15

## MS Excel Output Illustration

Shadow Price and Range of Feasibility

## 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 price
remains unchanged for that particular constraint.

16

## MS Excel Output Illustration

Shadow Price (contd.)
Constraints
Final Shadow Constraint Allowable Allowable
Value
Price R.H. Side Increase Decrease

Cell

Name

\$I\$10

Labour Constraint

150

0.667

150

150

\$I\$11

Material Constraint

200

200

infinity

## The Final Value column 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.
Sasadhar Bera, IIM Ranchi

17

## MS Excel Output Illustration

Shadow Price (contd.)

## 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).

18

## MS Excel Output Illustration

Shadow Price (contd.)

## Some software (LINGO) provides dual price which is used to

describe 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
constraint is zero.

19

## MS Excel Output Illustration

Range of Feasibility
Constraints
Final Shadow Constraint Allowable Allowable
Value
Price R.H. Side Increase Decrease

Cell

Name

\$I\$10

Labour Constraint

150

0.667

150

150

\$I\$11

Material Constraint

200

200

infinity

## The range of feasibility is calculated using Allowable Increase

and Allowable Decrease columns of above sensitivity output
table.
For labour constraint, range of feasibility:
Lower bound = 150 - 150 = 0, Upper bound = 150 + 0 = 150
0 b1 150
For material constraint, range of feasibility:
Lower bound = 200 0 = 200, Upper bound= Infinity
200 b2 +

## Sasadhar Bera, IIM Ranchi

20

Sensitivity Analysis
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 sensitivity
analysis 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 variable
5. Addition of a new constraint
Sensitivity analysis is also referred to as postoptimality
analysis.
21
Sasadhar Bera, IIM Ranchi

## Why Sensitivity Analysis is Important?

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.

## Sasadhar Bera, IIM Ranchi

22

Sensitivity Analysis
Change in only one coefficient (ci) of a objective function

## Range of optimality of each coefficients of an objective

function provides us the sensitivity of objective function
coefficient.
Values in the Allowable Increase and Allowable Decrease
columns in adjustment Cells of sensitivity analysis report
indicate 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.
Sasadhar Bera, IIM Ranchi

23

Sensitivity Analysis
Change in more than one coefficient (ci) simultaneously

## 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.

## Sasadhar Bera, IIM Ranchi

24

Sensitivity Analysis
Calculating a Percentage Change

## 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%.

## Sasadhar Bera, IIM Ranchi

25

Sensitivity Analysis
Change in resources (RHS of a constraint) (bi)

## 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 how

additional 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 often
optimal solution changes.

## Sasadhar Bera, IIM Ranchi

26

Sensitivity Analysis
Change in resources (RHS of a constraint) (bi) (contd.)

## 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.
Sasadhar Bera, IIM Ranchi

27

Sensitivity Analysis
Change in Technological Coefficient (aij)

## Technological coefficients reflect changes in coefficients in

the LHS of a constraint because of labour, raw material and
technology 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.
Sasadhar Bera, IIM Ranchi

28

Sensitivity Analysis
Adding a new decision variable or activity

## After addition of a column vector with a new decision

variable (Xn+1) we have to calculate the (zj cj) in 0th row 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 optimal
solution.
For understanding of (zj cj) value and 0th row refer to Operations
Research by H. M. Taha.

## Sasadhar Bera, IIM Ranchi

29

Sensitivity Analysis
Adding a new constraint

## 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 optimal
solution to an LP with added constraint.
For dual simplex method refer Operations Research by H. M.
Taha.

30

## Sensitivity Analysis using Microsoft Solver

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

## Sasadhar Bera, IIM Ranchi

31

Duality
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, but
sharing the same data.

32

## Primal and Dual

Primal: ZMax = c1 x1 + c2 x2 + . . .+cn xn
subject to
a11 x1 + a12 x2 + . . . + a1n xn b1
a21 x1 + a22 x2 + . . . + a2n xn b2
.
.
. . .
.
.
am1 x1 + am2 x2 + . . . + amn xn bm
x1 , x2 , .., xn 0
Dual: YMin = w1 b1 + w2 b2 + . . .+ wm bm
subject to
a11 w1 + a21 w2 + . . . + am1 wm c1
a12 w1 + a22 w2 + . . . + am2 wm c2
.
.
. . .
.
.
a1n w1 + a2n w2 + . . . + amn wn cn
w1 , w2 , .., wm 0

Resources

Dual variable

## wi indicates price paid for per unit of ith resource

33
Sasadhar Bera, IIM Ranchi

## Economic Interpretation of Dual

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 jth type product, j = 1, 2, . .,n.

## wi : Price paid for per unit of ith resource, i = 1, 2, . .,m.

The dual variables are interpreted as the contribution 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.
Sasadhar Bera, IIM Ranchi

34

## Economic Interpretation of Dual (contd.)

Meaning of primal constraint:
(ai1 x1 + ai2 x2 + . . . + ain xn) bi represents total
consumed 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.

## Sasadhar Bera, IIM Ranchi

35

Formulation of Dual
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.

36

## Primal and Dual Relationship

Minimization
Problem

Variables

0
0
Unrestricted

Constraints

Maximization
Problem

0
0

Constraints

Variables

Unrestricted
Sasadhar Bera, IIM Ranchi

37

## Formulation of Dual (contd.)

Ex1:
Primal: Maximize 6x1 + 8x2
subject to 3x1 + x2 4
5x1 + 2x2 7
x1 , x2 0

Dual:

## Minimize 4w1 + 7w2

subject to 3w1 + 5w2 6
w1 + 2w2 8
w1 , w2 0

38

## Formulation of Dual (contd.)

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 + 5w2 6
w1 + 2w2 8
- w1
0
- w2 0
w1, w2 unrestricted
Sasadhar Bera, IIM Ranchi

39

## Formulation of Dual (contd.)

EX3:
Primal: Minimize -12 x1 + 13 x2 + 15 x3
subject to
-2x1 + x2 + 3x3 + x4 15
2x1
+ x3 +3x4 14
+2x2 + x3 + x4 = 16
x1 0 x2, x3 0, x4 unrestricted

Dual: Maximize 15 w1 + 14 w2 + 16 w3
subject to
-2w1 + 2w2
-12
w1
+ 2w3 13
3w1 + w2
+ w3 15
w1 + 3w2
+ w3 = 0
w1 0 w2 0, w3 unrestricted
Sasadhar Bera, IIM Ranchi

40

## Advantages of Dual Linear Programming

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 the
same optimization problem with 800 variables and 8
constraints. Hence, computational time is less for dual LP as
it has fewer constraints.
Sasadhar Bera, IIM Ranchi

41

## Advantages of Dual LP (contd.)

Lets consider a situation where an analyst has overlooked
a constraint in the model during problem formulation
stage. 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 often
possible to find out optimal solution.

42