Overview
3D Bin Packing Formulas for Cold Chain Logistics
This section provides the mathematical foundations for pallet load planning – the formulas, logic, and calculations that determine how mixed box sizes can be arranged on standard pallets. These calculations support the article “Why Palletising Is Harder Than Tetris” and inform our palletisation planning tools.
Understanding these formulas explains why palletisation is genuinely complex, why professional service adds value, and why advance information about box dimensions dramatically improves outcomes.
Pallet Specifications (South African Standard)
Euro Pallet Dimensions
| Parameter | Value | Notes |
|---|---|---|
| Length | 1,200 mm | Four-way forklift entry |
| Width | 1,000 mm | |
| Pallet height | 150 mm | Deck thickness |
| Maximum total height | 1,800 mm | Carrier specification |
| Usable stacking height | 1,650 mm | 1,800 – 150 |
| Footprint area | 1.2 m² | 1.0 × 1.2 |
| Usable volume | 1,980 L | 1.0 × 1.2 × 1.65 |
Weight Limits by Route
| Route | Maximum Gross Weight |
|---|---|
| Johannesburg ↔ Cape Town | 940 kg |
| Johannesburg ↔ Durban | 840 kg |
| First/last 6 pallets in full load | 850 kg |
| Default (other routes) | 850 kg |
Combinatorial Complexity
Orientation Combinations
Formula:
O_total = 6^n
Variables:
O_total= Total possible orientation combinationsn= Number of boxes6= Possible orientations per rectangular box (which face up × which face forward)
What It Calculates: The number of ways boxes can be oriented before considering placement. Each rectangular box can be placed with any of its six faces pointing upward, and then rotated around the vertical axis.
Why It Matters: Even before deciding where to place boxes, you’ve already created an exponentially growing problem. For 30 boxes, there are 2.2 × 10²³ orientation combinations – more than the number of stars in the observable universe.
Worked Example:
Given: 30 boxes to palletise
O_total = 6^30
O_total = 2.21 × 10²³
For comparison:
- 10 boxes: 6^10 = 60,466,176 combinations
- 20 boxes: 6^20 = 3.66 × 10¹⁵ combinations
- 30 boxes: 6^30 = 2.21 × 10²³ combinations
Each additional box multiplies complexity by 6.
Placement Sequence Permutations
Formula:
P_total = n!
Variables:
P_total= Total possible placement sequencesn= Number of boxesn!= n factorial (n × (n-1) × (n-2) × … × 1)
What It Calculates: The number of different orders in which boxes could be placed. Placement order matters because earlier boxes constrain where later boxes can fit.
Why It Matters: Factorial growth is faster than exponential growth. By 30 boxes, you have 2.65 × 10³² possible sequences – a number so large it defies intuition.
Worked Example:
Given: 30 boxes to palletise
P_total = 30!
P_total = 30 × 29 × 28 × ... × 2 × 1
P_total = 2.65 × 10³²
For comparison:
- 10 boxes: 10! = 3,628,800
- 20 boxes: 20! = 2.43 × 10¹⁸
- 30 boxes: 30! = 2.65 × 10³²
Doubling boxes increases permutations by roughly 10^15 (quadrillion-fold).
Total Configuration Space
Formula:
C_total = O_total × P_total = 6^n × n!
Variables:
C_total= Total possible configurationsO_total= Orientation combinationsP_total= Placement permutations
What It Calculates: The complete solution space – every possible way the boxes could be arranged considering both orientation and placement order.
Why It Matters: This is the haystack in which we’re searching for the needle (a good configuration). The vast majority of configurations are physically impossible (boxes overlapping), unstable, or exceed constraints.
Worked Example:
Given: 30 boxes to palletise
C_total = 6^30 × 30!
C_total = 2.21 × 10²³ × 2.65 × 10³²
C_total = 5.86 × 10⁵⁵
For perspective:
- Atoms in Earth: ~10⁵⁰
- Atoms in observable universe: ~10⁸⁰
- 30-box configuration space: 10⁵⁵
The problem space is larger than the number of atoms on Earth.
Computational Implication:
If a computer evaluated 1 billion configurations per second:
Time to exhaustively search = 5.86 × 10⁵⁵ / 10⁹ seconds
= 5.86 × 10⁴⁶ seconds
= 1.86 × 10³⁹ years
Age of universe: 1.38 × 10¹⁰ years
Exhaustive search would take 10²⁹ times the age of the universe.
This is why 3D bin packing is classified NP-hard – no efficient algorithm exists.
Space Efficiency Calculations
Theoretical Fill Rate
Formula:
η_theoretical = (Σ V_box) / V_pallet × 100%
Where:
V_pallet = L_pallet × W_pallet × H_usable
Variables:
η_theoretical= Theoretical maximum fill rate (%)Σ V_box= Sum of all box volumes (L or m³)V_pallet= Usable pallet volume (L or m³)L_pallet= Pallet length (1,200 mm)W_pallet= Pallet width (1,000 mm)H_usable= Usable stacking height (1,650 mm)
What It Calculates: The percentage of pallet volume that could be filled if boxes packed with zero wasted space – the upper bound on efficiency.
Why It Matters: Theoretical fill rate sets expectations. If total box volume is 1,500L on a 1,980L pallet, theoretical maximum is 76%. Actual achieved rates will be lower due to geometric constraints. If theoretical is already below target, you need more pallets regardless of how clever your arrangement is.
Worked Example:
Given: Mixed load
- 8× Stock 3 (9.4 L each) = 75 L
- 10× Stock 5 (40.5 L each) = 405 L
- 6× Stock 6 (81 L each) = 486 L
- 6× Butcher's (30.9 L each) = 185 L
- Total: 1,151 L
V_pallet = 1.0 × 1.2 × 1.65 = 1.98 m³ = 1,980 L
η_theoretical = 1,151 / 1,980 × 100%
η_theoretical = 58.1%
Interpretation: Even perfect packing cannot exceed 58% fill.
Realistic achievable: 45-52% (mixed box sizes prevent perfect tiling).
Single Box Type Layer Efficiency
Formula:
η_layer = (n_L × n_W × A_box) / A_pallet × 100%
Where:
n_L = floor(L_pallet / L_box) or floor(L_pallet / W_box)
n_W = floor(W_pallet / W_box) or floor(W_pallet / L_box)
Variables:
η_layer= Layer space efficiency (%)n_L= Boxes fitting along pallet lengthn_W= Boxes fitting along pallet widthA_box= Box footprint area (L_box × W_box)A_pallet= Pallet footprint area (1,200 × 1,000 mm = 1,200,000 mm²)floor()= Round down to nearest integer (partial boxes don’t count)
What It Calculates: How efficiently a single box type covers the pallet footprint in one layer. Tests both orientations to find optimal arrangement.
Why It Matters: Layer efficiency determines how many boxes fit per height level. Low layer efficiency cascades through the entire pallet – you can’t recover lost horizontal space by stacking higher.
Worked Example – Stock 6 (600 × 450 × 300mm):
Orientation A: Length along 1200mm edge
n_L = floor(1200 / 600) = 2
n_W = floor(1000 / 450) = 2
Boxes per layer = 2 × 2 = 4
Coverage = 4 × (600 × 450) = 1,080,000 mm²
η_layer_A = 1,080,000 / 1,200,000 × 100% = 90%
Orientation B: Width along 1200mm edge
n_L = floor(1200 / 450) = 2
n_W = floor(1000 / 600) = 1
Boxes per layer = 2 × 1 = 2
Coverage = 2 × (600 × 450) = 540,000 mm²
η_layer_B = 540,000 / 1,200,000 × 100% = 45%
Optimal: Orientation A (90% layer efficiency, 4 boxes per layer)
Dead space: 1,200,000 - 1,080,000 = 120,000 mm² = 100mm × 1200mm strip
Worked Example – Butcher’s Box (577 × 369 × 145mm):
Orientation A: 577mm along length
n_L = floor(1200 / 577) = 2 (uses 1154mm, leaves 46mm)
n_W = floor(1000 / 369) = 2 (uses 738mm, leaves 262mm)
Boxes per layer = 4
Coverage = 4 × (577 × 369) = 851,652 mm²
η_layer_A = 851,652 / 1,200,000 × 100% = 71%
Orientation B: 369mm along length
n_L = floor(1200 / 369) = 3 (uses 1107mm, leaves 93mm)
n_W = floor(1000 / 577) = 1 (uses 577mm, leaves 423mm)
Boxes per layer = 3
Coverage = 3 × (577 × 369) = 638,739 mm²
η_layer_B = 638,739 / 1,200,000 × 100% = 53%
Optimal: Orientation A (71% layer efficiency)
But 71% is poor - nearly 30% of each layer is wasted.
Layers Per Pallet
Formula:
n_layers = floor(H_usable / H_box)
Variables:
n_layers= Maximum complete layersH_usable= Usable stacking height (1,650 mm)H_box= Box height
What It Calculates: How many complete horizontal layers of a given box height fit within the usable pallet height.
Why It Matters: Partial layers are unstable and waste vertical space. If boxes are 300mm tall and you have 1,650mm height, you get 5 layers (1,500mm) with 150mm wasted at top – 9% vertical inefficiency built in.
Worked Example – Standard Stock Boxes:
Stock 3 (250mm): floor(1650/250) = 6 layers, uses 1500mm, wastes 150mm (9%)
Stock 4 (300mm): floor(1650/300) = 5 layers, uses 1500mm, wastes 150mm (9%)
Stock 5 (300mm): floor(1650/300) = 5 layers, uses 1500mm, wastes 150mm (9%)
Stock 6 (300mm): floor(1650/300) = 5 layers, uses 1500mm, wastes 150mm (9%)
Butcher's (145mm): floor(1650/145) = 11 layers, uses 1595mm, wastes 55mm (3%)
Total Boxes Per Pallet (Uniform Load)
Formula:
N_total = n_per_layer × n_layers
Where:
n_per_layer = optimal layer arrangement from efficiency calculation
n_layers = floor(H_usable / H_box)
Variables:
N_total= Maximum boxes per pallet (uniform product)n_per_layer= Boxes per layer (from layer efficiency calculation)n_layers= Number of layers
Worked Example – Stock 6:
n_per_layer = 4 (from earlier calculation)
n_layers = 5 (1650/300)
N_total = 4 × 5 = 20 Stock 6 boxes per pallet
Volume check:
20 × 81 L = 1,620 L product
1,620 / 1,980 = 81.8% volume utilisation
But layer efficiency was only 90%, so:
Actual space used = 90% × (1500/1650) × 100% = 81.8% ✓
Worked Example – Butcher’s Boxes:
n_per_layer = 4 (from earlier calculation)
n_layers = 11 (1650/145)
N_total = 4 × 11 = 44 butcher's boxes per pallet
Volume check:
44 × 30.9 L = 1,360 L product
1,360 / 1,980 = 68.7% volume utilisation
Layer efficiency 71% × vertical efficiency 97% = 68.9% ≈ 68.7% ✓
Weight Distribution
Centre of Gravity Height
Formula:
H_cg = Σ(m_i × h_i) / Σ(m_i)
Variables:
H_cg= Height of centre of gravity above pallet deck (mm)m_i= Mass of each box or layer (kg)h_i= Height of each box’s centre from pallet deck (mm)
What It Calculates: The vertical position of the pallet’s centre of mass. Lower is more stable.
Why It Matters: High centre of gravity increases tip-over risk during forklift handling and cornering. Target: H_cg below 50% of total height (below 825mm for 1,650mm stack).
Worked Example – Heavy Bottom vs Heavy Top:
Scenario: 5 layers, each 100kg, total height 1500mm
Layer centres from deck:
Layer 1: 150mm (centre of 0-300mm)
Layer 2: 450mm
Layer 3: 750mm
Layer 4: 1050mm
Layer 5: 1350mm
Heavy-at-bottom (Layer 1 = 200kg, others = 75kg):
H_cg = (200×150 + 75×450 + 75×750 + 75×1050 + 75×1350) / 500
H_cg = (30000 + 33750 + 56250 + 78750 + 101250) / 500
H_cg = 300,000 / 500 = 600mm ✓ (below 50%)
Heavy-at-top (Layer 5 = 200kg, others = 75kg):
H_cg = (75×150 + 75×450 + 75×750 + 75×1050 + 200×1350) / 500
H_cg = (11250 + 33750 + 56250 + 78750 + 270000) / 500
H_cg = 450,000 / 500 = 900mm ✗ (above 50%, unstable)
Crush Weight Per Box
Formula:
W_crush = Σ(m_above) × g × SF
Where:
m_above = total mass of all boxes stacked above the box in question
SF = safety factor (typically 1.5-2.0 for dynamic loads)
Variables:
W_crush= Effective crush weight on box (N or kg-force)m_above= Mass above the box (kg)g= Gravitational acceleration (9.81 m/s², often simplified to 10)SF= Safety factor for dynamic loads (vibration, braking, impacts)
What It Calculates: The compressive force experienced by boxes at each layer, accounting for transport dynamics.
Why It Matters: Cardboard boxes have crush ratings (burst test values). Exceeding crush rating damages product and collapses the stack. Bottom layer boxes experience the most stress.
Worked Example:
5-layer stack, each layer 100kg, SF = 1.5 for road transport
Layer 5 (top): W_crush = 0 × 1.5 = 0 kg-force
Layer 4: W_crush = 100 × 1.5 = 150 kg-force
Layer 3: W_crush = 200 × 1.5 = 300 kg-force
Layer 2: W_crush = 300 × 1.5 = 450 kg-force
Layer 1 (bottom): W_crush = 400 × 1.5 = 600 kg-force
If bottom layer has 4 boxes:
Per-box crush load = 600 / 4 = 150 kg-force per box
Stock 6 cartons typically rated for 100-150kg stacking weight.
At 150 kg-force with SF 1.5, boxes are at limit.
Add humidity (weakens cardboard) or shock events → failure risk.
Mixed Load Complexity
Height Mismatch Penalty
Formula:
η_mixed = Σ(n_i × V_i) / V_used
Where:
V_used = A_pallet × max(H_tallest_stack)
Variables:
η_mixed= Actual efficiency of mixed-height arrangementn_i= Quantity of each box typeV_i= Volume of each box typeV_used= Volume of pallet space consumed by the arrangement
What It Calculates: The effective space utilisation when boxes of different heights are combined, accounting for the “tallest stack wins” problem.
Why It Matters: When mixing heights, the tallest stack determines the layer height. Shorter boxes in that layer waste vertical space. Two 145mm butcher’s boxes (290mm total) next to one 300mm Stock 5 waste 10mm. Over 5 layers, that’s 50mm × footprint area of dead space.
Worked Example:
Layer mixing Stock 5 (300mm) and Butcher's (145mm):
Option A: Separate layers
- Stock 5: 4 boxes × 300mm layers
- Butcher's: 4 boxes × 145mm layers
- Both tile independently at their optimal efficiencies
Option B: Same layer
- Must use 300mm layer height (taller box wins)
- Butcher's boxes waste 300 - 145 = 155mm vertical each
- Or stack 2 butcher's (290mm) leaving 10mm gap
Penalty calculation for mixed layer:
2 butcher's stacked = 290mm, in 300mm layer space
Wasted = 10mm per stack position
If 2 stack positions per layer, 5 layers:
Total waste = 10mm × 2 × 5 = 100mm × footprint area
For butcher's footprint (~577 × 369mm):
Wasted volume = 0.577 × 0.369 × 0.1 × 2 = 0.043 m³ = 43 L
Practical Heuristics
Layer Building Priority
Logic:
1. Sort boxes by height (descending)
2. Group boxes within ±10mm height tolerance
3. Build complete layers from each height group
4. Stack layer groups with tallest at bottom
Why It Works: Minimises height mismatch penalties by keeping similar heights together. Tall layers at bottom places heavy items low (assuming larger boxes are heavier).
Gap Filling Strategy
Logic:
1. Calculate residual space after major box placement
2. If gap > smallest box dimension: attempt to fill
3. If gap < smallest box dimension: accept as dead space
4. Position dead space toward pallet centre, not edges
Why It Works: Centre gaps get compressed by surrounding load. Edge gaps allow shifting and collapse. Small gaps that can’t be filled aren’t worth solving – move to the next pallet.
Weight Limit Check
Formula:
Pass/Fail = (Σ m_boxes + m_pallet + m_wrap) ≤ W_limit_route
Typical Values:
m_pallet= 20-25 kg (wooden Euro pallet)m_wrap= 1-2 kg (shrink wrap)W_limit_route= 840-940 kg depending on destination
Application: Before finalising arrangement, verify total weight. Space-optimal arrangements may exceed weight limits, requiring removal of bottom-layer boxes (the heavy ones contributing to stability).
Tool Implementation Logic
Input Requirements
For accurate palletisation planning, the tool requires:
| Input | Format | Purpose |
|---|---|---|
| Box dimensions | L × W × H (mm) | Tiling calculations |
| Quantities | Integer per box type | Volume and count totals |
| Box weight | kg per box | Weight limit and distribution |
| Crush rating | kg (optional) | Stacking constraints |
| Route | JHB↔CPT / JHB↔DBN / Other | Weight limit lookup |
Output Calculations
- Theoretical fill rate – Upper bound on efficiency
- Layer efficiency by box type – Optimal orientation for each
- Estimated pallet count – Ceiling of (total volume / achievable pallet volume)
- Weight distribution preview – Centre of gravity estimate
- Constraint warnings – Weight limit, crush risk, stability concerns
Algorithm Approach
Given NP-hard complexity, the tool uses heuristic approximation:
1. Sort boxes by volume (descending) - large boxes first
2. For each box type, calculate optimal layer orientation
3. Build virtual layers, grouping by compatible heights
4. Stack layers bottom-to-top, heavy first
5. Calculate residual space, attempt gap filling with small boxes
6. Verify constraints (weight, stability, crush)
7. Output arrangement and pallet count estimate
This produces good solutions (typically within 10-15% of optimal) in milliseconds rather than millennia.
Validation Notes
These formulas represent:
- Standard 3D bin packing mathematics
- Practical constraints from South African long-haul requirements
- Operational experience from The Frozen Food Courier
Actual results vary based on:
- Box condition (warped cardboard reduces tiling efficiency)
- Product-specific constraints (orientation requirements, crush sensitivity)
- Carrier-specific rules (some require specific label positions affecting orientation)
Related Resources:
Mathematics doesn’t make palletising easy. It explains why it’s hard – and why getting it right matters.
