Linear Programming - Sensitivity Analysis - Using Solver
Linear Programming - Sensitivity Analysis - Using Solver
OR-Notes
J E Beasley
OR-Notes are a series of introductory notes on topics that fall under
the broad heading of the field of operations research (OR). They were originally
used by me
in an introductory OR course I give at Imperial College. They
are now available for use by any students and teachers interested in OR
subject to the following
conditions.
Variant 1 2 3 2 1.50
2 4 2 3 2.50
3 3 3 2 3.00
4 7 4 5 4.50
Given the current state of the labour force the company estimate that,
each year, they have 100000 minutes of assembly time, 50000 minutes of
polishing
time and 60000 minutes of packing time available. How many of
each variant should the company make per year and what is the associated
profit?
Suppose now that the company is free to decide how much time to devote
to each of the three operations (assembly, polishing and packing) within
the
total allowable time of 210000 (= 100000 + 50000 + 60000) minutes.
How many of each variant should the company make per year and what is the
associated profit?
Variables
people.brunel.ac.uk/~mastjjb/jeb/or/lpsens_solver.html 1/7
11/4/21, 11:37 AM Linear programming - sensitivity analysis - using Solver
Let:
Constraints
The operation time limits depend upon the situation being considered.
In the first situation, where the maximum time that can be spent on each
operation is
specified, we simply have:
In the second situation, where the only limitation is on the total time
spent on all operations, we simply have:
Objective
people.brunel.ac.uk/~mastjjb/jeb/or/lpsens_solver.html 2/7
11/4/21, 11:37 AM Linear programming - sensitivity analysis - using Solver
Below we solve this LP with the Solver add-in that comes with Microsoft
Excel.
Look at Sheet A in lp.xls and to use Solver do Tools and then Solver.
In the version of Excel I am using (different versions of Excel have slightly
different
Solver formats) you will get the Solver model as below:
but where now we have highlighted (clicked on) two of the Reports available
- Answer and Sensitivity. Click OK and you will find that two new sheets
have
been added to the spreadsheet - an Answer Report and a Sensitivity
Report.
Answer Report
people.brunel.ac.uk/~mastjjb/jeb/or/lpsens_solver.html 3/7
11/4/21, 11:37 AM Linear programming - sensitivity analysis - using Solver
We can see that the optimal solution to the LP has value 58000 (£)
and that Tass=82000, Tpol=50000, Tpac=60000,
X1=0, X2=16000, X3=6000 and X4=0.
Note that we had three constraints for total assembly, total polishing
and total packing time in our LP. The assembly time constraint is declared
to be 'Not
Binding' whilst the other two constraints are declared to be
'Binding'. Constraints with a 'Slack' value of zero are said to be tight
or binding in that they are
satisfied with equality at the LP optimal.
Constraints which are not tight are called loose or not binding.
Sensitivity Report
people.brunel.ac.uk/~mastjjb/jeb/or/lpsens_solver.html 4/7
11/4/21, 11:37 AM Linear programming - sensitivity analysis - using Solver
We deal with each of these in turn, and note here that the analysis
presented below ONLY applies for a single change, if two or more things
change then we
effectively need to resolve the LP.
people.brunel.ac.uk/~mastjjb/jeb/or/lpsens_solver.html 5/7
11/4/21, 11:37 AM Linear programming - sensitivity analysis - using Solver
For the variables, the Reduced Cost column gives us, for each variable
which is currently zero (X1 and X4), an estimate
of how much the objective function will
change if we make (force) that
variable to be non-zero. Note here that the value in the Reduced Cost column
for a variable is often called the 'opportunity cost'
for the variable.
or X1>=A X4>=B
where we ignore the sign of the reduced cost when constructing the above
table. The objective function will always get worse (go down if we have
a
maximisation problem, go up if we have a minimisation problem) by at
least this estimate. The larger A or B are the more inaccurate this estimate
is of the exact
change that would occur if we were to resolve the LP with
the corresponding constraint for the new value of X1 or X4
added.
For each constraint the column headed Shadow Price tells us exactly
how much the objective function will change if we change the right-hand
side of the
corresponding constraint within the limits given in the Allowable
Increase/Decrease columns
For example for the polish constraint, provided the right-hand side
of that constraint remains between 50000 + 40000 =90000 and 50000 - 10000
= 40000 the
objective function change will be exactly 0.80[change in right-hand
side from 50000].
people.brunel.ac.uk/~mastjjb/jeb/or/lpsens_solver.html 6/7
11/4/21, 11:37 AM Linear programming - sensitivity analysis - using Solver
The direction of the change in the objective function (up or down) depends
upon the direction of the change in the right-hand side of the constraint
and the
nature of the objective (maximise or minimise).
Hence
if you had an extra 100 hours to which operation would you assign it?
if you had to take 50 hours away from polishing or packing which one
would you choose?
what would the new objective function value be in these two cases?
The value in the column headed Shadow Price for a constraint is often
called the 'marginal value' or 'dual value' for that constraint.
Note that, as would seem logical, if the constraint is loose the shadow
price is zero (as if the constraint is loose a small change in the right-hand
side cannot alter
the optimal solution).
Comments
Note here that, as mentioned above, the analysis given above relating
to:
is only valid for a single change. If two (or more) changes are made
the situation becomes more complex and it becomes advisable to resolve
the LP.
people.brunel.ac.uk/~mastjjb/jeb/or/lpsens_solver.html 7/7