Menu Close

Transportation and assignment problems: UPSC Maths Optional PYQ Solutions (2008–2026)

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

Cover of the UPSC Prelims Topic-wise PYQ book with detailed explanations

From the Optional Province team

Preparing for Prelims too?

Our UPSC Prelims Topic-wise PYQ Book covers every Prelims question with detailed explanations, so you can see exactly where UPSC asks from. Now available as a hard copy and an eBook.

Buy Hard Copy on AmazonBuy eBook (PDF)

Download a free sample

The following table represents the estimated costs of assigning jobs to machines. Solve this assignment problem to minimize the total cost. Job∖MachineM1M2M3M4J18242832J28131719J38151922 Is the assignment unique for the total minimum cost ? Justify your answer and obtain an alternate assignment, if it exists.

2026 · Paper II · Q3c · 15 marks

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: J1→M1J_1\to M_1 (8), J2→M3J_2\to M_3 (17), J3→M2J_3\to M_2 (15), with M4M_4 idle. Minimum total cost =8+17+15=40=8+17+15=40.

Is it unique? No. In the final matrix, J2J_2 and J3J_3 both have zeros under M2M_2 and M3M_3, so the two can be swapped. This gives the alternate assignment J1→M1J_1\to M_1 (8), J2→M2J_2\to M_2 (13), J3→M3J_3\to M_3 (19), also of cost 8+13+19=408+13+19=40. These are the only two optimal assignments.

✓ Checked by computer We checked by computer: all 4!=244!=24 assignments were enumerated; the minimum is 40, reached by exactly two assignments.

↑ Back to the question list

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 : Warehouse∖MarketIIIIIIIVSupplyA524322B481615C46758Requirement712179 The shipping clerk has worked out the following schedule from experience : 12 units from A to II, 1 unit from A to III, 9 units from A to IV, 15 units from B to III, 7 units from C to I and 1 unit from C to III. Find the optimal schedule and minimum total shipping cost.

2025 · Paper II · Q4c · 20 marks

Solution

Total supply =22+15+8=45==22+15+8=45= total requirement, so the problem is balanced.

The clerk’s schedule as a starting solution. It uses 6=m+n−16=m+n-1 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 2×12+4×1+3×9+1×15+4×7+7×1=1052\times 12 + 4\times 1 + 3\times 9 + 1\times 15 + 4\times 7 + 7\times 1 = 105.

Test for optimality (MODI / u–v method).

MODI check 1. Put u1=0u_1=0 and use ui+vj=ciju_i+v_j=c_{ij} for the occupied cells. For each empty cell, Δij=cij−(ui+vj)\Delta_{ij}=c_{ij}-(u_i+v_j) 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 Δ=−1\Delta=-1 at (C, IV), so it enters. Closed loop: (C, IV) → (C, III) → (A, III) → (A, IV) → (C, IV), with signs +,−,+,−,…+,-,+,-,\dots. The least allocation in a “−–” cell is θ=1\theta=1, at (C, III), which leaves. Moving θ\theta round the loop changes the cost by θΔ=1×(−1)=−1\theta\Delta=1\times(-1)=-1.

MODI check 2. Put u1=0u_1=0 and use ui+vj=ciju_i+v_j=c_{ij} for the occupied cells. For each empty cell, Δij=cij−(ui+vj)\Delta_{ij}=c_{ij}-(u_i+v_j) 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 Δij≥0\Delta_{ij}\ge0, 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 == 2×12+4×2+3×8+1×15+4×7+5×1=1042\times 12 + 4\times 2 + 3\times 8 + 1\times 15 + 4\times 7 + 5\times 1 = 104, 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.

↑ Back to the question list

The personnel manager of a company wants to assign officers A, B and C 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 : Officer∖OfficeDelhiMumbaiKolkataChennaiA16222420B10322616C10204630 Find the assignment which minimizes the total cost of relocation and also determine the minimum cost.

2024 · Paper II · Q4c · 20 marks

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: A→A\to Mumbai (22), B→B\to Chennai (16), C→C\to Delhi (10); Kolkata gets the dummy, i.e. no officer is moved there.

Minimum relocation cost =22+16+10=48=22+16+10=48 thousand rupees (₹48,000).

✓ Checked by computer We checked by computer: all 24 assignments were enumerated; the unique minimum is 48 (thousand rupees).

↑ Back to the question list

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 : Subordinates∖JobsABCDEI494124II15112058III177151218IV91311914V61112914 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 IV cannot be assigned job C.

2023 · Paper II · Q4c · 20 marks

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 =33=33 hours.

