On 14 Jun 2011, at 14:49, Max Ostrowski wrote:
> Thank you for your quick response.
> Just to clarify for me 2.2, if i only use expr(), and the resulting variables
> in global constraints, then i do not need to branch on any temporary
> variables to be "complete". Right?
>
> If so, does it give me any improvements?
> for example:
> IntVarArray temp(2);
> temp[0] = expr(a+b);
> temp[1] = expr(c+d);
> distinct(temp2).
>
> If i now branch on {a,b,c,d} i will find all solutions.
> But i could also branch on {a,b,c,d,temp[0],temp[1]} to find all solutions.
> Can this be considered "better" in terms of possible complexity, or is there
> any "experience" from your side that you would recommend to branch on as much
> or few variables as possible? (while still enumerating all models)
You should always branch on all variables. There is a good chance you will find
the variables of 'temp' are already assigned, in which case the cost of
checking is extremely small.
Several times I have seen people believe they don't have to branch on all
variables, and they are almost always wrong.
Chris
_______________________________________________
Gecode users mailing list
[email protected]
https://www.gecode.org/mailman/listinfo/gecode-users