Sensitivity analysis
Explains how to obtain sensitivity information on variables and constraints.
Finding the optimal solution to a linear programming model is important, but very often you need to know what happens when data values are changed. You need sensitivity information such as the reduced cost, or the basis status for variables.
Some types of sensitivity information are made available by IBM® ILOG OPL.
Basis status
Reduced cost or opportunity cost
Information on constraints
Basis status
You can get the basis status by calling the method getBasisStatus on a IloOplCplexBasis object. This API is documented in the IBM ILOG® Script Extensions Reference Manual. See also mulprod_main.mod for an example.
Reduced cost or opportunity cost
The reduced cost provides the rate of change in the objective for each nonbasic variable as it moves from the bound at which it resides. The most common type of variable has a lower bound of 0 and an infinite upper bound. In this case, the reduced cost indicates the rate of change in the objective as the variable moves to a nonzero value.
If v is
a decision variable, call:
v.reducedCost
See also Displaying results.
Information on constraints
For constraints, the dual variable measures the rate of change in the objective as the right hand side of the constraint changes. For example, with a capacity constraint, the dual variable measures the improvement in the objective per unit of additional capacity.
Table 1 summarizes
what information you can get on a constraint c.
| To get | Call |
|---|---|
| the value of the associated dual variable | c.dual |
| the slack | c.slack |
| the lower bound | c.LB |
| the upper bound | c.UB |
This API is documented in the IBM ILOG Script Extensions Reference Manual. You can also read this information in the Problem Browser of the IDE by clicking a constraint label after a run configuration has been executed.