[gecode-users] Display the values of a set of variable without duplicates

Christian Schulte cschulte at kth.se
Fri May 31 12:04:42 CEST 2013


Hi,

I am not sure whether I understand your question correctly. But you can
exchange the order of the search engine (that is, in my previous reply swap
e1 and e2).

Best
Christian

--
Christian Schulte, Professor of Computer Science, KTH,
www.ict.kth.se/~cschulte/


-----Original Message-----
From: users-bounces at gecode.org [mailto:users-bounces at gecode.org] On Behalf
Of Amina Kemmar
Sent: Friday, May 31, 2013 10:00 AM
To: users at gecode.org
Subject: [gecode-users] Display the values of a set of variable without
duplicates

Hello,

I already asked for the following problem:

According to the variables defined in our model (x,y,z,k), I obtained the
following solutions :
  1,1,2,3
  1,1,5,6
  1,1,7,9
  1.1,8,8
I am interested to the values of the two variable x and y, so I want to
avoid the enumeration of the three last solution in order to display just
the first solution.

I got the following response:

One way to do it is as follows:
  - You create a space s that only has a brancher for x and y
  - You create a search engine e1 for s and find a solution, say s1
  - You post a brancher in s1 for z and k.
  - You create a search engine e2 for s and find just a single solution!
  - You can then also get more solutions from e1 and repeat the previous two
steps.

Thank you for the solution, it works very well, but I have an other problem
which is the enumeration order of the variables x, y, z and k. I must begin
the branching from the variables  z and k, then x, y (In this way, Gecode
enumerates quickly the solutions but for the first order "x,y,z,k", it takes
about 30 minutes to enumerate the first solution).
Is there an other solution?

Thank you.
-----
Amina


_______________________________________________
Gecode users mailing list
users at gecode.org
https://www.gecode.org/mailman/listinfo/gecode-users




More information about the users mailing list