Skip to content

Operations Management and Strategic Management · Transportation

MODI Method for Optimality Test in Transportation Problems

Updated 10 October 2026 · Fact-checked

The MODI (u-v) method tests whether a basic feasible solution to a transportation problem is optimal. Find u and v values from the allocated cells, then compute the opportunity cost c − (u + v) for each empty cell. If none is negative (minimisation), the solution is optimal. Otherwise, reallocate along a closed loop and repeat.

Understand Optimality Test using MODI Method

A transportation problem finds the cheapest way to move goods from sources to destinations. Methods like North-West Corner, Least Cost and VAM give a starting solution called an initial basic feasible solution (IBFS). It is feasible, but it may not be the cheapest. You need a test.

The MODI method (Modified Distribution, also called the u-v method) is that test. It gives each row a number u and each column a number v. For every allocated cell, u + v equals the unit cost. This is how the numbers are fixed.

For an empty cell, u + v is the cost the current solution implicitly charges for that route. If the actual cost is higher than that, the route is not worth using. If it is lower, using it saves money. The gap, c − (u + v), is the opportunity cost (also called the cell evaluation or net evaluation).

For a minimisation problem, a negative opportunity cost means you can cut cost by shifting units into that cell. You pick the most negative cell, trace a closed loop through allocated cells, shift the smallest minus-cell quantity, and test again. You stop when no empty cell is negative.

MODI and the stepping stone method reach the same answer. Stepping stone traces a loop for every empty cell to find its cost change. MODI finds all the opportunity costs from u and v values without drawing loops, and you draw only one loop per iteration. That is why MODI is faster.

Key rules to remember

Basic cells condition
Number of allocated cells = m + n − 1
m = sources, n = destinations. Fewer cells means degeneracy, and you cannot solve for all u and v until you fix it.
u-v equation for allocated cells
uᵢ + vⱼ = cᵢⱼ
Use only for allocated cells. Set one u (usually the row with most allocations) to 0, then solve for the rest.
Opportunity cost of an empty cell
Δᵢⱼ = cᵢⱼ − (uᵢ + vⱼ)
Compute for every unallocated cell. Keep the sign.
Optimality rule (minimisation)
All Δᵢⱼ ≥ 0 ⇒ optimal
If any Δ = 0 for an empty cell, an alternative optimal solution exists with the same cost. If all are strictly positive, the solution is unique.
Optimality rule (maximisation)
All Δᵢⱼ ≤ 0 ⇒ optimal
Here c is profit. Enter the cell with the largest positive Δ. Or convert profits to losses and minimise.
Change in cost on reallocation
Total cost reduction = |Δ of entering cell| × θ
θ = smallest quantity in the minus cells of the loop. Use this to check your new total cost.

How to solve Optimality Test using MODI Method questions

Use this method on any MODI question, whether the IBFS is given or you must find it first.

  1. 1Check the problem is balanced (total supply = total demand). If not, add a dummy row or column with zero cost. Then get an IBFS if not given.
  2. 2Count allocated cells. It must be m + n − 1. If fewer, add a tiny ε to an unallocated cell that does not form a closed loop with allocated cells.
  3. 3Set u = 0 for one row. Using uᵢ + vⱼ = cᵢⱼ on allocated cells, find every other u and v.
  4. 4For each empty cell compute Δ = c − (u + v). Write the values in the cells.
  5. 5If all Δ ≥ 0 (minimisation), stop: the solution is optimal. Compute the total cost.
  6. 6Otherwise pick the empty cell with the most negative Δ. Draw a closed loop using only horizontal and vertical lines, turning at allocated cells. Mark the entering cell +, then alternate − and + around the loop.
  7. 7Find θ = smallest allocation among the − cells. Add θ to + cells, subtract from − cells. One − cell with that quantity becomes empty.
  8. 8Recompute u, v and Δ for the new solution. Repeat until no Δ is negative. State the final allocation and total cost.

Quickest way: Fast MODI under exam time

When to use it: Use it when the paper asks for the optimal cost and the IBFS is already given or easy to find. Keep working in one grid.

  1. Write u beside each row and v above each column on the cost table. Start with u = 0 for the row with the most allocations.
  2. Fill v and u by chasing allocated cells. Tick each as you fix it.
  3. Write Δ in small brackets in each empty cell. Scan for negatives only.
  4. Pick the most negative. Trace the loop from that cell. Check it closes back to the start.
  5. After reallocating, verify row and column totals match supply and demand before moving on.
  6. Check cost: new cost = old cost − |Δ| × θ. If this does not match a direct recomputation, you have an error.

