[gecode-users] Custom variables in Gecode

Guido Tack tack at gecode.org
Thu Jul 28 12:35:26 CEST 2011


Hi,

the usual way to deal with these kinds of more structured domains in CP is to map them to integer or set problems. In your case, this would mean mapping each name to an integer identifier.
I'm not sure about the infiniteness in your example.  You probably have a finite number of objects anyway, so what you're looking for is the dependency graph, which is finite, too.  Again, you'd model the graph in terms of integer or set variables and constraints.

Cheers,
Guido

On 28 Jul 2011, at 11:56, Dimitri Mazmanov wrote:

> Hello,
> 
> I'm thinking of using Gecode as a solver in my project. However the first hinder I've encountered was how to define a space and variables in Gecode. (I have some experience with Gecode, when I used only IntVar-s)
> The problem is following. 
> I have a set of objects with some properties of types such as string, double, integer, etc.
> This set defines my domain.
> The input for my program is an object that has dependencies on the objects from the domain. Apart from that the input object puts constraints on the properties of the objects from object domain. Here's an example:
> 
> --------------------------------------
> InputObject O1
>     property1 = "name"
>     property2 = 4.321
>     property3 = 2
>     
>     dependency1 = "objectName"
> --------------------------------------
> 
> Space:
> D1 {obj1, obj2, obj3, ...}
> 
> The idea is to select one or more objects from D1 such that the name of an object is "objectName" AND it satisfies the constraints (property1, property2, etc.). There can be dozens of objects with "objectName", but only few can satisfy the constraints. And this chain can be infinite, i.e. if selected object is obj1, it can also have dependencies on others (i.e. obj23), and it goes on and on.
> 
> The problem can be solved using DFS + backtracking. But I want to try Gecode first.
> 
> So the question is how to define an object in Gecode. Can it be expressed in terms of IntVar, IntVarArray? Should I create custom variable implementations, views, variable arrays?
> 
> Thanks!
> 
> Kind Regards, Dimitri Mazmanov.
> 
> _______________________________________________
> Gecode users mailing list
> users at gecode.org
> https://www.gecode.org/mailman/listinfo/gecode-users

-- 
Guido Tack, http://people.cs.kuleuven.be/~guido.tack/





-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.gecode.org/pipermail/users/attachments/20110728/7acc109d/attachment.htm>


More information about the users mailing list