Bin Packing – Simple Approach
Max Qty in box per product must be supplied. If not, certain provisions apply.
Option to allow mixing with other products
Tolerance 1: Ignore adding to box if empty space is less than for example ¼ box.
Tolerance 2: Ignore adding to box from none specified products if empty space is less than for example ¼ box.
-
Procedure
Group cart items by Product
Calculate boxes based on Quantity in Box Value.
If Mix is allowed then add the leftovers that are bigger than Tolerance 1 and get the up integer
If Mix is not allowed then ignore the empty space.
If Mix is allowed and there are unspecified Max in Box products then if the empty space is more than Tolerance 2 then add the filled parts and get the up integer
If Mix is not allowed then just use one extra box for all none specified products.
Assumption: Bin size is the same for all products if mix is allowed
Example 1:
Tolerance 1: ¼ box
Tolerance 2: ½ box
Product Name Qty Max Boxes
Product 1 15 12 1 ¼
Product 2 10 4 2 ½
Product 3 15
If mix is allowed then ¼ + ½ = ¾ use one extra box, that is, 1 + 2 + 1 = 4
Empty space left is ¼ (less then Tolerance 2) then use an extra box for Product 3, total = 4 + 1 = 5
If mix is not allowed then use 2 + 3 + 1 (Product 3) = 6
Example 2:
Tolerance 1: ¼ box
Tolerance 2: ½ box
Product Name Qty Max Boxes
Product 1 15 12 1 ¼
Product 2 10 4 2 ½
Product 3 11 4 2 ¾
Product 4 15
If mix is allowed then ¼ + ½ + ¾ = 1½ use two extra boxes, that is, 1 + 2 + 2 + 2 = 7
Since empty space left is ½ (within tolerance 2) then do not use an extra box for Product 4
If mix is not allowed then use 2 + 3 + 3 + 1 (Product 4) = 9
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article