Vous êtes sur la page 1sur 37

1

ASSIGNMENT MODEL
Term Paper

Quantitative Methods in Management (SML740)


Submitted By: - Vivek Kumar Jaiswal (2011ME20807)
Coordinator: - Dr. Surya Prakash Singh

Department of management studies


Indian Institute of Technology Delhi

Contents
1. Introduction ....................................................................................................... 3
2. Description of Assignment Problem ................................................................ 5
3. Formulation as a linear Programming Problem ............................................. 7
4. Solving Assignment Problem by Hungarian Method...................................... 10
5. Illustrations of Assignment Problem.............................................................. 17
6. Assignment model solution using LINGO ....................................................... 28
7. Appendix.......................................................................................................... 33
8. References ...................................................................................................... 37

1. Introduction
The assignment problem (AP) is a unique kind of linear programming (LP) problem
Where various tasks are assigned to the assignees that performs the tasks. For
Example, allotting work assignments to employees of a firm. i.e., a very simple
example to understand AP is assigning jobs to various people. However, it is not
always necessary that the assignees need to be people.. They might be machines,
plants, vehicles and even the time slots for assigning the tasks.
The best suited person for the intended job is an suitable example of the
assignment model. Since the workers have varying range of skills and abilities so
assignment of right job to right worker becomes important. Obviously a job which
matches the skill of a worker will be less costly to the case where there is no skilful
operator. Imagine, the problem of a printing press where there is only one operator to
operate a machine, now how will the allocation be done? The answer will be obvious
that the only operator would operate the machine. Now suppose that there are two
machines available and two operators having different rates of operating them are
available, then the question arises which operator will operator would operate which

machine so as to maximize the profit. Similarly, in case n machines available with n


persons having different rates to operation. Which operator should be given which
machine which machine to obtain maximum efficiency?
Such sort of problems is called as "assignment problems".
So, eventually the objective of the assignment model becomes minimising the overall
cost incurred in the assignment of jobs to the workers.
The general model assignment with n jobs and taking n workers is shown in the below
table.
jobs
workers
1
2
:
:
n

..

C11
C21
:
:
Cn1

C12
C22
:
:
Cn2

.
.
:
:
..

..
..
:
:

C1n
C2n

Cnn

The element Cij shows the cost of assigning worker i to job j (i, j =1, 2, ... , n). when
we assume that the number of jobs equals the number of workers then the generality
does not get lost, because we can always add or subtract a dummy worker or job to
satisfy the assumption.

The assignment problem is basically a special kind of the transportation problem in


which the workers are the sources, and the jobs shows the destinations. The supply
and the demand of each amount at each source and destination is exactly 1. The cost
of "assigning" worker i to job j is Cij. In reality, the assignment problem may be solved
directly as a general transportation problem. Nevertheless, because of the fact that all
supply and the demand being 1 has given rise to the development of simple algorithm
for solving which is known as the Hungarian method which will be discussed later.
However the given method has no relation to the transportation problem but the
algorithm is derived from the simplex method itself whose proof will be given later in
the sections just as the transportation problem is derived.

2. Description of Assignment Problem


The various assumptions which are taken during formulation of assignment model are
as follows:
1. The number of should be equal to the number of jobs available. (That
number is shown by n.)
2. Each worker should perform is exactly one task.
3. Each job has to be done by exactly one worker.
4. The cost is cij associated with worker i (i _ 1, 2, . . . , n) performing job j
( j _ 1, 2, . . . , n).
5. The goal is to finalise how all the assignment should be made in order to
minimise the total cost incurred.
So the problem that satisfies all the above stated assumptions can be solved very
efficiently by using the algorithms which are specifically designed for assignment
problems.
Fair restrictions are there in the first three assumptions. Many potentially important
applications fail to satisfy potential the given assumptions. Nevertheless, it is often
possible to reconstruct the problem to make it appropriate. For instance, for the

reconstructive purpose dummy tasks or dummy assignees are chosen. We will show
this method by the following example:

The XYZ Manufacturing has got three new machines of different types. But there are
only four available locations for the installation of the work. In which some of the
location are more desirable to a particular machines seeing its proximity because
some work centres will have heavy work in-flow and out-flow from the machines.
Therefore, objective is the assignment of the new machines to the locations so as to
minimize the overall cost of handling the materials.
The material handling cost in dollar per hour for every machine is given in Table for
the corresponding location. For machine 2 the Location 2 is not considered suitable,
so there will be no cost given for this case. To reconstruct this problem as an
assignment model, introduction of dummy machine for the extra location an
extremely large cost M is assigned to that position so as to neglect this assignment in
the optimal solution. The cost table for final assignment problem is given in Table
which contains all the necessary data for solving the problem.

