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
_______________________________________________
Gecode users mailing list
[EMAIL PROTECTED]
https://www.gecode.org/mailman/listinfo/gecode-users