0

Reduced cost give the dual variable corresponding to a box constraint of a variable as was pointed out in the related answer to this question: LP: postive reduced costs corresponding to positive variables?

How do I know whether the lower or upper bound is the active constraint? Of course, I could check whether the difference between the variable value and its bounds is smaller than some epsilon. However, the choice of such an epsilon is unclear to me, because a model could potentially attempt to fix a variable by setting the lower bound equal to the upper bound. In such a case, no epsilon could unambiguously indicate which of the bounds is the active one.

Does cplex provide the information which bound is active in its C++ api? Does any other LP solver do so? Is there another trick to figure out the active bound? Thank you.

1 Answers1

0

To a large extent you can look at the sign. The rule for reduced costs is:

               Basic   Non-basic-at-LB     Non-basic-at-UB      
minimization     0           >= 0               <= 0
maximization     0           <= 0               >= 0

Some problems with this:

  • Not all solvers may follow this (especially when maximizing).
  • Degeneracy may make things difficult

Most solvers will give you access to the basis status. E.g. Cplex has BasisStatus which gives you exactly the basis status of a variable: Basic, AtLower, AtUpper or FreeOrSuperbasic.

Erwin Kalvelagen
  • 15,677
  • 2
  • 14
  • 39