IntervalConstraintProgramming.jl icon indicating copy to clipboard operation
IntervalConstraintProgramming.jl copied to clipboard

`integerize` contractor and integer solutions

Open dpsanders opened this issue 4 years ago • 1 comments

Add an integerize contractor as in this code I wrote , discussed in this Discourse post

dpsanders avatar Apr 24 '21 19:04 dpsanders

Great idea!

As I mentioned in an email, you can either:

  • add the integerize() constraint to the system of constraints (like in your example), in which case the integerize contractor is invoked from time to time ;
  • call integerize() in a systematic manner within the generated code of the forward-backward contractor, whenever the range of an integer variable is reduced. This would be the "optimal" way to go to maximize the filtering power. A possibility would be to attach an "integer" tag to a variable upon symbolic definition (e.g. @integer_variables x) and the appropriate code should be generated, for example

begin (_c, _b, y) = minus_rev(_c, _b, y) (_b, _a, x) = plus_rev(_b, _a, x) x = integerize(x) (_a, x) = exp_rev(_a, x) x = integerize(x) end

for the constraint "exp(x) + x - y = 0" with x integer.

cvanaret avatar Apr 29 '21 09:04 cvanaret