Material handling cost data for XYZ Manufacturing

Cost table for the XYZ Manufacturing assignment problem

The optimal solution will be: assign m1 to l4, m2 to l3, and m3 to l1, for the
total optimal cost of $29 per hour. The dummy machine is given to location 2, so this
location would be available for future assignment of machine. In the later sections we

will discuss how the solution for this problem is obtained by formulating the
mathematical model for the assignment problem.

3. Formulation as a linear Programming


Problem
Suppose that there are n tasks and n workers which are available having different
skills. Since the cost of doing jth work by ith person is cij. Then the cost matrix is given
in the table.
The assignment problem of the following mathematical model employs the following
given decision variables:

For i = 1, 2. . . n and,
j = 1, 2. . . n.
Thus, each xij is a binary variable (which has value 0 or 1). Binary variables become
important in operations research and integer programming so as to give yes/no
decision. Here yes/no decision becomes relevant as to whether i should do the task j or
not.
Suppose Z denotes the total cost then the assignment problem model can be
represented as:

The given first set of functional constraints tells that each worker has to perform
exactly one task, whereas the second restriction tells that each job has to be performed
by exactly one worker. By deleting the last restriction in parenthesis that xij is binary,
and then the model becomes special kind of linear programming problem which can
be easily solved.
In fact, as explained in the previous section that the assignment problem is merely a
special kind of transportation problem in which the sources becomes the assignees and
the destinations become tasks and where :
Number of sources (m) = number of destinations (n),
Every supply si = 1,
Every demand dj = 1.
Now emphasize upon property of integer solutions in the transportation problem
model. Since si and dj are integers (=1) , this property shows that every basic feasible
solution (including the optimal solution ) gives the integer solution of the assignment
problem.
The problem of any variable becoming greater than 1in the assignment problem is
prevented by functional constraints and the less than 0 values are prevented by the
non-negativity constraints. Therefore, if we delete the binary restriction, then that
gives us the liberty to solve an assignment problem (AP) as linear programming
problem (LPP). Then the resulting binary feasible solution obtained (including the
optimal solution) will anyway automatically follow the binary restriction.

Fig.1 Assignment problem as Network

To explain this network let us go through an example.


A manufacturing company has three workers namely A, B and C. the company has
three job 1,2 and 3. The task completion time (in days) of each worker and the
alternative is given in the table below:

The manager likes to minimise the total completion time for all the three jobs. How
the allocation should be done?
The upper table is called the cost matrix as explained in the previous sections. The
data can be shown using the following network model.

Fig 2. Bipartite graph

This network is also known as bipartite graph in which the nodes are the tasks and the
assignees. The line joining them (arc) represents the possible assignment. The supply
and the demand at each source and destination are equal to 1. The cost incurred in
assigning the jobs to the workers is the time for job completion. Comparing this
network representation with the transportation network one can easily see the
similarity between the transportation and the assignment problem where supply,
demand=1, and amount shipped is either 0 or 1.

10

4. Solving Assignment Problem by Hungarian


Method
We have now acquainted ourselves as to how the assignment problems are
formulated. Now we will look at the essential assignment algorithm known as
Hungarian method to get the proper assignment.
In order to get the suitable assignment it is necessary for us to learn the Hungarian
method. This method is based upon two important theorems, as stated below.
Theorem 1: If a constant is added (or subtracted) to every element of any row (or
column) of the cost matrix [Cij] in an assignment problem then an assignment which
minimises the total cost for the new matrix will also minimize the total cost matrix.
Theorem 2: If all cij >= 0 and there exists a solution xij = Xij such that
Then this solution is an optimal solution, i.e., minimizes z.

cij xij = 0.

The computational method is written as under:


Step I
(A) Row reduction:
Subtract the minimum cost value of each row from all the available entries
in that particular row.
(B) Column reduction:
Once the row reduction is done apply it for the columns also i.e. subtract
the minimum entry of each column from that corresponding column.
Step II
Zero assignment:
(A) Start with the first row of the final matrix resulting in first step, check all
the rows one by one so as to find a row with one zero exactly until a Then an
is given to that zero and all the zeroes in the column of the made assignment
are crossed and this procedure is continued for all the rows.
(B) When all the rows are completely checked, then the similar method is
applied for the columns also as done above. We start with first column
inspection and continue it till column with exactly one zero is obtained. Then
the assignment in that position is made and all other zeroes in that column are
crossed.

11

