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.

SESSIONS: 4 TEXTBOOK: ANDERSON & SWEENEY β€” CH. 6, SEC. 6.1 pp. 259–265, SEC. 6.2 pp. 274–278 SCOPE: FORMULATION & BALANCE β€” SEE SCOPE NOTE Full PPT: Assignment class notes 6 Note 2 β€” Transportation 23
⚠ Scope note β€” read this before you revise

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.

β—† What the papers ask from this unit
  • 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:

If demand and supply are given, it is a transportation problem. If instead every row must be matched one-to-one with exactly one column, it is an assignment problem.
Transportation problemAssignment problem
Rows / columnsSources (plants, warehouses) Γ— Destinations (markets, regions)Workers / machines / flights Γ— Tasks / jobs / return flights
Extra dataA supply column and a demand rowNone β€” just the cost matrix
Balanced whenTotal supply = total demandNumber of rows (m) = number of columns (n)
Xα΅’β±Ό meansQuantity 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?

Question

For each scenario, state whether it is a transportation or an assignment problem, give your reason, and state the number of variables and constraints.

Scenario A

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.

  1. Step 1 β€” Look for the give-away Capacities are given (supply) AND requirements are given (demand) ⟹ TRANSPORTATION problem
  2. 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
  3. 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
Scenario B

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.

  1. 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
  2. Step 2 β€” Size and balance m = 5 salespeople , n = 5 territories m = n ⟹ BALANCED
  3. 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
  4. Step 4 β€” Note the objective direction

    This one maximises sales rather than minimising cost. The structure is identical; only Min becomes Max. Do not assume every assignment problem is a minimisation.

⚠ The one-line test

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.

Sources
Class Assignment vs transportation, cost matrix pp. 1–4 Β· Note 2 pp. 12–14

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:

Number of VARIABLES = m Γ— n (one Xα΅’β±Ό per cell of the matrix) Number of CONSTRAINTS = m + n (one per row + one per column, excluding NNC) BALANCED? Assignment β†’ m = n Transportation β†’ Ξ£ supply = Ξ£ demand

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.
Why zero costs: a dummy represents goods that are never actually shipped, or a task never actually performed. Charging it nothing keeps the objective value honest.

3Worked β€” the exact Q1B pattern, both versions

Final Exam Q1B β€” assignment, 3 workers Γ— 3 tasks QP p. 1
T1T2T3
W1927
W2643
W3581

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.

Re-Exam Q1B β€” transportation, and this one is not balanced QP p. 1
P1P2P3Supply
W192730
W264325
W358120
Demand203035

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 counting subtlety

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 β†’

Sources
Class Balance rule, dummy rows, counting pp. 1, 3 Β· Note 2 pp. 12–13
Exam Final Q1B p. 1 + key p. 1 Β· Re-Exam Q1B p. 1 + key p. 1

3. Converting the Matrix into an LPP Core syllabus concept

1The template β€” assignment problem

4 employees Γ— 4 tasks, the class example Class notes pp. 1–2
EmployeesTask 1Task 2Task 3Task 4
A1012815
B8101211
C1215913
D1191410
Solution
  1. 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
  2. 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β‚„β‚„
  3. 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
  4. 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
  5. 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

3 origins Γ— 4 destinations, the class example Class notes pp. 3–4
D1D2D3D4Supply
O₁641514
Oβ‚‚892716
O₃43625
Demand61015435 / 35
Solution
  1. 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
  2. Step 2 β€” Objective function, read row by row Min Z = 6X₁₁ + 4X₁₂ + 1X₁₃ + 5X₁₄ + 8X₂₁ + 9Xβ‚‚β‚‚ + 2X₂₃ + 7Xβ‚‚β‚„ + 4X₃₁ + 3X₃₂ + 6X₃₃ + 2X₃₄
  3. Step 3 β€” Supply constraints, one per ROW β€” note the ≀ X₁₁ + X₁₂ + X₁₃ + X₁₄ ≀ 14 X₂₁ + Xβ‚‚β‚‚ + X₂₃ + Xβ‚‚β‚„ ≀ 16 X₃₁ + X₃₂ + X₃₃ + X₃₄ ≀ 5
  4. 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
  5. 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.