Common mistakes in Optimality Test using MODI Method

  • Computing u and v using empty cells as well as allocated cells

    Students apply uᵢ + vⱼ = cᵢⱼ to every cell by habit.

    Fix: Use the equation only for allocated cells. Empty cells get Δ = c − (u + v) instead.

  • Starting MODI when allocated cells are fewer than m + n − 1

    Degeneracy goes unnoticed because the allocation looks complete.

    Fix: Count cells first. Add ε to an empty cell that does not make a closed loop, and treat it as allocated. Drop ε at the end.

  • Drawing a loop with diagonal moves or turning at an empty cell

    Loops are drawn by eye without a rule.

    Fix: Move only horizontally or vertically. Turn only at allocated cells (the entering cell is the one exception, as the start). Every row and column of the loop has exactly two cells in it.

  • Choosing θ from all loop cells instead of only the minus cells

    Confusion about which cells lose units.

    Fix: θ is the smallest quantity in the − cells. The + cells gain, so they never limit θ.

  • Mis-signing Δ or stopping when a Δ is zero

    Students forget the sign rule or think zero is a problem.

    Fix: For minimisation, only negative Δ means improve. Zero means an alternative optimum, so you can stop. For maximisation, reverse the test.

  • Not rechecking supplies and demands after reallocation

    Rushing causes a loop sign slip.

    Fix: Add each row and column of the new table. Then recompute the total cost and compare with old cost − |Δ| × θ.

Worked examples

Example 1

A firm ships from three plants S1, S2, S3 (supply 50, 45, 55 units) to three depots D1, D2, D3 (demand 40, 58, 52 units). Unit costs (₹): S1: 6, 4, 1; S2: 3, 8, 7; S3: 4, 4, 2. Starting from the North-West Corner solution, find the optimal allocation and minimum cost using MODI.

Show the solution
  1. Total supply = 150 = total demand. The problem is balanced.
  2. North-West Corner: S1→D1 = 40, S1→D2 = 10, S2→D2 = 45, S3→D2 = 3, S3→D3 = 52. That is 5 cells = 3 + 3 − 1, so it is non-degenerate.
  3. IBFS cost = 40×6 + 10×4 + 45×8 + 3×4 + 52×2 = 240 + 40 + 360 + 12 + 104 = ₹756.
  4. Iteration 1. Set u1 = 0. Then v1 = 6, v2 = 4. From S2D2: u2 = 8 − 4 = 4. From S3D2: u3 = 4 − 4 = 0. From S3D3: v3 = 2 − 0 = 2.
  5. Opportunity costs: S1D3 = 1 − (0 + 2) = −1; S2D1 = 3 − (4 + 6) = −7; S2D3 = 7 − (4 + 2) = 1; S3D1 = 4 − (0 + 6) = −2.
  6. Most negative is S2D1 (−7). Loop: S2D1 (+), S2D2 (−), S1D2 (+), S1D1 (−). Minus cells hold 45 and 40, so θ = 40.
  7. New allocation: S2D1 = 40, S2D2 = 5, S1D2 = 50, S3D2 = 3, S3D3 = 52 (S1D1 becomes empty). Cost = 120 + 40 + 200 + 12 + 104 = ₹476. Check: 756 − 7×40 = 476.
  8. Iteration 2. Set u1 = 0. Basic cells: S1D2 gives v2 = 4. S2D2 gives u2 = 4. S2D1 gives v1 = 3 − 4 = −1. S3D2 gives u3 = 0. S3D3 gives v3 = 2.
  9. Δ values: S1D1 = 6 − (0 − 1) = 7; S1D3 = 1 − (0 + 2) = −1; S2D3 = 7 − (4 + 2) = 1; S3D1 = 4 − (0 − 1) = 5. Only S1D3 is negative.
  10. Loop: S1D3 (+), S1D2 (−), S3D2 (+), S3D3 (−). Minus cells hold 50 and 52, so θ = 50.
  11. New allocation: S1D3 = 50, S2D1 = 40, S2D2 = 5, S3D2 = 53, S3D3 = 2. Cost = 50 + 120 + 40 + 212 + 4 = ₹426. Check: 476 − 1×50 = 426.
  12. Iteration 3. Set u1 = 0. S1D3 gives v3 = 1. S3D3 gives u3 = 1. S3D2 gives v2 = 3. S2D2 gives u2 = 5. S2D1 gives v1 = −2.
  13. Δ values: S1D1 = 6 − (0 − 2) = 8; S1D2 = 4 − (0 + 3) = 1; S2D3 = 7 − (5 + 1) = 1; S3D1 = 4 − (1 − 2) = 5. All are positive, so the solution is optimal and unique.

