A company makes a product at several plants and sells it in several markets. Each plant has a limited capacity, each market has a demand that must be met, and shipping one unit from a given plant to a given market has a known cost. How much should each plant send to each market?
This is the transportation problem. It is one of the oldest models in OR and still one of the most useful: it is the building block inside distribution planning, it is the simplest example of a network-flow problem, and its dual has a clean economic interpretation.
The decision
We have supply points (plants, warehouses, ports) indexed by and demand points (markets, stores, customers) indexed by .
- Supply point can ship at most units.
- Demand point requires units.
- Shipping one unit along route costs .
The decision is the shipment plan: how many units travel along each route. Costs are assumed to be linear in quantity — no fixed charges per route, no volume discounts. (Relaxing that assumption turns the LP into a MIP; see the extensions.)
Formulation
Let be the quantity shipped from to .
The model is feasible exactly when total supply covers total demand, .
A transportation problem is balanced if . In that case every constraint holds with equality at any feasible point. Any problem can be balanced by adding a dummy demand point that absorbs the surplus supply at zero cost; units sent to it represent unused capacity.
Structure
The constraint matrix has a very particular form: every variable appears in exactly two constraints — the capacity row of and the demand row of — each with coefficient . Equivalently, the problem is a flow problem on a bipartite graph with supply nodes on one side, demand nodes on the other, and an arc for every route.
The constraint matrix of the transportation problem is totally unimodular: every square submatrix has determinant , or . Consequently, if all and are integers, every basic feasible solution — and in particular the solution returned by the simplex method — is integer.
This matters in practice. If the units are trucks, containers or people, we need whole numbers, and integer programming is in general much harder than LP. For the transportation problem we get integrality for free.
Solution methods
Any LP solver handles transportation problems of realistic size in well under a second. Historically, though, the structure motivated a specialized version of the simplex method that is still taught because it makes the dual visible.
Finding a starting solution. In a balanced problem a basic feasible solution has at most positive entries (one constraint is redundant, since supplies and demands sum to the same total). Simple rules produce one:
- North-west corner rule: fill the table starting at the top-left cell, shipping as much as possible, and move right or down as rows and columns are exhausted. Ignores costs; easy to check.
- Least-cost rule: repeatedly fill the cheapest remaining cell.
- Vogel's approximation: for each row and column compute the gap between its two cheapest cells, and fill the cheapest cell in the row or column with the largest gap. Often close to optimal.
Testing optimality (MODI / u–v method). Assign a potential to each supply row and to each demand column such that
There are unknowns and equations, so fix one value (say ) and solve the rest. Then compute the reduced cost of each unused cell:
If every , the current plan is optimal. Otherwise, bring a cell with negative reduced cost into the solution by shifting flow around the unique cycle it forms with the basic cells, and repeat.
The and are precisely the LP dual variables, and the optimality test is LP complementary slackness written out for this problem.
Worked example
Supplies, demands and unit costs are:
| Supply | |||||
|---|---|---|---|---|---|
| 8 | 6 | 10 | 9 | 120 | |
| 9 | 12 | 13 | 7 | 80 | |
| 14 | 9 | 16 | 5 | 100 | |
| Demand | 70 | 90 | 60 | 80 | 300 |
Total supply equals total demand, so the problem is balanced. The optimal shipment plan is
| · | 70 | 50 | · | |
| 70 | · | 10 | · | |
| · | 20 | · | 80 |
with total cost
Verifying optimality. The six used cells give the equations . Setting :
- from and : , ;
- from : ; then gives ;
- from : ; then gives .
The reduced costs of the unused cells are
| 2 | · | · | 7 | |
| · | 3 | · | 2 | |
| 5 | · | 3 | · |
All are strictly positive, so the plan is optimal — and, because none is zero, it is the unique optimum.
Notice that the optimum is not greedy. Market is cheapest to serve from (cost 8), yet it is served entirely from (cost 9). Plant is more valuable sending its limited capacity to and , where its cost advantage over the alternatives is larger.
Reading the dual
In the balanced problem the potentials are only determined up to a constant (adding to every and subtracting it from every changes nothing), so their differences carry the meaning.
- Reduced costs price the routes not used. Route has : its unit cost would have to fall from 9 to 2 before it would be worth using. Route , at , is the nearest to entering the plan — useful to know if rates are renegotiated.
- Supply potentials price capacity. Here : an extra unit of capacity at (with one unit less at or ) would lower total cost by 3. If the company could expand one plant, the dual says to expand .
- Demand potentials price markets. Serving one extra unit at , using an extra unit of supply at , costs . One more unit at made at costs at the margin.
Shadow prices are valid only for small changes. Large changes in supply or demand alter which routes are used, and with them the potentials. LP sensitivity analysis reports the range over which each price holds.
Extensions
The transportation model is deliberately minimal. Real distribution planning typically adds:
- Transshipment. Goods may pass through intermediate warehouses or cross-docks. The model becomes a minimum-cost network flow problem on a general graph, with flow conservation at each intermediate node. It keeps total unimodularity, so integrality still comes for free.
- Multiple products. Several commodities share arc or plant capacity. The coupling constraints break the network structure, and integrality is no longer automatic.
- Fixed charges. Opening a route or a lane costs money regardless of volume. This needs binary variables, and leads directly to the facility location models.
- The assignment problem. The special case with all : assign workers to jobs at minimum total cost. It has its own efficient algorithm (the Hungarian method) and appears inside many scheduling problems.
Further reading: the transportation problem is treated in every introductory OR text; see for example Hillier and Lieberman, Introduction to Operations Research, or Ahuja, Magnanti and Orlin, Network Flows, for the network-flow view.