Hello,

I need help with Bin Packing Problem. Suppose we have a standard one with all standard constraints. The only difference is that I have a set of bins and set of containers:

BINS=[A,B,C,D]

Containers=[1,2,3,4,5,6]

each container has 76 m3 capacity and capacities of each bin are known:

BinCapacity=[0.024, 0.03, 0.02, 0.024]

it is also known the number of bins of each type that has to be packed in container

BinNumber=[1000, 1500, 910, 1200]

How is it possible to modify a standard bin packing problem (constraints or sets) if the number of bins of each type is predefined?

Unfortunately, I was not able to find the answer and cannot solve the problem

Looking forward to your reply!

Thank you!

If I am reading you correctly, your question is how to pack bins into containers, where many bins are of the same characteristics, so really to decide how many of every bin type go into each container. You could use a formulation like the following with Mosel:

declarations

CONTAINERS=1..6

BINS={'A','B','C','D'}

CCAP: real

BVOL: array(BINS) of real

NUMB: array(BINS) of integer

assign: array(BINS,CONTAINERS) of mpvar

end-declarations

CCAP := 76

BVOL::(['A','B','C','D'])[0.024, 0.03, 0.02, 0.024]

NUMB::(['A','B','C','D'])[1000, 1500, 910, 1200]

forall(b in BINS, c in CONTAINERS) do

assign(b,c) is_integer

assign(b,c)<=NUMB(b)

end-do

! Container capacity limit

forall(c in CONTAINERS) sum(b in BINS) BVOL(b)*assign(b,c) <= CCAP

! Pack all bins

forall(b in BINS) sum(c in CONTAINERS) assign(b,c)<=NUMB(b)

BinsPacked:= sum(b in BINS, c in CONTAINERS) assign(b,c)

maximise(BinsPacked)

if BinsPacked.sol = sum(b in BINS) NUMB(b) then

writeln("All bins packed")

end-if