I need to add the following constraint using google CP-SAT solver:
(x+y+z)/(x+y+z+k) < 10
The addDivisionEquality method signature is:
Constraint addDivisionEquality (IntVar target, IntVar num, IntVar denom)
Where
IntVar target = model.newIntVar(0, 10, "(x+y+z)/(x+y+z+k)");
But now I need to define the numerator and denominator as IntVar
types while they are the sum of multiple intVars.
The Java package provides a class called SumOfVariables to sum intVars but the addDivisionEquality
method requires IntVar
. I would expect it to get LinearExpr instead.
How can I define the numerator and denominator as IntVar
types?