[gecode-users] element constraint

Guido Tack tack at ps.uni-sb.de
Thu Nov 5 11:52:22 CET 2009


Hi,

frank lemoine wrote:
> thank you christian for tips about the element constraint i run it,  
> it's a very usefull but still i had some difficulties i don't know  
> if gecode provide a solution for representing two intvar by a single  
> intvar.
>
> let this constaint element (home, a,b,c)
>
> i have two integer variables represented by Intvar, i want to use a  
> variable Intvar in c that can represent the link between this two  
> varaibles (an edge for example)
> the goal is to check if this pair is in a the set of all pairs in a

I'm not sure you can use IntVars the way you describe the problem.  Do  
you want to have one variable for each node that describes the set of  
edges incident to the node?  Then you'll have to use set variables  
instead of integer variables.  Of course, if every node has exactly  
one incident edge, IntVars are fine.  A different approach is to use  
n*n Boolean variables if you have n nodes, one for each edge,  
representing that the graph contains the edge or not.  It really  
depends on what other constraints you want to put on the graph.
Maybe the literature on graph variables (simply google for CP Graph)  
or tree constraints will help you get an idea.

Cheers,
	Guido

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.ps.uni-sb.de/pipermail/users/attachments/20091105/c9cc0fc4/attachment.htm>


More information about the gecode-users mailing list