IBM Support

CPLEX appears to return a solution that violates some constraints or bounds

Question & Answer


Question

Why does CPLEX appear to return a solution that violates some constraints or bounds?

Answer

Possible causes for a solution that appears to violate one or more constraints after a successful optimization run include ill conditioning in the model and inappropriate tolerance settings.

Inaccuracies in the computed solution are possible symptoms of ill conditioning or numerical instability in a model. For more details about this topic, refer to this document.

CPLEX uses a number of tolerance settings that work well for most problems. In some cases, however, these default settings are not appropriate for the specific problem data. Here is a list of tolerance settings related to the feasibility of computed solutions:

  • Parameter CPX_PARAM_EPRHS (IloCplex::EpRHS) specifies the primal and dual simplex feasibility tolerances, or the degree to which the basic variables of a problem might violate their bounds. If the default value of 1e-6 results in unacceptable violations, a smaller value might be used. Note that this consideration applies not only when you are solving straight LPs, but also when you are using the primal or dual simplex algorithms to solve the node subproblems in the process of solving a MIP.
  • Parameter CPX_PARAM_NETEPRHS (IloCplex::NetEpRHS) is the equivalent of CPX_PARAM_EPRHS (IloCplex::EpRHS) for the Network Simplex algorithm.
  • Parameter CPX_PARAM_BAREPCOMP (IloCplex::BarEpComp) sets the Barrier convergence tolerance for LP and QP problems. If the solution appears to violate some constraints, a smaller value than the default might be needed. Note that when you are using crossover after the Barrier, the simplex feasibility tolerance will also have an effect on the computed solution.
  • Parameter CPX_PARAM_BARQCPEPCOMP (IloCplex::BarQCPEpComp) is the equivalent of parameter CPX_PARAM_BAREPCOMP (IloCplex::BarEpComp) for quadratically constrained problems.
  • Parameter CPX_PARAM_EPINT (IloCplex::EpInt) specifies the amount by which an integer variable can be different from an integer and still be considered feasible. This document gives more details about when it might be appropriate to use a nondefault setting for this parameter.

There can be downsides to tightening the feasibility tolerances listed here. Refer to the Parameter Table in the Reference Manuals for a discussion of possible downsides. That same table also lists the default values of all parameters as well as their allowable ranges.

Finally note that there will always be limits to the precision that can be attained with digital computers in floating-point computations. So, it is unreasonable to expect exactness in such computations.

[{"Product":{"code":"SSSA5P","label":"IBM ILOG CPLEX Optimization Studio"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"Mathematical Programming","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF016","label":"Linux"},{"code":"PF014","label":"iOS"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"12.6;12.5;12.4;12.3;12.2","Edition":"All Editions","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Historical Number

cplex/FAQ/128

Document Information

Modified date:
16 June 2018

UID

swg21400045