Best OR-Tools approach for 3D packing (bin packing with rotations) — CP-SAT vs alternatives? #5011
Replies: 4 comments 4 replies
-
|
Hi, I can share some thoughts about 3D packing. I did a solution with CP-SAT, it's not a full 3D packing, but still. I have a task of facade wall prefab panels packing. They are packed to the boxes (with rules of course), these boxes are packed into containers (with rules of course). Initially I have only panels with installation sequence (this sequence could be violated a bit with some rules), and I need to derive boxes and containers from that. Yes, my task does not imply rotation, the boxes in the containers are usually placed in 2 lanes, but could be wider boxes as well. The key takeaways from that:
|
Beta Was this translation helpful? Give feedback.
-
|
Maybe wait for end of Santa challenge 2025 for inspiration. It is 2d packing problem with rotations but from results you can see what works. Of course 3d is more challenging but what doesn’t work in 2d doesn’t work in 3d. I don’t think that cp-sat is suitable - it doesn’t understand geometry, only noOverlap constraints. Rotations can create huge number of variants. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
|
Note: I do not believe in full 3D packing. In most of the cases, boxes cannot hang in the air. They need to rest in a stable way and be fully supported. |
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
-
I’m designing a packing API in Python and would like feedback from people who’ve solved similar problems at scale.
Use case
Input: a list of items (L×W×H, weight, quantity)
Cartons: assumed infinite availability (or selectable from a catalog)
Goal: minimize number of cartons (or cost) and maximize the volume utilization (that is the best set of cartons should be selected by maximizing the vol utilization and minimizing the number of cartons selected.)
Constraints:
Full 3D packing
Item rotations must be considered
and definitely Items should not overlap
Output:
Packed carton list with Exact item placement positions (x,y,z) + orientation used
This is a classic 3D bin packing problem.
Findings so far
I initially considered solving the full 3D placement using OR-Tools CP-SAT (I think its possible BUT IS it the BEST from OR tools for such use cases ? or are there better alternatives in OR tools for this use case)
Questions
Within OR-Tools, is CP-SAT the best choice for the assignment/optimization layer in this use case?
Has anyone successfully used OR-Tools for full 3D packing with rotations?
Am I missing a better modeling approach or tool (inside or outside OR-Tools) that still integrates cleanly with Python?
Also for 100 items and above will it be too complex( I got that from AI it could be time consuming)
Beta Was this translation helpful? Give feedback.
All reactions