[gecode-users] Writing a Branching

Mikael Zayenz Lagerkvist zayenz at gmail.com
Thu Nov 22 08:56:52 CET 2007


On Nov 22, 2007 8:32 AM, Malcolm Ryan <malcolmr at cse.unsw.edu.au> wrote:
>
> On 22/11/2007, at 5:13 PM, Mikael Zayenz Lagerkvist wrote:
>
> > No, the standard branching class is not exposed in Java. On the other
> > hand, I'm not sure what you aim to do. You can have more than one
> > branching in a Space, so you can have a standard branching
> > instantiating all variables after your custom branching is finished.
>
> I am dealing with collections of variables which represent a variable-
> length plan. So there is a "length" variable and a collection of
> "element" variables. The element variables beyond the length value
> have no significance. I do not wish to waste time choosing bindings
> for them. So essentially my Branching just looks at elements 0
> through length.min() - 1.
>
> Having determined this set, I then want to choose one variable and
> assign it a value. I would like to experiment with a range of ways of
> choosing this variable and value, including all the standard ways. In
> would be easier if I could use an existing implementation to do this.

As an alternative, you could could add constraints that make the
variables after length.min()-1 be assigned some dummy value. Something
along the lines of
    for (int i = 0; i < vars.length; ++i) {
        post(this,
                new BExpr(length, IRT_LQ, i).imp(vars[i], IRT_EQ, dummy_val));
    }

With this, any branching (your or one of the standard ones) would just
operate on the variables at indexes less than length.


> What is the timeframe for Gecode/J 2.0.0?

We are currently working on it, and hope to have it finished as soon
as possible. Sorry I can't give a better answer than that.


> > Note that there is a bug in Gecode 1.3.1 that forces you to post all
> > branchings in the root-space.
>
> I don't understand. What would the alternative be?

The alternative is that additional branchings are posted as search progresses.


Cheers,
Mikael

-- 
Mikael Zayenz Lagerkvist, http://www.ict.kth.se/~zayenz/




More information about the gecode-users mailing list