Re: bpp plus type constrain

2023-10-11 Thread Michael Hennebry
On Wed, 11 Oct 2023, Leonardo Corato wrote: About the upper bound, I realized the bins could't have been enough, so my first code was a greedy solution: 1 bin per 1 item. Two items per bin would also work. Do you think I should write the full bpp with types, code? Maybe it could help

Re: bpp plus type constrain

2023-10-11 Thread Leonardo Corato
Thank you Michael, I already did, I realized immediately it was a typing error. I have to double thank you because you made me understand a thing in which I was stuck. About the upper bound, I realized the bins could't have been enough, so my first code was a greedy solution: 1 bin per 1 item. I

Re: bpp plus type constrain

2023-10-09 Thread Michael Hennebry
On Fri, 6 Oct 2023, Michael Hennebry wrote: YY{y in mouldTypes, b in 1..n, i in I: mo[i]==t} y[t, b] >= x[i, b] ; Oops. A y where a t was needed. The corrected version: YY{t in mouldTypes, b in 1..n, i in I: mo[i]==t} y[t, b] >= x[i, b] ; -- Michael henne...@mail.cs.ndsu.nodak.edu

Re: bpp plus type constrain

2023-10-06 Thread Michael Hennebry
On Fri, 6 Oct 2023, Michael Hennebry wrote: Your estimate of the number of bins necessary could be an underestimate. It does not enforce the only two types in a bin requirement. For larger problems, I think that that would be necessary. I think that all that is needed is another else if: else

Re: bpp plus type constrain

2023-10-06 Thread Michael Hennebry
Your estimate of the number of bins necessary could be an underestimate. It does not enforce the only two types in a bin requirement. For larger problems, I think that that would be necessary. -- Michael henne...@mail.cs.ndsu.nodak.edu "Occasionally irrational explanations are required" --

Re: bpp plus type constrain

2023-10-06 Thread Michael Hennebry
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

Re: bpp plus type constrain

2023-10-06 Thread Graciela Coitinho
Por favor no me envíen más correos, no pertenezco al grupo!! El El vie, oct. 6, 2023 a la(s) 5:32 p.m., Leonardo Corato escribió: > Thank you very much Michael, > and sorry for missing the maling list and sending the email directly to > you. > > I applied > s.t. fred{b in 1..n, t in

Re: bpp plus type constrain

2023-10-06 Thread Leonardo Corato
Thank you very much Michael, and sorry for missing the maling list and sending the email directly to you. I applied s.t. fred{b in 1..n, t in mouldTypes}: sum{i in I: mo[i]==t} x[i, b] <= 2 ; doesn't limit the types to max 2. To check whether s.t. fred worked properly, I added some printf

Re: bpp plus type constrain

2023-10-05 Thread Michael Hennebry
I'm assuming the your e-mail was intended for the list. I'm quoting most of it because the list does not have it. In either case, forget about what I wrote. GMPL is more powerful than I remembered. I think the desired constraint is fred{b in 1..n, t in mouldTypes} sum{i in I: mo[i]==t} x[i, b]

Re: bpp plus type constrain

2023-10-04 Thread Michael Hennebry
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