BoxPacker icon indicating copy to clipboard operation
BoxPacker copied to clipboard

Optimization of Packing in Smaller and Cheaper Boxes

Open grzegorzrzeznikiewicz opened this issue 1 year ago • 1 comments

Hello, I have a question. Is it possible to set up a scenario to show packing in smaller boxes that are cheaper? For example:

Product dimensions: 10 x 10 x 10 cm

Dimensions of Box 1: 15 x 15 x 15 cm, price 5 USD

Dimensions of Box 2: 60 x 60 x 60 cm, price 60 USD

We need to pack 3 products, which fit into the second box, but I would like to pack the products into 3 of the first boxes. Is it possible to achieve this? The BoxPacker version is 3.12.

grzegorzrzeznikiewicz avatar Nov 07 '24 13:11 grzegorzrzeznikiewicz

Yes, there are 2 ways of doing this depending on how complex your needs are:

If it's a case of "only use box 2 if the item literally doesn't fit inside box 1", then the mechanism at https://boxpacker.io/en/stable/sortation.html#choosing-between-permutations is probably suitable, simply override the sorter and sort by price. As long as you've got < 12 boxes that should always give a good result.

You can also use the mechanism at https://boxpacker.io/en/stable/all-permutations.html to brute-force it and again sort by price but from what you describe I don't think you need to do that here.

dvdoug avatar Nov 16 '24 20:11 dvdoug