You are on page 1of 16

Assignment topic:

ASSIGNMENT PROBLEM

Course code: MATH-4115


Course title: Operation Research-I

Submitted to:
Dr. Nahid Akhtar

Submitted by:

Group members
0507-BH-MATH-19 Iqra Bibi
0508-BH-MATH-19 Anika Tariq
0509-BH-MATH-19 Sana Tahir
0520-BH-MATH-19 Amina Bilal
0523-BH-MATH-19 Seerat Fatima
0533-BH-MATH-19 Manhaba Noor

1
Table of Contents

INTRODUCTION TO ASSIGNMENT PROBLEM ......................................... 3


MATRIX FORM OF ASSIGNENMT PROBLEM ........................................... 3
MATHEMATICAL FORMULATION OF AN ASSIGNMENT PROBLEM .......... 3
HUNGARIAN METHOD .......................................................................... 4
Example no 1. ..................................................................................... 5
Example no 2. .................................................................................... 7
MAXIMIZATION CASE IN ASSIGNMENT PROBLEM ................................ 11
Example no 3. ................................................................................... 11
UNBALANCED ASSIGNMENT PROBLEM ................................................ 14
Example no 4: ................................................................................... 14

2
INTRODUCTION TO ASSIGNMENT PROBLEM

The assignment problem is a particular case of transportation problem for which more efficient
solution has been devised by KUHN (1956) and FLOOD (1956). The justification of the step
leading to the solution is based on the theorem proved by Hungarian Mathematicians KONEIG
(1950) and EGERY ARY (1953), hence the method is named Hungarian Method.

• The objective is to assign a number of resources to an equal number of activities.


• So as to minimize total cost or maximize total profit of allocation.
• The problem of assignment arises because available resources such as men, machines etc.
have varying degrees of efficiency for performing different activities, therefore, cost,
profit or loss of performing the different activities are different.
• Suppose that we have n jobs to be performed on m machines (one job to one machine).
• Our objective is to assign the jobs to the machines at the minimum cost (or maximum
profit).
• Under the assumption that each machine can perform each job but with varying degree
of efficiencies.

MATRIX FORM OF ASSIGNENMT PROBLEM

The assignment problem can be stated that in the form of 𝑚 × 𝑛 matrix 𝑐𝑖𝑗 called a Cost Matrix
(or) Effectiveness Matrix where 𝑐𝑖𝑗 is the cost of assigning 𝑖 𝑡ℎ machine to 𝑗 𝑡ℎ job.

𝑐11 𝑐12 ⋯ 𝑐1𝑛


𝑐21 𝑐22 ⋯ 𝑐2𝑛
[ ⋮ ⋮ ⋱ ⋮ ]
𝑐𝑚1 𝑐𝑚2 ⋯ 𝑐𝑚𝑛

MATHEMATICAL FORMULATION OF AN ASSIGNMENT


PROBLEM
Consider an assignment problem of assigning n jobs to n machines (one job to one machine).
Let 𝑐𝑖𝑗 be the unit cost of assigning 𝑖 𝑡ℎ machine to the 𝑗 𝑡ℎ job and, 𝑖 𝑡ℎ machine to 𝑗 𝑡ℎ job.
Let
• 𝑥𝑖𝑗 = 1, if 𝑗 𝑡ℎ job is assigned to 𝑖 𝑡ℎ machine.
• 𝑥𝑖𝑗 = 0, if 𝑗 𝑡ℎ job is not assigned to 𝑖 𝑡ℎ machine.

3
𝑛 𝑛

𝑀𝑖𝑛𝑖𝑚𝑖𝑧𝑒 𝑍 = ∑ ∑ 𝑐𝑖𝑗 𝑥𝑖𝑗


𝑖=1 𝑗=1
𝑠𝑢𝑏𝑗𝑒𝑐𝑡 𝑡𝑜 𝑡ℎ𝑒 𝑐𝑜𝑛𝑠𝑡𝑟𝑎𝑖𝑛𝑡𝑠
𝑛

∑ 𝑥𝑖𝑗 = 1, 𝑗 = 1,2,3, … … … … , 𝑛
𝑖=1
𝑛

∑ 𝑥𝑖𝑗 = 1, 𝑖 = 1,2,3, … … … … , 𝑛
𝑗=1
𝑥𝑖𝑗 = 0 𝑜𝑟 1

HUNGARIAN METHOD

First check whether the number of rows is equal to number of columns, if it is so, the assignment
problem is said to be balanced. Then proceed to step 1. If it is not balanced, then it should be
balanced before applying the algorithm.

o Step 1: Subtract the smallest cost element of each row from all the elements in the row
of the given cost matrix. See that each row contains atleast one zero.
o Step 2: Subtract the smallest cost element of each column from all the elements in the
column of the resulting cost matrix obtained by step 1 and make sure each column
contains atleast one zero.

o Step 3: (Assigning the zeros)

