help-glpk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bpp plus type constrain


From: Michael Hennebry
Subject: Re: bpp plus type constrain
Date: Wed, 4 Oct 2023 13:08:58 -0500 (CDT)
User-agent: Alpine 2.21 (DEB 202 2017-01-01)

On Sat, 30 Sep 2023, Leonardo Corato wrote:

param m := 6;
param w :=     1 50, 2 60, 3 30, 4 40, 5 40, 6 40;
--> param t := 1 A,  2 B , 3 B, 4 C, 5 C, 6 C;
param c := 100;

end;

I have to add a constraint so that the number of types for every bin is
limited to maximum 2.

Each bin can contain a number of the same type of items (i.e. A) or max 2
different types (i.e. A and C).
it is not regarding the number of items, of course, I can have multiple
items.

If you want the types to have names, they will have to be a set.
You could just give them indices.
You will need a 2D boolean array indexed by item and type.
Once you have that, the rest should be obvious.

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]