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.port...@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@gecode.org > https://www.gecode.org/mailman/listinfo/gecode-users > >
_______________________________________________ Gecode users mailing list users@gecode.org https://www.gecode.org/mailman/listinfo/gecode-users