[gecode-users] python binding - Gecode does not find a solution on first run, finds a solution on consecutive runs.

Stefan Krastanov stefan.krastanov at yale.edu
Tue Jul 14 20:23:55 CEST 2015


Hello,

I am using:

gecode-python 0.27
gecode 3.7.3
(newer versions from the debian repository do not work with gecode-python)

I have a python function `my_function` that builds a `gecode.space()`
object with around 200 000 linear IRT_NQ constraints and 3 IRT_EQ
constraints on 9 int variables with domain 1-to-10. One final
constraint is `minimize` over the sum of the variables.

My python function returns `list(space.search())` at the end.

The first call to this function usually takes ~1minute and does not
return any solutions. Consecutive calls take less than a second and
return solutions.

Why is this happening? Is the search non-deterministic?

Can the search give no solutions when there are existing solutions?

Why is the first call slow and returns no solutions while consecutive
calls are fast and return solutions? Especially so given that I
recreate the space each time? Is there some fancy caching happening?

In any case, thanks for the great software. This is the first time I
am using a constraint solver and it is quite amazing what it can do.

Best,
Stefan



More information about the users mailing list