Hi,
Yes, that is a relevant question. The easy answer is to use the
constraint dom(home, x0, SRT_NQ, {a, b, c}) (see [1]) for the right
hand side. This is exactly what you describe, but it is also not very
good as it will most likely not propagate anything immediately. The
reason is that the set variable domain used in Gecode (and in most
constraint programming systems) is not detailed enough to record that
particular information. If you aren't careful, the brancher might even
end up re-trying the same decision again with the left decision
failing immediately and the right just creating a duplicate
propagator. The simple way to avoid re-trying the same decision is to
record the decisions made in the brancher and avoid making it again.
In general, the goal of a brancher is to partition the search space:
the alternatives created should be disjunct but also cover all
alternatives. In practice, the result of a decision by a brancher
should be reflected in the domains in some way, since otherwise there
is no new information derived from propagation.
I would say what you do depends on the particulars of your problem.
Try to see if there is something that you can say for the right hand
side that works for your problem that can be exploited. In the worst
case, you could also try an n-way branching with all the alternatives
that are not the first one enumerated:
x0={a, b, c}, (a in x0, {b, c} not in x0), ({a, b} in x0, c not in
x0), (b in x0, {a, c} not in x0), ...
while this would work, my guess is that it would be quite bad for the search.
Cheers,
Mikael
[1]
https://www.gecode.org/doc-latest/reference/group__TaskModelSetDom.html#ga8b5263e1bef81c11e4ba9889f0f26568
On Wed, Jul 13, 2022 at 6:32 PM 'John' via Gecode
> To view this discussion on the web visit
https://groups.google.com/d/msgid/gecode/17a92087-1b25-415c-8958-5c341130073en%40googlegroups.com.
--
Mikael Zayenz Lagerkvist