Skip to the content

Topics Covered

Formulation North-West Corner Least-Cost Entry VAM MODI Method Degeneracy Unbalanced TP Maximization TP
On this page
  1. 1. The Transportation Problem
  2. 2. Mathematical Formulation
  3. 3. Transportation Tableau
  4. 4. Initial Basic Feasible Solution (IBFS) — North-West Corner Method (NWCM)
  5. 5. IBFS — Least-Cost Entry Method (LCEM) / Matrix-Minima
  6. 6. IBFS — Vogel's Approximation Method (VAM)
  7. 7. Optimality Test — MODI (Modified Distribution) Method
  8. 8. Degeneracy in TP
  9. 9. Unbalanced TP
  10. 10. Maximization Transportation Problem
  11. Summary Workflow
  12. Key Take-aways

1. The Transportation Problem

DEFINITION

The Transportation Problem (TP) determines the cheapest way to ship a single homogeneous commodity from \(m\) sources (factories, warehouses) to \(n\) destinations (markets, customers), given supply at each source, demand at each destination and the unit shipping cost between every (source, destination) pair.

It is a special class of linear programming, but its structure makes it solvable much faster than the general simplex method.

Real-Life Examples

2. Mathematical Formulation

Let:

LP Form

\[ \text{Minimise } Z \;=\; \sum_{i=1}^{m}\sum_{j=1}^{n} c_{ij}\, x_{ij} \]

Subject to:

\[ \sum_{j=1}^{n} x_{ij} \;=\; a_i, \quad i = 1, 2, \ldots, m \quad \text{(supply constraints)}, \] \[ \sum_{i=1}^{m} x_{ij} \;=\; b_j, \quad j = 1, 2, \ldots, n \quad \text{(demand constraints)}, \] \[ x_{ij} \ge 0 \quad \forall\, i, j. \]

Balanced TP Condition

A TP is balanced if total supply equals total demand:

\[ \sum_{i=1}^{m} a_i \;=\; \sum_{j=1}^{n} b_j. \]

If unbalanced, add a dummy row or column with zero costs (Section 7).

Number of Basic Variables

A basic feasible solution to a balanced TP has exactly (m + n − 1) non-zero allocations (because one of the (m + n) constraints is redundant). Fewer non-zeros ⇒ degeneracy.

3. Transportation Tableau

TP data is laid out as a matrix:

D₁D₂…Dⱼ…DₙSupply aᵢ
S₁c₁₁ / x₁₁c₁₂ / x₁₂…c₁ⱼ / x₁ⱼ…c₁ₙ / x₁ₙa₁
S₂c₂₁c₂₂…c₂ⱼ…c₂ₙa₂
⋮⋮⋮⋮⋮⋮
Sₘcₘ₁cₘ₂…cₘⱼ…cₘₙaₘ
Demand bⱼb₁b₂…bⱼ…bₙΣ

4. Initial Basic Feasible Solution (IBFS) — North-West Corner Method (NWCM)

Algorithm

  1. Start at the north-west (top-left) cell of the tableau.
  2. Allocate as much as possible: \(x_{11} = \min(a_1, b_1)\).
  3. If \(a_1 < b_1\) — supply row 1 is exhausted, cross it out; move down to next row.
  4. If \(a_1 > b_1\) — demand column 1 is satisfied, cross it out; move right to next column.
  5. If \(a_1 = b_1\) — both are exhausted (tie). Cross out either row or column (not both, to avoid degeneracy).
  6. Repeat at the new north-west corner of the remaining tableau until all supplies / demands are met.

Merits: simplest, very quick.
Demerits: ignores cost structure — usually gives a poor starting solution.

EXAMPLE 1

Given the TP:

D₁D₂D₃D₄Supply
S₁3174300
S₂2659400
S₃8332500
Demand2503504002001200

NWCM allocations:

Total cost = 250·3 + 50·1 + 300·6 + 100·5 + 300·3 + 200·2 = 750 + 50 + 1800 + 500 + 900 + 400 = 4400.

