I just implemented a simple inventory model with two articles and six months.
The problem arises when I wanted to calculate the reduced cost of the sales variable called S_it. It is assumed that there should only be a reduced cost value >0 in those non-basic variables (with a value of zero at best); and the reduced cost must have a value of zero in those basic variables (with a value >0 in the optimum).
But this is not the case, when executing the ampl code, for example, the variable S_26 (with a value of zero in the optimum) also has a cost reduced to zero. Where is the error?
AMPL’s .status suffix can be used to see whether a variable is in the optimal basis returned by the solver. Since the variables are nonnegative, variables that are basic may be positive, and must have zero reduced costs; for example:
This situation, with both the variable’s value and the variable’s reduced cost equal to 0, is actually common. The variable (such as S[2,6]) is said to be “degenerate” in this case.