a) Examine the rows successively until a row with exactly one unmarked zero is
found. Make an assignment to this single unmarked zero by encircling it. Cross all
other zeros in the column of this encircled zero, as these will not be considered
for any future assignment. Continue in this way until all the rows have been
examined.
b) Examine the columns successively until a column with exactly one unmarked zero
is found. Make an assignment to this single unmarked zero by encircling it and
cross any other zero in its row. Continue until all the columns have been examined.

o Step 4: (Apply Optimal Test)

a) If each row and each column contain exactly one encircled zero, then the current
assignment is optimal.
b) If atleast one row or column is without an assignment (i.e., if there is atleast one
row or column is without one encircled zero), then the current assignment is not
optimal. Go to step 5. Subtract the smallest cost element of each column from all

4
the elements in the column of the resulting cost matrix obtained by step 1 and
make sure each column contains atleast one zero.

o Step 5: Cover all the zeros by drawing a minimum number of straight lines as follows:

a) Mark the rows that do not have assignment.


b) Mark the columns (not already marked) that have zeros in marked rows.
c) Mark the rows (not already marked) that have assignments in marked columns.
d) Repeat (b) and (c) until no more marking is required.
e) Draw lines through all unmarked rows and marked columns. If the number of
these lines is equal to the order of the matrix, then it is an optimum solution
otherwise not.

o Step 6: Determine the smallest cost element not covered by the straight lines. Subtract
this smallest cost element from all the uncovered elements and add this to all those
elements which are lying in the intersection of these straight lines and do not change the
remaining elements which lie on the straight lines.

o Step 7: Repeat steps (1) to (6), until an optimum assignment is obtained.

Example no 1.

Minimize the following assignment problem. Cell value represent cost of assigning job A, B, C,
and, D to the machines I, II, III, IV.

I II III IV

A 5 9 3 6

B 8 7 8 2

C 6 10 12 7

D 3 10 8 6

Solution
I: Identify the minimum value in each row and subtract it from every value in that row.

5
2 6 0 3

6 5 6 0

0 4 6 1

0 7 5 3

II: Identify the minimum value in each column and subtract it from every value in that column.

2 2 0 3

6 1 6 0

0 0 6 1

0 3 5 3

III: Draw minimum number of lines to cover all the zeros.

2 2 0 3

6 1 6 0

0 0 6 1

0 3 5 3

number of lines drawn = order of matrix i.e., 4 = 4

IV: If any row or any column has only one zero then make an assignment there and move to
next column or row.

2 2 0 3
9
6 1 6 0
9
0 0 6 1
9
3 5 3
0

• Since each row and each column contain exactly one encircled zero, then the
current assignment is optimal.
6
• The total cost of assignment = A to III + B to IV + C to II+ D to I
• Substituting valves from original table:
The total cost of assignment = 3+2+10+3 = 18

Example no 2.
Find minimize solution of the following assignment problem by Hungarian method.

11 7 10 17 10

13 21 7 11 13

13 13 15 13 14

18 10 13 16 14
12 8 16 19 10

Solution
I: Identify the minimum value in each row and subtract it from every value in that row.

4 0 3 10 3

6 14 0 4 6

0 0 2 0 1

8 0 3 6 4

4 0 8 11 2

II: Identify the minimum value in each column and subtract it from every value in that column.
4 0 3 10 2

6 14 0 4 5

0 0 2 0 0

8 0 3 6 3

4 0 8 11 1

III: Draw minimum number of lines to covers all the zeros

7
4 0 3 10 2

6 14 0 4 5

0 0 2 0 0

8 0 3 6 3

4 0 8 11 1

number of lines drawn ≠ order of matrix i.e., 3 ≠ 5


IV: find out the smallest valve which does not have any line passing through and called it x=1
1. Add x if two line is passing through.
2. Subtract x if no line passing through.
3. No change if the value of has only one line.

3 0 2 9 1
6 15 0 4 4
0 1 2 0 0
7 0 2 5 2
3 0 7 10 0

V: Now again draw minimum number of lines to covers all the zeros.

3 0 2 9 1

6 15 0 4 4

0 1 2 0 0

7 0 2 5 2

3 0 7 10 0

number of lines drawn ≠ order of matrix i.e., 4 ≠ 5

VI: find out the smallest valve which does not have any line passing through and called it x=1
1. Add x if two line is passing through.
2. Subtract x if no line passing through.
3. No change if the value of has only one line.

8
2 0 1 8 0

6 16 0 4 5

0 2 2 0 0

6 0 1 4 1

3 1 7 10 0

VII: Now again draw minimum number of lines to covers all the zeros.

2 0 1 8 0

6 16 0 4 5

0 2 2 0 0

6 0 1 4 1

3 1 7 10 0

number of lines drawn ≠ order of matrix i.e., 4 ≠ 5

VIII: find out the smallest valve which does not have any line passing through and called it x=1
1. Add x if two line is passing through.
2. Subtract x if no line passing through.
3. No change if the value of has only one line.

1 0 0 7 0

6 17 0 4 6

0 3 2 0 1

5 0 0 3 1

2 1 6 9 0

IX: Now again draw minimum number of lines to covers all the zeros.

