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

Mikael Zayenz Lagerkvist zayenz at gmail.com
Thu Dec 17 07:44:44 CET 2009


2009/12/16 Holger Winnemoeller <holger.winnemoeller at gmail.com>

> 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, ...).



> I should really try to get Gist working, as I have a feeling that it will
> demystify what to me is currently branching Voodoo.
>

Gist is a good tool to use, and if you installed form the MSI then it is
easy to call. See Modeling with Gecode.

In this case, the reason for branching on the specialSelected variables
first is not actually deep mysticism :) When a value is included in
specialSelected, then it must also be included in resultSet, which is
propagated. Adding a value to resultSet gives very little new information
though, since the value in most cases in your example would not come from
either specialSelected set (this is the crucial difference between
randomizing the value, and keeping them in-order).



> FYI, my system is Dell Intel Core Duo E8400 @ 3GHz with 4GB of RAM on
> WindowsXP professional, running Gecode 3.2.0 (x86). It's interesting, though
> maybe not surprising, that Gecode seems to run so much faster on your
> system. Do you think it's related more to the version of Gecode, the
> machine, or the OS? In any case, the correct answer is obviously not to
> upgrade the hardware, but to insert the branching statement :-)
>

My hardware is definitely slower than what you are using, so I would guess
there is something else going wrong. AFAIK, there were no changes to Gecode
between 3.2.2 and 3.2.0 that should explain the difference. It might be
something very simple, such as the output of the program being buffered for
some reason.

Cheers,
Mikael

-- 
Mikael Zayenz Lagerkvist, http://www.ict.kth.se/~zayenz/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.gecode.org/pipermail/users/attachments/20091217/fb635497/attachment.htm>


More information about the users mailing list