Number of allocations: 6 = m + n − 1 = 3 + 4 − 1 ✓.

EXAMPLE 2 (Smaller TP)

2 sources, 3 destinations. Costs and capacities:

D₁D₂D₃Supply
S₁48876
S₂16241682
Demand7210241215 ≠ 158

This TP is unbalanced (supply 158 < demand 215). Add a dummy source with 57 supply, zero cost. NWCM proceeds from top-left.

5. IBFS — Least-Cost Entry Method (LCEM) / Matrix-Minima

Algorithm

  1. Find the cell with the least cost \(c_{ij}\) in the entire table (break ties arbitrarily).
  2. Allocate \(x_{ij} = \min(a_i, b_j)\).
  3. Cross out the exhausted row or column.
  4. Repeat in the remaining (smaller) table.

Merits: uses cost information — usually a better starting solution than NWCM.
Demerits: still ignores the relative badness of next-cheapest option (which VAM does capture).

EXAMPLE 1

For the same TP as Example 1 (NWCM):

Cost = 300·1 + 250·2 + 200·2 + 50·3 + 250·3 + 150·5 = 300 + 500 + 400 + 150 + 750 + 750 = 2850 — much better than NWCM's 4400.

EXAMPLE 2

For a 3×3 problem with min-cost at (S₂, D₁) = 1, allocate the corresponding minimum; repeat in the reduced table. Process continues for at most (m + n − 1) steps.

6. IBFS — Vogel's Approximation Method (VAM)

Algorithm

  1. For each row, compute row penalty = difference between the two smallest costs in that row.
  2. For each column, similarly compute column penalty.
  3. Identify the row or column with the largest penalty (ties broken arbitrarily).
  4. In that row/column, allocate as much as possible to the least-cost cell.
  5. Cross out the satisfied row/column; recompute penalties for the reduced table.
  6. Repeat until all allocations are made.

Rationale: the penalty quantifies the regret if the cheapest cell is not used; allocating to the cell with the largest such regret is the "best bang for the buck".

Merits: usually produces a very close-to-optimal initial solution; often the optimum itself.
Demerits: more arithmetic per step than NWCM or LCEM.

EXAMPLE 1

Same TP. Initial penalties:

D₁D₂D₃D₄SupplyPenalty
S₁31743003−1 = 2
S₂26594005−2 = 3
S₃83325003−2 = 1
Demand2503504002001200
Penalty3−2=13−1=25−3=24−2=2

Largest penalty = 3 in row S₂. Min cost in S₂ is 2 at (S₂, D₁). Allocate min(400, 250) = 250. D₁ exhausted.

Continue with the reduced table; recalculate penalties; allocate; and so on. Final VAM solution typically gives cost ≈ 2700, close to optimal.

EXAMPLE 2

For a 2×3 TP with costs (4, 6, 8 / 8, 7, 5) and supplies (20, 30), demand (10, 25, 15):

Row penalties: 6−4 = 2; 7−5 = 2. Col penalties: 8−4 = 4; 7−6 = 1; 8−5 = 3.

Largest = 4 (col D₁). Min cost in D₁ = 4 at (S₁, D₁). Allocate min(20, 10) = 10. D₁ exhausted.

Continue: recompute penalties on remaining 2×2 table.

7. Optimality Test — MODI (Modified Distribution) Method

After obtaining an IBFS (by NWCM / LCEM / VAM), MODI tests whether it is optimum and, if not, gives an improved solution.

Algorithm

  1. Compute u_i, v_j: For each occupied (basic) cell, write the dual equation \(u_i + v_j = c_{ij}\). Set \(u_1 = 0\) (or any one of them) and solve for the rest. There are exactly (m + n − 1) basic cells, matching the (m + n − 1) unknown \(u_i, v_j\) values.
  2. Compute opportunity costs \(d_{ij} = c_{ij} - (u_i + v_j)\) for every non-basic cell.
  3. Optimality criterion: if all \(d_{ij} \ge 0\), the solution is optimum. Stop.
  4. If some \(d_{ij} < 0\), select the cell with the most negative \(d_{ij}\) (entering cell).
  5. Form a closed loop starting and ending at the entering cell, using only basic cells at the turning points; alternately mark "+" and "−" starting with "+" at the entering cell.
  6. Find θ = minimum allocation among the "−" cells.
  7. Update: add θ to "+" cells, subtract θ from "−" cells. The "−" cell with allocation θ leaves the basis.
  8. Repeat from step 1 until all \(d_{ij} \ge 0\).
