[gecode-users] optimising with 'constrain'

Andrea Rendl andrea.rendl at gmail.com
Fri Sep 5 10:52:28 CEST 2008


Hi Guido,

Yes, that was the problem - thanks a lot for the quick reply!

Cheers,
Andrea

2008/9/4 Guido Tack <tack at ps.uni-sb.de>:
> Hi!
>
> Did you instantiate the BAB search engine instead of DFS?  DFS will not call
> the constrain method.  Have a look at golomb-ruler.cc, for example.
>
> Cheers,
>        Guido
>
> Andrea Rendl wrote:
>
>> Hello everybody,
>>
>> I'm trying to minimise a variable in my problem instance by adding the
>> following method (as member of my problem class that inherits from
>> Example):
>>
>> void
>>  constrain(Space* s) {
>>   rel(this, variable, IRT_LE,
>> static_cast<ProblemModel*>(s)->variable.val());
>>  }
>>
>> However, it has no effect: whenever I run the instance it gives me all
>> possible solutions, ignoring the minimisation constraint. I compared
>> my instance to some of the optimisation problems in the examples/
>> directory and could not see any difference. Do you have any idea what
>> I could have done wrong? When and where is 'constrain' called? I could
>> not find a description in the documentation...
>>
>> Thanks for your help,
>> Andrea
>>
>> _______________________________________________
>> Gecode users mailing list
>> users at gecode.org
>> https://www.gecode.org/mailman/listinfo/gecode-users
>
>




More information about the gecode-users mailing list