9
1 0 0 7 0

6 17 0 4 6

0 3 2 0 1

5 0 0 3 1

2 1 6 9 0

number of lines drawn ≠ order of matrix i.e., 4 ≠ 5


X: find out the smallest valve which does not have any line passing through and called it x=1
1. Add x if two line is passing through.
2. Subtract x if no line passing through.
3. No change if the value of has only one line.

0 0 0 6 0

5 17 0 3 6

0 4 3 0 2

4 0 0 2 1

1 1 6 8 0

XI: Draw minimum number of lines to cover all the zeros.

0 0 0 6 0

5 17 0 3 6

0 4 3 0 2

4 0 0 2 1

1 1 6 8 0

number of lines drawn =order of matrix i.e., 5 = 5

XII: If any row or any column has only one zero then make an assignment there and move to
next column or row.

10
0
0 0 6 0

5 17 3 6
0
0 4 3 2
0
4 0 2 1
0
1 1 6 8
0

• Since each row and each column contain exactly one encircled zero, then the current
assignment is optimal.
• Substituting valves from original table:
The total cost of assignment = 11+7+13+10+10 = 51

MAXIMIZATION CASE IN ASSIGNMENT PROBLEM

Some assignment problems entail maximizing profit, effectiveness, or layoff of am assignment


of person to task or of jobs to machines

• The conversion is accomplished by subtracting all the elements of the given


effectiveness matrix from the highest element.
• It turns out that minimizing opportunity loss produces the same assignment solution the
same assignment solution as the original maximization problem.

Example no 3.
Find maximization solution of the following Assignment problem

30 37 40 28 40

40 24 27 21 36

40 32 33 30 35

25 38 40 36 36

29 62 41 34 39

Solution

11
I: Here the highest value is 62. So, we subtract each value from it.

32 25 22 34 22

22 38 35 41 26

22 30 29 32 27

37 24 22 26 26

33 0 21 28 23

II: Identify the minimum value in each row and subtract it from every value in that row.
10 3 0 12 0

0 16 13 19 4

0 8 7 10 5

15 2 0 4 4

33 0 21 28 23

III: Identify the minimum value in each column and subtract it from every value in that column.

10 3 0 8 0

0 16 13 15 4

0 8 7 6 5

15 2 0 0 4

33 0 21 24 23

IV: Draw minimum number of lines to covers all the zeros.

12
10 3 0 8 0

0 16 13 15 4

0 8 7 6 5

15 2 0 0 4

33 0 21 24 23

number of lines drawn ≠ order of matrix i.e., 4 ≠ 5


VI: find out the smallest valve which does not have any line passing through and called it x=4
1. Add x if two line is passing through.
2. Subtract x if no line passing through.
3. No change if the value of has only one line.
14 3 0 8 0

0 12 9 11 0

0 4 3 2 1

19 2 0 0 4

37 0 21 24 23

VII: Now again draw minimum number of lines to covers all the zeros

14 3 0 8 0

0 12 9 11 0

0 4 3 2 1

19 2 0 0 4

37 0 21 24 23

number of lines drawn =order of matrix i.e., 5 = 5


XII: If any row or any column has only one zero then make an assignment there and move to
next column or row.

13
14 3 0 8 0

0 12 9 11 0

4 3 2 1
0
19 2 0 4
0
37 21 24 23
0

• Since each row and each column contain exactly one encircled zero, then the current
assignment is optimal.
• Substituting valves from original table:
The total cost of assignment = 40+36+40+36+62 = 214

UNBALANCED ASSIGNMENT PROBLEM

• It is an assignment problem where the number of person or machines is not equal to


number of jobs.
• If the number of person or machines is less than the number of jobs then we introduce
one or more dummy person or machines (rows) with zero valves to make the assignment
problem balanced.
• If the number of jobs is less than the number of person or machines then we introduce
one or more dummy jobs (columns) with zero valves to make the assignment problem
balanced.

Example no 4:
Find minimize solution of the following assignment problem by Hungarian method.

5 9 3 6

8 7 8 2

6 10 12 7

14
Solution
5 9 3 6

8 7 8 2

6 10 12 7

3 Jobs ≠ 4 person or machines


I: First add a dummy row in it to balanced number of jobs is equal to number of person or
machines.

5 9 3 6

8 7 8 2

6 10 12 7

0 0 0 0

II: Identify the minimum value in each row and subtract it from every value in that row.

2 6 0 3

6 5 6 0

0 4 6 1

0 0 0 0

Column-wise reduction is not necessary since all columns contain zero.

III: Draw minimum number of lines to covers all the zeros.


15
2 6 0 3

6 5 6 0

0 4 6 1

0 0 0 0

IV: If any row or any column has only one zero then make an assignment there and move to
next column or row.

2 6 3
0

6 5 6
0

0 4 6 1

0 0 0
0

• Since each row and each column contain exactly one encircled zero, then the current
assignment is optimal.
• Substituting valves from original table:
The total cost of assignment = 3+2+6+0 = 11

16

You might also like