[gecode-users] Symbolic Constraints - fd_relation contraint in Gecode?

Pedro Salgueiro pds at di.uevora.pt
Wed May 20 18:58:34 CEST 2009


Hi!

I already managed to use the "extensional" constraints with tuples and
they are great, but I have some problems modeling my problem with these
constraints.

In my problem, each valid tuples are composed by 16 values, and some of
those values can have very large values, such as 800000 or 900000. The
table I used to test has 125 of those tuples. I have tested it with
Gecode 2.x, and with values that big it gave segmentation fault. 

Then I updated it to Gecode 3.0.2 and it worked, but its performance is
really bad. Then I replaced the large values of the tuples in the table
with smaller ones, and the performance got lot better. 

When I started to increment some of the values, the performance of 
starts to get much worse...

Is this the expected behavior of Gecode when handling with large
integers, or am I doing something wrong?

Thank you,
Pedro Salgueiro



On Tue, 2009-05-19 at 21:37 +0200, Christian Schulte wrote:
> Yes, these constraints are called "extensional" (or user-defined
> constraints). Gecode has quite some support for that: you can specify the
> relation by a set of tuples (that's implemented as lists of lists in Prolog)
> or by a regular expression or DFA. Please check "Modeling with Gecode", it
> elaborates on extensional constraints.
> 
> Christian
> 
> -----Original Message-----
> From: users-bounces at gecode.org [mailto:users-bounces at gecode.org] On Behalf
> Of Pedro Salgueiro
> Sent: Tuesday, May 19, 2009 5:40 PM
> To: users at gecode.org
> Subject: [gecode-users] Symbolic Constraints - fd_relation contraint in
> Gecode?
> 
> Hi!
> 
> GNU Prolog has a Symbolic Constraint called fd_relation that constraints
> a tuple of variables to be equal to one tuple of a list of relations.
> 
> Here is its description: 
> 
> fd_relation(Relation, Vars) constraints the tuple of variables Vars to
> be equal to one tuple of the list Relation. A tuple is represented by a
> list.
> 
> Using this predicate as follows:
> 
> fd_relation([[0,0,0],[0,1,0]], [X,Y,Z]).
> 
> the tuple [X,Y,Z] only could take the values specified in the tuple list
> [[0,0,0],[0,1,0]].
> 
> Here is its documentation:
> http://www.gprolog.org/manual/html_node/gprolog062.html#toc274
> 
> Is there any simple way to do this in Gecode? Maybe a constraint that
> limits the domain values of a tuple defined by an IntVarArray to any of
> the elements of an array, where each element of such array is an array
> composed by Integer values, defining a tuple.
> 
> Any help will be appreciated :)
> 
> Thanks
> Pedro Salgueiro
> 
> 
> 
> 
> 
> 
> 
> _______________________________________________
> Gecode users mailing list
> users at gecode.org
> https://www.gecode.org/mailman/listinfo/gecode-users
> 





More information about the gecode-users mailing list