Module 1 of 6 · Lesson 7 of 7
The Transportation Model
A named problem family whose structure decides feasibility before solving and returns whole units without an integer program.
What you will be able to do
Given a situation describing supply points, demand points and unit shipping costs, the learner can write the transportation model, test the balance condition and restore balance with a dummy row or column when it fails, read a plan in both the cost-table and network forms, and say what total unimodularity does and does not guarantee about the answer.
Orientation
Three warehouses hold stock. Three shops need it. Every warehouse-shop pair has a known cost per unit. The question is which routes to use and how much to send on each.
This is a linear program, and writing it as one is straightforward. What makes the model worth naming is that its structure settles two things a general linear program leaves open: whether the data admits any solution at all, and whether the answer comes back in whole units.
The first is a condition on the numbers before any solving begins. The second is a property of the constraint matrix that removes the need for integer programming. A guarantee with precise limits, which are part of what there is to learn here.
Definition
Indices, data and what a variable counts
Beyond the program itself, what is worth fixing is what each index ranges over and what one variable counts.
The variable.
Why the constraints are equalities. Writing
Counting variables and constraints. An
What the cost coefficients must be.
Principle
Balance, and what a dummy asserts
The condition. With equality constraints on both sides, the model is feasible only when total supply equals total demand. This is checked before solving, by adding two columns of numbers.
Restoring balance when it fails. The imbalance is not an error in the data; most real situations are unbalanced. It is restored by adding a row or a column, and which side depends on which is short.
| Situation | Add | Size | What its costs mean |
|---|---|---|---|
| Supply exceeds demand | a dummy demand point | cost of leaving a unit at supply point | |
| Demand exceeds supply | a dummy supply point | penalty for one unit of unmet demand at point |
The costs are a modelling decision. Setting a dummy row to zero asserts that a shortfall costs nothing, which is rarely true, unmet demand usually carries a lost margin, a contractual penalty, or a cost of emergency purchase, and these may differ by destination. A dummy column at zero asserts that holding surplus stock is free, which is a defensible approximation over a short horizon and wrong if storage is charged.
Using zeros is not a neutral default. It is a claim about the situation, and where it is wrong the optimal plan will be wrong in a specific direction: with zero shortfall costs the model is indifferent about which demand goes unserved, and will leave whichever destination is most expensive to reach unserved regardless of how much that matters.
Why the dummy does not distort the rest of the answer. Adding a zero-cost dummy column leaves every real route's cost unchanged, so among plans serving the same real demands the model still prefers the cheapest. The dummy only records where the slack went.
Representation
The cost table and the network
The same problem is written two ways, and each answers a different question directly.
As a cost table. An
| Shop 1 | Shop 2 | Shop 3 | Supply | |
|---|---|---|---|---|
| Depot A | 8 | 6 | 10 | 30 |
| Depot B | 9 | 12 | 13 | 40 |
| Depot C | 14 | 9 | 16 | 30 |
| Demand | 35 | 25 | 40 | 100 |
The table makes the balance check immediate — the margins total 100 on both sides — and the cost structure visible at a glance: Depot A is cheap to Shop 2, Depot C expensive to Shop 3.
As a network. The figure draws the same nine pairs as arcs, so a cell is a flow, a row sum is conservation at a supply node and a column sum is conservation at a demand node.
Three arcs carry their cost so the correspondence is concrete: cell (Depot A, Shop 2) is the arc
That reading is what explains the shape of an optimum. A basis is
What each hides. Five filled cells in a nine-cell grid look arbitrary until the tree is visible; and the network carries no compact view of the costs, which stay in the table.
Worked example
Three plans for one problem
Using the data above: supplies
Step 1: check balance. Supply totals
Step 2: a first feasible plan by the northwest-corner rule. Start at the top-left cell and assign the most the row and column allow, then move right when a column fills and down when a row empties.
Cell
Five basic cells, matching
Step 3: a plan by taking the cheapest cell first. Fill the lowest-cost cell as much as possible, then the next, and so on.
Cheapest is
Better than 1195, and using costs did help. The question is whether it is optimal.
Step 4: the optimum. It is
Check feasibility: rows sum to
Step 5: what the comparison shows. The greedy plan costs
The reason is visible in the optimal plan. It sends all 30 units of Depot A to Shop 3 at cost 10, ignoring A's cheapest route
A note on the numbers. Every entry is a whole number, and nothing required that. No integrality constraint was imposed and none was needed, which is the structural property the next block accounts for.
Derivation
Forced balance and integral optimal solutions
Balance is forced by the equalities. Sum the supply constraints over
Sum the demand constraints over
The left sides are the same quantity, every variable appears once in each, so any feasible
The same calculation shows the redundancy. Given balance, the sum of the supply equations equals the sum of the demand equations, so one constraint is a linear combination of the others. The rank is
Integrality follows from the constraint matrix. Each variable
A matrix is totally unimodular when every square submatrix has determinant
The consequence: for a totally unimodular
Since the simplex method returns a basic feasible solution, an optimum of a transportation problem with integer supplies and demands is a plan in whole units, with no integrality constraint imposed.
The limits of the guarantee. Three of them matter.
It needs integer
It says nothing about the costs. They may be any real numbers; unimodularity is a property of the constraint matrix alone.
It is not preserved by arbitrary additions. Capacities on individual routes,
Contrast
Transportation against a general linear program
The transportation model is a linear program, and the differences are all consequences of its constraint structure.
| Transportation model | General linear program | |
|---|---|---|
| Feasibility | decided before solving, by comparing two totals | discovered by solving, or by a phase-one procedure |
| Integral optimum | guaranteed with integer supplies and demands | not guaranteed; needs an integer program |
| Basis size | the number of constraints, and a basis may be degenerate | |
| Basis structure | a spanning tree of the bipartite graph | any independent column set |
| Specialised method | transportation simplex, working on the table | general simplex on the tableau |
When the model stops applying. A shipping situation fails to be a transportation problem when a cost is not per-unit, when several commodities compete for shared capacity, or when the decision is which routes to open rather than how much to send. Each breaks a different requirement: linearity of the objective, the two-nonzeros column structure, and the continuity of the variable.
What survives being a special case. Everything true of linear programs remains true here. The optimum sits at an extreme point, the simplex method solves it, and duality applies. The dual variables are interpretable as the value of a unit of supply at each depot and a unit of demand at each shop. Nothing about the special structure suspends the general theory; it adds guarantees on top of it.
Why it is worth recognising the shape. Two reasons, and the first is not efficiency. Recognising the model tells you to check balance, which catches a data problem before a solver reports infeasibility with no explanation. The second is that it tells you the answer will be in whole units, so a fractional result signals an error in the data or the formulation rather than a need to round.