Until we cross-out or assign all the zeros, the above operation is continued
successively.
Now two possibilities are raised:
(a) All zeroes are either crossed-out or assigned, i.e., we get optimal
assignment. Or
(b) After crossing/assigning each row or column at least two zeroes remain.
We adopt trial and error method to exclude some of the zeroes. Here the
second step is completed resulting in two sorts of situations.
i)
ii)

Total number of assigned zeroes = n


(Optimal assignment)
Total number of assigned zeroes < n
(Apply step III and further)

Step III
Draw minimum number of horizontal and vertical line so as to cover all the
zeros.
Step IV
Smallest element from the uncovered entries is chosen.
(i) This smallest entry is subtracted from all the uncovered entries.
(ii) This entry is now added to all those entries which are there at the
intersection of any two lines.
Step V
Thus the number of zeroes is now increased. Now the matrix is modified using
step ii and the assignment of task is obtained.

All the above steps would become clearer after seeing the following example:
John has three children Shane, Stuart and Maria who want to earn some money for
their personal expenses during a picnic in summer. John has decided to give three
tasks namely: garage door painting, family car washing and lawn mowing. So as to
avoid sibling competition john asks them for secret bid submission according to their

12

choices for which each task is fair pay according to them. All the three children will
abide the fathers decision as to who will do which task.
Table summarizes the received bids. How Mr John should do the assignment based on
this information?
The assignment problem would be solved by using Hungarian method.
Step1. First the row minimum is identified and it is subtracted from all the entries of
that row in the original cost.
Shane
Stuart
Maria

mowing
15
9
10

painting
10
15
12

washing
9
10
8

Step 2. Then column minimum is identified and subtracted from all the entries of that
column in the matrix obtained from step 1.
Step 3. Obtain the optimal solution by the feasible assignment with zero entries of the
matrix resulted in step 2.
Suppose Pi and qj are the minimum costs that are associated with the row i and column
j as explained in steps 1and 2. The row minimums are calculated using step 1 from the
initial cost matrix as shown in Table below.

Shane
Stuart
Maria

Mowing

Painting

Washing

15
9
10

10
15
12

9
10
8

Row minimum
p1=9
p2=9
p3=8

Next, from each row, its row minimum is subtracted to get the reduced matrix in the
below table
Shane
Stuart
Maria
Column minimum

Mowing
6
0
2
q1=0

Painting
1
6
4
q2=1

Washing
0
1
0
q3=0

13

The above table shows the column minimum by applying step 2. The reduced matrix
is obtained by subtracting the column minimum values from corresponding columns.
The reduced matrix is shown in the table below:
Mowing
6
0
2

Shane
Stuart
Maria

Painting
0
5
3

Washing
0
1
0

The cells which are having zero entries give the optimum solution. This means Shane
gets to painting of garage door, Stuart gets to lawn mowing, and Maria has to wash the
family cars. The total cost incurred to Mr John is 9 + 10 + 8 = 27. This amount should
always be equal to (PI + P2 + P3) + (ql + q2 + q3) = (9 + 9 + 8)+(0 + 1 + 0) = 27.
(Next section explains the justification of the result).

The Hungarian method steps which are given here apply well in the previous example
because a feasible assignment is produced by the zero entries of the final matrix.
(in a way that each task is assigned by different child). But there are some cases where
zeroes produced by step 1 and step 2 might not provide the direct feasible solution,
and more steps are required to find out the feasible and the optimal solution.
The following instance explains this situation.
Suppose that the problem discussed in the previous example is changed and extended
to four tasks and four children. The below given Table provides the cost entries of the
problem.

Tasks
Child
1
2
3
4

1
9
4
8

4
7
5
7

6
10
11
8

3
9
7
5

In the above table if steps1 and 2(using Pl = 1, P2 = 7,P3 = 4, P4 = 5, ql = 0, q2 = 0,


q3 = 3, and q4 = 0) are applied then they give rise to the reduced matrix in below
table.

14

Tasks
Child
1
2
3
4

0
2
0
3

3
0
1
2

2
0
4
0

2
2
3
0

(We can verify it also)


The presence of zero entries does not allow assignment of of unique tasks to all
children.
For instance, if we make the assignment of child 1 to task 1, then column 1 would be
deleted, and child 3 would not have a zero element in any of the three remaining
columns. This problem can be overcome by further adding following steps to the
method outlined in previous example
Step 2a. If no any feasible assignment (with all zero elements) can be obtained from
steps 1 and 2,
(i)

We draw the minimum number of vertical and horizontal lines so as to


cover all the zero entries in the last reduced matrix.

