This article uses the Best Fit Packing algorithm.
Let’s say you have 3 SKUs with varying dimensions that need to pack together into pre-defined boxes:
- BIKE – 30x10x16
- T-shirt – 4x1x4
- Book – 8x4x2
These can pack together into one of several boxes:
- Small – 6x6x4
- Medium – 12x10x8
- Large – 35x12x18
Small box has a volume of 144 (6x6x4)
- T-shirt has a volume of 16 (4x1x4) so up to 9 can fit into this box
- The lengths of the “Book” and “BIKE” products are larger than the dimensions of this box so it cannot pack
Medium box has a volume of 960 (12x10x8)
- T-shirt has a volume of 16 (4x1x4) so up to 60 can fit into this box
- Book has a volume of 64 (8x4x2) so up to 15 can fit into this box
- The length of the “Bike” is larger than the dimensions of this box so it cannot pack
Large box has a volume of 7,560 (35x12x18)
- T-shirt has a volume of 16 (4x1x4) so up to 472 can fit into this box
- Book has a volume of 64 (8x4x2) so up to 118 can fit into this box
- Bike has a volume of 4,800 so 1 can fit into this box
The T-shirt is malleable so we want to retain the use of volume-based packing for this product.
Although the bike is not malleable multiple T-shirts could be packed inside the frame and items placed underneath the frame so the volume is preferred here too.
The book, however, has fixed dimensions so we want to ensure that only 1 of that SKU can fit into the medium box and 12 into the large box. One option could be to adjust the dimensions of the product so that only 1 of that product can fit into the box volumetrically. Alternatively, you could set the max weight on the box to ensure that multiple T-shirts could still pack as that is lighter than the book.