How Mathematics Improves The World | Fitting More Cargo Into the Same Container Without Crushing Anything
A container looks like empty space with walls.
That makes loading look easy.
Put boxes inside until no more fit.
Except the heaviest box may now be sitting on the lightest.
The centre of gravity may be too far to one side.
A fragile machine may be trapped behind twenty pallets even though it must be unloaded first.
A drum may fit geometrically and still be unsafe because it can roll.
A dense cluster near one patch of floor can overload the container structure or handling equipment.
An apparently full container may still contain thousands of litres of unusable void space because the boxes were arranged badly.
And once the doors close, the container may travel by truck, crane, rail and ship, experiencing acceleration in several directions.
So loading is not merely a geometry problem.
It is geometry under safety, strength, order and transport constraints.
Mathematics helps logistics systems find packing plans that use space efficiently without turning the container into a hidden hazard.
Quick Read
The container-loading problem is a three-dimensional form of bin packing. Given boxes or cargo items with dimensions, weights and operational constraints, choose positions and orientations inside a container so that items do not overlap, remain inside boundaries and satisfy safety rules. The objective might maximise volume utilisation, cargo value, number of items loaded or a weighted combination.
The problem is computationally difficult because the number of possible arrangements grows explosively. Even simplified one-dimensional bin packing is NP-hard; real 3D cargo loading adds rotations, stacking, support surfaces, fragility, weight distribution, unloading order and stability. Recent logistics research therefore uses heuristics, block-building methods, genetic algorithms, simulated annealing and hybrid optimisation rather than brute-force enumeration.
Safety constraints are not optional decorations around the optimiser. The IMO/ILO/UNECE Code of Practice for Packing of Cargo Transport Units instructs packers to distribute heavy cargo appropriately over the floor, keep the centre of gravity correctly located, avoid heavy goods on top of light goods and secure cargo against sliding and tipping. IMO guidance emphasises that improper stowage and securing have caused serious casualties and that loads experience vertical, longitudinal and transverse accelerations in transport.
One-sentence answer: Mathematics improves the world by turning container loading into a constrained three-dimensional optimisation problem, allowing logistics systems to use more of the same physical space while respecting weight, balance, support, unloading and securing requirements that keep people and cargo safe.
Volume Utilisation Is the First Number
If the container has internal volume V and loaded cargo occupies total box volume B, a simple utilisation measure is:
utilisation = B/V.
90% looks better than 75%.
But volume is not everything.
A dense shipment can reach maximum legal gross weight before filling the container.
A fragile shipment may need protective voids.
An unloading sequence may require accessible corridors.
The optimiser must know whether space, weight or operational access is the binding resource.
Three Dimensions Create Rotation Choices
A rectangular carton with sides a, b and c can have up to six axis-aligned orientations.
Which side faces down?
Which side aligns with container length?
Rotation can make a box fit into a gap.
Rotation can also violate “this side up”.
Some cargo may allow 90-degree rotation around one axis but not inversion.
Orientation is therefore a discrete variable constrained by handling instructions.
Non-Overlap: Every Pair of Boxes Needs Separation Somewhere
For two axis-aligned boxes i and j not to overlap, at least one of six relationships must hold:
- i is left of j;
- i is right of j;
- i is in front of j;
- i is behind j;
- i is below j;
- i is above j.
This logical “or” is what makes mathematical programming formulations combinatorial.
Mixed-integer models introduce binary variables to select which spatial relationship applies.
With hundreds of boxes, pairwise possibilities explode.
Container Bounds: Everything Must Stay Inside
If box i begins at coordinates (xi,yi,zi) and has oriented dimensions (li,wi,hi), then:
0 ≤ xi, xi+li ≤ L
0 ≤ yi, yi+wi ≤ W
0 ≤ zi, zi+hi ≤ H.
Simple inequalities define the physical walls.
The hard part is choosing coordinates that satisfy them for every item simultaneously.
Why Brute Force Fails
Twenty boxes.
Even before continuous coordinates, 20! possible loading orders exist.
That is roughly 2.4×1018.
Add orientations.
Add positions.
Add stacking constraints.
Exact enumeration becomes impossible.
This is why container loading belongs to operations research.
We need intelligent search through a huge feasible space.
NP-Hardness: Difficulty Is Structural, Not Bad Programming
One-dimensional bin packing is already NP-hard.
Three-dimensional container loading contains that simpler problem inside it.
Therefore no known algorithm solves all large cases optimally in polynomial time.
Industry relies on heuristics that produce very good solutions quickly.
Mathematical maturity includes knowing when “optimal” is computationally too expensive and “excellent in two seconds” is more useful.
Extreme Points: Good Placements Often Touch Something
A box floating in the middle of empty air is rarely useful.
Efficient packings place boxes against walls, floor surfaces or existing boxes.
Many algorithms therefore consider a finite set of candidate “extreme points” generated by corners of already placed items.
Instead of searching every real-valued coordinate, search strategically meaningful locations.
Geometry reduces the continuous search space to a manageable discrete frontier.
Block Building: Combine Boxes Into Larger Regular Shapes
Heterogeneous cartons create irregular packing.
One heuristic groups compatible boxes into blocks.
Five identical cartons become one rectangular block.
Blocks are easier to place than individual items.
A 2025 open-access study in the EURO Journal on Transportation and Logistics combines block-generating heuristics with placement-point strategies and an improved genetic algorithm to handle strongly heterogeneous cargo and real-world constraints.
Aggregation simplifies search without forgetting the individual boxes inside.
Support Constraints: A Box Cannot Stand on Air
Geometric non-overlap allows a box to be placed at z=1 metre even if nothing supports it.
Real packing cannot.
A box must be supported by the floor or by other cargo beneath it.
Some models require a minimum percentage of base area supported.
Others calculate pressure on supporting boxes.
Stability turns a pure packing puzzle into mechanics.
Stacking Strength: Lower Boxes Have Limits
A carton can carry only so much weight.
If boxes j sit above box i, then:
Σ weight above i ≤ stacking capacity of i.
The IMO/ILO/UNECE CTU Code advises against stowing heavy goods on top of light goods.
This common-sense instruction becomes a mathematical inequality in a loading algorithm.
Safety guidance and optimisation can speak the same language.
Centre of Gravity: A Full Container Can Still Be Badly Loaded
If item i has mass mi and centre coordinate xi, the cargo centre of gravity along one axis is:
x̄ = Σmixi/Σmi.
Do the same in y and z.
A high centre of gravity increases tipping risk.
An eccentric lateral centre creates uneven load.
CTU guidance explicitly instructs packers to locate the centre of gravity appropriately and avoid eccentric load distribution.
Volume utilisation is subordinate to stable mass distribution.
Floor Loading: Weight Must Be Distributed
A machine weighing ten tonnes may fit easily.
Place its tiny feet directly on the floor and local pressure can become excessive.
Spread the load using timber or steel supports.
The same total mass becomes safer because force is distributed over greater area.
CTU guidance specifically warns against concentrating heavy cargo on small floor areas.
Pressure is:
p = F/A.
Elementary physics prevents structural damage.
Axle Loads: The Container Is Part of a Truck Too
A perfectly balanced shipping container at sea can become an illegal road load if weight distribution overloads trailer axles.
Moment balance determines axle reactions.
Put too much dense cargo near one end and one axle group carries excessive load.
Intermodal loading therefore has to respect road, rail and maritime constraints together.
The container travels across several physical systems.
Securing: Heavy Objects Move When the Vehicle Moves
A common mistake is assuming heavy cargo cannot move.
IMO/ILO/UNECE guidance says the opposite explicitly.
Transport subjects cargo to longitudinal, vertical and transverse accelerations.
Force scales with mass:
F = ma.
A 5,000 kg machine under 0.5g lateral acceleration produces roughly 24.5 kN of lateral inertial force.
Mass makes securing more important, not less.
Friction Helps but Is Not a Promise
Friction force is approximately:
Ffriction ≤ μN.
Non-slip mats increase μ.
But moisture, contamination and vibration can change contact conditions.
CTU guidance therefore combines tight packing, blocking and lashing rather than relying casually on weight and friction alone.
A safety factor belongs between theoretical friction and real transport.
Blocking and Bracing: Turn Empty Space Into Structure
Void space is bad not only because it wastes volume.
It lets cargo accelerate before impact.
Blocking fills space with timber, airbags, dunnage or engineered restraints so cargo cannot build momentum.
Bracing transfers load to stronger structural regions.
The optimiser can include maximum allowed gaps or reserved dunnage zones.
Sometimes “unused” space is actually safety equipment.
Lashing: Geometry Turns Tension Into Restraint
A lashing applies tension along its own direction.
Only the component opposing cargo motion provides direct restraint.
Angles matter.
A badly angled lashing can have high tension and poor horizontal restraint.
Vector decomposition calculates effective components.
Securing becomes trigonometry attached to webbing and steel.
Fragility: Some Boxes Can Carry Zero Weight
A pallet of ceramic instruments may have high value and low stacking tolerance.
Mark it “non-stackable”.
The algorithm must reserve the vertical column above it.
Geometrically that space looks wasteful.
Economically it protects the cargo.
The objective should maximise delivered value, not cubic metres filled.
Orientation Constraints: “This Side Up” Is a Mathematical Rule
Liquid containers.
Refrigerators.
Machinery with oil reservoirs.
Glass panels.
Some cargo may be rotated only within a subset of orientations.
Allowed-orientation sets reduce flexibility.
That can lower theoretical utilisation and prevent damage.
Real optimisation respects meaning printed on the box.
Unloading Order: The First Delivery May Need to Be Loaded Last
A truck serves customers A, B and C.
If A is first stop, A’s cargo should be accessible near the door.
Otherwise workers must unload B and C temporarily.
That costs time and increases damage risk.
Loading order can therefore be constrained by reverse delivery sequence.
Container loading becomes coupled to vehicle routing.
Multi-Drop Logistics: Geometry and Route Design Meet
The shortest delivery route may be impossible to load efficiently.
A slightly longer route may permit a clean last-in-first-out packing sequence.
Integrated vehicle-routing-and-loading problems optimise route and packing together.
One problem decides where the truck goes.
The other decides whether the truck can physically carry that route’s cargo.
Logistics is a coupled system.
Weight-Limited Versus Volume-Limited Cargo
Steel parts reach weight limits quickly and leave empty cubic space.
Pillows fill volume long before weight.
A mixed shipment can use both constraints more efficiently.
This resembles portfolio diversification.
Combine dense and light cargo and the container can approach both weight and volume capacity simultaneously.
Heterogeneity can improve utilisation if arranged safely.
Dimensional Weight: Freight Pricing Knows About Empty Space
A light parcel can occupy enormous volume.
Carriers therefore often price using dimensional or volumetric weight:
dimensional weight ∝ length × width × height / divisor.
The exact divisor depends on carrier and service.
Pricing converts scarce cubic capacity into an economic signal.
Bad packaging becomes expensive even when mass is low.
Palletisation: Standardisation Simplifies Geometry
Thousands of loose cartons are difficult to handle.
Stack them onto standard pallets.
Now forklifts can move them as units.
But pallet dimensions can create unused strips inside containers.
Box dimensions can be designed to tile pallet footprints efficiently.
Packaging design and container loading interact upstream.
Packaging Can Be Optimised Before Packing
One product ships in a box 51 cm wide.
Two boxes almost fit across a 100 cm pallet.
Almost is useless.
Redesign the packaging to 49.5 cm and two fit.
Pallet utilisation jumps.
Container utilisation may improve too.
A few millimetres in packaging design can reduce trucks, storage and emissions throughout the supply chain.
Cutting Stock: Sometimes We Make the Boxes to Fit the Material
Container loading packs finished objects into space.
Cutting-stock problems run the geometry backwards.
Cut smaller pieces from standard rolls, sheets or bars while minimising waste.
The two problems are mathematical relatives.
One fills a container.
The other empties a stock sheet intelligently.
Genetic Algorithms: Evolve Packing Sequences
Encode a loading order and orientation choices as a chromosome.
Decode it into a packing using a placement heuristic.
Score the result.
Select better candidates.
Crossover.
Mutate.
Repeat.
Recent container-loading research uses improved genetic algorithms precisely because the combinatorial search space is too large for direct enumeration.
Evolution becomes a search metaphor implemented in code.
Simulated Annealing: Escape a Locally Good Packing
A heuristic reaches 88% utilisation.
Every small change makes the packing worse.
It is trapped in a local optimum.
Simulated annealing occasionally accepts a worse move early.
That can open a path to a better region of the search space.
As temperature cools, worse moves become rarer.
Recent algorithms combine annealing with genetic search for this reason.
Greedy Heuristics: Fast Rules Can Be Surprisingly Strong
Sort boxes by descending volume.
Place each in the lowest, deepest, leftmost feasible point.
Simple.
Fast.
Often good.
Not always optimal.
A large awkward box placed first can block a combination of smaller boxes that would have used space better.
Heuristics trade proof of optimality for speed and robustness.
Lower Bounds: Know How Far You Might Be From Optimal
Suppose total cargo volume is 2.6 container volumes.
At least three containers are required.
That is a volume lower bound.
Weight may give another.
Orientation or incompatibility can raise the true minimum.
If a heuristic uses four containers while a strong lower bound is three, the gap is at most one container.
Bounds let approximate solutions be evaluated intelligently.
Dangerous Goods: Some Things Must Not Be Neighbours
Certain hazardous materials require segregation under transport regulations.
Two items may each fit perfectly and be forbidden in the same container or compartment.
Compatibility becomes a graph:
edge = cannot co-load.
The optimisation must colour or partition the graph while packing geometry simultaneously.
Safety rules create combinatorial structure.
Temperature Zones: Refrigerated Cargo Adds Another Dimension
A reefer container needs airflow.
Packing too tightly can block circulation and create hot spots.
Different products may require different temperature or ventilation conditions.
Maximising geometric fill can reduce thermal performance.
Void space can be necessary for cold-chain physics.
The optimiser should maximise delivered quality, not empty-space elimination.
Moisture and Condensation: Packing Changes the Microclimate
Warm humid air enters during loading.
Container cools at sea.
Water condenses.
Cargo moulds or corrodes.
CTU guidance includes condensation and cargo-condition concerns because a mechanically perfect packing can still fail environmentally.
Logistics optimisation must respect material science.
Loading Time: The Perfect Packing May Take Too Long to Build
An algorithm finds 96% utilisation.
It requires 400 individually sequenced placements.
A simpler 93% plan uses 40 pallet moves.
Which is better?
Warehouse labour, loading dock time and error probability matter.
Practical optimisation often penalises complexity.
Three extra percentage points of space may not justify ten times the handling.
Human Execution: A Plan Must Be Understandable
A loading algorithm outputs coordinates to millimetre precision.
Warehouse workers need a sequence they can execute safely.
Visual load plans, numbered items and layer diagrams convert optimisation into action.
If workers cannot identify boxes or access the intended placement, the plan is not operationally feasible.
An optimiser has to communicate with the floor.
Scanning and Digital Twins: Did the Container Get Loaded as Planned?
Barcode or RFID scans can confirm each item entered the container.
Computer vision can estimate position.
Load cells can verify mass.
A digital twin compares planned state with actual loading.
If one pallet is missing, the centre-of-gravity calculation changes.
The plan must update.
Execution feedback closes the logistics loop.
Uncertainty: Dimensions in the Database Can Be Wrong
A carton is listed as 600 mm wide.
Real carton bulges to 615.
An exact packing with zero clearance fails physically.
Robust packing adds tolerances for packaging variation, pallet overhang and measurement error.
Perfect geometry is fragile geometry.
A centimetre of margin can be worth more than one theoretical extra box.
Demand Uncertainty: The Shipment Can Change While the Container Is Being Planned
Orders arrive late.
One pallet is delayed.
Another becomes urgent.
Static optimal packing becomes obsolete.
Rolling-horizon logistics replans as the shipment set changes.
Real operations need fast re-optimisation, not one perfect answer at midnight.
Sustainability: Better Packing Can Remove Entire Trips
Suppose 100 containers currently carry a shipment at 80% average useful utilisation.
Improve practical utilisation enough and the same cargo may fit into fewer containers.
Each avoided container can reduce:
- truck kilometres;
- terminal moves;
- ship slots;
- handling;
- storage;
- fuel and emissions.
Representation and optimisation substitute for physical capacity.
A better arrangement can act like more infrastructure.
But Maximum Fill Can Increase Damage
Push utilisation too hard.
Boxes are compressed.
Workers cannot access lashings.
Airflow disappears.
Unloading becomes dangerous.
The optimum is not maximum cubic fill.
It is maximum useful, safe, executable logistics value.
A Classroom Thought Experiment: Pack the Shoebox
Give students one shoebox and ten rectangular blocks of different dimensions.
Goal 1:
maximise occupied volume.
Then add rules:
- red block must stay upright;
- black block weighs five times more;
- yellow block cannot support anything;
- blue block must be removed first.
The best packing changes.
Students learn how constraints turn a puzzle into operations research.
A Second Thought Experiment: Find the Centre of Gravity
Place three masses on a ruler at positions 10, 50 and 90 cm.
Use masses 1, 2 and 5 kg.
Calculate:
x̄=(1×10+2×50+5×90)/(1+2+5)=70 cm.
The heavy object pulls the centre toward itself.
Move it to 40 cm.
Recalculate.
Students see why cargo placement affects vehicle balance.
Primary Mathematics: Packing Begins With Measurement
Primary students already know:
- length;
- area;
- volume;
- mass;
- fractions;
- coordinates;
- spatial reasoning.
Does it fit?
How much space remains?
Which box belongs underneath?
The foundations are already a logistics problem.
Secondary Mathematics: Packing Becomes Constraints
Secondary students add:
- inequalities;
- vectors;
- moments;
- trigonometry;
- combinatorics;
- optimisation;
- graphs.
Container walls become inequalities.
Centre of gravity becomes weighted average.
Lashing forces become vector components.
Loading order becomes combinatorics.
Advanced Mathematics: Container Loading as Combinatorial Optimisation
Modern loading systems draw on:
- integer programming;
- computational geometry;
- metaheuristics;
- constraint programming;
- graph theory;
- mechanics;
- robust optimisation;
- vehicle routing.
Geometry says where things can fit.
Mechanics says whether they will stay safe.
Operations research says which feasible arrangement best serves the logistics objective.
Why This Improves the World
1. It gets more useful freight from the same container fleet
Better loading reduces unused space and can lower the number of transport units required.
2. It improves safety
Weight distribution, centre-of-gravity and securing constraints prevent efficient-looking but hazardous arrangements.
3. It reduces product damage
Fragility and stacking limits are included before cargo enters the container.
4. It reduces handling time
Loading and unloading order can be planned together with route sequence.
5. It improves packaging design
Upstream dimensions can be redesigned to tile pallets and containers more efficiently.
6. It reduces physical waste and emissions
Fewer partially empty transport units mean less energy spent moving air.
What Mathematics Does Not Do
Maximum volume utilisation does not guarantee safe loading.
A geometric fit does not guarantee adequate support.
An optimisation output does not replace cargo securing requirements.
A database dimension does not guarantee the real carton has that exact size.
A high-quality heuristic does not prove global optimality.
Automation does not remove the need for trained packers and supervisors.
And a container should never be packed more densely by violating safety rules merely because the algorithm can fit one more box.
Frequently Asked Questions
What is the container loading problem?
It is the optimisation problem of placing three-dimensional cargo inside one or more containers while satisfying non-overlap, boundary and operational constraints and maximising an objective such as utilisation or cargo value.
Why is container loading difficult?
The number of possible item orders, orientations and positions grows combinatorially. Real applications also include stacking, weight, stability, unloading and safety constraints.
Why does centre of gravity matter?
Poor mass distribution can create unstable handling, excessive axle loads or dangerous vehicle behaviour. Safe packing keeps the combined centre of gravity within appropriate limits.
Why not simply fill every gap?
Some gaps are needed for dunnage, securing, airflow, unloading access or dimensional tolerance. Maximum geometric fill can reduce safety and practical usability.
What algorithms are used?
Methods include greedy placement heuristics, block-building, extreme-point methods, mixed-integer optimisation, genetic algorithms, simulated annealing and other hybrid metaheuristics.
Sources and Further Reading
- International Maritime Organization, IMO/ILO/UNECE Code of Practice for Packing of Cargo Transport Units, covering safe packing and securing across intermodal transport.
- UNECE CTU Code guidance on packing and cargo securing, including weight distribution, centre of gravity, sliding and tipping.
- A Three-Dimensional Container Loading Algorithm for Solving Logistics Packing Problem, EURO Journal on Transportation and Logistics, 2025.
Continue Through eduKateSG
Continue with How Mathematics Works. Compare this article with Keeping Supermarket Shelves Full Without Filling Warehouses With Waste, where logistics capacity is again balanced against uncertainty and operational cost, and with Testing a Structure Before Reality Has To, where mechanical limits remain above numerical optimisation.
Final Thought: The Empty Space Is Not Always Waste
A box fits.
That is not enough.
Can the box support what sits above it?
Can workers unload it safely?
Will the load remain stable when the ship rolls?
Is the weight centred?
Does cold air still circulate?
Will the first customer’s cargo be reachable?
Mathematics improves the world here by refusing to call a container “full” merely because no visible gap remains.
The best loading plan is not the one that removes every centimetre of emptiness.
It is the one that turns the largest safe fraction of that finite box into useful transport.
