Transportation Problem Solver
Minimize shipping cost from sources to destinations — North-West Corner for a start, MODI (u–v) for the optimum, with automatic dummy balancing.
Related solvers
| D1 | D2 | D3 | Supply | |
|---|---|---|---|---|
| S1 | ||||
| S2 | ||||
| S3 | ||||
| Demand |
What is the transportation problem?
Ship goods from m sources with supplies sᵢ to n destinations with demands dⱼ at unit costs cᵢⱼ, minimizing total cost while meeting every supply and demand.
Balance & dummies
Feasibility requires Σ s = Σ d. If not, this solver inserts a dummy source or destination with zero costs so the totals match; dummy shipments do not change the real cost.
North-West Corner → MODI
An initial basic feasible solution is built with the North-West Corner Method. The MODI (u–v) method then improves occupied cells until no non-basic cell has a negative opportunity cost — the minimum-cost plan.
Degeneracy
A basic solution should have m + n − 1 positive allocations. Fewer means degeneracy; algorithms may insert a tiny ε allocation so potentials uᵢ, vⱼ stay well-defined.
Balanced 3×3 example (cost = 140)
Supply [20, 30, 25], demand [15, 25, 35]. NW Corner then MODI → total cost 140.
Unbalanced example (dummy destination)
Supply 50+40 = 90, demand 30+40 = 70 → dummy destination of 20 with zero costs.
Frequently Asked Questions
1. What is a necessary condition for a feasible transportation solution?
2. What is the North-West Corner Method used for?
3. What does cell (i, j) in the cost matrix represent?
4. When is a transportation solution degenerate?