Back to All Blogs
Operations Research

Transportation Problem: North-West Corner and MODI Method Explained

Solver360 Team
February 18, 2025
9 min read

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:

📐 Formula
D1 D2 D3 Supply S1 2 3 4 20 S2 3 2 1 30 S3 1 4 3 25 Demand 15 25 35

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:

📐 Formula
S1→D1: 15, S1→D2: 5 S2→D2: 20, S2→D3: 10 S3→D3: 25 Initial cost = 15(2)+5(3)+20(2)+10(1)+25(3) = 170

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:

  1. Compute row potentials uᵢ and column potentials vⱼ from the used cells, where cost = uᵢ + vⱼ.
  2. For each unused cell, compute the opportunity cost dᵢⱼ = costᵢⱼ − (uᵢ + vⱼ).
  3. If any dᵢⱼ is negative, that route improves the solution. Trace a closed loop and shift as many units as possible around it.
  4. Repeat until every opportunity cost is ≥ 0 — the optimal solution.

The Optimal Solution

After applying MODI, the total cost drops to:

📐 Formula
Optimal total cost = 140

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.
Tags:
Transportation ProblemMODI MethodNetwork OptimizationLogistics