How to use it
- 1. Pick a modelSwitch between Container Loading and SC Assignment with the tabs.
- 2. Change the inputsEvery + / − press and every matrix click re-solves the model instantly.
- 3. Watch everything reactObjective, gauge, charts, network and constraint status are all wired to your inputs.
- 4. Do the challengesEach tab has small experiments designed to surprise you - that surprise is the lesson.
Interactive studio
Each term is vi xi. Highlighted terms are in the optimal plan; grey terms have xi = 0. The line below substitutes the solver’s decision back into the formula.
Try these experiments
- Break the greedy rule. Set capacity to 10t and watch the “Greedy vs optimal” card - can you find inputs where greedy loses?
- Find the binding moment. Increase capacity one tonne at a time. When does slack appear and why does marginal value hit $0k?
- Displace Machinery. Raise Electronics’ value until Machinery leaves the container. What ratio triggers the flip?
Optimal container plan -
The trailer is drawn to scale: one slot = one tonne of capacity C, and every cargo block spans exactly its weight wi. Change any input and the load, the slack and the “left on the dock” queue redraw instantly - what the optimiser rejects is as informative as what it loads.
Decision variables & data editorxi = units loaded
Selecting an item edits its data - it does not force it into the container. The solver alone decides what gets loaded. Your selection is highlighted everywhere: red on its tile, an amber underline on its objective term, a marked bar in the ranking, and a thick outline on its blocks in the truck. To get a selected item loaded, make it worth loading: raise vi, cut wi, or grow the container.
Value density vi/wi - the greedy ranking
Greedy loads items in this order until the container is full. It is fast and intuitive - and, because units are indivisible, sometimes wrong. The card below checks it against the exact optimum on every change.
Greedy heuristic vs exact optimum-
-
Constraint classification · liveFeasible
A constraint is binding when it holds with equality at the optimum - it is the bottleneck. Binding rows are flagged with a red edge; relax them and Z* can improve.
Sensitivity: optimal value Z* as capacity C variesclick a point to jump there
The curve is a staircase: value only jumps when one more tonne lets a whole new unit fit - the integer effect. Flat segments mean the extra tonne is worthless (marginal value $0k). The red marker is your current capacity; steps get smaller as availability qi runs out (diminishing returns).
xij = 1 when supplier i serves order j. The substituted line shows exactly which three costs the optimum pays.
Try these experiments
- Create a conflict of interest. Make one supplier the cheapest for two orders. Who gets it, and who covers the other order?
- Find the tipping point. Raise an assigned cell $1k at a time. At what value does the plan reroute? Compare with rank #2 in the explorer.
- Cheap cell, never chosen. Can you build a matrix where the single cheapest cell is not in the optimal plan?
Optimal supplier → order network3 assignments
All nine possible lanes are drawn, not just the chosen three: a lane’s thickness and label update the moment you edit its cost, the amber dashed lane mirrors the cell selected in the matrix, and an amber pulse marks the lane you just changed. When the optimum reroutes, the red flows jump to their new lanes.
Landed-cost matrix cij · heatmapcheapdear
Darker red = more expensive. Navy cells are the ones the optimum pays. Click any cell to select it, then nudge its cost and watch the network, the ranking and the stats react.
Permutation explorer - all 3! = 6 feasible plans
With 3 suppliers and 3 orders there are exactly six one-to-one plans. The solver simply evaluates each one; the shortest bar wins. Real networks explode combinatorially (10×10 → 3,628,800 plans), which is why the Hungarian algorithm and LP solvers exist.
Constraint classification · liveFeasible
The two models
Container loading (bounded integer knapsack)
Max Z = ∑i vi xi
s.t. ∑i wi xi ≤ C
0 ≤ xi ≤ qi, xi ∈ ℤ≥0
Solved exactly by dynamic programming over capacity. Value per tonne is a useful heuristic, but the integer constraint means the greedy ranking is not always optimal - the studio checks this on every change.
Supplier–order assignment
Min Z = ∑i ∑j cij xij
s.t. ∑i xij = 1 ∀ j (demand covered)
∑j xij ≤ 1 ∀ i (one order per supplier)
xij ∈ {0, 1}
A 3×3 assignment problem, solved here by enumerating all permutations - shown live in the explorer. At scale this is the Hungarian algorithm; the LP relaxation is integral, so binary variables come for free.
About this tool
The concept
Two classic combinatorial models. Container loading is a knapsack: choose indivisible cargo to maximise value inside a weight capacity. Supplier assignment is the assignment problem: match orders to suppliers at least total cost with each order placed once.
How it works
Edit the data and both models re-solve instantly. The studio shows the objective with your numbers substituted, marks which constraints bind, and runs a greedy heuristic beside the exact optimum so you can see when intuition fails.
Winning strategy
Look for the gap between greedy and optimal, then explain it: it appears when a high-ratio item blocks a better combination or when the cheapest supplier for one order is needed elsewhere. Sensitivity comes from changing one number at a time.