Transportation & Assignment Problem
Transportation & Assignment Problem
Methods to Solve:
To find the initial basic feasible solution there are three methods:
1. North-West Corner Cell Method.
2. Least Call Cell Method.
3. Vogel’s Approximation Method (VAM).
Basic structure of transportation problem:
In the above table D1, D2, D3 and D4 are the destinations where the products/goods are to be
delivered from different sources S1, S2, S3 and S4. Si is the supply from the source Oi. dj is the
demand of the destination Dj. Cij is the cost when the product is delivered from source Si to
destination Dj.
MZUMBE UNIVERSITY
Topic 5: Transportation Problem and Assignment problem
Explanation: Given three sources O1, O2 and O3 and four destinations D1, D2, D3 and D4. For the
sources O1, O2 and O3, the supply is 300, 400 and 500 respectively.
The destinations D1, D2, D3 and D4 have demands 250, 350, 400 and 200 respectively.
Solution: According to North West Corner method, (O1, D1) has to be the starting point i.e. the
north-west corner of the table. Each and every value in the cell is considered as the cost per
transportation. Compare the demand for column D1 and supply from the source O1 and allocate the
minimum of two to the cell (O1, D1) as shown in the figure.
The demand for Column D1 is completed so the entire column D1 will be canceled. The supply from
the source O1 remains 300 – 250 = 50.
Now from the remaining table i.e. excluding column D1, check the north-west corner i.e. (O1,
D2) and allocate the minimum among the supply for the respective column and the rows. The supply
from O1 is 50 which is less than the demand for D2 (i.e. 350), so allocate 50 to the cell (O1, D2).
MZUMBE UNIVERSITY
Topic 5: Transportation Problem and Assignment problem
Since the supply from row O1 is completed cancel the row O1. The demand for
column D2 remains 350 – 50 = 50.
From the remaining table the north-west corner cell is (O2, D2). The minimum among the supply
from source O2 (i.e. 400) and demand for column D2 (i.e. 300) is 300, so allocate 300 to the cell
(O2, D2). The demand for the column D2 is completed so cancel the column and the remaining
supply from source O2 is 400 – 300 = 100.
Now from remaining table find the north-west corner i.e. (O2, D3) and compare the O2supply (i.e.
100) and the demand for D2 (i.e. 400) and allocate the smaller (i.e. 100) to the cell (O2, D2). The
supply from O2 is completed so cancel the row O2. The remaining demand for
column D3 remains 400 – 100 = 300.
MZUMBE UNIVERSITY
Topic 5: Transportation Problem and Assignment problem
Proceeding in the same way, the final values of the cells will be:
Note: In the last remaining cell the demand for the respective columns and rows are equal which was
cell (O3, D4). In this case, the supply from O3 and the demand for D4 was 200which was allocated
to this cell. At last, nothing remained for any row or column.
Now just multiply the allocated value with the respective cell value (i.e. the cost) and add all of them
to get the basic solution i.e. (250 * 3) + (50 * 1) + (300 * 6) + (100 * 5) + (300 * 3) + (200 * 2) =
4400
MZUMBE UNIVERSITY
Topic 5: Transportation Problem and Assignment problem
Solution: According to the Least Cost Cell method, the least cost among all the cells in the table has
to be found which is 1 (i.e., cell (O1, D2)).
Now check the supply from the row O1 and demand for column D2 and allocate the smaller value to the cell. The
smaller value is 300 so allocate this to the cell. The supply from O1 is completed so cancel this row and the
remaining demand for the column D2 is 350 – 300 = 50.
Now find the cell with the least cost among the remaining cells. There are two cells with the least
cost i.e. (O2, D1) and (O3, D4) with cost 2. Lets select (O2, D1). Now find the demand and supply
for the respective cell and allocate the minimum among them to the cell and cancel the row or
column whose supply or demand becomes 0 after allocation.
MZUMBE UNIVERSITY
Topic 5: Transportation Problem and Assignment problem
Now the cell with the least cost is (O3, D4) with cost 2. Allocate this cell with 200 as the demand is
smaller than the supply. So the column gets canceled.
There are two cells among the unallocated cells that have the least cost. Choose any at random
say (O3, D2). Allocate this cell with a minimum among the supply from the respective row and the
demand of the respective column. Cancel the row or column with zero value.
Now the cell with the least cost is (O3, D3). Allocate the minimum of supply and demand and cancel
the row or column with zero value.
MZUMBE UNIVERSITY
Topic 5: Transportation Problem and Assignment problem
The only remaining cell is (O2, D3) with cost 5 and its supply is 150 and demand is 150 i.e. demand
and supply both are equal. Allocate it to this cell.
Now just multiply the cost of the cell with their respective allocated values and add all of them to get
the basic solution i.e. (300 * 1) + (250 * 2) + (150 * 5) + (50 * 3) + (250 * 3) + (200 * 2) = 2850
MZUMBE UNIVERSITY
Topic 5: Transportation Problem and Assignment problem
Solution:
• For each row find the least value and then the second least value and take the absolute difference
of these two least values and write it in the corresponding row difference as shown in the image
below. In row O1, 1 is the least value and 3 is the second least value and their absolute
difference is 2. Similarly, for row O2 and O3, the absolute differences are 3 and 1 respectively.
• For each column find the least value and then the second least value and take the absolute
difference of these two least values then write it in the corresponding column difference as
shown in the figure. In column D1, 2 is the least value and 3 is the second least value and their
absolute difference is 1. Similarly, for column D2, D3and D3, the absolute differences
are 2, 2 and 2 respectively.
MZUMBE UNIVERSITY
Topic 5: Transportation Problem and Assignment problem
• These value of row difference and column difference are also called as penalty. Now select the
maximum penalty. The maximum penalty is 3 i.e. row O2. Now find the cell with the least cost
in row O2 and allocate the minimum among the supply of the respective row and the demand of
the respective column. Demand is smaller than the supply so allocate the column’s demand
i.e. 250 to the cell. Then cancel the column D1.
• From the remaining cells, find out the row difference and column difference.
• Again, select the maximum penalty which is 3 corresponding to row O1. The least-cost cell
inrow O1 is (O1, D2) with cost 1. Allocate the minimum among supply and demand from
the
MZUMBE UNIVERSITY
Topic 5: Transportation Problem and Assignment problem
respective row and column to the cell. Cancel the row or column with zero value.
• Now find the row difference and column difference from the remaining cells.
• Now select the maximum penalty which is 7 corresponding to column D4. The least cost cell in
column D4 is (O3, D4) with cost 2. The demand is smaller than the supply for cell (O3, D4).
Allocate 200 to the cell and cancel the column.
MZUMBE UNIVERSITY
Topic 5: Transportation Problem and Assignment problem
• Find the row difference and the column difference from the remaining cells.
• Now the maximum penalty is 3 corresponding to the column D2. The cell with the least value
in D2 is (O3, D2). Allocate the minimum of supply and demand and cancel the column.
MZUMBE UNIVERSITY
Topic 5: Transportation Problem and Assignment problem
• Now there is only one column so select the cell with the least cost and allocate the value.
• Now there is only one cell so allocate the remaining demand or supply to the cell
• No balance remains. So multiply the allocated value of the cells with their corresponding cell
cost and add all to get the final cost i.e. (300 * 1) + (250 * 2) + (50 * 3) + (250 * 3) + (200 * 2)
+ (150 * 5) = 2850
MZUMBE UNIVERSITY
Topic 5: Transportation Problem and Assignment problem
The problem is unbalanced because the sum of all the supplies i.e. O1, O2, O3 and O4 is not equal
to the sum of all the demands i.e. D1, D2, D3, D4 and D5.
Solution:
In this type of problem, the concept of a dummy row or a dummy column will be used. As in this
case, since the supply is more than the demand so a dummy demand column will be added and a
demand of (total supply – total demand) will be given to that column i.e. 117 – 95 = 22 as shown in
the image below. If demand were more than the supply then a dummy supply row would have been
added.
Now that the problem has been updated to a balanced transportation problem, it can be solved using
any one of the following methods to solve a balanced transportation problem as discussed in the
earlier posts:
1. North West Corner Method
2. Least Cost Cell Method
3. Vogel’s Approximation Method
MZUMBE UNIVERSITY
Topic 5: Transportation Problem and Assignment problem
There are two phases to solve the transportation problem. In the first phase, the initial basic feasible
solution has to be found and the second phase involves optimization of the initial basic feasible
solution that was obtained in the first phase. There are three methods for finding an initial basic
feasible solution,
Solution:
Step 1: Check whether the problem is balanced or not.
If the total sum of all the supply from sources O1, O2, and O3 is equal to the total sum of all the
demands for destinations D1, D2, D3 and D4 then the transportation problem is a balanced
transportation problem.
Note: If the problem is not unbalanced then the concept of a dummy row or a dummy column to
transform the unbalanced problem to balanced can be followed as discussed.
MZUMBE UNIVERSITY
Topic 5: Transportation Problem and Assignment problem
Now, the total cost of transportation will be (200 * 3) + (50 * 1) + (250 * 6) + (100 * 5) + (250 * 3) +
(150 * 2) = 3700.
Step 3: U-V method to optimize the initial basic feasible solution.
The following is the initial basic feasible solution:
– For U-V method the values ui and vj have to be found for the rows and the columns respectively.
As there are three rows so three ui values have to be found i.e. u1 for the first row, u2 for the second
row and u3 for the third row.
Similarly, for four columns four vj values have to be found i.e. v1, v2, v3 and v4. Check the image
below:
MZUMBE UNIVERSITY
Topic 5: Transportation Problem and Assignment problem
There is a separate formula to find ui and vj,
ui + vj = Cij where Cij is the cost value only for the allocated cell.
Before applying the above formula, we need to check whether m + n – 1 is equal to the total
number of allocated cells or not where m is the total number of rows and n is the total number of
columns.
In this case m = 3, n = 4 and total number of allocated cells is 6 so m + n – 1 = 6. The case when m +
n – 1 is not equal to the total number of allocated cells will be discussed in the later posts.
Now to find the value for u and v we assign any of the three u or any of the four v as 0. Let we
assign u1 = 0 in this case. Then using the above formula we will get v1 = 3 as u1 + v1 = 3 (i.e.
C11) and v2 = 1 as u1 + v2 = 1 (i.e. C12). Similarly, we have got the value for v2 = 3 so we get
the value for u2 = 5 which implies v3 = 0. From the value of v3 = 0 we get u3 = 3 which implies v4
= -1.
Now, compute penalties using the formula Pij = ui + vj – Cij only for unallocated cells. We have
two unallocated cells in the first row, two in the second row and two in the third row. Let’s compute
this one by one.
1. For C13, P13 = 0 + 0 – 7 = -7 (here C13 = 7, u1 = 0 and v3 = 0)
The rule for drawing closed-path or loop. Starting from the new basic cell draw a closed-path in
such a way that the right-angle turn is done only at the allocated cell or at the new basic cell.
Assign alternate plus-minus sign to all the cells with right angle turn (or the corner) in the loop with
plus sign assigned at the new basic cell.
MZUMBE UNIVERSITY
Topic 5: Transportation Problem and Assignment problem
Consider the cells with a negative sign. Compare the allocated value (i.e. 200 and 250 in this case)
and select the minimum (i.e. select 200 in this case). Now subtract 200 from the cells with a minus
sign and add 200 to the cells with a plus sign. And draw a new iteration. The work of the loop is over
and the new solution looks as shown below.
Check the total number of allocated cells is equal to (m + n – 1). Again find u values and v values
using the formula ui + vj = Cij where Cij is the cost value only for allocated cell. Assign u1 = 0
then we get v2 = 1. Similarly, we will get following values for ui and vj.
Find the penalties for all the unallocated cells using the formula Pij = ui + vj –
Cij.1. For C11, P11 = 0 + (-3) – 3 = -6
2. For C13, P13 = 0 + 0 – 7 = -7
3. For C14, P14 = 0 + (-1) – 4 = -5
4. For C24, P24 = 5 + (-1) – 9 = -5
5. For C31, P31 = 0 + (-3) – 8 = -11
6. For C32, P32 = 3 + 1 – 3 = 1
There is one positive value i.e. 1 for C32. Now this cell becomes new basic cell.
MZUMBE UNIVERSITY
Topic 5: Transportation Problem and Assignment problem
Now draw a loop starting from the new basic cell. Assign alternate plus and minus sign with new
basic cell assigned as a plus sign.
Select the minimum value from allocated values to the cell with a minus sign. Subtract this value
from the cell with a minus sign and add to the cell with a plus sign. Now the solution looks as shown
in the image below:
Check if the total number of allocated cells is equal to (m + n – 1). Find u and v values as above.
MZUMBE UNIVERSITY
Topic 5: Transportation Problem and Assignment problem
Now again find the penalties for the unallocated cells as above.
Now, find the total cost i.e. (250 * 1) + (200 * 2) + (150 * 5) + (50 * 3) + (200 * 3) + (150 * 2) =
2450
MZUMBE UNIVERSITY
Topic 5: Transportation Problem and Assignment problem
Solution:
This problem is balanced transportation problem as total supply is equal to total demand.
There are 13 unallocated cells. Select the least value (i.e., 5 in this case) from unallocated cells. There
are two 5s here so you can select randomly anyone. Let’s select the cell with star marked.
Check if there is any closed-loop formation starting from this cell. If a closed-loop is drawn from this
cell following the condition for closed-loop then it can be observed that this cell cannot be reached to
complete the closed-loop. So, this cell will be selected and assigned a random value ‘e’.
MZUMBE UNIVERSITY
Topic 5: Transportation Problem and Assignment problem
Note: If the closed loop would have been formed from that cell, then we would try another cell with
least value and do the same procedure and check whether closed loop is possible or not.
Now total number of allocated cells becomes 8 and m + n – 1 = 4 + 5 – 1 = 8. Now this solution can
be optimized using U-V method. We get the below solution after performing optimization using U-V
method.
The presence of two ‘e’ in the final solution means after doing some iterations during optimization,
the condition for degeneracy will be met once again.
While finding the total cost, just leave the ‘e’ and multiply the allocated value with its cell’s cost
value and add all of them. So, the transportation cost is (35 * 3) + (20 * 5) + (10 * 2) + (10 * 4) + (20
* 5) + (5 * 13) + (25 * 8) = 630.
Module 4: Transportation Problem and Assignment problem
ASSIGNMENT PROBLEMS
The assignment problem deals with allocating various resources (items) to various activities
(receivers) on a one-to-one basis, i.e., the number of operations are to be assigned to an equal
number of operators where each operator performs only one operation. For example, suppose
an accounts officer has 4 subordinates and 4 tasks. The subordinates differ in efficiency and
take different time to perform each task. If one task is to be assigned to one person in such a
way that the total person hours are minimized, the problem is called an assignment problem.
Though the assignment problem is a special case of transportation problem, it is not solved
using the methods described in Unit 4. We use another method called the Hungarian method
for solving an assignment problem. It is shorter and easier compared to any method of finding
the optimal solution of a transportation problem. In this unit, we discuss various types of
assignment problems, including travelling salesman problem and apply the Hungarian method
for solving these problems.
In the next unit, we shall discuss the fundamental structure and operating characteristics of a
queueing system and explain a single server M/M/1 queueing model with Poisson input and
exponential service time.
Objectives
• determine the optimal solutions of assignment problems using the Hungarian method;
• obtain the solutions for special cases of assignment problems, i.e, maximization problem,
unbalanced assignment problem, alternative optimal solutions and restriction on
assignments;and
• Solve the travelling salesman problem as an assignment problem.
An assignment problem may be considered as a special type of transportation problem in which the number
of sources and destinations are equal. The capacity of each source as well as the requirement of each
destination is taken as 1. In the case of an assignment problem, the given matrix must necessarily be a
square matrix which is not the condition for a transportation problem.
Suppose there are n persons and n jobs and the assignment of jobs has to be done on a one-to-
Module 4: Transportation Problem and Assignment problem
one basis. This assignment problem can be stated in the form of an n×n matrix of real numbers
(known as the cost matrix) as given in the following table:
Job
Person 1 2 ... j... n
1 C11 C12 .. . C1j … C1n
Where cij represents the amount of time taken by ith person to complete the jth job. Let xij
denote the jth job assigned to the ith person. Then, mathematically, the assignment problem can
be stated as follows:
subject to
1 if the ith person is assigned the
jth job0 if the ith person is not
assigned the j job
xi1 + xi2 +... + xin= 1, i = 1, 2,..., n (one job is done by the ith person)
The constant cij in the above problem represents time. It may be cost or some other parameter
which
is to be minimized in the assignment problem under consideration.
Module 4: Transportation Problem and Assignment problem
Note that an assignment problem is a special type of transportation problem and may be solved
as one. However, we use another method known as the Hungarian method for solving it. This
method is shorter and easier compared to any other method of finding the optimal solution of a
transportation problem. Let us explain the Hungarian method of finding the optimal solution of
an assignment problem.
1. Check whether the given matrix is square. If not, make it square by adding a suitable
number ofdummy rows (or columns) with 0 cost/time elements.
2. Locate the smallest cost element in each row of the cost matrix. Subtract the smallest
elementof each row from every element of that row.
3. In the resulting cost matrix, locate the smallest element in each column and subtract
thesmallest element of each column from every element of that column.
ii) Repeat step (i) above for the columns of the resulting cost matrix.
iii) If a row or column of the reduced matrix contains more than one zeroes, arbitrarily
choose a row or column having the minimum number of zeroes. Arbitrarily select any
zero in the row or column so chosen. Draw a rectangle around it and cross out all the
zeroes in the corresponding row and column. Repeat steps (i), (ii) and (iii) until all the
zeroes have either been assigned (by drawing a rectangle around them) or crossed.
iv) If each row and each column of the resulting matrix has one and only one assigned 0,
the optimum assignment is made in the cells corresponding to 0 . The optimum solution
of theproblem is attained and you can stop here.
i) Tick mark ( ) the rows in which assignment has not been made.
ii) Tick mark ( ) columns, which have zeroes in the marked rows.
iii) Tick mark ( ) rows (not already marked) which have assignments in marked
columns. Then tick mark ( ) columns, which have zeroes in newly marked rows, if
any. Tick mark ( ) rows (not already marked), which have assignments in these
newly marked columns.
iv) Draw straight lines through all unmarked rows and marked columns.
ii) Subtract this from all the uncovered elements and add it to the elements at the
intersectionof the two lines.
A B C D
1 40 20 0 10
2 10 20 40 0
3 10 40 20 0
4 10 10 0 10
Let us now subtract the minimum element of each column from every element of that column in
the resulting matrix. The minimum element in the first column is 10. So 10 is to be subtracted
from every element of the first column, i.e., from 40, 10, 10, and 10, respectively. As a result,
the elements of the first column of the resulting matrix are 30, 0, 0, 0, respectively. Similarly, we
obtain the elements of the other columns of the resulting matrix. Thus, the resulting matrix is:
A B C D
1 30 10 0 10
2 0 10 40 0
3 0 30 20 0
4 0 0 0 10
Now, starting from first row onward, we draw a rectangle around the 0 in each row having a
single zero and cross all other zeroes in the corresponding column. Here, in the very first row we
find a single zero. So, we draw a rectangle around it and cross all other zeroes in the
corresponding column.
We get
A B C D
1 30 10 0 10
2 0 10 40 0
3 0 30 20 0
4 0 0
0 10
In the second, third and fourth row, there is no single zero. Hence, we move column-wise. In the
second column, we have a single zero. Hence, we draw a rectangle around it and cross all other
Module 4: Transportation Problem and Assignment problem
zeroes in the corresponding row. We get
A B C D
1 30 10 0 10
2 0 10 40 0
0 30 20 0
4
0 0
0 10
In the matrix above, there is no row or column, which has a single zero. Therefore, we first
move row-wise to locate the row having more than one zero. The second row has two zeroes.
So, we draw a rectangle arbitrarily around one of these zeroes and cross the other one. Let us
draw a rectangle around the zero in the cell (2, A) and cross the zero in the cell (2, D). We
cross out the other zeroes in the first column. Note that we could just as well have selected the
zero in the cell (2, D), drawn a rectangle around it and crossed all other zeroes. This would
have led to an alternative solution.
In this way, we are left with only one zero in every row and column around which a rectangle
has been drawn. This means that we have assigned only one operation to one operator. Thus,
we get the optimum solution as follows:
A B C D
1 30 10 0 10
2 0 10 40 0
3
0 30 20 0
4
0 0
0 10
Note that the assignment of jobs should be made on the basis of the cells corresponding to the
zeroes around which rectangles have been drawn. Therefore, the optimum solution for this
problem is:
1 → C, 2 → A, 3 → D, 4 → B
Module 4: Transportation Problem and Assignment problem
Example 2: A company is producing a single product and selling it through five agencies
situated in different cities. All of a sudden, there is a demand for the product in five more cities
that do not have any agency of the company.
The company is faced with the problem of deciding on how to assign the existing agencies to
dispatch the product to the additional cities in such a way that the travelling distance is
minimised. The distances (in km) between the surplus and deficit cities are given in the
following distance matrix.
Deficit City I II III IV V
Surplus city
A 160 130 175 190 200
B 135 120 130 160 175
C 140 110 155 170 185
D 50 50 80 80 110
E 55 35 70 80 105
Solution: Subtracting the minimum element of each row from every element of that row, we
have
I II III IV V
A 30 0 45 60 70
B 15 0 10 40 55
C 30 0 45 60 75
D 0 0 30 30 60
E 20 0 35 45 70
Subtracting the minimum element of each column from every element of that column, we
have
Module 4: Transportation Problem and Assignment problem
I II III IV V
A 30 0 35 30 15
B 15 0 0 10 0
C 30 0 35 30 20
D 0 0 20 0 5
E 20 0 25 15 15
I II III IV V
A 30 0 35 30 15
B 15
0 0 10
0
C 30
0 35 30 20
D 0
0 20
0 5
E 20
0 25 15 15
Since the number of assignments is less than the number of rows (or columns), we proceed
from Step 5 onwards of the Hungarian method as follows:
i) we tick mark ( ) the rows in which the assignment has not been made. These are the 3rd
and 5th rows.
ii) we tick mark ( ) the columns which have zeroes in the marked rows. This is the 2nd
column.
iii) we tick mark ( ) the rows which have assignments in marked columns. This is the 1st
row.
iv) again we tick mark ( ) the column(s) which have zeroes in the newly marked row. This
is the 2nd column, which has already been marked. There is no other such column. So, we
have
Module 4: Transportation Problem and Assignment problem
I II III IV V
A 30 0 35 30 15
B 15
0 0 10
0
C 30
0 35 30 20
D 0 0 20
0 5
E 20
0 25 15 15
We draw straight lines through unmarked rows and marked columns as follows:
I II III IV V
A 30 0 35 30 15
B 15 0 0 10 0
C 30 0 35 30 20
D 0 0 20 0 5
E 20 0 25 15 15
i) We find the smallest element in the matrix not covered by any of the lines. It is 15 in this
case.
ii) We subtract the number ‘15’ from all the uncovered elements and add it to the elements at
the intersection of the two lines.
iii) Other elements covered by the lines remain unchanged. Thus, we have
Module 4: Transportation Problem and Assignment problem
I II III IV V
A 15 0 20 15 0
B 15 15 0 10 0
C 15 0 20 15 5
D 0 15 20 0 5
E 5 0 10 0 0
We repeat Steps 1 to 4 of the Hungarian method and obtain the following matrix:
I II III IV V
A 15
0 20 15 0
B 15 15 0 20
0
C 15 0 20 15 5
D 0 15 20 0 5
E 5
0 10 0 0
Since each row and each column of this matrix has one and only one assigned 0, we obtain the
optimum assignment schedule as follows:
A → V, B → III, C → II, D → I, E → IV