2

I'm working on an algorithm to optimize the packing of items in boxes.

I can have up to 20 items which I need to pack in as few boxes as possible (6 possible box sizes), while minimizing the wasted volume within the boxes. I thought of implementing a variation of the 3D BPP algorithm - which solves part of my problem - but cannot find any algorithm written in Python.

Does anyone have suggestions of the way to go or of python algorithms for 3D BPP which I could use?

Thanks!

Louis Dussart
  • 31
  • 1
  • 3
  • This is quite broad...mind specifying an example so we know what exact data is your input and desired output? – Don Thousand Jul 23 '18 at 15:44
  • Yes: I have the list of items which customers have ordered over the past year (for each item: height, width, length) on the one hand and a list of 6 boxes. First step: I am trying to see for each order what boxes to choose to pack the items (I want to have all of them in 1 box as much as possible) and second step: revamp the boxes' sizes to optimize the packing considering the past orders. – Louis Dussart Jul 24 '18 at 08:17

2 Answers2

4

Unfortunately, the problem you want to solve here is NP-complete, so there are no great absolute solutions to this problem, but the following papers provide some nice heuristic algorithms which are not difficult to implement.

OPTIMIZING THREE-DIMENSIONAL BIN PACKING THROUGH SIMULATION

Three-dimensional packings with rotations

An Improved Three-Weight Message-Passing Algorithm

Don Thousand
  • 1,202
  • 8
  • 28
0

The first link posted by Don Thousand, "Optimizing...", has not lasted three years. Another 3D packer, Enzo Ruiz, has saved it on his GitHub page https://github.com/enzoruiz/3dbinpacking the link to the paper by Erick Dube is https://github.com/enzoruiz/3dbinpacking/blob/master/erick_dube_507-034.pdf