Transportation and Assignment Problem
Transportation and Assignment Problem
NorthWest-Corner-Method
Destination supply
Source A B C D
1 3 1 7 4 250
2 2 6 5 9 350
3 8 3 3 2 400
Demand 200 300 350 150 1000
3 1 7 4 250
200 50 250-200=50
50-50=0
2 6 5 9 350
250 100 350-250=100
100-100=0
8 3 3 2 400
250 150 400-250=150
150-150=0
𝑈1 = 0 3 1 7 4
200 50
𝑈2 = 5 2 6 5 9
250 100
𝑈3 = 3 8 3 3 2
250 150
𝑈𝑖 + 𝑉𝑗 = 𝐶𝑖𝑗
Calculate the penalties of the unallocated cells using the formula 𝑃𝑖𝑗 = 𝑈𝑖 + 𝑉𝑗 −
𝐶𝑖𝑗 , 𝐶𝑖𝑗 𝑖𝑠 𝑡ℎ𝑒 𝑣𝑎𝑙𝑢𝑒 𝑜𝑓 𝑡ℎ𝑒 𝑢𝑛𝑎𝑙𝑙𝑜𝑐𝑎𝑡𝑒𝑑 𝑐𝑒𝑙𝑙
𝐶13 = −7, 𝐶14 = −5, 𝐶21 = 6, 𝐶24 = −5, 𝐶31 = −2, 𝐶32 = 1
Optimality is reached if 𝑃𝑖𝑗 ≤ 0. Since we have some positive penalties then optimality has not been
reached.
Find the new basic cell by identifying the unallocated cell with the highest positive penalty then draw a
closed loop using horizontal and vertical lines only with turning points being at allocated cells. Assign (+)
and (-) at each turning point alternatively starting (+) at the new basic cell.
𝐶21 = 6 is the cell with the highest positive penalty therefore our new basic cell.
𝑉1 = 3 𝑉2 = 1 𝑉3 = 0 𝑉4 = −1
𝑈1 = 0 3(-) (+)1 7 4
200 50
𝑈2 = 5 (+)2 (-)6 5 9
250 100
𝑈3 = 3 8 3 3 2
250 150
Look at the turning points of the loop in the allocated cell then pick the least negative value, 200. To the
negative turning points(loop cells) subtract 200, to the positive turning points(loop cells) add 200.
𝑉1 = −3 𝑉2 = 1 𝑉3 = 0 𝑉4 = −1
𝑈1 = 0 3 1 7 4
250
𝑈2 = 5 2 6 5 9
200 50 100
𝑈3 = 3 8 3 3 2
250 150
𝑈𝑖 + 𝑉𝑗 = 𝐶𝑖𝑗
𝐶11 = −6, 𝐶13 = −7, 𝐶14 = −5, 𝐶24 = −5, 𝐶31 = −8, 𝐶32 = 1 Optimality not reached since we have a
positive penalty value on 𝐶32 = 1 hence our new basic cell. Draw a closed loop starting with cell C32.
𝑉1 = −3 𝑉2 = 1 𝑉3 = 0 𝑉4 = −1
𝑈1 = 0 3 1 7 4
250
𝑈2 = 5 2 (-)6 (+)5 9
200 50 100
𝑈3 = 3 8 (+)3 (-)3 2
250 150
Look at the turning points of the loop in the allocated basic cell then pick the least negative value, 50. To
the negative turning points(loop cells) subtract 50, to the positive turning points(loop cells) add 50.
𝑉1 = −2 𝑉2 = 1 𝑉3 = 1 𝑉4 = 0
𝑈1 = 0 3 1 7 4
250
𝑈2 = 4 2 6 5 9
200 150
𝑈3 = 2 8 3 3 2
50 200 150
𝑈𝑖 + 𝑉𝑗 = 𝐶𝑖𝑗
3+4−1=6
Calculate the penalties of the unallocated cells using the formula 𝑃𝑖𝑗 = 𝑈𝑖 + 𝑉𝑗 −
𝐶𝑖𝑗 , 𝐶𝑖𝑗 𝑖𝑠 𝑡ℎ𝑒 𝑣𝑎𝑙𝑢𝑒 𝑜𝑓 𝑡ℎ𝑒 𝑢𝑛𝑎𝑙𝑙𝑜𝑐𝑎𝑡𝑒𝑑 𝑐𝑒𝑙𝑙
𝐶11 = −5, 𝐶13 = −6, 𝐶14 = −4, 𝐶22 = −1, 𝐶24 = −5, 𝐶31 = −8. 𝑠𝑖𝑛𝑐𝑒 𝑎𝑙𝑙 𝑃𝑖𝑗 ≤
0 𝑡ℎ𝑒𝑛 𝑤𝑒 ℎ𝑎𝑣𝑒 𝑟𝑒𝑎𝑐ℎ𝑒𝑑 𝑜𝑝𝑡𝑖𝑚𝑎𝑙𝑖𝑡𝑦.
Least-Cost-Cell-Method
Destination supply
source 1 2 3 4
1 3 1 7 4 300
2 2 6 5 9 400
3 8 3 3 2 500
Start with the cell with minimum value in the cost matrix
2 6 5 9 400
250 150 400-250=150
150-150=0
8 3 3 2 500
50 250 200 500-200=300
300-50=250
250-
250=0
source 1 2 3 4
1 3 1 7 4 300
2 2 6 5 9 400
3 8 3 3 2 500
Select the maximum value among row difference and column difference
Identify the cell for allocation which has least cost in that row or column.
Row Difference
3 1 7 4 300 2 3 - - - -
300 300-
300=0
2 6 5 9 400 3 - - - - -
250 150 400-
250=150
150-
150=0
8 3 3 2 500 1 1 1 - - -
50 250 200 500-
200=300
300-
50=250
250-
250=0
250 350 400 200 1200
250- 350- 400- 200-
250=0 300=50 250=150 200=0
50- 150-
50=0 150=0
Column 1 2 2 2 1
Difference - 2 2 2 2
- 3 2 7 3
- 3 2 - 4
- - 2 - 5
- - - -
The initial feasible basic solution is 300 × 1 + 250 × 2 + 150 × 5 + 50 × 3 + 250 × 3 + 200 × 2 =
2850
To optimize the solution ,follow the same procedure as conducted under northwest cost cell method.
This is a type of transportation problem where demand does not equal the supply.
Destination Supply
Source A B C D E
1 5 1 8 7 5 15
2 3 9 6 7 8 25
3 4 2 7 6 5 42
4 7 11 10 4 9 35
Demand 30 20 15 10 20
The transportation problem is unbalanced since 𝐷 ≠ 𝑆; 95 ≠ 117
Destination Supply
Source A B C D E F
1 5 1 8 7 5 0 15
2 3 9 6 7 8 0 25
3 4 2 7 6 5 0 42
4 7 11 10 4 9 0 35
Demand 30 20 15 10 20 22 117
Find initial basic feasible solution, use either NorthWest Corner Cell method, Least-Cost cell Method or
VAM method.
3 4 2 7 6 5 0 42
10 15 10 7 42-10=32
32-15=17
17-
10=7
7-
7=0
4 7 11 10 4 9 0 35
13 22 35-13=22
22-22=0
Demand 30 20 15 10 20 22 117
30-15=15 20-10=10 15- 10- 20-7=13 22-
15- 10- 15=0 10=0 13- 22=0
15=0 10=0 13=0
Find the initial basic feasible solution using least cost cell method
10 2 3 15 9 35
20 15 35-
20=15
15-
15=0
5 10 15 2 4 40
10 30 40-
10=30
30-
30=0
15 5 14 7 15 20
20 20-
20=0
20 15 13 25 8 30
25 5 30-
5=25
25-
25=0
20 20 40 10 35 125
20- 20- 40- 10- 35-
20=0 20=0 15=25 10=0 30=5
25- 5-
25=0 5=0
8≠7
If No;
Convert the necessary number of unallocated cells into allocated cells to satisfy the following conditions;
Check the loop formation one by one, there should be no closed loop formation.
10 2 3 15 9
20 15
5 10 15 2 4
10 30
15 5 14 7 15
20
20 15 13 25 8
25 5
Among the unallocated cells, the least value is 5. Cell 𝐶32 satisfy the condition, no closed loop formation,
therefore its converted to an allocated cell
10 2 3 15 9
20 15
5 10 15 2 4
10 30
15 5 14 7 15
20 𝜀
20 15 13 25 8
25 5
8=8
𝑉1 = 2 𝑉2 = 2 𝑉3 = 3 𝑉4 = −4 𝑉5 = −2 Supply
𝑈1 = 0 10 2 3 15 9 35
20 15
𝑈2 = 6 5 10 15 2 4 40
10 30
𝑈3 = 3 15 5 14 7 15 20+𝜀
20 𝜀
𝑈4 20 15 13 25 8 30
= 10 25 5
Calculate the penalties of the unallocated cells using the formula 𝑃𝑖𝑗 = 𝑈𝑖 + 𝑉𝑗 −
𝐶𝑖𝑗 , 𝐶𝑖𝑗 𝑖𝑠 𝑡ℎ𝑒 𝑣𝑎𝑙𝑢𝑒 𝑜𝑓 𝑡ℎ𝑒 𝑢𝑛𝑎𝑙𝑙𝑜𝑐𝑎𝑡𝑒𝑑 𝑐𝑒𝑙𝑙
𝐶11 = −8, 𝐶14 = −19, 𝐶15 = −11, 𝐶21 = 13, 𝐶22 = −2, 𝐶23 = −6, 𝐶33 = −8, 𝐶34 = −8, 𝐶35 =
−14, 𝐶41 = 2, 𝐶42 = −3, 𝐶44 = −19
Optimality is reached if 𝑃𝑖𝑗 ≤ 0. Since we have some positive penalties, optimality has not been
reached.
Pick the cell with the most positive penalty and consider that cell as the new allocated cell.
From that new particular allocated cell, draw a closed loop using horizontal and vertical lines passing
through some allocated cells. The turning point of the loop should be only at the allocated cells.
𝐶21 = 13, 𝑖𝑠 𝑡ℎ𝑒 𝑚𝑜𝑠𝑡 𝑝𝑜𝑠𝑖𝑡𝑖𝑣𝑒 𝑡ℎ𝑒𝑟𝑒𝑓𝑜𝑟𝑒 𝐶21 𝑖𝑠 𝑡ℎ𝑒 𝑛𝑒𝑤 𝑎𝑙𝑙𝑜𝑐𝑎𝑡𝑒𝑑 𝑐𝑒𝑙𝑙.
𝑉1 = 2 𝑉2 = 2 𝑉3 = 3 𝑉4 = −4 𝑉5 = −2 Supply
𝑈1 = 0 10 (-)2 (+)3 15 9 35
20 15
𝑈2 = 6 (+)5 10 15 2 (-)4 40
10 30
𝑈4 20 15 (-)13 25 (+)8 30
= 10 25 5
select the minimum of the allocated value among the (-) signed cells.
Add and subtract that selected minimum value in all the (+) and (-) signed cells respectively.
𝑉1 = 2 𝑉2 = 2 𝑉3 = 3 𝑉4 = −4 𝑉5 = −2 Supply
𝑈1 = 0 10 2 3 15 9 35
35
𝑈2 = 6 5 10 15 2 4 40
20 10 10
𝑈3 = 3 15 5 14 7 15 20+𝜀
20 + 𝜀
𝑈4 20 15 13 25 8 30
= 10 5 25
8 ≠ 7, cell 𝐶12satisfy the condition of no closed loop formation therefore our new allocated cell.
𝑉1 = 2 𝑉2 = 2 𝑉3 = 3 𝑉4 = −4 𝑉5 = −2 Supply
𝑈1 = 0 10 2 3 15 9 35+𝜀
𝜀 35
𝑈2 = 6 5 10 15 2 4 40
20 10 10
𝑈3 = 3 15 5 14 7 15 20+𝜀
20 + 𝜀
𝑈4 20 15 13 25 8 30
= 10 5 25
8=8
𝑉1 = −1 𝑉2 = 2 𝑉3 = 3 𝑉4 = −4 𝑉5 = −2 Supply
𝑈1 = 0 10 2 3 15 9 35+𝜀
𝜀 35
𝑈2 = 6 5 10 15 2 4 40
20 10 10
𝑈3 = 3 15 5 14 7 15 20+𝜀
20 + 𝜀
𝑈4 20 15 13 25 8 30
= 10 5 25
𝐶11 = −11, 𝐶14 = −19, 𝐶15 = −11, 𝐶22 = −2, 𝐶23 = −6, 𝐶31 = −13, 𝐶33 = −8, 𝐶34 = −8, 𝐶35
= −14, 𝐶41 = −11, 𝐶42 = −3, 𝐶44 = −19
Check the optimality condition all 𝑃𝑖𝑗 values should be equal or less than zero; 𝑃𝑖𝑗 ≤ 0.
We have reached optimality since all 𝑃𝑖𝑗 values are equal or less than zero.
ASSIGNMENT PROBLEM
The assignment problem is a special case of transportation problem in which the objective is to assign
‘m’ jobs or workers to ‘n’ machines such that the cost incurred is minimized.
Row reduction
1 2 3 4
A 0 2 9 1
B 0 5 2 3
C 1 3 2 0
D 0 4 3 1
Column reduction
1 2 3 4
A 0 0 7 1
B 0 3 0 3
C 1 1 0 0
D 0 2 1 1
1 2 3 4
A 0 0 7 1
B 0 3 0 3
C 1 1 0 0
D 0 2 1 1
All the zeros are covered with vertical lines.
The allocated cells equal the order of the matrix. N=n; 4=4, therefore we have reached
optimality.
Person job total
A 2 12
B 3 7
C 4 11
D 1 8
Total optimum 38
cost
Problem 2.
Solve the assignment problem using Hungarian method. The matrix entries represent the
processing time in hours.
Operators
jobs A B C D
1 5 3 2 8
2 7 9 2 6
3 6 4 5 7
4 5 7 7 8
Row reduction
A B C D
1 3 1 0 6
2 5 7 0 4
3 2 0 1 3
4 0 2 2 3
Column reduction
A B C D
1 3 1 0 3
2 5 7 0 1
3 2 0 1 0
4 0 2 2 0
A B C D
1 3 1 0 3
2 5 7 0 1
3 2 0 1 0
4 0 2 2 0
All the zeros are covered with lines
However number of allocated cells does not equal the order of the matrix N≠ 𝑛; 3 ≠ 4.
A B C D
1 2 0 0 2
2 4 6 0 0
3 2 0 2 0
4 0 2 3 0
A B C D
1 2 0 0 2
2 4 6 0 0
3 1 0 2 0
4 0 2 3 0
MACHINES
JOBS 1 2 3 4
A 18 24 28 32
B 8 13 17 19
C 10 15 19 22
1 2 3 4
A 0 6 10 14
B 0 5 9 11
C 0 5 9 12
D 0 0 0 0
All the zeros are covered but the number of allocated cells does not equal the order of the
matrix.
1 2 3 4
A 0 1 5 9
B 0 0 4 6
C 0 0 4 7
D 5 0 0 0
All the zeros covered but allocated cells do not equal the order of the matrix.
1 2 3 4
A 0 1 1 5
B 0 0 0 2
C 0 0 0 3
D 9 4 0 0
All the zeros are covered, the allocated cells equal the order of the matrix, optimality has been
attained.
Jobs Machines Total
hours
A 1 18
B 2 13
C 3 19
D 4 0
Total optimum 50
cost
A B C D E
1 49 33 61 0 29
2 40 27 50 38 52
3 24 19 0 40 30
4 63 47 24 34 31
5 111 111 111 111 111
Row reduction
A B C D E
1 49 33 61 0 29
2 13 0 23 11 25
3 24 19 0 40 30
4 39 23 0 10 8
5 0 0 0 0 0
Column reduction
A B C D E
1 49 33 61 0 29
2 13 0 23 11 25
3 24 19 0 40 30
4 39 23 0 10 8
5 0 0 0 0 0
A B C D E
1 49 33 61 0 29
2 13 0 23 11 25
3 24 19 0 40 30
4 39 23 0 10 8
5 0 0 0 0 0
All zeros are covered however the allocated cells do not equal the order of the matrix.
A B C D E
1 41 33 61 0 21
2 5 0 23 11 17
3 16 19 0 40 22
4 31 23 0 10 0
5 0 8 8 8 0
All the zeros are covered with lines, allocated cells equal the order of the matrix hence
optimality has been attained.
Jobs Worker Total
hours
A 5 0
B 2 84
C 3 111
D 1 111
E 4 80
Total optimum 386
profit