[gecode-users] Two questions about finite set variables
Guido Tack
tack at ps.uni-sb.de
Mon Jan 26 10:16:17 CET 2009
Patrik Haslum wote:
> Q1: Propagation for the weights constraint. I've posted the
> constraint:
[...]
> So, it seems that the upper bound on the cardinality of deleted has
> been
> propagated to total_cost (it is at most the sum of the 3 largest
> costs),
> but the lower bound has not (total_cost can not be smaller than the
> sum
> of the 2 smallest costs, which is 2, yet the lower bound remains
> zero).
> This is the case also if I change the upper bound on cardinality (for
> example, if I don't put one at all, the upper bound on total_cost
> becomes 60, the sum of all the costs, but the lower bound stays zero).
>
> Is there an explanation for this behaviour?
Yes, that kind of inference was simply missing in the propagator. The
trunk version should do it now.
> And, more importantly, is
> there any way to change it? Since I'm trying to solve an optimisation
> problem, it is of course the lower bound on cost that is important.
You could move to the trunk version of Gecode, or back-port the
weights propagator (which shouldn't be too hard, you just have to take
everything from the propagate method).
> Q2: When branching on in/not-in for a potential element of SetVar,
> what
> is the order in which the alternatives are tried? (i.e., does it
> explore
> the in or out branch first). And how do I change it to do the
> opposite?
The left (first) branch includes the element, the right branch
excludes it. In the Gecode trunk, you also have the opposite option.
Cheers,
Guido
More information about the gecode-users
mailing list