[gecode-users] question about branching and diversity between solutions

Lorenzo Gatti lorenzo.gatti at gmail.com
Tue Nov 18 16:26:26 CET 2014


At the beginning of each run, you might compute one random permutation of
your variables, store in some std::map<IntVar,int> the place of each
variable in the permutation, and return that value as a merit function for
INT_VAR_MERIT_MIN; a constant value should be much cheaper than generating
random numbers each time.
You can do the same with values, value functions and INT_VAL, but in that
case a randomly chosen hash function might be cheaper than a lookup table.

On Fri, Nov 14, 2014 at 4:54 PM, Chd Orti <richard.portell at gmail.com> wrote:

> Hello,
> I have an array of size 100.
> I have some constraints that I implemented for that array but they are not
> big constraints, which means there are a lot of solutions for the problem.
>
> I have issues with the branching. Basically what I want is to have the
> biggest diversity for the values at 2 levels :
> - biggest diversity within the same gecode generation (which would mean,
> use the maximum range for each variable)
> - biggest diversity between 2 gecode generations (I would like to have
> completely different results with the same problem if I solve it again with
> gecode).
>
> For now, only
> *branch(*this, myArray, INT_VAR_RND(r), INT_VAL_RND(r));*
> has given me good results but it takes ages to compute for a simple
> problem.
> I have tried some of the other branching options but its very regular
> solution and almost the same between 2 generations .
>
> Would you have some ideas to achieve that?
> Cheers,
> Richard
>
>
> _______________________________________________
> Gecode users mailing list
> users at gecode.org
> https://www.gecode.org/mailman/listinfo/gecode-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.gecode.org/pipermail/users/attachments/20141118/d7af27c4/attachment.html>


More information about the users mailing list