Transportation and assignment problems
Transportation model, balancing and degeneracy, NWC/LCM/VAM starts, MODI optimality test, and the Hungarian method for assignment, with fully worked numericals.
Drafted with Aria, reviewed by the AiCanCode.org team. Spotted an error? Use Give Feedback at the bottom of the page.
Why it matters
Shipping castings from three foundries to four assembly plants, or giving five jobs to five machines, are everyday planning decisions where the cheapest plan is far from obvious. Transportation and assignment models solve these special linear programs quickly by hand or in software, and they are a reliable source of short numerical questions.
Key ideas
- Transportation problem. m sources with supplies aᵢ, n destinations with demands bⱼ, and a unit shipping cost cᵢⱼ on each route. Find shipments xᵢⱼ ≥ 0 that meet every supply and demand at minimum total cost. It is an LP with m + n constraints, but only m + n − 1 of them are independent (one is implied by the others when totals balance).
- Balanced vs unbalanced. The methods need Σaᵢ = Σbⱼ. If supply exceeds demand, add a dummy destination that takes the excess; if demand exceeds supply, add a dummy source. Dummy costs are zero (or a penalty for unmet demand if given).
- Basic feasible solution. A non-degenerate solution has exactly m + n − 1 occupied (basic) cells, and they contain no closed loop. Fewer occupied cells means degeneracy; place a tiny allocation ε in a suitable empty independent cell so that u and v can be computed.
- Initial solution methods.
- North-west corner (NWC) — allocate as much as possible starting from the top-left cell, moving right or down. Fast, ignores cost, so usually far from optimum.
- Least cost method (LCM) — allocate to the cheapest remaining cell first.
- Vogel's approximation method (VAM) — for each row and column compute a penalty = second-lowest cost − lowest cost; allocate to the cheapest cell of the row/column with the largest penalty. It usually gives the best start, often the optimum.
- Optimality test (MODI / u–v method). For occupied cells set cᵢⱼ = uᵢ + vⱼ (start with one uᵢ = 0). For each empty cell compute the opportunity cost dᵢⱼ = cᵢⱼ − (uᵢ + vⱼ). If every dᵢⱼ ≥ 0 the solution is optimal (for minimisation); a zero dᵢⱼ means an alternative optimum. If some dᵢⱼ < 0, bring the most negative cell into the solution through a closed loop (+, −, +, − at corners), shifting the smallest quantity at a "−" corner. The stepping-stone method evaluates the same loops directly.
- Assignment problem. n jobs to n machines (one each), cost cᵢⱼ. It is a transportation problem with all supplies and demands equal to 1, so it is highly degenerate; the Hungarian method solves it efficiently.
- Hungarian method. Subtract each row's minimum from that row, then each column's minimum from that column. Cover all zeros with the minimum number of horizontal and vertical lines. If the number of lines equals n, an optimal assignment exists among the zeros. If not, subtract the smallest uncovered element from all uncovered elements, add it to elements at line intersections, and repeat.
- Variants. Unequal jobs and machines → add dummy rows or columns of zeros. Maximisation (profit) → subtract every entry from the largest entry (or negate) and minimise. A prohibited assignment → give that cell a very large cost M.
Formulas
- Transportation objective:
Min Z = Σᵢ Σⱼ cᵢⱼ·xᵢⱼ - Supply constraints:
Σⱼ xᵢⱼ = aᵢfor i = 1 … m; demand constraints:Σᵢ xᵢⱼ = bⱼfor j = 1 … n;xᵢⱼ ≥ 0- cᵢⱼ = cost per unit from source i to destination j (₹/unit); xᵢⱼ = units shipped; aᵢ = supply at i (units); bⱼ = demand at j (units).
- Balance condition:
Σ aᵢ = Σ bⱼ - Number of basic (occupied) cells in a non-degenerate solution:
m + n − 1 - MODI for occupied cells:
uᵢ + vⱼ = cᵢⱼ - Opportunity cost of an empty cell:
dᵢⱼ = cᵢⱼ − (uᵢ + vⱼ); optimal for minimisation when alldᵢⱼ ≥ 0. - Assignment:
Min Z = Σᵢ Σⱼ cᵢⱼ·xᵢⱼ, withΣⱼ xᵢⱼ = 1,Σᵢ xᵢⱼ = 1,xᵢⱼ ∈ {0, 1}.
Worked examples
Example 1 (standard): NWC, VAM and MODI test Costs in ₹/unit (rows S1–S3, columns D1–D3): S1: 6, 4, 1; S2: 3, 8, 7; S3: 4, 4, 2. Supplies 50, 40, 60 units; demands 20, 95, 35 units.
- Balance: supply 150 = demand 150 → balanced. Basic cells needed: 3 + 3 − 1 = 5.
- NWC: S1–D1 20, S1–D2 30, S2–D2 40, S3–D2 25, S3–D3 35. Cost = 20(6) + 30(4) + 40(8) + 25(4) + 35(2) = 120 + 120 + 320 + 100 + 70 = ₹730.
- VAM, round 1: row penalties S1 = 4 − 1 = 3, S2 = 7 − 3 = 4, S3 = 4 − 2 = 2; column penalties D1 = 4 − 3 = 1, D2 = 4 − 4 = 0, D3 = 2 − 1 = 1. Largest is S2 (4) → cheapest cell S2–D1 (₹3): allocate 20. D1 is satisfied.
- Round 2 (D2, D3 left): row penalties S1 = 4 − 1 = 3, S2 = 8 − 7 = 1, S3 = 4 − 2 = 2; columns D2 = 0, D3 = 2 − 1 = 1. Largest is S1 → cell S1–D3 (₹1): allocate 35. D3 is satisfied.
- Only D2 is left: S1–D2 15, S2–D2 20, S3–D2 60.
- VAM cost = 20(3) + 35(1) + 15(4) + 20(8) + 60(4) = 60 + 35 + 60 + 160 + 240 = ₹555. Occupied cells = 5 = m + n − 1.
- MODI: set u₁ = 0. S1–D2: v₂ = 4; S1–D3: v₃ = 1; S2–D2: u₂ = 8 − 4 = 4; S2–D1: v₁ = 3 − 4 = −1; S3–D2: u₃ = 4 − 4 = 0.
- Empty cells: d₁₁ = 6 − (0 − 1) = 7; d₂₃ = 7 − (4 + 1) = 2; d₃₁ = 4 − (0 − 1) = 5; d₃₃ = 2 − (0 + 1) = 1. All positive. Answer: VAM solution is optimal and unique; minimum cost ₹555 (NWC start was ₹730).
Example 2 (GATE level): Hungarian method Four jobs A–D, four machines 1–4, cost in ₹: A: 10, 19, 8, 15; B: 10, 18, 7, 17; C: 13, 16, 9, 14; D: 12, 19, 8, 18.
- Row minima 8, 7, 9, 8. Row-reduced: A: 2, 11, 0, 7; B: 3, 11, 0, 10; C: 4, 7, 0, 5; D: 4, 11, 0, 10.
- Column minima 2, 7, 0, 5. Reduced: A: 0, 4, 0, 2; B: 1, 4, 0, 5; C: 2, 0, 0, 0; D: 2, 4, 0, 5.
- Minimum lines covering all zeros: row A, row C, column 3 → 3 lines < 4.
- Smallest uncovered element = 1. Subtract from uncovered, add to intersections: A: 0, 4, 1, 2; B: 0, 3, 0, 4; C: 2, 0, 1, 0; D: 1, 3, 0, 4.
- Lines: column 1, column 3, row C → 3 lines. Smallest uncovered = 2. Result: A: 0, 2, 1, 0; B: 0, 1, 0, 2; C: 4, 0, 3, 0; D: 1, 1, 0, 2.
- Now 4 lines are needed. Assign: D has a single zero → D–3; then B–1; then A–4; then C–2.
- Cost = A4 + B1 + C2 + D3 = 15 + 10 + 16 + 8 = 49. Answer: A→4, B→1, C→2, D→3; minimum total cost ₹49.
Common mistakes
- Applying NWC, VAM or MODI to an unbalanced table without first adding a dummy row or column.
- Computing VAM penalties as lowest minus highest, or not recomputing them after a row or column is removed.
- Missing degeneracy: with fewer than m + n − 1 occupied cells the u–v equations cannot all be solved.
- Using the sign rule backwards: for minimisation, a negative dᵢⱼ means improvement is possible.
- In the Hungarian method, covering zeros with more lines than needed, or adding the minimum to uncovered elements instead of intersections.
- Forgetting to convert a profit-maximisation assignment into a regret (opportunity-loss) matrix.
For GATE ME
Expect: initial cost by NWC, LCM or VAM from a small table; the number of basic variables (m + n − 1) and degeneracy; checking optimality with u–v and finding the opportunity cost of a given empty cell; balancing with dummies; and 3×3 or 4×4 assignment problems solved by the Hungarian method, including maximisation and prohibited cells. Practise writing allocations neatly and checking that row and column totals match.
Quick check
- How many occupied cells does a non-degenerate basic solution of a 4 × 5 transportation problem have?
- Total supply is 500 units and total demand is 450 units. What do you add?
- In MODI, what does dᵢⱼ = 0 for an empty cell at the optimum indicate?
- How do you solve an assignment problem where profits must be maximised?
- Why is the assignment problem always degenerate when treated as a transportation problem?
Answers: 1. 4 + 5 − 1 = 8. 2. A dummy destination with demand 50 units and zero cost. 3. An alternative optimal solution. 4. Subtract every entry from the largest entry (or negate) and minimise. 5. It has only n positive allocations but needs 2n − 1 basic cells.
Interview questions
All Metrology, CIM and Industrial Engineering interview questionsTry answering each one aloud before you open it.
1.What is the transportation problem in the context of industrial engineering?Concept
The transportation problem is a type of optimization problem where the objective is to determine the most cost-effective way to transport goods from multiple suppliers to multiple consumers. The goal is to minimize the total transportation cost while satisfying supply and demand constraints at each supplier and consumer location.
2.Explain the assignment problem and its significance in industrial engineering.Concept
The assignment problem is a special type of linear programming problem where the goal is to assign a set of tasks to a set of agents in the most efficient way. Each task is assigned to one agent, and the objective is to minimize the total cost or maximize the total efficiency of the assignments. This problem is significant in industrial engineering for optimizing resource allocation, scheduling, and workforce management.
3.How does the Hungarian method solve the assignment problem?Concept
The Hungarian method is an algorithm used to solve the assignment problem in polynomial time. It involves creating a cost matrix, reducing the matrix by subtracting the smallest element of each row and column, and then finding the minimum number of lines needed to cover all zeros in the matrix. Adjustments are made to the matrix until an optimal assignment is found, where each task is assigned to one agent with the minimum total cost.
4.Why is the Vogel's Approximation Method used in solving transportation problems?Application
Vogel's Approximation Method (VAM) is used to find an initial feasible solution to transportation problems. It is preferred because it often provides a better starting solution compared to other methods like the Northwest Corner Rule. VAM considers the penalty cost of not using the cheapest route, which helps in approximating a solution closer to the optimal one, thus reducing the number of iterations needed in subsequent optimization steps.
5.What happens if the supply does not equal demand in a transportation problem?Application
If supply does not equal demand in a transportation problem, the problem is considered unbalanced. To balance it, a dummy row or column is added to the transportation table. If supply exceeds demand, a dummy column with zero cost is added to absorb the excess supply. Conversely, if demand exceeds supply, a dummy row is added. This ensures that the total supply equals total demand, allowing the problem to be solved using standard methods.
6.Explain how the stepping stone method is used to optimize a transportation problem.Application
The stepping stone method is used to evaluate the potential of improving the current solution of a transportation problem. It involves tracing a closed loop path from an unoccupied cell and alternating between adding and subtracting the costs along the path. If the net change in cost is negative, the current solution can be improved by adjusting the allocations along the path. This process is repeated until no further improvements can be made.
7.What is the role of linear programming in solving transportation and assignment problems?Application
Linear programming plays a crucial role in solving transportation and assignment problems by providing a mathematical framework to model and solve these optimization problems. It allows for the formulation of objective functions and constraints, which can be solved using algorithms like the Simplex method or specialized algorithms like the Hungarian method for assignment problems. Linear programming ensures that the solutions are optimal and efficient.
8.A company has 3 warehouses and 4 retail outlets. The supply from the warehouses is 20, 30, and 50 units respectively, and the demand at the outlets is 30, 40, 20, and 10 units respectively. Is this transportation problem balanced?Numerical
To determine if the transportation problem is balanced, we need to compare the total supply and total demand. The total supply is 20 + 30 + 50 = 100 units, and the total demand is 30 + 40 + 20 + 10 = 100 units. Since the total supply equals the total demand, this transportation problem is balanced.
9.Calculate the initial feasible solution using the Northwest Corner Rule for a transportation problem with the following supply and demand: Supply: [15, 25], Demand: [10, 20, 10].Numerical
Using the Northwest Corner Rule, we start at the top-left corner of the matrix. Allocate 10 units to the first cell (15 supply, 10 demand), leaving 5 supply. Move to the next column, allocate 5 units (5 supply, 20 demand), leaving 15 demand. Move to the next row, allocate 15 units (25 supply, 15 demand), leaving 10 supply. Finally, allocate 10 units to the last cell (10 supply, 10 demand). The initial feasible solution is: (10, 5, 0), (0, 15, 10).
Finished this topic? Mark it so your progress, study plan and readiness keep up.
Stuck on something here?