[gecode-users] Limits on nonlinear constraints

Guido Tack tack at gecode.org
Fri Aug 20 17:49:42 CEST 2010


Javier Romero wrote:

> Thanks for the fast answer. I tried decomposing the last constraint into mul, sqr and linear rules, but i got the same result. I attached the code. I compiled it by doing 
> g++ parallelepiped.cpp -lgecodeminimodel -lgecodeint -lgecodesearch -lgecodegist -lgecodedriver -o parallelepiped

Ok, now it's easier to see what's going wrong.  The problem is that the equation may hold, but it cannot be expressed using IntVars because of the limited domains.  In your decomposition, the first constraint that exposes the problem is 

            sqr(*this,k,kk);

At this point, k is already at least 2000000, but kk was initialized as an IntVar with domain Int::Limits::min..Int::Limits::max. Therefore, the problem has no solution, as 2000000*2000000 > Int::Limits::max.  This is expected and correct behavior.
Unfortunately, the minimodel layer lets you express constraints that are (semantically) satisfiable, but the introduction of intermediate IntVars makes them unsatisfiable.
For your actual problem, there's no way around this limitation except implementing IntVars with arbitrary precision (using e.g. the gmp library).  This would be possible, but it's not something we're planning to do anytime soon.

Cheers,
	Guido

-- 
Guido Tack, http://people.cs.kuleuven.be/~guido.tack/




More information about the users mailing list