I have Products and Boxes. I want to use minimum box count for packaging. Please ignore product and box dimensions (WxHxD). Only focus on volumes.
I need an algorithm for placing these products to boxes. Algorithm must use minimum count of boxes and the smallest boxes it can. Algorithm can use same box more than one. Each product can be used only one time.
I Tried this algorithm
- Order products ascending by volume
- Put smallest product to biggest box, then add next product to box. Until there is no space for next one. Repeat until products finish.
Acoording to this algorithm
- E product to Z-1 Box (Free Space: 2900 cm3)
- B product to Z-1 Box (Free Space: 2700 cm3)
- F product to Z-1 Box (Free Space: 2300 cm3)
- D product to Z-1 Box (Free Space: 1700 cm3)
- A product to Z-1 Box (Free Space: 700 cm3)
- B product to Z-2 Box (Free Space: 1500 cm3)
So algorithm uses 2 pieces Z Box. But human brain can fit (C+A+F+E)= 3000 cm3 (Z box) and (B+D) = 800 cm3 (X Box) Thanks for all comments and replies.