[gecode-users] Re: Var indexes-help

Guido Tack tack at ps.uni-sb.de
Thu Feb 1 02:20:43 CET 2007


Hi!

> Thanks for the advice, it works smooth now.
> But one last question about the Var equalities.
>
> suppose Var A, B and an integer array I
> Let A to be the one possible values of index i where  B=I[i]

I'm not sure I understand completely what you mean by possible
values. If you just mean I[A]=B, then you can use element(this, I, A,   B).

> sth like;
> for all indexes i
> if " A equals I[i]" then "B can be assigned to i"
>
> but I couldnot find a way to imply the equality of VAR&Intger on  
another VAR's possible values.

You swapped A and B now, right? In you original statement it read "if   B
equals I[i] then A can be assigned to i". What you describe is just   half
of what element does. Is there anything wrong in your model   about the
inference "if A cannot be assigned to i, then B does not   equal I[i]"
(i.e., the contraposition)? This is something you can   implement using
reified constraints. However, if this does not hold   for your model,
something's fishy ;-)

Cheers,
	Guido

-- 
Guido Tack
Programming Systems Lab, Saarland University, Germany
http://www.ps.uni-sb.de/~tack
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.ps.uni-sb.de/pipermail/users/attachments/20070201/5b8b1e6a/attachment.htm>


More information about the gecode-users mailing list