Transportation Assignment
Transportation Assignment
The assignment problem refers to the class of linear programming problems that involve
determining the most efficient assignment of
• people to projects
• salespeople to territories
• contracts to bidders
The objective is most often to minimize total costs or total time of performing the tasks at
hand.
One important characteristic of assignment problems is that only one job or worker is
assigned to one machine or project. An example is the problem of a taxi company with 4
taxis and 4 passengers. Which taxi should collect which passenger in order to minimize
costs?
Each assignment problem has associated with it a table, or matrix. Generally, the rows
contain the objects or people we wish to assign, and the columns comprise the tasks or
things we want them assigned to. The numbers in the table are the costs associated with
each particular assignment.
An assignment problem can be viewed as a transportation problem in which
As an illustration of the assignment problem, let us consider the case of a Fix-It-Shop, which
has just received three new rush projects to repair: (1) a radio, (2) a toaster oven, and (3) a
broken coffee table. Three repair persons, each with different talents and abilities, are
available to do the jobs. The owner of the shop estimates what it will cost in wages to assign
each of the workers to each of the three projects. The costs which are shown in Table 18
differ because the owner believes that each worker will differ in speed and skill on these
quite varied jobs.
Table 19 summarizes all six assignment options. The table also shows that the least-cost
solution would be to assign Cooper to project 1, Brown to project 2, and Adams to project 3,
at a total cost of $25.
The owner’s objective is to assign the three projects to the workers in a way that will result
in the lowest cost to the shop. Note that the assignment of people to projects must be on a
one-to-one basis; each project will be assigned exclusively to one worker only.
105
PROJECT
PERSON 1 2 3
Adams $11 $14 $6
Brown 8 10 11
Cooper 9 12 7
Table 18: Repair costs of the Fix-It-Shop assignment problem
PROJECTASSIGNMENT
1 2 3 LABOUR COSTS ($) TOTAL COSTS ($)
Adams Brown Cooper 11 + 10 +7 28
Adams Cooper Brown 11 + 12 +11 34
Brown Adams Cooper 8 + 14 + 7 29
Brown Cooper Adams 8 + 12 + 6 26
Cooper Adams Brown 9 + 14 + 11 34
Cooper Brown Adams 9 + 10 + 6 25
Table 19: Assignment alternatives and Costs of Fix-It-Shop assignment problem
Special algorithms exist to solve assignment problems. The most common is probably the
Hungarian solution method. The Hungarian method of assignment provides us with an
efficient means of finding the optimal solution without having to make a direct comparison
of every assignment option. It operates on a principle of matrix reduction, which means that
by subtracting and adding appropriate numbers in the cost table or matrix, we can reduce
the problem to a matrix of opportunity costs. Opportunity costs show the relative penalties
associated with assigning any person to a project as opposed to making the best or least-
cost assignment. We would like to make assignments such that the opportunity cost for each
assignment is zero.
The steps involved in the Hungarian method are outlined below.
(a) Subtracting the smallest number in each row of the original cost table or
matrix from every number in that row.
(b) Then subtracting the smallest number in each column of the table obtained
in part (a) from every number in that column.
2. Test the table resulting from step 1 to see whether an optimal assignment can be
made. The procedure is to draw the minimum number of vertical and horizontal
straight lines necessary to cover all zeros in the table. If the number of lines
equals either the number of rows or columns, an optimal assignment can be
106
made. If the number of lines is less than the number of rows or columns, we
proceed to step 3.
3. Revise the present opportunity cost table. This is done by subtracting the smallest
number not covered by a line from every other uncovered number. This same
smallest number is also added to any number(s) lying at the intersection of the
horizontal and vertical lines. We then return to step 2 and continue the cycle until
an optimal assignment is possible.
Let us now apply the three steps to the Fix-It-Shop assignment example.
The original cost table for the problem is given in Table 20
PROJECT PROJECT
PERSON 1 PERSON 1 2 3
Adams 11 Adams 5 8 0
Brown 8 Brown 0 2 3
Cooper 2 5 0
Cooper 9
Table 20: Initial Table Table 21: Row reduction (part a)
After the row reduction (Step 1 part a) we get the cost Table 21.
Taking the costs in Table 21 and subtracting the the smallest number in each column from
each number in that column results in the total opportunity costs given in Table 22. This
step is the column reduction of Step 1 part (b)
If we draw vertical and horizontal straight lines (Step 2) to cover all the zeros in Table 22
we get Table 23. Since the number of lines is less than the number of rows or columns an
optimal assignment cannot be made.
Since Table 23 doesn’t give an optimal solution we revise the table. This is accomplished by
subtracting the smallest number not covered by a line from all numbers not covered by
PROJECT
PERSON 1 2 3
Adams 5 6 0
Brown 0 0 3
Cooper 2 3 0
Table 22: Column Reduction (Step 1 part b)
PROJECT
PERSON 1 2 3
Adams 5 6 0
107
Brown 0 0 3
Cooper
2 3 0
Table 23: Testing for an optimal solution
a straight line. This same smallest number is then added to every number (including zeros)
lying in the intersection on any two lines. The smallest uncovered number in Table 23 is 2, so
this value is subtracted from each of the four uncovered numbers. A 2 is also added to the
number that is covered by the intersecting horizontal and vertical lines. The results of this
step are shown in Table 24
To test now for an optimal assignment, we return to Step 2 and find the minimum number of
lines necessary to cover all zeros in the revised opportunity cost table. Because it requires
three lines to cover the zeros (see Table 25), an optimal assignment can be made.
PROJECT PROJECT
PERSON 1 PERSON 1 2 3
Adams 3 Adams 3 4 0
Brown 0 Brown 0 0 5
Cooper 0 Cooper
0 1 0
Table 24: Revised opportunity cost Table 25: Optimality test on the retable
vised table
Finally, we make the allocation. Note that only one assignment will be made from each row
or column. We use this fact to proceed to making the final allocation as follows:
108
To interpret the table we recall that our objective was to minimize costs, there is only one
assignment that Adams can go to where the opportunity costs are $0. That is to assign
Adams Project 3. If Adams gets assigned to Project 3, then there is only one project left
where the opportunity cost is $0 for Cooper. Therefore Cooper gets assigned to Project 1.
This leaves Brown being assigned to Project 2, where the opportunity costs are $0.
The optimal allocation is to assign Adams to Project 3, Brown to Project 2, and Cooper to
Project 1. The total labour cost of this assignment are computed from the original cost table
(see Table 18). They are as follows:
ASSIGNMENT COST ($)
Adams to Project 3 6
Brown to Project 2 10
Cooper to Project 1 9
Total cost 25
Example 4.3 Suppose we have to allocate 4 tasks (1,2,3,4) between 4 people (W,X,Y,Z).
The costs are set out in the following table:
Task
Person 1 2 3 4
W 8 20 15 17
X 15 16 12 10
Y 22 19 16 30
Z 25 15 12 9
The entries in the table denote the costs of assigning a task to a particular person.
Solution: Step 1 of the Hungarian method involves the following parts:
(a) subtract the minimum value from each column (see Table 27)
(b) subtract the minimum value from each column (see Table 28)
Task Task
Person 1 2 3 4 Person 1 2 3 4
W 0 12 7 9 W 0 9 7 9
X 5 6 2 0 X 5 3 2 0
Y 6 3 0 14 Y 6 0 0 14
Z 16 6 3 0 Z 16 3 3 0
Table 27: Subtract the minimum Table 28: subtract the minimum value from each
row value from each column
The next step is to check whether optimal assignment can be made. This is done by finding the
minimum number of lines necessary to cross-out all the zero cells in the table. If this is equal to
n (the number of people/tasks) then the solution has been found. The minimum number of
109
lines necessary to cross through all the zeros (see Table 29)is 3 ¡ n = 4 so that an optimal
allocation has not been found.
(Note that there may be more than one way to draw the lines through the zero cells. It does
not matter which way you choose as long as there is no alternative way involving fewer
lines)
Ta
sk
Perso 1 2 3 4
n
W 0 9 7 9
X 5 3 2 0
Y
6 0 0 1 4
Z 1 6 3 3 0
Table 29: Checking if an optimal assignment can been made
(a) Finding the minimum uncovered cell. Table 29 shows that the minimum uncovered cell
has a value of 2
(b) Subtracting the value obtained in (a) (i.e subtract 2) from all the uncovered cells.
(c) Adding to all the cells at the intersection of the two lines.
Task Task
Perso 1 2 3 4 Perso 1 2 3 4
n n
W 0 7 5 9 W 0 7 5 9
X 5 1 0 0 X 5 1 0 0
110
Y 8 0 0 1 Y
8 0 0 1 6
6
Z 1 1 1 0 Z 1 6 1 1 0
6
Table 30: Revising the Table Table 31: Checking for optimality
Person 1 2 3 4
W 0 7 5 9
X 5 1 0 0
Y 8 0 0 16
Z 16 1 1 0
• Assign person W to task 1 and eliminate row W and column 1.
From the original cost table, we can determine the costs associated with the optimal
assignment:
Total Cost = 48
Some assignment problems are phrased in terms of maximizing the payoff, profit, or
effectiveness of an assignment instead of minimization costs. It is easy to obtain an
equivalent minimization problem by converting all numbers in the table to opportunity
costs; efficiencies to inefficiencies,etc. This is achieved through subtracting every number in
the original payoff table from the largest single number in the number. The transformed
entries represent opportunity costs; it turns out that minimizing the opportunity costs
produces the same assignment as the original maximization problem. Once the optimal
111
assignment for this transformed problem has been computed, the total payoff or profit is
found by adding the original payoffs of those cells that are in the original assignment.
Example. The British Navy wishes to assign four ships to patrol four sectors of the North
Sea. In some areas ships are to be on the outlook for illegal fishing boats, and in other
sectors to watch for enemy submarines, so the commander rates each ship in terms of its
profitable efficiency in each sector. These relative efficiencies are illustrated in Tables 32.
On the basis of the ratings shown, the commander wants to determine the patrol
assignments producing the greatest overall efficiencies.
SECTOR
SHIP A SHIP A B C
1 20 1 80 40 50
2 60 2 40 70 20
3 80 3 20 0 10
4 65 4 35 20 25
We start by converting the maximizing efficiency table into a minimization opportunity cost
table. This is done by subtracting each rating from 100, the largest rating in the whole table.
The resulting opportunity costs are given in Table 33.
Next, we follow steps 1 and 2 of the assignment algorithm. The smallest number is
subtracted from every number in that row to give Table 34; and then the smallest number in
each column is subtracted from every number in that column as shown in Table 35.
SECTOR SECTOR
SHIP A B SHIP A B C D
1 40 0 1 25 0 10 0
2 20 50 2 5 50 0 0
3 20 0 3 5 0 10 1
5
4 15 0 4 0 0 5 5
Table 34: Row opportunity costs for Table 35: Total opportunity costs for the British
Navy Problem the British Navy Problem
112
The minimum number of straight lines needed to cover all zeros in this total opportunity
cost table is four. Hence an optimal assignment can be made. The optimal assignment is ship
1 to sector D, ship 2 to sector C, ship 3 to sector B, and ship 4 to sector A.
The overall efficiency, computed from the original efficiency data Table 32, can now be
shown:
ASSIGNMENT EFFICIENCY
Ship 1 to Sector D 55
Ship 2 to Sector C 80
Ship 3 to Sector B 100
Ship 4 to Sector A 65
Total Efficiency 300
4.9 Summary
In this section we discussed the Hungarian method for solving both maximization and
minimization assignment problems.
1. Three accountants, Phindile, Rachel and Sibongile, are to be assigned to three projects,
1, 2 and 3. The assignment costs in units of E1000 are given in the table below.
Project
1 2 3
P 15 9 12
Accountant
R 7 5 10
S 13 4 6
2. Joy Taxi has four taxis, 1,2,3 and 4, and there are four
customers, P, Q, R and S requiring taxis. The distance between the
taxis and the customers are given in the table below, in Kilometres. The Taxi company wishes
to assign the taxis to customers so that the distance traveled is a minimum.
Customers
P Q R S
1 10 8 4 6
Taxis
2 6 4 12 8
3 14 10 8 2
4 4 14 10 8
3. Four precision components are to be shaped using four
machine tools, one tool being assigned to each
113
Component
1 2 3 4
A 21 20 39 36
Machine Tool
B 25 22 24 25
C 36 22 36 26
D 34 21 25 39
4. In a job shop operation, four jobs may be performed on any
of four machines. The hours required for each job on each
machine are presented in the following table. The plant
supervisor would like to assign jobs so that total time in minimized. Use the assignment
MACHINE
JOB W X Y Z
A12 10 14 16 13
A15 12 13 15 12
B2 9 12 12 11
B9 14 16 18 16
Answer: A12 to W, A15 to Z, B2 to Y, B9 to Z, 50 hours.
1. A head of department has four lecturers to assign to pure maths (1), mechanics (2),
statistics (3) and Quantitative techniques (4). All of the teachers have taught the
courses in the past and have been evaluated with a score from 0 to 100. The scores are
shown in the table below.
1 2 3 4
Peters 80 55 45 45
Radebe 58 35 70 50
Tsabedze 70 50 80 65
Williams 90 70 40 80
The head of department wishes to know the optimal assignment of teachers to
courses that will maximize the overall total score. Use the Hungarian algorithm to
solve this problem. [ P → 1 , R → 3, T → 4, W → 2 Max Score = 285]
2. A department store has leased a new store and wishes to decide how to place four
departments in four locations so as to maximize total profits. The table below gives
the profits, in thousands of emalangeni, when the departments are allocated to the
various locations. Find the assignment that maximizes total profits.
Location
114
1 2 3 4
Shoes 20 16 22 18
Department
Toys 25 28 15 21
Auto 27 20 23 26
Houseware 24 22 23 22
s
3. The head of the business department,
has decided to apply the Hungarian
method in assigning lecturers to courses next
semester. As a criterion for judging who should
teach each course, the head of department reviews the past two years’ teaching evaluations. All
the four lecturers have taught each of the courses at one time or another during the two year
period. The ratings are shown in the table below.
Find the best assignment of lecturers to courses to maximize the overall teaching
rating. Total Rating =
335
COURSE
115