Supply Chain LabKnapsack - Container LoadingLab Home
Optimisation · Packing

Knapsack - Container Loading

A shipping container holds only so much weight. Each product earns a different value but consumes different weight. Which mix should you load to maximise the value shipped without exceeding capacity? That is the classic 0/1 knapsack problem - solved here to the true optimum.

Container & cargo

max weight (e.g. tonnes or volume units)

Optimal load Ready

–
Weight used
Container fill
0%
Load decision per product
Set the container capacity and edit your cargo, then press Optimise the load. The solver uses dynamic programming to find the highest-value combination that fits - not just greedily grabbing the most valuable item, which often wastes space.

About this tool

Knapsack - Container Loading

The concept

The knapsack problem picks the most valuable subset that fits a capacity.

How it works

Each item has value and weight; optimisation packs the best combination.

Winning strategy

Value density (value/weight) is the greedy compass - and exactly where it fails is the lesson.

max sum(v_i x_i) s.t. sum(w_i x_i) <= W
KnapsackValue densityCapacitySelection
Core idea: Knapsack problem