[gecode-users] Implementing No-goods

Kish Shen kisshen at cisco.com
Wed Sep 25 20:47:33 CEST 2013


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 to the master() function -- I assume 
you need to somehow remember it (as with the no-goods).

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




More information about the users mailing list