[gecode-users] element constraint

frank lemoine benouna84 at live.fr
Fri Nov 6 19:12:08 CET 2009


hello christian and Guido,

 

thank's Guido for the approaches you give it to me, i see cp(map) it's very interesting but it's also very far from my level in gecode. the idea of using a boolean variable is very useful and i use it but i still have some troubling :

 

my constraint it's about checking for an edge represented by two variable  if it's present in a set possible edge and it should work on the element constraint like this element (*this, a ,b ,c) so that:

 

a is the set of possible edge (set of edges each one is represented by two int variables)

b incrementation

d candidat edge (represented by two int varaibless)

 

but in c From what I know we can just put one single variable  so i can't describe an edge 

 

i hope  this expression will be more explicit. 

 

Hamza


From: tack at ps.uni-sb.de
Date: Thu, 5 Nov 2009 11:52:22 +0100
CC: users at gecode.org
To: benouna84 at live.fr
Subject: Re: [gecode-users] element constraint

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

 		 	   		  
_________________________________________________________________
Nouveau Windows 7 : Trouvez le PC qui vous convient. En savoir plus.
http://clk.atdmt.com/FRM/go/181574580/direct/01/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.ps.uni-sb.de/pipermail/users/attachments/20091106/a74be083/attachment.htm>


More information about the gecode-users mailing list