In linear programming problems, each variable has a corresponding reduced cost. To access the reduced cost of a variable,
add the suffix .rc
or .dual
to the variable name. These two suffixes are interchangeable.
The reduced cost of a variable is the rate at which the objective value changes when the value of that variable changes. At optimality, basic variables have a reduced cost of zero; a nonbasic variable with zero reduced cost indicates the existence of multiple optimal solutions.
In nonlinear programming problems, the reduced cost interpretation does not apply. The .dual
and .rc
variable suffixes represent the gradient of the Lagrangian function, computed using the values returned by the solver.
The following example illustrates the use of the .rc
suffix:
proc optmodel; var x >= 0, y >= 0, z >= 0; max cost = 4*x + 3*y - 5*z; con -x + y + 5*z <= 15, 3*x - 2*y - z <= 12, 2*x + 4*y + 2*z <= 16; solve; print x y z; print x.rc y.rc z.rc;
The PRINT statements generate the output shown in Figure 5.57.
In this example, x
and y
are basic variables, while z
is nonbasic. The reduced cost of z
is –6.5, which implies that increasing z
from 0 to 1 decreases the optimal value from 24.5 to 18.