Answer: Optimal allocation: S1→D3 = 50, S2→D1 = 40, S2→D2 = 5, S3→D2 = 53, S3→D3 = 2. Minimum transportation cost = ₹426.

Example 2

Two warehouses W1 and W2 (supply 40 and 60 units) serve three shops A, B, C (demand 30, 30, 40 units). Unit costs (₹): W1: 5, 3, 6; W2: 4, 7, 2. A proposed plan is W1→A = 30, W1→B = 10, W2→B = 20, W2→C = 40. Test whether it is optimal. If not, improve it.

Show the solution
  1. Supply 100 = demand 100. Allocated cells = 4 = 2 + 3 − 1, so MODI can be applied.
  2. Cost of plan = 30×5 + 10×3 + 20×7 + 40×2 = 150 + 30 + 140 + 80 = ₹400.
  3. Set u1 = 0. W1A gives v1 = 5. W1B gives v2 = 3. W2B gives u2 = 7 − 3 = 4. W2C gives v3 = 2 − 4 = −2.
  4. Opportunity costs: W1C = 6 − (0 − 2) = 8; W2A = 4 − (4 + 5) = −5.
  5. W2A is negative, so the plan is not optimal.
  6. Loop: W2A (+), W2B (−), W1B (+), W1A (−). Minus cells hold 20 and 30, so θ = 20.
  7. New plan: W2A = 20, W2B = 0, W1B = 30, W1A = 10, W2C = 40. Check rows: W1 = 10 + 30 = 40; W2 = 20 + 40 = 60. Columns: A = 30, B = 30, C = 40.
  8. Cost = 10×5 + 30×3 + 20×4 + 40×2 = 50 + 90 + 80 + 80 = ₹300. Check: 400 − 5×20 = 300.
  9. Retest. Set u1 = 0. v1 = 5, v2 = 3. W2A gives u2 = 4 − 5 = −1. W2C gives v3 = 2 + 1 = 3.
  10. Δ values: W1C = 6 − (0 + 3) = 3; W2B = 7 − (−1 + 3) = 5. Both are positive, so the plan is optimal.

Answer: The proposed plan (₹400) is not optimal. The optimal plan is W1→A = 10, W1→B = 30, W2→A = 20, W2→C = 40, with minimum cost ₹300.

Exam tips

  • Show the u and v values and the Δ values in a table or beside the grid. Step marks are given for these, even if the final cost goes wrong.
  • Always state the optimality condition in words: all opportunity costs are non-negative, so the solution is optimal. Then write the total cost with the calculation.
  • Check m + n − 1 before you start. Questions often give a degenerate IBFS to test whether you add ε.
  • If the question is a maximisation problem, say clearly which sign rule you use. Do this before you start the tests.
  • MCQs on this topic often ask the count of basic cells, the formula for opportunity cost, or what a zero Δ means. Learn these three facts.

Practice questions from Transportation

Optimality Test using MODI Method in other exams

The same ground in other exams, if you are preparing for more than one or want another angle on it.

Optimality Test using MODI Method: frequently asked questions

What is the difference between the stepping stone method and the MODI method?

Both test an IBFS for optimality and give the same final answer. Stepping stone traces a closed loop for every empty cell to find its cost change. MODI finds all opportunity costs from u and v values, and you trace only one loop per iteration, so it is faster for larger tables.

What does a zero opportunity cost mean in MODI?

For a minimisation problem with all other Δ values non-negative, a zero Δ in an empty cell means an alternative optimal solution exists. You can move units into that cell without changing the total cost. The solution you have is still optimal.

What do I do if the number of allocated cells is less than m + n − 1?

The solution is degenerate. Place a very small quantity ε in an empty cell that does not form a closed loop with the allocated cells, and treat it as allocated. Solve as usual and set ε to zero in the final answer.

Can I choose any negative opportunity cost to enter?

Yes, any negative cell will reduce cost and the method will still reach the optimum. The most negative cell is the usual choice because it often needs fewer iterations. State your choice in the answer.

How do I apply MODI to a maximisation problem?

Either convert profits to opportunity losses by subtracting each from the largest profit, then minimise. Or work directly with profits and stop when all Δ = c − (u + v) are zero or negative, entering the cell with the largest positive Δ.