Hi Christian,

Thanks for your quick reply!

Christian Schulte wrote:

Yes that can be the case. The difference in efficiency actually is not
related to the variables themselves.

If you post constraints on the IntVars before their domain is reduced to
0..1 then some propagators might have to resort to a less efficient
representation. The difference can range from anything like 10% (linear
constraints, for example) to 50% (extensional constraints, for example).
But do you post Gecode constraints on these IntVars? I would guess that
you'd post Gecode constraints on the channeled BoolVars instead. If the
latter is the case then I would not know where the difference in performance
could come from.

I can't be absolutely certain as there are hundreds of constraints even in the simple example I generated a trace for (this is not the instance that show the 10% difference -- that is for a bigger problem instance that is also much harder, i.e. the search time is much longer). However, at least some of the constraints are involving the boolean variable. These are in fact the BoolExpr I discussed in my previous posts, of the
form:

V1 <=> V2 #= 1 and ....

and V1 is the IntVar/BoolVar pair that was just created as described.
In my C++ code to parse this boolean expression, the BoolVar of V1 will be the variable extracted (V2 #= 1 will be reified with the ~ operator, and in this case, it is the IntVar of V2 that is used, even if it is a boolean variable (I don't know if it is or not from just looking at the trace).

Would this explain the performance differences? The reason for the change is that previously I had a hack to specially catch these type of expressions, whereas in my new code, these expressions are processed as general expressions (the ECLiPSe example code actually use #= instead of <=>, as the ic library (for which the example was originally written) does not actually have an <=> operator).

Cheers,

Kish

--
This e-mail may contain confidential and privileged material for the
sole use of the intended recipient. Any review, use, distribution or
disclosure by others is strictly prohibited. If you are not the intended
recipient (or authorized to receive for the recipient), please contact
the sender by reply e-mail and delete all copies of this message.
Cisco Systems Limited (Company Number: 02558939), is registered in
England and Wales with its registered office at 1 Callaghan Square,
Cardiff, South Glamorgan CF10 5BT.

_______________________________________________
Gecode users mailing list
[email protected]
https://www.gecode.org/mailman/listinfo/gecode-users

Reply via email to