[gecode-users] Passing information to the master() function

Christian Schulte cschulte at kth.se
Thu Oct 3 10:51:01 CEST 2013


Hi Kish,

Sorry for missing this.

If you want to post the constraint then you would have to store the
y-variables at someplace such that the master() function (you would have to
re-define it) can access y.

The second option is more meaningful: I think restricting restart to a
single solution does not hurt.

Cheers
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 Kish Shen
Sent: Thursday, October 03, 2013 5:15 AM
To: users at gecode.org
Subject: [gecode-users] Passing information to the master() function

(This is an edited repost of a message I sent, that was missed by Christian)

Hi Christian,

Thanks for your reply. I haven't been able to look again at this issue until
now, so sorry for the delay...

On 13/09/2013 12:20, Christian Schulte wrote:
 >
 > As for making sure that the same solution is not found again there is
some  > support but not really the right one. For integer variable arrays x
and y  > (also for Boolean arrays) you can post by
 >     rel(home, x, IRT_NQ, y);
 > cannot be the same, that is there is at least one i for which x_i is  >
different from y_i.
 >

Am I correct that for the above, x would be the variables that are being
labelled by the search (i.e. the variables passed to branch()), and y is the
solution values for these variables (x and y can be swapped, of course)?
Also, this rel constraint should be posted in master()?

I am not quite sure how to pass y (the solution values) to the master()
function and space. Can this be done without some low-level programming
(i.e. inside the search engine)?

If this is not easy to do, then I think an alternative behaviour I can
implement is to not allow the user to ask for an alternative solution if
restart is used with DFS. Am I correct in thinking that restart is probably
not that useful if you want to search for multiple solutions of a problem,
because the search (unless you use some randomisation, as you
mentioned) will always drive you close to solutions you already found,
before exploring other parts of the search space.

Cheers,

Kish

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




More information about the users mailing list