Transportation Problem: North-West Corner and MODI Method Explained
Transportation Problem: North-West Corner and MODI Method Explained
The transportation problem asks how to ship goods from several sources (factories, warehouses) to several destinations (stores, customers) at minimum total cost, given supply limits and demand requirements. It is a classic network-optimization model. This tutorial covers both stages: finding an initial solution and then optimizing it.
Solve any transportation problem step by step with the free Transportation Problem Solver.
The Problem
Three sources with supplies 20, 30, 25 must serve three destinations with demands 15, 25, 35. The unit shipping costs are:
Total supply (75) equals total demand (75), so the problem is balanced. If it were not, we would add a dummy source or destination with zero costs.
Step 1: Initial Solution — North-West Corner Method
Start at the top-left cell and allocate as much as possible, then move right or down as supplies and demands are exhausted:
This gives a feasible solution costing 170 — but it is usually not optimal.
Step 2: Optimize with the MODI (u–v) Method
The MODI method tests whether any unused route could lower the cost:
- Compute row potentials uᵢ and column potentials vⱼ from the used cells, where cost = uᵢ + vⱼ.
- For each unused cell, compute the opportunity cost dᵢⱼ = costᵢⱼ − (uᵢ + vⱼ).
- If any dᵢⱼ is negative, that route improves the solution. Trace a closed loop and shift as many units as possible around it.
- Repeat until every opportunity cost is ≥ 0 — the optimal solution.
The Optimal Solution
After applying MODI, the total cost drops to:
That is a 30-unit cost reduction from the initial North-West Corner solution — which is exactly why you should never stop at the initial allocation.
Balanced vs. Unbalanced Problems
If total supply ≠ total demand, add a dummy row or column with zero shipping costs to absorb the difference. The solver does this automatically and tells you how much went to the dummy.
Common Mistakes
- Stopping at the initial solution — North-West Corner is only a starting point, not the optimum.
- Degeneracy — when the number of used cells is fewer than (rows + columns − 1), you must add a zero allocation to keep the method working.
- Ignoring balance — always check supply vs. demand first.
Try It Yourself
Enter your supply, demand, and cost matrix into the Transportation Problem Solver to get the initial solution, each MODI iteration, and the optimal minimum-cost plan. For one-to-one matching (workers to jobs), see the Assignment Problem Solver; for routing, the Shortest Path Solver.
Key Takeaways
- North-West Corner gives a quick feasible solution; MODI optimizes it.
- For the example, cost falls from 170 to the optimal 140.
- Balance the problem with a dummy source/destination when supply ≠ demand.