1

I am using OPL CPLEX 12.9. In my model, a dvar float + variable disregards the non-negativity condition and returns the value -4.4409e-16. I have already read that this is due to the tolerances in Cplex. This does not bother the actual process either. It will still be counted with the value 0. However, it seems to affect the binary variables. Because at the same time the binary variables in my model also disregard their constraints. The binary variables disregard their constraints is undesirable Is a connection possible and how can I avoid it?

Frieda12
  • 37
  • 1
  • 7
  • Perhaps [this](https://render-prd-trops.events.ibm.com/support/pages/cplex-appears-return-solution-violates-some-constraints-or-bounds) support article is helpful. – rkersh Sep 25 '19 at 21:15
  • I already read that article, but I don't understand which one would help me. And I don't know how to use it. I can't find examples. An example how to use CPX_PARAM_EPRHS (IloCplex::EpRHS) would be helpful. – Frieda12 Sep 26 '19 at 10:55
  • To set parameters in the OPL IDE, see the documentation [here](https://www.ibm.com/support/knowledgecenter/SSSA5P_12.9.0/ilog.odms.ide.help/OPL_Studio/refoplide/topics/opl_gui_setprog.html). The [CPX_PARAM_EPRHS](https://www.ibm.com/support/knowledgecenter/SSSA5P_12.9.0/ilog.odms.cplex.help/CPLEX/Parameters/topics/EpRHS.html) parameter (aka "feasibility tolerance") can be found under `Simplex > Tolerances` in the settings editor. You could try setting it to a smaller value like `1e-7`, for example. – rkersh Sep 26 '19 at 15:36

1 Answers1

1

As stated in the comments to your question this is expected behavior for variables of all types (due to numerical roundoff).

In case you want to increase the chances that your integer/binary variables have exact integer values, you can set the CPX_PARAM_EPINT parameter ("integrality tolerance") to 0. In the OPL settings editor you do this via Mixed Integer Programming > Tolerances.

For binary variables you could also explicitly cast the results to integer values by using something like value < 0.5 ? 0 : 1.

Daniel Junglas
  • 5,830
  • 1
  • 5
  • 22