All 15 questions UPSC has asked on transportation and assignment problems in the Mathematics Optional (Paper II, Linear Programming) from 2008 to 2026, solved step by step – latest first.
Try them yourself first: the same questions, without solutions, are on our Linear Programming topic-wise PYQs page.
How we check these solutions
These are our own solutions, prepared with AI help. UPSC does not publish official answers. Every solution is checked a second way before it goes up, and says how:
- ✓ Checked by computer the answer was worked out again independently with a linear-programming solver (SciPy/HiGHS), with the simplex tables recomputed in exact fractions.
- ✓ Proof checked step by step for “prove that” questions, every step was checked against the definitions.
Spotted a mistake or a neater method? Tell us in the comments below or through Report an error.
Jump to a question (year · question number):
2026 · 3c 2025 · 4c 2024 · 4c 2023 · 4c 2022 · 4c 2021 · 1e 2020 · 4c 2018 · 4c 2017 · 4b 2015 · 1e 2014 · 2c 2013 · 4a 2012 · 4c 2010 · 4c 2008 · 4c
The following table represents the estimated costs of assigning jobs to machines. Solve this assignment problem to minimize the total cost. Is the assignment unique for the total minimum cost ? Justify your answer and obtain an alternate assignment, if it exists.
Solution
There are 3 jobs and 4 machines, so add a dummy job with zero costs to make the matrix square. (The machine given the dummy job stays idle.)
Row reduction. Subtract the smallest element of each row (8, 8, 8, 0) from that row:
| M1 | M2 | M3 | M4 | |
|---|---|---|---|---|
| J1 | 0 | 16 | 20 | 24 |
| J2 | 0 | 5 | 9 | 11 |
| J3 | 0 | 7 | 11 | 14 |
| Dummy | 0 | 0 | 0 | 0 |
Column reduction. Every column already contains a zero, so nothing changes.
Cover the zeros. All zeros can be covered by 2 lines (row Dummy, column M1), fewer than 4, so an assignment is not yet possible. The smallest uncovered element is 5: subtract it from every uncovered element and add it where two lines cross.
| M1 | M2 | M3 | M4 | |
|---|---|---|---|---|
| J1 | 0 | 11 | 15 | 19 |
| J2 | 0 | 0 | 4 | 6 |
| J3 | 0 | 2 | 6 | 9 |
| Dummy | 5 | 0 | 0 | 0 |
Cover the zeros. All zeros can be covered by 3 lines (row J2, row Dummy, column M1), fewer than 4, so an assignment is not yet possible. The smallest uncovered element is 2: subtract it from every uncovered element and add it where two lines cross.
| M1 | M2 | M3 | M4 | |
|---|---|---|---|---|
| J1 | 0 | 9 | 13 | 17 |
| J2 | 2 | 0 | 4 | 6 |
| J3 | 0 | 0 | 4 | 7 |
| Dummy | 7 | 0 | 0 | 0 |
Cover the zeros. All zeros can be covered by 3 lines (row Dummy, column M1, column M2), fewer than 4, so an assignment is not yet possible. The smallest uncovered element is 4: subtract it from every uncovered element and add it where two lines cross.
| M1 | M2 | M3 | M4 | |
|---|---|---|---|---|
| J1 | 0 | 9 | 9 | 13 |
| J2 | 2 | 0 | 0 | 2 |
| J3 | 0 | 0 | 0 | 3 |
| Dummy | 11 | 4 | 0 | 0 |
Now at least 4 lines are needed to cover all the zeros, so an optimal assignment exists. Choose one zero in each row and column (a row or column with a single zero first):
| M1 | M2 | M3 | M4 | |
|---|---|---|---|---|
| J1 | [0] | 9 | 9 | 13 |
| J2 | 2 | 0 | [0] | 2 |
| J3 | 0 | [0] | 0 | 3 |
| Dummy | 11 | 4 | 0 | [0] |
Optimal assignment: (8), (17), (15), with idle. Minimum total cost .
Is it unique? No. In the final matrix, and both have zeros under and , so the two can be swapped. This gives the alternate assignment (8), (13), (19), also of cost . These are the only two optimal assignments.
✓ Checked by computer We checked by computer: all assignments were enumerated; the minimum is 40, reached by exactly two assignments.
The following table shows all the necessary information on the available supply to each warehouse, the requirement of each market and the unit transportation cost from each warehouse to each market : The shipping clerk has worked out the following schedule from experience : 12 units from to , 1 unit from to , 9 units from to , 15 units from to , 7 units from to and 1 unit from to . Find the optimal schedule and minimum total shipping cost.
Solution
Total supply total requirement, so the problem is balanced.
The clerk’s schedule as a starting solution. It uses cells and contains no closed loop, so it is a basic feasible solution:
| I | II | III | IV | Supply | |
|---|---|---|---|---|---|
| A | 5 | 2 (12) | 4 (1) | 3 (9) | 22 |
| B | 4 | 8 | 1 (15) | 6 | 15 |
| C | 4 (7) | 6 | 7 (1) | 5 | 8 |
| Requirement | 7 | 12 | 17 | 9 |
Its cost is .
Test for optimality (MODI / u–v method).
MODI check 1. Put and use for the occupied cells. For each empty cell, is shown in brackets.
| I | II | III | IV | Supply | ui | |
|---|---|---|---|---|---|---|
| A | 5 [4] | 2 (12) | 4 (1) | 3 (9) | 22 | 0 |
| B | 4 [6] | 8 [9] | 1 (15) | 6 [6] | 15 | −3 |
| C | 4 (7) | 6 [1] | 7 (1) | 5 [−1] | 8 | 3 |
| Requirement | 7 | 12 | 17 | 9 | ||
| vj | 1 | 2 | 4 | 3 |
The most negative is at (C, IV), so it enters. Closed loop: (C, IV) → (C, III) → (A, III) → (A, IV) → (C, IV), with signs . The least allocation in a “” cell is , at (C, III), which leaves. Moving round the loop changes the cost by .
MODI check 2. Put and use for the occupied cells. For each empty cell, is shown in brackets.
| I | II | III | IV | Supply | ui | |
|---|---|---|---|---|---|---|
| A | 5 [3] | 2 (12) | 4 (2) | 3 (8) | 22 | 0 |
| B | 4 [5] | 8 [9] | 1 (15) | 6 [6] | 15 | −3 |
| C | 4 (7) | 6 [2] | 7 [1] | 5 (1) | 8 | 2 |
| Requirement | 7 | 12 | 17 | 9 | ||
| vj | 2 | 2 | 4 | 3 |
All , so this allocation is optimal.
Optimal schedule: A → II: 12, A → III: 2, A → IV: 8, B → III: 15, C → I: 7, C → IV: 1.
Minimum total shipping cost , one unit cheaper than the clerk’s schedule.
✓ Checked by computer We checked by computer: an LP solver gives the minimum cost 104; the clerk’s schedule costs 105.
The personnel manager of a company wants to assign officers , and to the regional offices at Delhi, Mumbai, Kolkata and Chennai. The cost of relocation (in thousand Rupees) of the three officers at the four regional offices are given below : Find the assignment which minimizes the total cost of relocation and also determine the minimum cost.
Solution
There are 3 officers and 4 offices, so add a dummy officer with zero relocation costs. (The office given the dummy stays without a new officer.)
Row reduction. Subtract the smallest element of each row (16, 10, 10, 0) from that row:
| Delhi | Mumbai | Kolkata | Chennai | |
|---|---|---|---|---|
| A | 0 | 6 | 8 | 4 |
| B | 0 | 22 | 16 | 6 |
| C | 0 | 10 | 36 | 20 |
| Dummy | 0 | 0 | 0 | 0 |
Column reduction. Every column already contains a zero, so nothing changes.
Cover the zeros. All zeros can be covered by 2 lines (row Dummy, column Delhi), fewer than 4, so an assignment is not yet possible. The smallest uncovered element is 4: subtract it from every uncovered element and add it where two lines cross.
| Delhi | Mumbai | Kolkata | Chennai | |
|---|---|---|---|---|
| A | 0 | 2 | 4 | 0 |
| B | 0 | 18 | 12 | 2 |
| C | 0 | 6 | 32 | 16 |
| Dummy | 4 | 0 | 0 | 0 |
Cover the zeros. All zeros can be covered by 3 lines (row A, row Dummy, column Delhi), fewer than 4, so an assignment is not yet possible. The smallest uncovered element is 2: subtract it from every uncovered element and add it where two lines cross.
| Delhi | Mumbai | Kolkata | Chennai | |
|---|---|---|---|---|
| A | 2 | 2 | 4 | 0 |
| B | 0 | 16 | 10 | 0 |
| C | 0 | 4 | 30 | 14 |
| Dummy | 6 | 0 | 0 | 0 |
Cover the zeros. All zeros can be covered by 3 lines (row Dummy, column Delhi, column Chennai), fewer than 4, so an assignment is not yet possible. The smallest uncovered element is 2: subtract it from every uncovered element and add it where two lines cross.
| Delhi | Mumbai | Kolkata | Chennai | |
|---|---|---|---|---|
| A | 2 | 0 | 2 | 0 |
| B | 0 | 14 | 8 | 0 |
| C | 0 | 2 | 28 | 14 |
| Dummy | 8 | 0 | 0 | 2 |
Now at least 4 lines are needed to cover all the zeros, so an optimal assignment exists. Choose one zero in each row and column (a row or column with a single zero first):
| Delhi | Mumbai | Kolkata | Chennai | |
|---|---|---|---|---|
| A | 2 | [0] | 2 | 0 |
| B | 0 | 14 | 8 | [0] |
| C | [0] | 2 | 28 | 14 |
| Dummy | 8 | 0 | [0] | 2 |
Optimal assignment: Mumbai (22), Chennai (16), Delhi (10); Kolkata gets the dummy, i.e. no officer is moved there.
Minimum relocation cost thousand rupees (₹48,000).
✓ Checked by computer We checked by computer: all 24 assignments were enumerated; the unique minimum is 48 (thousand rupees).
A department head has 5 subordinates and 5 jobs to be performed. The time (in hours) that each subordinate will take to perform each job is given in the matrix below : How should the jobs be assigned, one to each subordinate, so as to minimize the total time? Also, obtain the total minimum time to perform all the jobs if the subordinate cannot be assigned job .
Solution
(a) No restriction. Apply the Hungarian method.
Row reduction. Subtract the smallest element of each row (4, 5, 7, 9, 6) from that row:
| A | B | C | D | E | |
|---|---|---|---|---|---|
| I | 0 | 5 | 0 | 8 | 0 |
| II | 10 | 6 | 15 | 0 | 3 |
| III | 10 | 0 | 8 | 5 | 11 |
| IV | 0 | 4 | 2 | 0 | 5 |
| V | 0 | 5 | 6 | 3 | 8 |
Column reduction. Every column already contains a zero, so nothing changes.
Cover the zeros. All zeros can be covered by 4 lines (row I, row III, column A, column D), fewer than 5, so an assignment is not yet possible. The smallest uncovered element is 2: subtract it from every uncovered element and add it where two lines cross.
| A | B | C | D | E | |
|---|---|---|---|---|---|
| I | 2 | 5 | 0 | 10 | 0 |
| II | 10 | 4 | 13 | 0 | 1 |
| III | 12 | 0 | 8 | 7 | 11 |
| IV | 0 | 2 | 0 | 0 | 3 |
| V | 0 | 3 | 4 | 3 | 6 |
Now at least 5 lines are needed to cover all the zeros, so an optimal assignment exists. Choose one zero in each row and column (a row or column with a single zero first):
| A | B | C | D | E | |
|---|---|---|---|---|---|
| I | 2 | 5 | 0 | 10 | [0] |
| II | 10 | 4 | 13 | [0] | 1 |
| III | 12 | [0] | 8 | 7 | 11 |
| IV | 0 | 2 | [0] | 0 | 3 |
| V | [0] | 3 | 4 | 3 | 6 |
Optimal assignment: I → E (4), II → D (5), III → B (7), IV → C (11), V → A (6). Minimum total time hours.
(b) Subordinate IV cannot do job C. Put a very large cost (shown “–”) in cell (IV, C) and solve again.
Row reduction. Subtract the smallest element of each row (4, 5, 7, 9, 6) from that row:
| A | B | C | D | E | |
|---|---|---|---|---|---|
| I | 0 | 5 | 0 | 8 | 0 |
| II | 10 | 6 | 15 | 0 | 3 |
| III | 10 | 0 | 8 | 5 | 11 |
| IV | 0 | 4 | – | 0 | 5 |
| V | 0 | 5 | 6 | 3 | 8 |
Column reduction. Every column already contains a zero, so nothing changes.
Cover the zeros. All zeros can be covered by 4 lines (row I, row III, column A, column D), fewer than 5, so an assignment is not yet possible. The smallest uncovered element is 3: subtract it from every uncovered element and add it where two lines cross.
| A | B | C | D | E | |
|---|---|---|---|---|---|
| I | 3 | 5 | 0 | 11 | 0 |
| II | 10 | 3 | 12 | 0 | 0 |
| III | 13 | 0 | 8 | 8 | 11 |
| IV | 0 | 1 | – | 0 | 2 |
| V | 0 | 2 | 3 | 3 | 5 |
Now at least 5 lines are needed to cover all the zeros, so an optimal assignment exists. Choose one zero in each row and column (a row or column with a single zero first):
| A | B | C | D | E | |
|---|---|---|---|---|---|
| I | 3 | 5 | [0] | 11 | 0 |
| II | 10 | 3 | 12 | 0 | [0] |
| III | 13 | [0] | 8 | 8 | 11 |
| IV | 0 | 1 | – | [0] | 2 |
| V | [0] | 2 | 3 | 3 | 5 |
Optimal assignment: I → C (4), II → E (8), III → B (7), IV → D (9), V → A (6). Minimum total time hours.
(In (a) the optimum used IV → C, so forbidding it raises the minimum by one hour.)
✓ Checked by computer We checked by computer: all assignments were enumerated, giving 33 without the restriction and 34 with it; each optimum is unique.
Find the initial basic feasible solution of the following transportation problem by Vogel’s approximation method and use it to find the optimal solution and the transportation cost of the problem :
Solution
Total availability total requirement, so the problem is balanced.
Vogel’s approximation method. For each row and column the penalty is the difference between its two smallest costs. At each step we pick the line with the largest penalty (on a tie, the one whose cheapest cell is cheapest), allocate as much as possible to its least-cost cell, and cross out the line that is used up.
| Step | Row penalties | Column penalties | Largest | Allocation |
|---|---|---|---|---|
| 1 | S1:3, S2:3, S3:9 | A:4, B:2, C:4, D:10 | 10 (D) | 11 in (S1, D) (cost 13) |
| 2 | S2:3, S3:9 | A:15, B:9, C:4, D:18 | 18 (D) | 4 in (S2, D) (cost 23) |
| 3 | S2:3, S3:9 | A:15, B:9, C:4 | 15 (A) | 6 in (S2, A) (cost 17) |
| 4 | S2:4, S3:9 | B:9, C:4 | 9 (S3) | 12 in (S3, C) (cost 18) |
Only one line is then left, so its cells are filled directly: 3 in (S2, B), 7 in (S3, B).
Initial basic feasible solution ( occupied cells):
| A | B | C | D | Availability | |
|---|---|---|---|---|---|
| S1 | 21 | 16 | 25 | 13 (11) | 11 |
| S2 | 17 (6) | 18 (3) | 14 | 23 (4) | 13 |
| S3 | 32 | 27 (7) | 18 (12) | 41 | 19 |
| Requirement | 6 | 10 | 12 | 15 |
Cost .
Optimality test (MODI).
MODI check 1. Put and use for the occupied cells. For each empty cell, is shown in brackets.
| A | B | C | D | Availability | ui | |
|---|---|---|---|---|---|---|
| S1 | 21 [14] | 16 [8] | 25 [26] | 13 (11) | 11 | 0 |
| S2 | 17 (6) | 18 (3) | 14 [5] | 23 (4) | 13 | 10 |
| S3 | 32 [6] | 27 (7) | 18 (12) | 41 [9] | 19 | 19 |
| Requirement | 6 | 10 | 12 | 15 | ||
| vj | 7 | 8 | −1 | 13 |
All , so this allocation is optimal.
Optimal solution: S1 → D: 11, S2 → A: 6, S2 → B: 3, S2 → D: 4, S3 → B: 7, S3 → C: 12. Minimum transportation cost .
✓ Checked by computer We checked by computer: an LP solver gives the minimum cost 796.
A department of a company has five employees with five jobs to be performed. The time (in hours) that each man takes to perform each job is given in the effectiveness matrix. Assign all the jobs to these five employees to minimize the total processing time :
Solution
Apply the Hungarian method to the matrix (rows: jobs, columns: employees).
Row reduction. Subtract the smallest element of each row (5, 3, 2, 7, 4) from that row:
| I | II | III | IV | V | |
|---|---|---|---|---|---|
| A | 5 | 0 | 8 | 10 | 11 |
| B | 0 | 6 | 15 | 10 | 3 |
| C | 8 | 5 | 0 | 0 | 0 |
| D | 0 | 4 | 2 | 0 | 5 |
| E | 3 | 5 | 6 | 0 | 8 |
Column reduction. Every column already contains a zero, so nothing changes.
Cover the zeros. All zeros can be covered by 4 lines (row A, row C, column I, column IV), fewer than 5, so an assignment is not yet possible. The smallest uncovered element is 2: subtract it from every uncovered element and add it where two lines cross.
| I | II | III | IV | V | |
|---|---|---|---|---|---|
| A | 7 | 0 | 8 | 12 | 11 |
| B | 0 | 4 | 13 | 10 | 1 |
| C | 10 | 5 | 0 | 2 | 0 |
| D | 0 | 2 | 0 | 0 | 3 |
| E | 3 | 3 | 4 | 0 | 6 |
Now at least 5 lines are needed to cover all the zeros, so an optimal assignment exists. Choose one zero in each row and column (a row or column with a single zero first):
| I | II | III | IV | V | |
|---|---|---|---|---|---|
| A | 7 | [0] | 8 | 12 | 11 |
| B | [0] | 4 | 13 | 10 | 1 |
| C | 10 | 5 | 0 | 2 | [0] |
| D | 0 | 2 | [0] | 0 | 3 |
| E | 3 | 3 | 4 | [0] | 6 |
Optimal assignment: job A → employee II (5), job B → employee I (3), job C → employee V (2), job D → employee III (9), job E → employee IV (4).
Minimum total processing time hours.
✓ Checked by computer We checked by computer: all 120 assignments were enumerated; the unique minimum is 23 hours.
Find the initial basic feasible solution of the following transportation problem by Vogel’s approximation method and use it to find the optimal solution and the transportation cost of the problem.
Solution
Total availability total demand, so the problem is balanced.
Vogel’s approximation method. For each row and column the penalty is the difference between its two smallest costs. At each step we pick the line with the largest penalty (on a tie, the one whose cheapest cell is cheapest), allocate as much as possible to its least-cost cell, and cross out the line that is used up.
| Step | Row penalties | Column penalties | Largest | Allocation |
|---|---|---|---|---|
| 1 | S1:10, S2:1, S3:14 | D1:10, D2:8, D3:7, D4:7 | 14 (S3) | 5 in (S3, D1) (cost 0) |
| 2 | S1:11, S2:1, S3:2 | D2:8, D3:7, D4:7 | 11 (S1) | 15 in (S1, D2) (cost 0) |
| 3 | S2:1, S3:2 | D2:6, D3:7, D4:2 | 7 (D3) | 15 in (S2, D3) (cost 9) |
| 4 | S2:12, S3:4 | D2:6, D4:2 | 12 (S2) | 5 in (S2, D2) (cost 8) |
Only one line is then left, so its cells are filled directly: 5 in (S3, D4), 5 in (S2, D4).
Initial basic feasible solution (6 occupied cells ):
| D1 | D2 | D3 | D4 | Availability | |
|---|---|---|---|---|---|
| S1 | 10 | 0 (15) | 20 | 11 | 15 |
| S2 | 12 | 8 (5) | 9 (15) | 20 (5) | 25 |
| S3 | 0 (5) | 14 | 16 | 18 (5) | 10 |
| Demand | 5 | 20 | 15 | 10 |
Cost .
Optimality test and improvement (MODI).
MODI check 1. Put and use for the occupied cells. For each empty cell, is shown in brackets.
| D1 | D2 | D3 | D4 | Availability | ui | |
|---|---|---|---|---|---|---|
| S1 | 10 [16] | 0 (15) | 20 [19] | 11 [−1] | 15 | 0 |
| S2 | 12 [10] | 8 (5) | 9 (15) | 20 (5) | 25 | 8 |
| S3 | 0 (5) | 14 [8] | 16 [9] | 18 (5) | 10 | 6 |
| Demand | 5 | 20 | 15 | 10 | ||
| vj | −6 | 0 | 1 | 12 |
The most negative is at (S1, D4), so it enters. Closed loop: (S1, D4) → (S1, D2) → (S2, D2) → (S2, D4) → (S1, D4), with signs . The least allocation in a “” cell is , at (S2, D4), which leaves. Moving round the loop changes the cost by .
MODI check 2. Put and use for the occupied cells. For each empty cell, is shown in brackets.
| D1 | D2 | D3 | D4 | Availability | ui | |
|---|---|---|---|---|---|---|
| S1 | 10 [17] | 0 (10) | 20 [19] | 11 (5) | 15 | 0 |
| S2 | 12 [11] | 8 (10) | 9 (15) | 20 [1] | 25 | 8 |
| S3 | 0 (5) | 14 [7] | 16 [8] | 18 (5) | 10 | 7 |
| Demand | 5 | 20 | 15 | 10 | ||
| vj | −7 | 0 | 1 | 11 |
All , so this allocation is optimal.
Optimal solution: S1 → D2: 10, S1 → D4: 5, S2 → D2: 10, S2 → D3: 15, S3 → D1: 5, S3 → D4: 5. Minimum transportation cost .
✓ Checked by computer We checked by computer: an LP solver gives the minimum cost 360.
In a factory there are five operators and five machines . The operating costs are given when the operator operates the machine . But there is a restriction that cannot be allowed to operate the third machine and cannot be allowed to operate the fifth machine . The cost matrix is given above. Find the optimal assignment and the optimal assignment cost also.
Solution
The restrictions are handled by giving the cells and a prohibitive cost (shown “–”), so they are never chosen.
Row reduction. Subtract the smallest element of each row (18, 17, 16, 18, 16) from that row:
| M1 | M2 | M3 | M4 | M5 | |
|---|---|---|---|---|---|
| O1 | 6 | 11 | 0 | 14 | 1 |
| O2 | 0 | 9 | 17 | 5 | – |
| O3 | 11 | 0 | – | 1 | 9 |
| O4 | 4 | 0 | 10 | 12 | 6 |
| O5 | 12 | 0 | 15 | 8 | 11 |
Column reduction. Subtract the smallest element of each column (0, 0, 0, 1, 1) from that column:
| M1 | M2 | M3 | M4 | M5 | |
|---|---|---|---|---|---|
| O1 | 6 | 11 | 0 | 13 | 0 |
| O2 | 0 | 9 | 17 | 4 | – |
| O3 | 11 | 0 | – | 0 | 8 |
| O4 | 4 | 0 | 10 | 11 | 5 |
| O5 | 12 | 0 | 15 | 7 | 10 |
Cover the zeros. All zeros can be covered by 4 lines (row O1, row O2, row O3, column M2), fewer than 5, so an assignment is not yet possible. The smallest uncovered element is 4: subtract it from every uncovered element and add it where two lines cross.
| M1 | M2 | M3 | M4 | M5 | |
|---|---|---|---|---|---|
| O1 | 6 | 15 | 0 | 13 | 0 |
| O2 | 0 | 13 | 17 | 4 | – |
| O3 | 11 | 4 | – | 0 | 8 |
| O4 | 0 | 0 | 6 | 7 | 1 |
| O5 | 8 | 0 | 11 | 3 | 6 |
Cover the zeros. All zeros can be covered by 4 lines (row O1, row O3, column M1, column M2), fewer than 5, so an assignment is not yet possible. The smallest uncovered element is 1: subtract it from every uncovered element and add it where two lines cross.
| M1 | M2 | M3 | M4 | M5 | |
|---|---|---|---|---|---|
| O1 | 7 | 16 | 0 | 13 | 0 |
| O2 | 0 | 13 | 16 | 3 | – |
| O3 | 12 | 5 | – | 0 | 8 |
| O4 | 0 | 0 | 5 | 6 | 0 |
| O5 | 8 | 0 | 10 | 2 | 5 |
Now at least 5 lines are needed to cover all the zeros, so an optimal assignment exists. Choose one zero in each row and column (a row or column with a single zero first):
| M1 | M2 | M3 | M4 | M5 | |
|---|---|---|---|---|---|
| O1 | 7 | 16 | [0] | 13 | 0 |
| O2 | [0] | 13 | 16 | 3 | – |
| O3 | 12 | 5 | – | [0] | 8 |
| O4 | 0 | 0 | 5 | 6 | [0] |
| O5 | 8 | [0] | 10 | 2 | 5 |
Optimal assignment: O1 → M3 (18), O2 → M1 (17), O3 → M4 (17), O4 → M5 (24), O5 → M2 (16).
Minimum operating cost .
✓ Checked by computer We checked by computer: all 120 assignments avoiding the two forbidden cells were enumerated; the unique minimum is 92.
Find the initial basic feasible solution of the following transportation problem using Vogel’s approximation method and find the cost.
Solution
Total supply total demand, so the problem is balanced. (Negative costs cause no difficulty: penalties are still differences of the two smallest costs.)
Vogel’s approximation method. For each row and column the penalty is the difference between its two smallest costs. At each step we pick the line with the largest penalty (on a tie, the one whose cheapest cell is cheapest), allocate as much as possible to its least-cost cell, and cross out the line that is used up.
| Step | Row penalties | Column penalties | Largest | Allocation |
|---|---|---|---|---|
| 1 | O1:3, O2:4, O3:1 | D1:2, D2:3, D3:3, D4:3, D5:1 | 4 (O2) | 8 in (O2, D3) (cost −3) |
| 2 | O1:1, O2:1, O3:1 | D1:2, D2:3, D4:3, D5:1 | 3 (D2) | 3 in (O3, D2) (cost −1) |
| 3 | O1:1, O2:2, O3:3 | D1:2, D4:3, D5:1 | 3 (O3) | 13 in (O3, D4) (cost 0) |
| 4 | O1:2, O2:7, O3:2 | D1:2, D5:1 | 7 (O2) | 1 in (O2, D1) (cost 1) |
| 5 | O1:2, O3:2 | D1:1, D5:1 | 2 (O3) | 1 in (O3, D1) (cost 3) |
Only one line is then left, so its cells are filled directly: 6 in (O1, D1), 8 in (O1, D5).
Initial basic feasible solution ( occupied cells):
| D1 | D2 | D3 | D4 | D5 | Supply | |
|---|---|---|---|---|---|---|
| O1 | 4 (6) | 7 | 0 | 3 | 6 (8) | 14 |
| O2 | 1 (1) | 2 | −3 (8) | 3 | 8 | 9 |
| O3 | 3 (1) | −1 (3) | 4 | 0 (13) | 5 | 17 |
| Demand | 8 | 3 | 8 | 13 | 8 |
Cost .
(A MODI check gives all , so this IBFS is in fact optimal.)
✓ Checked by computer We checked by computer: the allocation satisfies every supply and demand, and an LP solver confirms that 49 is also the minimum cost.
Solve the following assignment problem to maximize the sales :
Solution
Convert to a minimisation. Subtract every entry from the largest entry, 15. This gives the “loss” matrix; minimising the loss maximises the sales:
| I | II | III | IV | V | |
|---|---|---|---|---|---|
| A | 12 | 11 | 10 | 9 | 8 |
| B | 11 | 0 | 2 | 8 | 9 |
| C | 9 | 2 | 3 | 10 | 4 |
| D | 8 | 3 | 0 | 7 | 10 |
| E | 7 | 2 | 5 | 9 | 6 |
Row reduction. Subtract the smallest element of each row (8, 0, 2, 0, 2) from that row:
| I | II | III | IV | V | |
|---|---|---|---|---|---|
| A | 4 | 3 | 2 | 1 | 0 |
| B | 11 | 0 | 2 | 8 | 9 |
| C | 7 | 0 | 1 | 8 | 2 |
| D | 8 | 3 | 0 | 7 | 10 |
| E | 5 | 0 | 3 | 7 | 4 |
Column reduction. Subtract the smallest element of each column (4, 0, 0, 1, 0) from that column:
| I | II | III | IV | V | |
|---|---|---|---|---|---|
| A | 0 | 3 | 2 | 0 | 0 |
| B | 7 | 0 | 2 | 7 | 9 |
| C | 3 | 0 | 1 | 7 | 2 |
| D | 4 | 3 | 0 | 6 | 10 |
| E | 1 | 0 | 3 | 6 | 4 |
Cover the zeros. All zeros can be covered by 3 lines (row A, row D, column II), fewer than 5, so an assignment is not yet possible. The smallest uncovered element is 1: subtract it from every uncovered element and add it where two lines cross.
| I | II | III | IV | V | |
|---|---|---|---|---|---|
| A | 0 | 4 | 2 | 0 | 0 |
| B | 6 | 0 | 1 | 6 | 8 |
| C | 2 | 0 | 0 | 6 | 1 |
| D | 4 | 4 | 0 | 6 | 10 |
| E | 0 | 0 | 2 | 5 | 3 |
Cover the zeros. All zeros can be covered by 4 lines (row A, row E, column II, column III), fewer than 5, so an assignment is not yet possible. The smallest uncovered element is 1: subtract it from every uncovered element and add it where two lines cross.
| I | II | III | IV | V | |
|---|---|---|---|---|---|
| A | 0 | 5 | 3 | 0 | 0 |
| B | 5 | 0 | 1 | 5 | 7 |
| C | 1 | 0 | 0 | 5 | 0 |
| D | 3 | 4 | 0 | 5 | 9 |
| E | 0 | 1 | 3 | 5 | 3 |
Now at least 5 lines are needed to cover all the zeros, so an optimal assignment exists. Choose one zero in each row and column (a row or column with a single zero first):
| I | II | III | IV | V | |
|---|---|---|---|---|---|
| A | 0 | 5 | 3 | [0] | 0 |
| B | 5 | [0] | 1 | 5 | 7 |
| C | 1 | 0 | 0 | 5 | [0] |
| D | 3 | 4 | [0] | 5 | 9 |
| E | [0] | 1 | 3 | 5 | 3 |
Optimal assignment: A → IV (6), B → II (15), C → V (11), D → III (15), E → I (8).
Maximum total sales .
✓ Checked by computer We checked by computer: all 120 assignments were enumerated; the maximum total sales is 55.
Find the initial basic feasible solution to the following transportation problem by Vogel’s approximation method. Also, find its optimal solution and the minimum transportation cost :
Solution
Total supply total demand, so the problem is balanced.
Vogel’s approximation method. For each row and column the penalty is the difference between its two smallest costs. At each step we pick the line with the largest penalty (on a tie, the one whose cheapest cell is cheapest), allocate as much as possible to its least-cost cell, and cross out the line that is used up.
| Step | Row penalties | Column penalties | Largest | Allocation |
|---|---|---|---|---|
| 1 | O1:3, O2:5, O3:1 | D1:2, D2:1, D3:1, D4:3 | 5 (O2) | 15 in (O2, D3) (cost 2) |
| 2 | O1:1, O2:1, O3:1 | D1:2, D2:1, D4:3 | 3 (D4) | 4 in (O3, D4) (cost 2) |
| 3 | O1:2, O2:1, O3:1 | D1:2, D2:1 | 2 (O1) | 10 in (O1, D2) (cost 4) |
Only one line is then left, so its cells are filled directly: 1 in (O3, D1), 4 in (O1, D1), 1 in (O2, D1).
Initial basic feasible solution (6 occupied cells):
| D1 | D2 | D3 | D4 | Supply | |
|---|---|---|---|---|---|
| O1 | 6 (4) | 4 (10) | 1 | 5 | 14 |
| O2 | 8 (1) | 9 | 2 (15) | 7 | 16 |
| O3 | 4 (1) | 3 | 6 | 2 (4) | 5 |
| Demand | 6 | 10 | 15 | 4 |
Cost .
Optimality test (MODI).
MODI check 1. Put and use for the occupied cells. For each empty cell, is shown in brackets.
| D1 | D2 | D3 | D4 | Supply | ui | |
|---|---|---|---|---|---|---|
| O1 | 6 (4) | 4 (10) | 1 [1] | 5 [1] | 14 | 0 |
| O2 | 8 (1) | 9 [3] | 2 (15) | 7 [1] | 16 | 2 |
| O3 | 4 (1) | 3 [1] | 6 [8] | 2 (4) | 5 | −2 |
| Demand | 6 | 10 | 15 | 4 | ||
| vj | 6 | 4 | 0 | 4 |
All , so this allocation is optimal.
Optimal solution: O1 → D1: 4, O1 → D2: 10, O2 → D1: 1, O2 → D3: 15, O3 → D1: 1, O3 → D4: 4. Minimum transportation cost .
✓ Checked by computer We checked by computer: an LP solver gives the minimum cost 114.
Solve the minimum time assignment problem :
Solution
Row reduction. Subtract the smallest element of each row (3, 7, 5, 4) from that row:
| M1 | M2 | M3 | M4 | |
|---|---|---|---|---|
| J1 | 0 | 9 | 2 | 11 |
| J2 | 0 | 2 | 1 | 5 |
| J3 | 0 | 6 | 5 | 7 |
| J4 | 2 | 10 | 0 | 7 |
Column reduction. Subtract the smallest element of each column (0, 2, 0, 5) from that column:
| M1 | M2 | M3 | M4 | |
|---|---|---|---|---|
| J1 | 0 | 7 | 2 | 6 |
| J2 | 0 | 0 | 1 | 0 |
| J3 | 0 | 4 | 5 | 2 |
| J4 | 2 | 8 | 0 | 2 |
Cover the zeros. All zeros can be covered by 3 lines (row J2, row J4, column M1), fewer than 4, so an assignment is not yet possible. The smallest uncovered element is 2: subtract it from every uncovered element and add it where two lines cross.
| M1 | M2 | M3 | M4 | |
|---|---|---|---|---|
| J1 | 0 | 5 | 0 | 4 |
| J2 | 2 | 0 | 1 | 0 |
| J3 | 0 | 2 | 3 | 0 |
| J4 | 4 | 8 | 0 | 2 |
Now at least 4 lines are needed to cover all the zeros, so an optimal assignment exists. Choose one zero in each row and column (a row or column with a single zero first):
| M1 | M2 | M3 | M4 | |
|---|---|---|---|---|
| J1 | [0] | 5 | 0 | 4 |
| J2 | 2 | [0] | 1 | 0 |
| J3 | 0 | 2 | 3 | [0] |
| J4 | 4 | 8 | [0] | 2 |
Optimal assignment: J1 → M1 (3), J2 → M2 (9), J3 → M4 (12), J4 → M3 (4).
Minimum total time .
✓ Checked by computer We checked by computer: all 24 assignments were enumerated; the minimum time is 28.
By the method of Vogel, determine an initial basic feasible solution for the following transportation problem : Products , , and have to be sent to destinations , and . The cost of sending product to destinations is , where the matrix The total requirements of destinations , and are given by 45, 45, 95 respectively and the availability of the products , , and are respectively 25, 35, 55 and 70.
Solution
In the cost matrix the rows are the destinations and the columns are the products . Total requirement total availability, so the problem is balanced. We work with the matrix as given (rows , columns ).
Vogel’s approximation method. For each row and column the penalty is the difference between its two smallest costs. At each step we pick the line with the largest penalty (on a tie, the one whose cheapest cell is cheapest), allocate as much as possible to its least-cost cell, and cross out the line that is used up.
| Step | Row penalties | Column penalties | Largest | Allocation |
|---|---|---|---|---|
| 1 | D1:5, D2:3, D3:9 | P1:7, P2:3, P3:3, P4:8 | 9 (D3) | 25 in (D3, P1) (cost 0) |
| 2 | D1:5, D2:3, D3:2 | P2:3, P3:3, P4:8 | 8 (P4) | 45 in (D1, P4) (cost 5) |
| 3 | D2:3, D3:2 | P2:8, P3:3, P4:2 | 8 (P2) | 35 in (D2, P2) (cost 3) |
| 4 | D2:9, D3:4 | P3:3, P4:2 | 9 (D2) | 10 in (D2, P3) (cost 6) |
Only one line is then left, so its cells are filled directly: 45 in (D3, P3), 25 in (D3, P4).
Initial basic feasible solution ( occupied cells):
| P1 | P2 | P3 | P4 | Requirement | |
|---|---|---|---|---|---|
| D1 | 10 | 0 | 15 | 5 (45) | 45 |
| D2 | 7 | 3 (35) | 6 (10) | 15 | 45 |
| D3 | 0 (25) | 11 | 9 (45) | 13 (25) | 95 |
| Availability | 25 | 35 | 55 | 70 |
That is: D1 → P4: 45, D2 → P2: 35, D2 → P3: 10, D3 → P1: 25, D3 → P3: 45, D3 → P4: 25.
Cost of this IBFS . (A MODI check shows it is already optimal.)
✓ Checked by computer We checked by computer: the allocation meets every requirement and availability, and an LP solver confirms that 1120 is also the minimum cost.
Determine an optimal transportation programme so that the transportation cost of 340 tons of a certain type of material from three factories , , to five warehouses , , , , is minimized. The five warehouses must receive 40 tons, 50 tons, 70 tons, 90 tons and 90 tons respectively. The availability of the material at , , is 100 tons, 120 tons, 120 tons respectively. The transportation costs per ton from factories to warehouses are given in the table below : Use Vogel’s approximation method to obtain the initial basic feasible solution.
Solution
Total availability total requirement, so the problem is balanced.
Vogel’s approximation method. For each row and column the penalty is the difference between its two smallest costs. At each step we pick the line with the largest penalty (on a tie, the one whose cheapest cell is cheapest), allocate as much as possible to its least-cost cell, and cross out the line that is used up.
| Step | Row penalties | Column penalties | Largest | Allocation |
|---|---|---|---|---|
| 1 | F1:1, F2:1, F3:2 | W1:1, W2:1, W3:1, W4:1, W5:1 | 2 (F3) | 50 in (F3, W2) (cost 2) |
| 2 | F1:2, F2:2, F3:1 | W1:1, W3:1, W4:1, W5:1 | 2 (F1) | 70 in (F1, W3) (cost 2) |
| 3 | F1:2, F2:1, F3:1 | W1:1, W4:1, W5:1 | 2 (F1) | 30 in (F1, W1) (cost 4) |
| 4 | F2:1, F3:1 | W1:1, W4:1, W5:1 | 1 (F3) | 70 in (F3, W4) (cost 4) |
Only one line is then left, so its cells are filled directly: 20 in (F2, W4), 10 in (F2, W1), 90 in (F2, W5).
Initial basic feasible solution ( occupied cells):
| W1 | W2 | W3 | W4 | W5 | Available | |
|---|---|---|---|---|---|---|
| F1 | 4 (30) | 1 | 2 (70) | 6 | 9 | 100 |
| F2 | 6 (10) | 4 | 3 | 5 (20) | 7 (90) | 120 |
| F3 | 5 | 2 (50) | 6 | 4 (70) | 8 | 120 |
| Required | 40 | 50 | 70 | 90 | 90 |
Cost .
Optimality test and improvement (MODI).
MODI check 1. Put and use for the occupied cells. For each empty cell, is shown in brackets.
| W1 | W2 | W3 | W4 | W5 | Available | ui | |
|---|---|---|---|---|---|---|---|
| F1 | 4 (30) | 1 [0] | 2 (70) | 6 [3] | 9 [4] | 100 | 0 |
| F2 | 6 (10) | 4 [1] | 3 [−1] | 5 (20) | 7 (90) | 120 | 2 |
| F3 | 5 [0] | 2 (50) | 6 [3] | 4 (70) | 8 [2] | 120 | 1 |
| Required | 40 | 50 | 70 | 90 | 90 | ||
| vj | 4 | 1 | 2 | 3 | 5 |
The most negative is at (F2, W3), so it enters. Closed loop: (F2, W3) → (F2, W1) → (F1, W1) → (F1, W3) → (F2, W3), with signs . The least allocation in a “” cell is , at (F2, W1), which leaves. Moving round the loop changes the cost by .
MODI check 2. Put and use for the occupied cells. For each empty cell, is shown in brackets.
| W1 | W2 | W3 | W4 | W5 | Available | ui | |
|---|---|---|---|---|---|---|---|
| F1 | 4 (40) | 1 [−1] | 2 (60) | 6 [2] | 9 [3] | 100 | 0 |
| F2 | 6 [1] | 4 [1] | 3 (10) | 5 (20) | 7 (90) | 120 | 1 |
| F3 | 5 [1] | 2 (50) | 6 [4] | 4 (70) | 8 [2] | 120 | 0 |
| Required | 40 | 50 | 70 | 90 | 90 | ||
| vj | 4 | 2 | 2 | 4 | 6 |
The most negative is at (F1, W2), so it enters. Closed loop: (F1, W2) → (F1, W3) → (F2, W3) → (F2, W4) → (F3, W4) → (F3, W2) → (F1, W2), with signs . The least allocation in a “” cell is , at (F2, W4), which leaves. Moving round the loop changes the cost by .
MODI check 3. Put and use for the occupied cells. For each empty cell, is shown in brackets.
| W1 | W2 | W3 | W4 | W5 | Available | ui | |
|---|---|---|---|---|---|---|---|
| F1 | 4 (40) | 1 (20) | 2 (40) | 6 [3] | 9 [3] | 100 | 0 |
| F2 | 6 [1] | 4 [2] | 3 (30) | 5 [1] | 7 (90) | 120 | 1 |
| F3 | 5 [0] | 2 (30) | 6 [3] | 4 (90) | 8 [1] | 120 | 1 |
| Required | 40 | 50 | 70 | 90 | 90 | ||
| vj | 4 | 1 | 2 | 3 | 6 |
All , so this allocation is optimal. (Some empty cell has , so an alternative optimal schedule with the same cost exists.)
Optimal programme: F1 → W1: 40, F1 → W2: 20, F1 → W3: 40, F2 → W3: 30, F2 → W5: 90, F3 → W2: 30, F3 → W4: 90.
Minimum transportation cost . (An empty cell has , so an alternative optimal programme with the same cost exists.)
✓ Checked by computer We checked by computer: an LP solver gives the minimum cost 1400.
Solve the following transportation problem : (rows: Factories; columns: Destinations) by finding the initial solution by Matrix Minima method.
Solution
Total availability total demand, so the problem is balanced.
Matrix minima (least-cost) method. Repeatedly pick the cheapest remaining cell (on a tie, the one that takes the larger amount), allocate as much as possible, and cross out the exhausted row or column.
| Step | Least-cost cell | Allocation |
|---|---|---|
| 1 | (F1, D2), cost 1 | 50 |
| 2 | (F4, D4), cost 1 | 30 |
| 3 | (F3, D6), cost 1 | 10 |
| 4 | (F2, D3), cost 2 | 20 |
| 5 | (F3, D4), cost 2 | 10 |
| 6 | (F2, D2), cost 2 | 0 (degenerate: basic cell at level 0) |
| 7 | (F3, D1), cost 3 | 30 |
| 8 | (F2, D5), cost 3 | 20 |
| 9 | (F3, D5), cost 4 | 10 |
When a row and a column are exhausted together, only one is crossed out, so a zero allocation is recorded later. This keeps basic cells (the solution is degenerate).
Initial basic feasible solution:
| D1 | D2 | D3 | D4 | D5 | D6 | Availability | |
|---|---|---|---|---|---|---|---|
| F1 | 2 | 1 (50) | 3 | 3 | 2 | 5 | 50 |
| F2 | 3 | 2 (0) | 2 (20) | 4 | 3 (20) | 4 | 40 |
| F3 | 3 (30) | 5 | 4 | 2 (10) | 4 (10) | 1 (10) | 60 |
| F4 | 4 | 2 | 2 | 1 (30) | 2 | 2 | 30 |
| Demand | 30 | 50 | 20 | 40 | 30 | 10 |
Cost .
Optimality test and improvement (MODI).
MODI check 1. Put and use for the occupied cells. For each empty cell, is shown in brackets.
| D1 | D2 | D3 | D4 | D5 | D6 | Availability | ui | |
|---|---|---|---|---|---|---|---|---|
| F1 | 2 [1] | 1 (50) | 3 [2] | 3 [3] | 2 [0] | 5 [6] | 50 | 0 |
| F2 | 3 [1] | 2 (0) | 2 (20) | 4 [3] | 3 (20) | 4 [4] | 40 | 1 |
| F3 | 3 (30) | 5 [2] | 4 [1] | 2 (10) | 4 (10) | 1 (10) | 60 | 2 |
| F4 | 4 [2] | 2 [0] | 2 [0] | 1 (30) | 2 [−1] | 2 [2] | 30 | 1 |
| Demand | 30 | 50 | 20 | 40 | 30 | 10 | ||
| vj | 1 | 1 | 1 | 0 | 2 | −1 |
The most negative is at (F4, D5), so it enters. Closed loop: (F4, D5) → (F4, D4) → (F3, D4) → (F3, D5) → (F4, D5), with signs . The least allocation in a “” cell is , at (F3, D5), which leaves. Moving round the loop changes the cost by .
MODI check 2. Put and use for the occupied cells. For each empty cell, is shown in brackets.
| D1 | D2 | D3 | D4 | D5 | D6 | Availability | ui | |
|---|---|---|---|---|---|---|---|---|
| F1 | 2 [0] | 1 (50) | 3 [2] | 3 [2] | 2 [0] | 5 [5] | 50 | 0 |
| F2 | 3 [0] | 2 (0) | 2 (20) | 4 [2] | 3 (20) | 4 [3] | 40 | 1 |
| F3 | 3 (30) | 5 [3] | 4 [2] | 2 (20) | 4 [1] | 1 (10) | 60 | 1 |
| F4 | 4 [2] | 2 [1] | 2 [1] | 1 (20) | 2 (10) | 2 [2] | 30 | 0 |
| Demand | 30 | 50 | 20 | 40 | 30 | 10 | ||
| vj | 2 | 1 | 1 | 1 | 2 | 0 |
All , so this allocation is optimal. (Some empty cell has , so an alternative optimal schedule with the same cost exists.)
Optimal solution: F1 → D2: 50, F2 → D3: 20, F2 → D5: 20, F3 → D1: 30, F3 → D4: 20, F3 → D6: 10, F4 → D4: 20, F4 → D5: 10. Minimum transportation cost . (Some empty cells have , so other optimal schedules with the same cost exist.)
✓ Checked by computer We checked by computer: an LP solver gives the minimum cost 330.
More on Linear Programming
- Linear Programming topic-wise PYQs (questions only, for practice)
- Mathematics PYQ analysis: which units carry the marks year by year
- Year-wise question papers
- Mathematics booklist
Questions: UPSC Civil Services (Main) Examination, Mathematics Paper II, 2008–2026. Solutions: Optional Province. Found an error? Tell us.

