// // x = y * z where x,y,z in [0..1000] // // When we use bound integer variables, what is complexity? // When we use enumerated domains, what is complexity? // Run it and see // import static choco.Choco.*; import choco.cp.model.CPModel; import choco.cp.solver.CPSolver; import choco.kernel.model.Model; import choco.kernel.solver.Solver; import choco.kernel.model.variables.integer.IntegerVariable; public class BigXYZ { public static void main(String[] args) { Model m = new CPModel(); int n = 1000; IntegerVariable x = makeIntVar("x",0,n,"cp:bound"); IntegerVariable y = makeIntVar("y",0,n,"cp:bound"); IntegerVariable z = makeIntVar("z",0,n,"cp:bound"); /* IntegerVariable x = makeIntVar("x",0,n); IntegerVariable y = makeIntVar("y",0,n); IntegerVariable z = makeIntVar("z",0,n); */ m.addConstraint(eq(x,mult(y,z))); Solver s = new CPSolver(); s.read(m); s.solve(); System.out.println(s.pretty()); } }