Skip to main content

Variable: IntVarMax

const IntVarMax: 1073741823 = 1073741823

Remarks

Maximum value of a decision variable or a decision expression (such as x+1 where x is a variable).

Arithmetic expressions must stay within the range [IntVarMin, IntVarMax]. If an expression exceeds this range for all possible variable assignments, the model becomes infeasible.

Example

The following model is infeasible because x*x exceeds IntVarMax for all values in the variable's domain:

let model = new CP.Model();
let x = model.intVar({range: [10000000, 20000000]});
// Constraint x*x >= 1:
model.enforce(x.times(x).ge(1));
let result = await model.solve();

For any value of x in the range [10000000, 20000000], the expression x*x exceeds IntVarMax and cannot be computed, making the model infeasible.