[gecode-users] Branching on temporary variables
Christian Schulte
cschulte at kth.se
Tue Jun 14 15:12:48 CEST 2011
Hi,
1) Not quite. Instead of var1.post(...) use expr(home, var1) (that is, the
documented interface not its implementation)
2)
2.1) In principle, of course! However, for all expressions available through
expr() you can be sure that the resulting variables are assigned if all
variables in the expressions are assigned.
2.2) As said, you have to in general.
3) Do not understand the question but you get 6 solutions as there are six
solutions!
Christian
--
Christian Schulte, www.ict.kth.se/~cschulte/
-----Original Message-----
From: users-bounces at gecode.org [mailto:users-bounces at gecode.org] On Behalf
Of Max Ostrowski
Sent: Tuesday, June 14, 2011 10:37 AM
To: users at gecode.org
Subject: [gecode-users] Branching on temporary variables
Hello everybody,
i have some expressions (linear and non-linear) stored in a
"Gecode::LinExpr" object.
Know i want to post a global constraint on them.
So, expressions for example:
//pseudocode
LinExpr var1 = a+b*c;
LinExpr var2 = 4-7
and i want the results of them to be allDifferent (distinct)
IntVarArray z(home,2);
z[0] = var1.post(home);
z[1] = var2.post(home);
distinct(home,z);
1: Is this the right way to do this?
2: I do branching on the variables a,b,c.
2.1: Can it happen that some of the temporary variables z[i] stay
unassigned (regarding any linear or non-linear expression)?
2.2: Does it make an advantage to branch on {a,b,c,z[1..n]} instead of
{a,b,c} ? Can this decrease complexity, as it is the case with conjunctions
in SAT.
3: If i post the constraint a*b==0 a\in{0..2} and b\in{0..2} and i do branch
on {a}, do i get 3 or 6 solutions. (So, are my solutions really projected
on the branching variables?)
Thanks a lot in advance,
Max
--
NEU: FreePhone - kostenlos mobil telefonieren!
Jetzt informieren: http://www.gmx.net/de/go/freephone
_______________________________________________
Gecode users mailing list
users at gecode.org
https://www.gecode.org/mailman/listinfo/gecode-users
More information about the users
mailing list