I have read about cutting stock problem, but this is a bit different.
We have orders in different variants, and a maximum sized machine to produce it.
Variants would be, X,S,XL,L and ordered quantities, 100,40,40,80
X > 100
S > 40
XL > 40
L > 80
Say, machine width is 6
This means, we can put 6 different variants together and produce it.
We can put 2 X,1 S,1 XL,2 L , this means if we produce it 50 times , output is :
X > 100 (0 waste)
S > 50 (10 waste)
XL > 50 (10 waste)
L > 100 (20 waste)
Total of 40 waste in 300 produced.
Another aproach to reduce waste would be creating 2 different variation. We can put 4 X,2 S and produce it 25 times, with 10 waste and make another setup and put 2 XL,4 L and produce it 20 times with no waste. With total 10 waste we handled this production in 2 setups.
Since setup has a price, we would prefer first setup, or depending on quantities, we may choose the second one.
I have read about cutting stock and it looks similar to this one, but ability to divide quantities between different setups, this has more potential to optimize and therefore more complex.
I have thought about it, and couldn't come with a reliable solution, If this problem has any place in literature, could you at least tell me the keywords so I can search for it?
Note : I know basic mathematics and good python programming language.