Unit 03 β Transportation & Assignment
Recognising the two problem types, checking whether they are balanced, counting variables and constraints, converting the cost matrix into a full LPP β and solving it by NWCR, Least Cost, VAM, MODI and the Hungarian method.
The course session plan lists the full Unit 3 as including North-West Corner Rule, Least Cost Method, VAM, the Modified Distribution (MODI) method, degeneracy, maximisation problems and the Hungarian Method Policy p. 7.
Your class notes β the handwritten Assignment Problems set pp. 1β6 and Note 2 pp. 12β18 β stop at formulation, and so do Assignment 6 and every 2025-26 paper question (Q1B, Q5B, Q7). Concepts 1β3 cover that thoroughly.
Concept 4 adds the solving algorithms from the standard textbook method, clearly labelled, so that a "solve by VAM / test by MODI / use the Hungarian method" question cannot catch you out.
- Q1B (2.5 marks), both papers β a cost matrix, then three fixed sub-questions: Is the problem balanced? Number of constraints (excluding NNC)? Number of variables? Final p. 1 Re-Exam p. 1. This is the most formulaic 2.5 marks on the paper. Solved β
- Q5B (5 marks), both papers β flight scheduling: "formulate an assignment problem to minimise aircraft overnight idle time". Solved β
- Q7B (5 marks), Final β "formulate in transportation format and identify the number of constraints and variables", with a profit twist. Solved β
1. Telling the Two Problems Apart Core syllabus concept
1Understand the Concept
Both problems arrive as a cost matrix. One sentence separates them Class notes p. 3:
| Transportation problem | Assignment problem | |
|---|---|---|
| Rows / columns | Sources (plants, warehouses) Γ Destinations (markets, regions) | Workers / machines / flights Γ Tasks / jobs / return flights |
| Extra data | A supply column and a demand row | None β just the cost matrix |
| Balanced when | Total supply = total demand | Number of rows (m) = number of columns (n) |
| Xα΅’β±Ό means | Quantity shipped from i to j (any non-negative number) | 1 if row i is assigned to column j, else 0 |
| Row constraint | Ξ£β±Ό Xα΅’β±Ό β€ supplyα΅’ | Ξ£β±Ό Xα΅’β±Ό = 1 (each worker gets exactly one task) |
| Column constraint | Ξ£α΅’ Xα΅’β±Ό = demandβ±Ό | Ξ£α΅’ Xα΅’β±Ό = 1 (each task gets exactly one worker) |
2Worked Example β which problem type is each of these?
For each scenario, state whether it is a transportation or an assignment problem, give your reason, and state the number of variables and constraints.
Three factories with monthly capacities of 500, 700 and 400 units supply four warehouses requiring 300, 600, 400 and 300 units. Shipping cost per unit differs by route. Minimise total shipping cost.
- Step 1 β Look for the give-away Capacities are given (supply) AND requirements are given (demand) βΉ TRANSPORTATION problem
- Step 2 β Size and balance m = 3 factories , n = 4 warehouses Total supply = 500 + 700 + 400 = 1600 Total demand = 300 + 600 + 400 + 300 = 1600 1600 = 1600 βΉ BALANCED, no dummy needed
- Step 3 β Counting Variables = m Γ n = 3 Γ 4 = 12 Constraints = m + n = 3 + 4 = 7 Xα΅’β±Ό = quantity shipped, so Xα΅’β±Ό can be ANY non-negative number
Five salespeople must each be given exactly one of five territories. The expected sales for each person in each territory are known. Maximise total expected sales.
- Step 1 β Look for the give-away No supply column, no demand row Each person takes exactly ONE territory, and each territory gets exactly ONE person βΉ ASSIGNMENT problem
- Step 2 β Size and balance m = 5 salespeople , n = 5 territories m = n βΉ BALANCED
- Step 3 β Counting, and the variable type Variables = m Γ n = 5 Γ 5 = 25 Constraints = m + n = 5 + 5 = 10 Xα΅’β±Ό = 1 if person i gets territory j, else 0 β BINARY, not a quantity
- Step 4 β Note the objective direction
This one maximises sales rather than minimising cost. The structure is identical; only
MinbecomesMax. Do not assume every assignment problem is a minimisation.
Ask: "Is a row allowed to be split across several columns?" If yes β a factory can ship to several warehouses β it is transportation and Xα΅’β±Ό is a quantity. If no β one person, one territory β it is assignment and Xα΅’β±Ό is 0 or 1.
2. Balance, Variables and Constraints Core syllabus concept
1The three counting rules
Q1B in both papers is exactly these three rules applied to an m Γ n matrix. Memorise them as a block:
2How to balance an unbalanced problem
Whichever side is less, add a corresponding DUMMY row or column, and set every cost in the dummy to zero Class notes p. 1.
- Assignment: if rows β columns, add a dummy row (or column) of zeros so the matrix becomes square.
- Transportation: if Ξ£ supply β Ξ£ demand, add a dummy source (if supply is short) or dummy destination (if demand is short), with zero costs and the missing quantity as its supply/demand p. 3.
3Worked β the exact Q1B pattern, both versions
| T1 | T2 | T3 | |
|---|---|---|---|
| W1 | 9 | 2 | 7 |
| W2 | 6 | 4 | 3 |
| W3 | 5 | 8 | 1 |
Answer: (1) Yes, balanced β number of rows = number of columns = 3. (2) Constraints m + n = 3 + 3 = 6. (3) Variables m Γ n = 3 Γ 3 = 9. Matches the synoptic key exactly Key p. 1.
| P1 | P2 | P3 | Supply | |
|---|---|---|---|---|
| W1 | 9 | 2 | 7 | 30 |
| W2 | 6 | 4 | 3 | 25 |
| W3 | 5 | 8 | 1 | 20 |
| Demand | 20 | 30 | 35 |
Answer: Ξ£ supply = 30 + 25 + 20 = 75; Ξ£ demand = 20 + 30 + 35 = 85. (1) No, not balanced β demand exceeds supply by 10, so add a dummy row (source) with supply 10 and zero costs. (2) Constraints m + n = 3 + 3 = 6. (3) Variables m Γ n = 3 Γ 3 = 9. Matches the key Key p. 1.
The synoptic key counts m + n and m Γ n on the original matrix, not on the balanced one. Answer the counting parts from the matrix as given, and mention the dummy separately when asked how to balance it. Also note the phrase "excluding NNC" in the question β the non-negativity restriction is not counted as a constraint.
Practice H1βH2 β one unbalanced assignment, one unbalanced transportation β
3. Converting the Matrix into an LPP Core syllabus concept
1The template β assignment problem
| Employees | Task 1 | Task 2 | Task 3 | Task 4 |
|---|---|---|---|---|
| A | 10 | 12 | 8 | 15 |
| B | 8 | 10 | 12 | 11 |
| C | 12 | 15 | 9 | 13 |
| D | 11 | 9 | 14 | 10 |
- Step 1 β Housekeeping (write these four lines first, they carry marks) Balanced problem : Yes (m = n = 4) No. of variables : m Γ n = 4 Γ 4 = 16 No. of constraints: m + n = 4 + 4 = 8 Decision variable : Xα΅’β±Ό , i β employee A to D , j β task 1 to 4 Xα΅’β±Ό = 1 if employee i is assigned task j, else 0
- Step 2 β Objective function, read row by row off the matrix Min Z = 10Xββ + 12Xββ + 8Xββ + 15Xββ + 8Xββ + 10Xββ + 12Xββ + 11Xββ + 12Xββ + 15Xββ + 9Xββ + 13Xββ + 11Xββ + 9Xββ + 14Xββ + 10Xββ
- Step 3 β Row constraints: each employee gets exactly one task Xββ + Xββ + Xββ + Xββ = 1 Xββ + Xββ + Xββ + Xββ = 1 Xββ + Xββ + Xββ + Xββ = 1 Xββ + Xββ + Xββ + Xββ = 1
- Step 4 β Column constraints: each task goes to exactly one employee Xββ + Xββ + Xββ + Xββ = 1 Xββ + Xββ + Xββ + Xββ = 1 Xββ + Xββ + Xββ + Xββ = 1 Xββ + Xββ + Xββ + Xββ = 1
- Step 5 β Non-negativity, and the internal check Xα΅’β±Ό β₯ 0 (and binary, 0 or 1) 4 row + 4 column = 8 constraints β matches the m + n counted in Step 1
2The template β transportation problem
| D1 | D2 | D3 | D4 | Supply | |
|---|---|---|---|---|---|
| Oβ | 6 | 4 | 1 | 5 | 14 |
| Oβ | 8 | 9 | 2 | 7 | 16 |
| Oβ | 4 | 3 | 6 | 2 | 5 |
| Demand | 6 | 10 | 15 | 4 | 35 / 35 |
- Step 1 β Housekeeping, starting with the balance test Total supply = 14 + 16 + 5 = 35 Total demand = 6 + 10 + 15 + 4 = 35 35 = 35 βΉ BALANCED, no dummy needed Decision variable : Xα΅’β±Ό = quantity shipped from origin i (1β3) to destination j (1β4) No. of variables : m Γ n = 3 Γ 4 = 12 No. of constraints: m + n = 3 + 4 = 7
- Step 2 β Objective function, read row by row Min Z = 6Xββ + 4Xββ + 1Xββ + 5Xββ + 8Xββ + 9Xββ + 2Xββ + 7Xββ + 4Xββ + 3Xββ + 6Xββ + 2Xββ
- Step 3 β Supply constraints, one per ROW β note the β€ Xββ + Xββ + Xββ + Xββ β€ 14 Xββ + Xββ + Xββ + Xββ β€ 16 Xββ + Xββ + Xββ + Xββ β€ 5
- Step 4 β Demand constraints, one per COLUMN β note the = Xββ + Xββ + Xββ = 6 Xββ + Xββ + Xββ = 10 Xββ + Xββ + Xββ = 15 Xββ + Xββ + Xββ = 4
- Step 5 β Non-negativity, and the internal check
Xα΅’β±Ό β₯ 0
3 supply + 4 demand = 7 constraints β matches m + n from Step 1
The asymmetry is deliberate: supply is a ceiling (β€) but demand must be met exactly (=). When the problem is perfectly balanced you may write the supply constraints as
=too; the class notes useβ€, which is the safer general form.
- Writing Xα΅’β±Ό without saying what i and j range over. "i β row 1 to 3, j β column 1 to 4" is a marked line.
- Mixing up the row and column constraint directions. Supply β€, demand =. For assignment, both are = 1.
- Transposing the cost matrix in the objective. Xββ is row 1, column 3 β read row-wise and it is impossible to slip.
- Answering "how many constraints" with m Γ n. Variables are m Γ n; constraints are m + n. They are swapped surprisingly often under time pressure.
Practice H3βH5 β full LPP conversion, profit variant, forbidden pairing β
4. Solving the Problems β NWCR, Least Cost, VAM, MODI and the Hungarian Method Supporting concept
The session plan lists these algorithms for Unit 3 Policy p. 7, but your class notes, Assignment 6 and both 2025-26 papers only ever ask for formulation. They are added here for completeness, using the standard textbook method, so that a "find the initial solution by VAM" question cannot catch you out.
1The three ways to get an initial feasible solution
| Method | Rule | Quality |
|---|---|---|
| North-West Corner (NWCR) | Start top-left; allocate as much as possible; move right when a column is filled, down when a row is used up. | Fast, ignores cost β usually poor |
| Least Cost (LCM) | Allocate as much as possible to the cheapest cell left; strike out the exhausted row/column; repeat. | Better |
| Vogel's Approximation (VAM) | For every row and column, penalty = difference between its two lowest costs. Pick the largest penalty; allocate to the cheapest cell in that row/column; strike out; recompute. | Best β often optimal or close |
2Worked Example β one problem, three starting solutions
| Cost | D1 | D2 | D3 | D4 | Supply |
|---|---|---|---|---|---|
| S1 | 19 | 30 | 50 | 10 | 7 |
| S2 | 70 | 30 | 40 | 60 | 9 |
| S3 | 40 | 8 | 70 | 20 | 18 |
| Demand | 5 | 8 | 7 | 14 | 34 |
Find an initial solution by NWCR, LCM and VAM, then test the VAM solution for optimality.
- NWCR
Cost = 5(19) + 2(30) + 6(30) + 3(40) + 4(70) + 14(20) = βΉ1,015
NWCR D1 D2 D3 D4 Supply S1 5 @19 2 @30 50 10 7 S2 70 6 @30 3 @40 60 9 S3 40 8 4 @70 14 @20 18 Demand 5 8 7 14 34 - Least Cost
LCM D1 D2 D3 D4 Supply S1 19 30 50 7 @10 7 S2 2 @70 30 7 @40 60 9 S3 3 @40 8 @8 70 7 @20 18 Demand 5 8 7 14 34 Cheapest cell first: S3D2 (8) β 8, then S1D4 (10) β 7, S3D4 (20) β 7, S2D3 (40) β 7, S3D1 (40) β 3, S2D1 (70) β 2.
Cost = βΉ814 - VAM β penalties at each step
Step Largest penalty Allocate 1 Column D2: 30 β 8 = 22 S3D2 β 8 2 Column D1: 40 β 19 = 21 S1D1 β 5 3 Row S3: 70 β 20 = 50 S3D4 β 10 4 Column D4: 60 β 10 = 50 S1D4 β 2 5 Only S2 is left S2D3 β 7, S2D4 β 2 Cost = 5(19) + 2(10) + 7(40) + 2(60) + 8(8) + 10(20) = βΉ779 β 6 occupied cells = m + n β 1 βVAM D1 D2 D3 D4 Supply S1 5 @19 30 50 2 @10 7 S2 70 30 7 @40 2 @60 9 S3 40 8 @8 70 10 @20 18 Demand 5 8 7 14 34 - MODI test on the VAM solution For every occupied cell, uα΅’ + vβ±Ό = cα΅’β±Ό; set uβ = 0 uβ = 0, uβ = 50, uβ = 10; vβ = 19, vβ = β2, vβ = β10, vβ = 10 For every empty cell, dα΅’β±Ό = cα΅’β±Ό β (uα΅’ + vβ±Ό): S1D2 = 32, S1D3 = 60, S2D1 = 1, S2D2 = 30 β 48 = β18, S3D1 = 11, S3D3 = 70 A negative dα΅’β±Ό (S2D2) βΉ NOT optimal
- One improvement β the closed loop
Loop: S2D2 (+) β S3D2 (β) β S3D4 (+) β S2D4 (β)
ΞΈ = smallest (β) allocation = min(8, 2) = 2
New: S2D2 = 2, S3D2 = 6, S3D4 = 12, S2D4 = 0 (leaves)
Cost falls by 18 Γ 2 = 36 βΉ βΉ743
Optimal D1 D2 D3 D4 Supply S1 5 @19 30 50 2 @10 7 S2 70 2 @30 7 @40 60 9 S3 40 6 @8 70 12 @20 18 Demand 5 8 7 14 34 Re-running MODI gives no negative dα΅’β±Ό, so βΉ743 is optimal β confirmed independently by solving the LPP.
3Two variations
| Variation | What to do |
|---|---|
| Maximisation (profit matrix) | Convert to a loss matrix β subtract every profit from the largest profit (or multiply by β1) β then minimise as usual. |
| Unbalanced | Add a dummy row or column with zero cost first (concept 2). |
| Degeneracy | Occupied cells < m + n β 1: place Ξ΅ (a very small quantity) in an empty cell that does not form a loop, and continue. |
4The Hungarian method for assignment problems
- Row reduction β subtract each row's minimum from every entry in that row.
- Column reduction β subtract each column's minimum from every entry in that column.
- Cover all zeros with the minimum number of horizontal/vertical lines.
- If the number of lines = n, an optimal assignment exists among the zeros β pick one zero in each row and column.
- Otherwise subtract the smallest uncovered number from every uncovered cell, add it to cells covered twice, and return to step 3.
Fully worked on a flight-pairing problem β with two optimal answers β in Assignment 6, Q1. For a maximisation assignment, first subtract every entry from the largest; for a forbidden pairing, put a very large cost (M) in that cell.