Most logistics teams are losing money on this without measuring it.
Every day, in ports, warehouses, and logistics control rooms, someone decides what goes into which container, in what order, stacked how high, next to what. That decision happens fast and usually by feel, not by formula.
The gap between feel and formula is where the money goes.
Heading into the second half of 2026, the container shipping market is doing something unusual: it is structurally oversupplied and sharply volatile at the same time. The global fleet absorbed more than 7 million TEU of new capacity between 2024 and 2026, pushing major east-west routes into double-digit oversupply. Yet the Drewry World Container Index still jumped 5% in a single week in late June as early peak-season demand hit transpacific lanes, and spot rates on some routes can move by 10 to 20% within a week. China-to-US bookings remain roughly 30% below last year as tariff uncertainty pushes importers toward Southeast Asian sourcing, while trade policy questions, including the timing of the USMCA review and Section 301 adjustments, keep planning horizons short.
None of that volatility is something a logistics team controls. What every team controls is how efficiently each container it ships is used. That’s where mathematical optimization earns its place.
The bin packing problem
Container loading is a version of what operations researchers call the bin packing problem: a class of combinatorial optimization problems that asks how to fill a fixed-capacity container with items of varying size, weight, and constraints while minimizing waste and maximizing value.
The Tetris comparison gets the idea across, but the real problem runs in three dimensions, not two. It involves weight limits, weight distribution for stability, stacking rules for fragile cargo, sequencing tied to which port unloads first, and regulatory compliance on top of all of it. Fitting the shapes together is the easy part. Fitting them in the right order, in the right configuration, at the lowest cost, while satisfying every constraint at once, is the actual problem.
Why the common-sense approach falls short
Most loading decisions still run on heuristics: sort by weight, sort by size, fill containers in sequence. These rules are fast and intuitive, but they make locally optimal choices without seeing the full picture. A heuristic might pack one container perfectly while leaving the next one a third empty.
One small worked example makes the principle visible: a shipment of 11 parcels that needed three containers under manual sorting needed only two once the loading was modeled as a mixed integer linear program, a one-third reduction in container count. The example is intentionally simple. The principle holds at scale. Across thousands of shipments a week, that kind of inefficiency compounds into a real, recurring cost.
Why this matters in the current market
Three forces make solving this worth prioritizing right now.
Rate volatility cuts both ways. A market that can swing 10 to 20% in a week rewards teams that control what they can control. Wasted container space is a fixed cost regardless of which direction rates move next.
Trade policy keeps changing the rules. Sourcing diversification toward Southeast Asia, ongoing tariff refund disputes, and ocean import contraction in the US (projected around 2% for 2026) mean shipment volumes and routes are shifting under teams that planned around last year’s assumptions.
There’s less room for inefficiency to hide. In an oversupplied market, carriers manage capacity aggressively through blank sailings and allocation controls. Containers that move need to earn their cost. Partially filled containers, paying to ship air, are a margin leak that gets harder to absorb when capacity and pricing are this unpredictable.
What mathematical optimization actually solves
Formally, container loading is a three-dimensional bin packing problem with multiple constraints: weight limits, center-of-gravity requirements, fragility and stacking rules, loading sequence, and multi-container assignment. It belongs to a class of NP-hard problems, meaning the number of possible configurations grows exponentially as item counts grow. Manual planning and spreadsheet logic hit a ceiling fast.
Mixed integer linear programming approaches the problem differently. Instead of evaluating configurations one at a time, it evaluates the full set of constraints simultaneously to find a solution that minimizes container count and cost while satisfying every operational requirement at once.
In practice, this looks like:
- Fewer containers per shipment, by closing the gaps, heuristic sorting leaves behind
- Better weight distribution, enforcing stability and compliance constraints that manual loading often violates under time pressure
- Smarter sequencing, respecting multi-port unloading order without sacrificing packing efficiency
- Real scalability, since a model built for 50 SKUs works the same way for 5,000
The decision that actually needs to be made
Container optimization is a decision-structuring problem before it’s a software problem. The real question for a logistics team is whether its loading logic reflects every constraint of the actual operation: capacity, sequencing, weight, cost, evaluated together rather than one rule at a time.
Most teams have tools that help: TMS platforms, load planning modules, and experienced planners. The underlying logic behind those tools is often still heuristic, and the gaps from that approximation accumulate quietly, shipment after shipment.
For supply chain leaders managing actual container volume in an unpredictable market, closing that gap is one of the more direct levers available. The data needed already exists in most operations. The math is well understood. The returns are measurable.
What we do at Modaai
We build production-ready mathematical optimization models for problems exactly like this one. Our approach starts with the decision structure: the constraints, the objectives, and the operational reality, and selects the right mathematical tools from there. For container optimization, that typically means a MIP formulation built on Gurobi, tuned for solve time, and integrated into existing planning workflows.
If your team manages meaningful container volume and is still relying on manual or heuristic load planning, it’s worth a conversation.
Modaai is a mathematical optimization and decision intelligence firm. We are IBM Silver Partners and Gurobi Approved Partners, delivering production-ready optimization solutions across supply chain, logistics, and operations.