[gecode-users] Constraint Optimization (newbie)
Guido Tack
tack at ps.uni-sb.de
Tue Sep 12 17:03:54 CEST 2006
Hi.
> As I'm crawling through the reference documentation, and the
> examples, I
> have stumbled across the following problem.
> Suppose I want to find the maximal value of X [0..100] such that X
> < 10,
> how do I model this (the maximization objective - the simple
> constraint
> problem has turned up in the mailing list archives)?
>
> I have taken a look (inspired by the n-queens example) at BAB and the
> function constrain() added to the problem class, but I have not been
> able to let my problem return X = 9 so far - even after fiddling with
> the BAB and constrain() function, my problem still returns X = [0..9]
> What's the simple (and correct) way of doing this?
Using the constrain function and the BAB search engine is already the
right direction. Maybe you forgot to add a branching to the space?
That would explain why your variable is not instantiated.
Cheers,
Guido
--
Guido Tack
Programming Systems Lab, Saarland University, Germany
http://www.ps.uni-sb.de/~tack
More information about the gecode-users
mailing list