[gecode-users] Set constraints working for sequential data, but not non-sequential data. Ideas?

Holger Winnemoeller holger.winnemoeller at gmail.com
Fri Dec 18 02:08:30 CET 2009


>
>
> I've added "branch(*this, specialSelected, SET_VAL_MIN_INC);" as the last
>> line in CreateAndRequestCategory
>>
>> and the code runs like a charm!
>>
>
>  You might want to collect the specialSelected variables, and branch on
> them at the same time. Then you could use some selection heuristic between
> the variables (e.g., the specialSelected var with the smallest unknown
> value, a random choice, ...).
>
>
Ok, this brings up some other questions:

*1) *I assume the way I would collect on all specialSelected variables would
be:

SetVarArray mySpecialSets (*space, numSpecialSets, IntSet::empty, 0,
maxSpecialSetSize);
foreach(SetVar specialSet in mySpecialSets)
{
   // do something
}
branch(*space, mySpecialSets, SET_VAR_NONE, SET_VAL_MIN_INC); // or other
options

Is this what you had in mind?

*2)* The second, related, questions are then:

   - Would mySpecialSets have to be a member of my Space definition?
   - Would I have to propagate this info in the special copy constructor,
   like so:

MySpace(bool share, MySpace& s)
        : Space(share,s) {
            mySpecialSets.update(*this,share,s.mySpecialSets);
    }

   - Or more generally: What kind of variables (IntVar, SetVar, ...) do I
   have to update in this fashion? I gues I am not quite clear on the
   relationship between the branching and the special copy constructor.


Any help is appreciated.
Thanks,

Holger.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.gecode.org/pipermail/users/attachments/20091217/f77c18ad/attachment.htm>


More information about the users mailing list