⚠ Unit 3 β€” where marks are lost
  • 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 β†’

Sources
Class Full LPP conversion for both problem types pp. 1–4 Β· Note 2 pp. 12–18
Course Session plan for Unit 3 Policy p. 7
Exam Final Q5B, Q7B pp. 4, 6 Β· Re-Exam Q5B p. 3

4. Solving the Problems β€” NWCR, Least Cost, VAM, MODI and the Hungarian Method Supporting concept

Why this section exists

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

MethodRuleQuality
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
Count check: a basic feasible solution has exactly m + n βˆ’ 1 occupied cells (3 + 4 βˆ’ 1 = 6 here). Fewer ⟹ degenerate: put a tiny Ξ΅ in an empty independent cell so the MODI test can run.

2Worked Example β€” one problem, three starting solutions

Question
CostD1D2D3D4Supply
S1193050107
S2703040609
S3408702018
Demand5871434

Find an initial solution by NWCR, LCM and VAM, then test the VAM solution for optimality.

Solution
  1. NWCR
    NWCRD1D2D3D4Supply
    S15 @192 @3050107
    S2706 @303 @40609
    S34084 @7014 @2018
    Demand5871434
    Cost = 5(19) + 2(30) + 6(30) + 3(40) + 4(70) + 14(20) = β‚Ή1,015
  2. Least Cost
    LCMD1D2D3D4Supply
    S11930507 @107
    S22 @70307 @40609
    S33 @408 @8707 @2018
    Demand5871434

    Cheapest cell first: S3D2 (8) ← 8, then S1D4 (10) ← 7, S3D4 (20) ← 7, S2D3 (40) ← 7, S3D1 (40) ← 3, S2D1 (70) ← 2.

    Cost = β‚Ή814
  3. VAM β€” penalties at each step
    StepLargest penaltyAllocate
    1Column D2: 30 βˆ’ 8 = 22S3D2 ← 8
    2Column D1: 40 βˆ’ 19 = 21S1D1 ← 5
    3Row S3: 70 βˆ’ 20 = 50S3D4 ← 10
    4Column D4: 60 βˆ’ 10 = 50S1D4 ← 2
    5Only S2 is leftS2D3 ← 7, S2D4 ← 2
    VAMD1D2D3D4Supply
    S15 @1930502 @107
    S270307 @402 @609
    S3408 @87010 @2018
    Demand5871434
    Cost = 5(19) + 2(10) + 7(40) + 2(60) + 8(8) + 10(20) = β‚Ή779 β€” 6 occupied cells = m + n βˆ’ 1 βœ“
  4. 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
  5. 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
    OptimalD1D2D3D4Supply
    S15 @1930502 @107
    S2702 @307 @40609
    S3406 @87012 @2018
    Demand5871434

    Re-running MODI gives no negative dα΅’β±Ό, so β‚Ή743 is optimal β€” confirmed independently by solving the LPP.

3Two variations

VariationWhat 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.
UnbalancedAdd a dummy row or column with zero cost first (concept 2).
DegeneracyOccupied 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

  1. Row reduction β€” subtract each row's minimum from every entry in that row.
  2. Column reduction β€” subtract each column's minimum from every entry in that column.
  3. Cover all zeros with the minimum number of horizontal/vertical lines.
  4. If the number of lines = n, an optimal assignment exists among the zeros β€” pick one zero in each row and column.
  5. 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.

Sources
Course Session plan, Unit 3: NWCR, Least Cost, VAM, unbalanced problems, MODI, degeneracy, maximisation, Hungarian method Policy p. 7
Textbook Anderson & Sweeney Ch. 6 sec. 6.1–6.2 (named by the session plan; not supplied as a file). The worked example is a standard textbook problem, checked by solving its LPP.