EXAMPLE 1 — One iteration of MODI

Suppose the IBFS has basic cells (S₁,D₁)=20, (S₁,D₂)=30, (S₂,D₂)=10, (S₂,D₃)=40 with costs 4, 6, 5, 7.

Set \(u_1 = 0\). From (S₁,D₁): \(v_1 = 4\). From (S₁,D₂): \(v_2 = 6\). From (S₂,D₂): \(u_2 = -1\). From (S₂,D₃): \(v_3 = 8\).

Non-basic cells: (S₁,D₃) cost = 9. \(d = 9 - (0 + 8) = 1\) ≥ 0. (S₂,D₁) cost = 3. \(d = 3 - (-1 + 4) = 0\). Both ≥ 0 ⇒ optimal.

EXAMPLE 2 — Improvement step

If a non-basic cell has \(d_{ij} = -2\), forming the closed loop and adjusting by θ reduces the total cost by \(2\theta\). Continue until no negative \(d_{ij}\) remains.

8. Degeneracy in TP

DEFINITION

A TP solution is degenerate if the number of basic (non-zero) allocations is fewer than \(m + n − 1\). Degeneracy makes MODI fail because we don't have enough equations to solve for all \(u_i, v_j\).

How does degeneracy arise?

Resolution

Allocate an infinitesimally small quantity ε > 0 to a chosen empty (non-basic) cell so that the total number of allocations becomes \(m + n − 1\). The cell chosen should preserve the rim conditions (allow the dual equations to be solved). At the end of the algorithm, set ε = 0.

9. Unbalanced TP

If total supply ≠ total demand, the basic LP has no feasible solution. Two cases:

9.1 Supply > Demand

Add a dummy destination with demand = (supply − demand) and zero cost in every row. Any allocations to the dummy column represent goods that remain unshipped.

9.2 Supply < Demand

Add a dummy source with supply = (demand − supply) and zero cost in every column. Allocations to the dummy row represent unsatisfied demand.

After balancing, solve as a regular TP.

EXAMPLE 1

Supply = 100, 150; Demand = 80, 100, 90. Total supply = 250, demand = 270. Add dummy source with supply 20 and zero costs.

EXAMPLE 2

Supply = 60, 80; Demand = 50, 60. Total supply 140 > demand 110. Add dummy destination with demand 30 and zero costs.

10. Maximization Transportation Problem

Sometimes \(c_{ij}\) represents profit rather than cost, and we want to maximise \(Z\).

Conversion to Minimisation

  1. Find the largest profit \(M = \max c_{ij}\).
  2. Replace each \(c_{ij}\) by \(M - c_{ij}\). The new matrix has all non-negative entries with the largest profit becoming 0.
  3. Solve as a minimization TP.
  4. The optimum allocation from the converted TP is also the optimum for the original; total profit = \(\sum c_{ij}^{\text{original}} \cdot x_{ij}\).
EXAMPLE

Profit matrix:

D₁D₂D₃
S₁402522
S₂443530

M = 44. Conversion: 44 − each.

D₁D₂D₃
S₁41922
S₂0914

Solve this min-cost TP normally; the resulting allocation maximises original profit.

Summary Workflow

  1. Check balance; add dummy if needed.
  2. For maximization, convert (M − cᵢⱼ).
  3. Find IBFS (NWCM / LCEM / VAM). VAM is usually best.
  4. Apply MODI to test optimality and improve.
  5. Resolve degeneracy with ε if it arises.
  6. Report final allocations and cost (or profit).

Key Take-aways