[gecode-users] Recovery Scheduling as CSP/COP

Guido Tack tack at ps.uni-sb.de
Sat Apr 14 21:37:30 CEST 2007


Hi.

Stanimir Dragiev wrote:
> - optimization
> I expected that there are means to  "post" an objective functions  
> and go relax
> :o) while GECODE optimizes the solutions found. But I didn't found  
> any. So,
> what I think should  work, is to post additional constraint dealing  
> with this in
> the following way:
> IF for constraint("Solution_cost < N") there are non-trivial  
> solutions THEN
> post constraint("Solution_cost < N-1");

There is support for optimization in Gecode, using branch&bound  
search. You have to define a function "constrain" in your Space. The  
function gets one argument, which is the so-far best solution found,  
and posts a constraint that any subsequent solution must be better,  
pretty much like the constraints you mention above. Typically, you  
use this to minimize or maximize a single variable, and post the real  
objective function (like a weighted sum or an n-ary max) as a  
constraint.

For simple examples, have a look at the photo or golomb source code.

Cheers,
	Guido





More information about the gecode-users mailing list