(ii) Then the smallest entry which is uncovered is selected, subtract this entry
from every remaining uncovered entry, then this smallest entry is added to
every entry which is located at the intersection of two lines.
(iii) Repeat the above step (2A) in case if the feasible assignment cannot be
found using the resulting zero elements, otherwise, apply step 3 to obtain the
optimal assignment.

15

By applying step 2a to the final matrix gives the shaded cells in above table. The only
smallest entry which is unshaded equals 1. This entry is then added to the intersection
of the shaded lines and subtracted from the unshaded entries resulting into matrix
given in the below table.
Tasks
Child
1
2
3
4

0
3
0
4

2
0
0
2

1
0
3
0

1
2
2
0

The optimum solution (given by the zero entries) is given as following:


Assigning child 1 to task 1
Child 2 to task 3,
Child 3 to task 2, and
Child 4 to task 4.
The corresponding optimal cost will be 1 + 10 + 5 + 5 = 21. The optimal cost can also
be obtained from summation the p/s, the q/s, and the smallest uncovered entry were that is, (1 + 7 + 4 + 5) +(0 + 0 + 3 + 0) + (1) = 21.

16

WHAT WE HAVE LEARNT

17

5. Illustrations of Assignment Problem EXCEL


solver

Solution.
(a)

18

(b) & (c)

ASSIGNEE

(d)

A
B
C
D
DEMAND

1
8
6
7
6
1

UNIT COST
2
6
5
8
7
1

3
5
3
4
5
1

4 SUPPLY
7
1
4
1
6
1
6
1
1

19

Solution.
(a) Since ships are assignees and ports are assignments, this is assignment problem.

20

(b) The problem is solved by excel solver

21

Solution.
(a) & (b)

22

23

Solution.
(a)
If we add a dummy stroke in which everyone can swim in 0 sec, the problem becomes
assignment model 5 swimmers and 5 strokes. See the cost table below:
COST TABLE
SWIMMERS

STROKE

CARL
CHRIS
DAVID
TONY
KEN
BACK
37.7
32.9
33.8
37
35.4
BREAST
43.4
33.1
42.2
34.7
41.8
FLY
33.3
28.5
38.9
30.4
33.6
FREE
29.2
26.4
29.6
28.5
31.1
DUMMY
0
0
0
0
0

(b)

The optimal solution would be:


David swims the backstroke
Tony swims the breaststroke
Chris swims the butterfly
Carl swims freestyle
Total time= 126.2 seconds

24

25

Solution.
(a) The assignments are the loads needed at sites 1,2 and 3and the three trucks from
north and 2 from south are the assignees.
(b)

26

Solution.
(a) & (b) Let assignees 1 and 2 represent plant A, assignees 3 and 4 represent plant B,
tasks be the distribution centres.

27

28

6. Assignment model solution using LINGO


Solution of illustration 1(d).

29

Solution of illustration 2(b).

30

31

Solution of illustration 6(b).

32

We can see the assignment in the solution report as:

33

7. Appendix
How to use EXCEL SOLVER
1. Model formulation
The model will look like as given the excel snapshot given below:

2. Insert the following function.

3. Solve the Model


To get the optimal solution, following steps are executed.
1. click Solver on the Data tab.

34

Enter the solver parameters (read on). The result should be consistent with the
picture below.

You have the choice of typing the range names or clicking on the cells in the spread
sheet.
2. Enter TotalCost for the Objective.
3. Click Min.
4. Enter Assignment for the Changing Variable Cells.
5. Click Add to enter the following constraint.

35

Note: binary variables are either 0 or 1.


6. Click Add to enter the following constraint.

7. Click Add to enter the following constraint.

8. Check 'Make Unconstrained Variables Nonnegative' and select 'Simplex LP'.

9. Finally, click Solve.

36

The optimal solution:

Conclusion: it is optimal to assign Person 1 to task 2, Person 2 to Task 3 and


Person 3 to Task 1. This solution gives the minimum cost of 129. All
constraints are satisfied.

For using LINGO go on


http://www.lindo.com/index.php?option=com_content&view=article&id=2&Itemid=10

37

8. References
http://www.lindo.com/index.php?option=com_content&view=artic
le&id=2&Itemid=10
Operations_Research_An_Introduction_8th_Ed_Hamdy_A_Taha
Introduction to Operations Research - Hillier & Liebermann
http://www.lindo.com/index.php?option=com_content&view=artic
le&id=2&Itemid=10
http://www.exceleasy.com/examples/assignmentproblem.html

Vous aimerez peut-être aussi