(b) Subordinate IV cannot do job C. Put a very large cost MM (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 =34=34 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 5!=1205!=120 assignments were enumerated, giving 33 without the restriction and 34 with it; each optimum is unique.

↑ Back to the question list

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 : Source∖DestinationABCDAvailabilityS12116251311S21718142313S33227184119Requirement610121543

2022 · Paper II · Q4c · 20 marks

Solution

Total availability =43==43= 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 (m+n−1=6m+n-1=6 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 == 13×11+17×6+18×3+23×4+27×7+18×12=79613\times 11 + 17\times 6 + 18\times 3 + 23\times 4 + 27\times 7 + 18\times 12 = 796.

Optimality test (MODI).

MODI check 1. Put u1=0u_1=0 and use ui+vj=ciju_i+v_j=c_{ij} for the occupied cells. For each empty cell, Δij=cij−(ui+vj)\Delta_{ij}=c_{ij}-(u_i+v_j) 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 Δij≥0\Delta_{ij}\ge0, 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 == 13×11+17×6+18×3+23×4+27×7+18×12=79613\times 11 + 17\times 6 + 18\times 3 + 23\times 4 + 27\times 7 + 18\times 12 = 796.

✓ Checked by computer We checked by computer: an LP solver gives the minimum cost 796.

↑ Back to the question list

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 : Jobs∖EmployeesIIIIIIIVVA105131516B3918136C107222D7119712E7910412

2021 · Paper II · Q1e · 10 marks

Solution

Apply the Hungarian method to the 5×55\times5 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 =23=23 hours.

✓ Checked by computer We checked by computer: all 120 assignments were enumerated; the unique minimum is 23 hours.

↑ Back to the question list

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. Sources∖DestinationsD1D2D3D4AvailabilityS1100201115S212892025S3014161810Demand5201510

2020 · Paper II · Q4c · 20 marks

Solution

Total availability =50==50= 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 =m+n−1=m+n-1):

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 == 0×15+8×5+9×15+20×5+0×5+18×5=3650\times 15 + 8\times 5 + 9\times 15 + 20\times 5 + 0\times 5 + 18\times 5 = 365.

Optimality test and improvement (MODI).

MODI check 1. Put u1=0u_1=0 and use ui+vj=ciju_i+v_j=c_{ij} for the occupied cells. For each empty cell, Δij=cij−(ui+vj)\Delta_{ij}=c_{ij}-(u_i+v_j) 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 Δ=−1\Delta=-1 at (S1, D4), so it enters. Closed loop: (S1, D4) → (S1, D2) → (S2, D2) → (S2, D4) → (S1, D4), with signs +,−,+,−,…+,-,+,-,\dots. The least allocation in a “−–” cell is θ=5\theta=5, at (S2, D4), which leaves. Moving θ\theta round the loop changes the cost by θΔ=5×(−1)=−5\theta\Delta=5\times(-1)=-5.

MODI check 2. Put u1=0u_1=0 and use ui+vj=ciju_i+v_j=c_{ij} for the occupied cells. For each empty cell, Δij=cij−(ui+vj)\Delta_{ij}=c_{ij}-(u_i+v_j) 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 Δij≥0\Delta_{ij}\ge0, 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 == 0×10+11×5+8×10+9×15+0×5+18×5=3600\times 10 + 11\times 5 + 8\times 10 + 9\times 15 + 0\times 5 + 18\times 5 = 360.

✓ Checked by computer We checked by computer: an LP solver gives the minimum cost 360.

↑ Back to the question list

Cover of the UPSC Mains Topic-wise and Year-wise PYQs book (2013–2026)

From the Optional Province team

Strengthen your GS papers

Our UPSC Mains Topic-wise & Year-wise PYQ Book (2013–2026) maps every GS question to the syllabus, so you know what UPSC asks and how often. Now available as a hard copy and an eBook.

Buy Hard Copy on AmazonBuy eBook (PDF)

Download a free sample

Operator∖MachineM1M2M3M4M5O12429183219O21726342221O32716281725O42218283024O52816312427 In a factory there are five operators O1,O2,O3,O4,O5 and five machines M1,M2,M3,M4,M5. The operating costs are given when the Oi operator operates the Mj machine (i,j=1,2,…,5). But there is a restriction that O3 cannot be allowed to operate the third machine M3 and O2 cannot be allowed to operate the fifth machine M5. The cost matrix is given above. Find the optimal assignment and the optimal assignment cost also.

2018 · Paper II · Q4c · 15 marks

Solution

The restrictions are handled by giving the cells (O3,M3)(O_3,M_3) and (O2,M5)(O_2,M_5) a prohibitive cost MM (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 =92=92.

✓ Checked by computer We checked by computer: all 120 assignments avoiding the two forbidden cells were enumerated; the unique minimum is 92.

↑ Back to the question list

Find the initial basic feasible solution of the following transportation problem using Vogel’s approximation method and find the cost. D1D2D3D4D5SupplyO14703614O212−3389O33−140517Demand838138

2017 · Paper II · Q4b · 15 marks

Solution

Total supply =40==40= 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 (m+n−1=7m+n-1=7 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 == 4×6+6×8+1×1+−3×8+3×1+−1×3+0×13=494\times 6 + 6\times 8 + 1\times 1 + -3\times 8 + 3\times 1 + -1\times 3 + 0\times 13 = 49.

(A MODI check gives all Δij≥0\Delta_{ij}\ge0, 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.

↑ Back to the question list

Solve the following assignment problem to maximize the sales : Salesmen∖TerritoriesIIIIIIIVVA34567B4151376C61312511D7121585E8131069

2015 · Paper II · Q1e · 10 marks

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 =55=55.

✓ Checked by computer We checked by computer: all 120 assignments were enumerated; the maximum total sales is 55.

↑ Back to the question list

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 : D1D2D3D4SupplyO1641514O2892716O343625Demand610154

2014 · Paper II · Q2c · 20 marks

Solution

Total supply =35==35= 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 == 6×4+4×10+8×1+2×15+4×1+2×4=1146\times 4 + 4\times 10 + 8\times 1 + 2\times 15 + 4\times 1 + 2\times 4 = 114.

Optimality test (MODI).

MODI check 1. Put u1=0u_1=0 and use ui+vj=ciju_i+v_j=c_{ij} for the occupied cells. For each empty cell, Δij=cij−(ui+vj)\Delta_{ij}=c_{ij}-(u_i+v_j) 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 Δij≥0\Delta_{ij}\ge0, 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 == 6×4+4×10+8×1+2×15+4×1+2×4=1146\times 4 + 4\times 10 + 8\times 1 + 2\times 15 + 4\times 1 + 2\times 4 = 114.

✓ Checked by computer We checked by computer: an LP solver gives the minimum cost 114.

↑ Back to the question list

Solve the minimum time assignment problem : Jobs∖MachinesM1M2M3M4J1312514J279812J35111012J4614411

2013 · Paper II · Q4a · 15 marks

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 =28=28.

✓ Checked by computer We checked by computer: all 24 assignments were enumerated; the minimum time is 28.

↑ Back to the question list

By the method of Vogel, determine an initial basic feasible solution for the following transportation problem : Products P1, P2, P3 and P4 have to be sent to destinations D1, D2 and D3. The cost of sending product Pi to destinations Dj is Cij, where the matrix [Cij]=[10015573615011913]. The total requirements of destinations D1, D2 and D3 are given by 45, 45, 95 respectively and the availability of the products P1, P2, P3 and P4 are respectively 25, 35, 55 and 70.

2012 · Paper II · Q4c · 20 marks

Solution

In the cost matrix the rows are the destinations D1,D2,D3D_1,D_2,D_3 and the columns are the products P1,…,P4P_1,\dots,P_4. Total requirement =45+45+95=185=25+35+55+70==45+45+95=185=25+35+55+70= total availability, so the problem is balanced. We work with the matrix as given (rows DiD_i, columns PjP_j).

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 (m+n−1=6m+n-1=6 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 == 5×45+3×35+6×10+0×25+9×45+13×25=11205\times 45 + 3\times 35 + 6\times 10 + 0\times 25 + 9\times 45 + 13\times 25 = 1120. (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.

↑ Back to the question list

Determine an optimal transportation programme so that the transportation cost of 340 tons of a certain type of material from three factories F1, F2, F3 to five warehouses W1, W2, W3, W4, W5 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 F1, F2, F3 is 100 tons, 120 tons, 120 tons respectively. The transportation costs per ton from factories to warehouses are given in the table below : W1W2W3W4W5F141269F264357F352648 Use Vogel’s approximation method to obtain the initial basic feasible solution.

2010 · Paper II · Q4c · 30 marks

Solution

Total availability =340==340= 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 (m+n−1=7m+n-1=7 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 == 4×30+2×70+6×10+5×20+7×90+2×50+4×70=14304\times 30 + 2\times 70 + 6\times 10 + 5\times 20 + 7\times 90 + 2\times 50 + 4\times 70 = 1430.

Optimality test and improvement (MODI).

MODI check 1. Put u1=0u_1=0 and use ui+vj=ciju_i+v_j=c_{ij} for the occupied cells. For each empty cell, Δij=cij−(ui+vj)\Delta_{ij}=c_{ij}-(u_i+v_j) 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 Δ=−1\Delta=-1 at (F2, W3), so it enters. Closed loop: (F2, W3) → (F2, W1) → (F1, W1) → (F1, W3) → (F2, W3), with signs +,−,+,−,…+,-,+,-,\dots. The least allocation in a “−–” cell is θ=10\theta=10, at (F2, W1), which leaves. Moving θ\theta round the loop changes the cost by θΔ=10×(−1)=−10\theta\Delta=10\times(-1)=-10.

MODI check 2. Put u1=0u_1=0 and use ui+vj=ciju_i+v_j=c_{ij} for the occupied cells. For each empty cell, Δij=cij−(ui+vj)\Delta_{ij}=c_{ij}-(u_i+v_j) 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 Δ=−1\Delta=-1 at (F1, W2), so it enters. Closed loop: (F1, W2) → (F1, W3) → (F2, W3) → (F2, W4) → (F3, W4) → (F3, W2) → (F1, W2), with signs +,−,+,−,…+,-,+,-,\dots. The least allocation in a “−–” cell is θ=20\theta=20, at (F2, W4), which leaves. Moving θ\theta round the loop changes the cost by θΔ=20×(−1)=−20\theta\Delta=20\times(-1)=-20.

MODI check 3. Put u1=0u_1=0 and use ui+vj=ciju_i+v_j=c_{ij} for the occupied cells. For each empty cell, Δij=cij−(ui+vj)\Delta_{ij}=c_{ij}-(u_i+v_j) 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 Δij≥0\Delta_{ij}\ge0, so this allocation is optimal. (Some empty cell has Δij=0\Delta_{ij}=0, 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 == 4×40+1×20+2×40+3×30+7×90+2×30+4×90=14004\times 40 + 1\times 20 + 2\times 40 + 3\times 30 + 7\times 90 + 2\times 30 + 4\times 90 = 1400. (An empty cell has Δij=0\Delta_{ij}=0, 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.

↑ Back to the question list

Solve the following transportation problem : D1D2D3D4D5D6AvailabilityF121332550F232243440F335424160F442212230Demand305020403010 (rows: Factories; columns: Destinations) by finding the initial solution by Matrix Minima method.

2008 · Paper II · Q4c · 30 marks

Solution

Total availability =180==180= 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 m+n−1=9m+n-1=9 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 == 1×50+2×20+3×20+3×30+2×10+4×10+1×10+1×30=3401\times 50 + 2\times 20 + 3\times 20 + 3\times 30 + 2\times 10 + 4\times 10 + 1\times 10 + 1\times 30 = 340.

Optimality test and improvement (MODI).

MODI check 1. Put u1=0u_1=0 and use ui+vj=ciju_i+v_j=c_{ij} for the occupied cells. For each empty cell, Δij=cij−(ui+vj)\Delta_{ij}=c_{ij}-(u_i+v_j) 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 Δ=−1\Delta=-1 at (F4, D5), so it enters. Closed loop: (F4, D5) → (F4, D4) → (F3, D4) → (F3, D5) → (F4, D5), with signs +,−,+,−,…+,-,+,-,\dots. The least allocation in a “−–” cell is θ=10\theta=10, at (F3, D5), which leaves. Moving θ\theta round the loop changes the cost by θΔ=10×(−1)=−10\theta\Delta=10\times(-1)=-10.

MODI check 2. Put u1=0u_1=0 and use ui+vj=ciju_i+v_j=c_{ij} for the occupied cells. For each empty cell, Δij=cij−(ui+vj)\Delta_{ij}=c_{ij}-(u_i+v_j) 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 Δij≥0\Delta_{ij}\ge0, so this allocation is optimal. (Some empty cell has Δij=0\Delta_{ij}=0, 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 == 1×50+2×20+3×20+3×30+2×20+1×10+1×20+2×10=3301\times 50 + 2\times 20 + 3\times 20 + 3\times 30 + 2\times 20 + 1\times 10 + 1\times 20 + 2\times 10 = 330. (Some empty cells have Δij=0\Delta_{ij}=0, so other optimal schedules with the same cost exist.)

✓ Checked by computer We checked by computer: an LP solver gives the minimum cost 330.

↑ Back to the question list

More on Linear Programming

Questions: UPSC Civil Services (Main) Examination, Mathematics Paper II, 2008–2026. Solutions: Optional Province. Found an error? Tell us.

Spotted an error? Tell us.

We classify every PYQ with care, but mistakes can slip in. If a question is in the wrong topic, has a typo, the wrong year, or is missing, let us know. We review every report and update the page.

Report an Error
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted