python-3.xor-toolscoin-or-cbc

Is there any way to create a conditional constraint while using CBC solver with or-tools?


Lets suppose I use BoolVars called 'x,y,z' in my MIP problem and I would like to set a contraint like :

 3x + 4y <= 5*z  only if z = 1

I would I do that using CBC solver in ortools library for python?


Solution

  • Currently no. We are in the process of rewriting the linear solver wrapper to support these.

    This being said, I do not know if they are supported by CBC. If your problem is purely integer, the CP-SAT solver supports implied constraints natively.