[gecode-users] Intersection

Guido Tack tack at ps.uni-sb.de
Tue Aug 7 10:37:43 CEST 2007


Hi.

Nick Hindle wrote:
> I would like to constrain values in an IntSet to the intersection  
> with another IntSet, so all values from outside the intersection  
> are eliminated from the space.
>
> Being a CSP novice I am struggling with how to implement this in  
> Gecode!

An IntSet is just a constant set, not a variable that you can post  
constraints (like intersection) on.  It's like the difference between  
an IntVar and an int.  If it's really about constants, you can use  
range iterators to just compute the intersection.
If you want your sets to be real constraint variables, have a look at  
one of the examples (like golf.cc), it will give you an idea how to  
use finite set constraints in Gecode.

Cheers,
	Guido

-- 
Guido Tack
Programming Systems Lab, Saarland University, Germany
http://www.ps.uni-sb.de/~tack







More information about the gecode-users mailing list