On Fri, 6 Oct 2023, Leonardo Corato wrote:

As you can see in bin 2 and 3 there are 3 mold types, so sadly s.t. fred is
not limiting to 2

I'd misunderstood.
I'd thought that you want no more than two of a given type.

Using an auxillary array is probably easiest:
y[t, b] == 1 iff bin b has an item of type t.
It need not be binary or have an upper bound.
An upper bound of one would not hurt and might help.
An upper bound of two can be inferred from other constraints.

greg{b in 1..n} sum{t in mouldTypes} y[t, b] <= 2 ;

YY{y in mouldTypes, b in 1..n, i in I: mo[i]==t} y[t, b] >= x[i, b] ;

Without y, I think that O(n*|I|**3) constraints might be necessary.
cube{b in 1..n, i1 in I, i2 in I, i3 in I: i1< i2 < i3 and
                       mo[i1] != mo[i2] != mo[i3] != moi10] }
        x[i1, b] + x[i2, b] + x[i3, b] <= 2 ;
This is the kind of thing I'd be inclined to generate on the fly.

I'm not sure which set is stronger.
They might be equivalent.


Apparently you problems are small enough so that it does not matter much,
but you have rather a lot of symmetry.
That sort of thing plays havoc with branch and bound.

--
Michael   henne...@mail.cs.ndsu.nodak.edu
"Occasionally irrational explanations are required"  --  Luke Roman

Please do not quote boilerplate.

--
Michael   henne...@mail.cs.ndsu.nodak.edu
"Occasionally irrational explanations are required"  --  Luke Roman

Reply via email to