0% found this document useful (0 votes)
57 views

Unit 3 - Part 1 Assignment Problem

Uploaded by

Firoza
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
57 views

Unit 3 - Part 1 Assignment Problem

Uploaded by

Firoza
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 54

Assignment problem

Introduction to Assignment Problem

• The objective of assignment problems, is to assign a number of


jobs to the equal number of persons to minimize cost or to
maximize profit.
• There are ‘n’ jobs to be performed and ‘n’ persons are available
for doing these jobs.
• Assume each person can do each job at a time with a varying
degree of efficiency. Let cij be the cost of ith person assigned to

jth job. Then the problem is to find an assignment so that the


total cost for performing all jobs is minimum. Such problems are
known as assignment problems.
Steps of Hungarian Method

1. Number of rows = number of columns then the problem

is balanced . If problem is unbalanced Make problem

balanced by adding dummy rows or columns with cost 0.

2. Row Reduction: For every row select minimum element in

row. subtract it from all element from that row.

3. Column Reduction: Perform step 2 for every column


4. Draw minimum number of horizontal or vertical lines to cover all zero. Let
it be N . (Perform assignment row wise or column wise when exactly
single zero found). Now check
4.1 N=n, i.e. No of lines drawn = number of rows or column of given
matrix then optimal assignment can be made.
4.2 If N < n then further procedure required.
Find smallest element in matrix not covered by N lines . Subtract
this element from all uncovered element and add it into
element which covered twice . (The elements which are covered
once will be copies as it is.)
5. Repeat step 4 until minimum number of lines becomes equal to number
of rows N= n
6. Calculate assignment cost
Example:1
A B C D
P 31 25 33 29
Q 25 24 23 21
R 19 21 23 24
S 38 36 34 40

solution:
• Problem is balanced as number of row = number of columns i.e. 4=4
Solution

• For rows : row reduction

A B C D min
P 31 25 33 29 25
Q 25 24 23 21 21
R 19 21 23 24 19
S 38 36 34 40 34

A B C D
P 6 0 8 4
Q 4 3 2 0
R 0 2 4 5
S 4 2 0 6
Solution
• For columns: column reduction

A B C D
P 6 0 8 4
Q 4 3 2 0
R 0 2 4 5
S 4 2 0 6
min 0 0 0 0

A B C D
P 6 0 8 4
Q 4 3 2 0
R 0 2 4 5
S 4 2 0 6
Solution

A B C D
P 6 00 8 4
Q 4 3 2 0
R 0
0 2 4 5
S 4 2 0 6

• number of lines = 4 = no. of rows and columns


Solution

A B C D

P 6 0 8 4
0

Q 4 3 2 0
0

R 00 2 4 5

S 4 2 00 6

assignment is,

P🡪 B 25
Q🡪 D 21
R🡪 A 19
S🡪 C 34
-------------------------
assignment cost : 99
Example:2
⦿ A automobile dealer whishes to put four repairmen to four jobs. The

repairmen have somewhat different kinds of skill & they exhibit

different level of efficiency from one job to another. The dealer has

estimated the number of man hour that would be required for each

job man combination . This is given in matrix form in adjacent table

find optimum assignment that will result in minimum man hours

needed A B C D
1 5 3 2 8
2 7 9 2 6
3 6 4 5 7
4 5 7 7 8
Solution

• Problem is balanced
as no of rows = no of columns
• For rows : row reduction
A B C D min
1 5 3 2 8 2
2 7 9 2 6 2
3 6 4 5 7 4
4 5 7 7 8 5

A B C D
1 3 1 0 6
2 5 7 0 4
3 2 0 1 3
4 0 2 2 3
• For column: column 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
min 0 0 0 3

A B C D
1 3 1 0 3
2 5 7 0 1
3 2 0 1 0
4 0 2 2 0
• Draw min no of line to cover max zero

No of lines = 3 ≠ no of rows or column


Minimum uncovered element is 1
A B C D
1 3 1 0 3 Add 1 in to element which is covered twice
And subtract 1 from uncovered element
2 5 7 0 1
3 2 0 1 0
4 0 2 2 0

A B C D
1 2 0 0 2
2 4 6 0 0
3 2 0 2 0
4 0 2 3 0
• Again draw number of lines

A B C D
1 2 0 0 2
2 4 6 0 0
3 2 0 2 0
4 0 2 3 0

• Number of lines = number of rows or columns


• Perform assignment row wise or column wise when exactly single zero
found
1 solution
st

A B C D
assignment is,
1 2 00 X0 2
1🡪 B 3
2 4 6 00
X0 2🡪 C 2
3🡪 D 7
4🡪 A 5
3 2
X0 2 00
-------------------------
17
4 0 2 3
X
0
MULTIPLE SOLUTION: second solution

A B C D
assignment is,
1 2 X
0 00 2
1🡪 C 2
2 4 6
X
0 00 2🡪 D 6
3🡪 B 4
4🡪 A 5
3 2 00 2
X0 -------------------------
17
4 0 2 3
X
0
Practice Question

Solve the assignment problem using Hungarian method. Assign the jobs
to different machines so as to minimize the total cost.

A B C D E
1 13 8 16 18 19
2 9 15 24 9 12
3 12 9 4 4 4 Ans: Assignment
is,
4 6 12 10 8 13
5 15 17 18 12 20
1🡪 B 8
2🡪 E 12
3🡪 C 4
4🡪 A 6
5🡪 D 12
-------------------------
42
Example:3

⦿ A CARS HIRE COMPANY HAS ONE CAR AT EACH FIVE DEPOTS 1,2,3,4,5.

A CUSTOMER REQUIRE A CAR IN EACH TOWN NAMELY A,B,C,D & E .

DISTANCE BETWEEN DEPOTS & TOWN ARE GIVEN IN FOLLOWING

DISTANCE MATRIX .

HOW SHOULD CARS BE ASSIGN TO CUSTOMER SO AS TO MINIMIZE

THE DISTANCE TRAVELED ?


A B C D E
1 160 130 175 190 200
2 135 120 130 160 175
3 140 110 155 170 185
4 50 50 80 80 110
5 55 35 70 80 105
Solution:
A B C D E
1 160 130 175 190 200
2 135 120 130 160 175 No of rows = no of columns
So the problem is balanced
3 140 110 155 170 185
4 50 50 80 80 110
5 55 35 70 80 105
Solution:
Row reduction :

A B C D E Min A B C D E
1 160 130 175 190 200 130 1 30 0 45 60 70
2 135 120 130 160 175 120 2 15 0 10 40 55
3 140 110 155 170 185 110 3 30 0 45 60 75
4 50 50 80 80 110 50 4 0 0 30 30 60
5 55 35 70 80 105 35 5 20 0 35 45 70
Solution:
column reduction :

A B C D E
A B C D E
1 30 0 45 60 70
1 30 0 35 30 15
2 15 0 10 40 55
2 15 0 0 10 0
3 30 0 45 60 75
3 30 0 35 30 20
4 0 0 30 30 60
4 0 0 20 0 5
5 20 0 35 45 70
5 20 0 25 15 15
min 0 0 10 30 55
Solution:
A B C D E

1 30 0 35 30 15

2 15 0 0 10 0

3 30 0 35 30 20

4 0 0 20 0 5

5 20 0 25 15 15

No of lines=3 ≠ no of rows or no of columns


Minimum uncovered element is 15 . Add 15 in to element which covered twice and
subtract 15 from all uncovered element
A B C D E

1 15 0 20 15 0

2 15 15 0 10 0

3 15 0 20 15 5

4 0 15 20 0 5

5 5 0 10 0 0

No of lines=5= no of rows or no of columns


A B C D E

1 15 0 20 15 0

2 15 15 0 10 0

3 15 0 20 15 5

4 0 15 20 0 5

5 5 0 10 0 0

No of lines=5= no of rows or no of columns


ALLOCATION
A B C D E

Assignment cost=
1 1🡪E 200
15 0 20 15 0
2🡪C 130
2 3🡪B 110
15 15 0 10 0 4🡪A 50
5🡪D 80
3 -------------------
15 00 20 15 5
570
4
0 15 20 0 5

5
5 0 10 0 0
Maximization problem
Example:4
• A captain of cricket team has to allot five middle batting position to five

batsman. The average run scored by each batsman at these position

are as follows: find assignment of batman to position which will give

the maximum number of runs.

I II III IV V
P 40 40 35 25 50
Q 42 30 16 25 27
R 50 48 40 60 50
S 20 19 20 18 25
T 58 60 59 55 53
Solution:

• SELECT MAXIMUM VALUE FROM GIVEN MATRIX .

• SUBTRACT ALL VALUES FROM THIS VALUE SO THAT PROBLEM IS

CONVERTED TO MINIMIZATION

• SOLVE PROBLEM BY NORMAL METHOD

• MAX=60
Solution
• Matrix after subtracting every cell from maximum cost i.e. 60
so that problem is converted into minimization problem

I II III IV V
P 20 20 25 35 10
Q 18 30 44 35 33
R 10 12 20 0 10
S 40 41 40 42 35
T 2 0 1 5 7
Solution
• Row reduction

I II III IV V min I II III IV V


P 20 20 25 35 10 10 P 10 10 15 25 0
Q 18 30 44 35 33 18 Q 0 12 26 17 15
R 10 12 20 0 10 0 R 10 12 20 0 10
S 40 41 40 42 35 35 S 5 6 5 7 0
T 2 0 1 5 7 0 T 2 0 1 5 7
Solution
• Column reduction

I II III IV V I II III IV V
P 10 10 15 25 0 P 10 10 14 25 0
Q 0 12 26 17 15 Q 0 12 25 17 15
R 10 12 20 0 10 R 10 12 19 0 10
S 5 6 5 7 0 S 5 6 4 7 0
T 2 0 1 5 7 T 2 0 0 5 7
min 0 0 1 0 0
• Draw minimum number of lines to cover maximum
zeros

I II III IV V I II III IV V
P 10 10 14 25 0 P 10 6 10 25 0
Q 0 12 25 17 15 Q 0 8 21 17 15

R 10 12 19 0 10 R 10 8 15 0 10

S 5 6 4 7 0 S 5 2 0 7 0
T 6 0 0 9 11
T 2 0 0 5 7

number of lines N = 4 ≠ number of rows

Minimum uncovered element= 4

Add 4 to element which covered twice & subtracts from uncovered


element
I II III IV V

P 10 6 10 25 0

Q 0 8 21 17 15

R 10 8 15 0 10

S 5 2 0 7 0

T 6 0 0 9 11

Assignment:

P-> v 50
Q-> I 42
R-> IV 60
S->III 20
T - > II 60
------------------------
COST = 232
problem

– There are 4 machine operator . Five jobs are offered with expected profits in
RS. For each operator on each job as follows. find the assignment of operator
to the job that will result in maximum profit . Which job should be declined
justify steps you take to solve the problem.

A B C D E
1 6.20 7.80 5.00 10.10 8.20
2 7.10 8.40 6.10 7.30 5.90
3 8.70 9.20 11.20 7.10 8.10
4 4.80 6.40 8.70 7.70 8.00
Solution

• SELECT MAXIMUM VALUE FROM GIVEN MATRIX .

• SUBTRACT ALL VALUES FROM THIS VALUE SO THAT PROBLEM IS

CONVERTED TO MINIMIZATION

• SOLVE PROBLEM BY NORMAL METHOD

• MAX= 11.20
MAX= 11.20 after subtracting every cell from 11.20

A B C D E

1 5 3.40 6.20 1.10 3.00

2 4.10 2.80 5.10 3.90 5.30

3 2.50 2.00 0.00 4.10 3.10

4 6.40 4.80 2.50 3.50 3.20

Unbalanced problem make it balance


Add dummy row

A B C D E

1 5 3.40 6.20 1.10 3.00

2 4.10 2.80 5.10 3.90 5.30

3 2.50 2.20 0.00 4.10 3.10

4 6.40 4.80 2.50 3.50 3.20

5 0 0 0 0 0
After Row Reduction

A B C D E

1 3.9 2.30 5.10 0 1.90

2 1.30 0 2.30 1.10 2.50

3 2.50 2.00 0 4.10 3.10

4 3.90 2.30 0 1 0.70

5 0 0 0 0 0
After Column Reduction
A B C D E

1 3.9 2.30 5.10 0 1.90

2 1.30 0 2.30 1.10 2.50

3 2.50 2.00 0 4.10 3.10

4 3.90 2.30 0 1 0.70

5 0 0 0 0 0
• Draw minimum number of lines to cover maximum zeros

A B C D E
1 3.9 2.30 5.10 0 1.90
2 1.30 0 2.30 1.10 2.50
3 2.50 2.00 0 4.10 3.10
4 3.90 2.30 0 1 0.70
5 0 0 0 0 0

⦿ N= 4 ≠ number of rows or columns


⦿ Select minimum uncovered element = 0.70
⦿ Subtract from uncovered element and add in element that
covered twice
A B C D E

1 3.2 2.30 5.10 0 1.2

2 0.6 0 2.30 1.10 1.8

3 1.8 2.00 0 4.10 2.4

4 3.2 2.30 0 1 0

5 0 0.7 0.7 0.7 0


Draw minimum number of lines to cover maximum zeros
A B C D E

1 3.2 2.30 5.10 0 1.2

2 0.6 0 2.30 1.10 1.8

3 1.8 2.20 0 4.10 2.4

4 3.2 2.30 0 1 0

5 0 0.7 0.7 0.7 0

⦿ N= 5 = number of rows
A B C D E

1 3.2 2.30 5.10 0 1.2

2 0.6 0 2.30 1.10 1.8

3 1.8 2.00 0 4.10 2.4

4 3.2 2.30 0 1 0

5 0 0.7 0.7 0.7 0

Assignment:

1-> D 10.10
2 -> B 8.40
3-> C 11.20
4-> E 8.00
5-> A 0.0
------------------------
COST = 37.70
Prohibited routes
• An airline has drown up a new flight scheduled involving five flight . To
assist in allocating five pilots to the flight they have ask them to state their
preference score by giving each flight a number out of 10 . The higher the
number, greater is the preference. Some of theses flight are unsuitable to
some pilots due to domestic problem, these are marked with (X).
what should be allocation of pilots to flight in order to meet as many
preference as possible

1 2 3 4 5
A 8 2 X 5 4
B 10 9 2 8 4
C 5 4 9 6 X
D 3 6 2 8 7
E 5 6 10 4 3
Solution

• Problem is to 1 2 3 4 5

maximize total
A 2 8 M 5 6
preference score
select max = 10
B 0 1 8 2 6

C 5 6 1 4 M

D 7 4 8 2 3

E 5 4 0 6 7
After Row Reduction
1 2 3 4 5

A 0 6 M 3 4

B 0 1 8 2 6

C 4 5 0 3 M

D 5 2 6 0 1

E 5 4 0 6 7
After Column Reduction

1 2 3 4 5

A 0 5 M 3 3

B 0 0 8 2 5

C 4 4 0 3 M

D 5 1 6 0 0

E 5 3 0 6 6
1 2 3 4 5

A 0 5 M 3 3

B 0 0 8 2 5

C 4 4 0 3 M

D 5 1 6 0 0

E 5 3 0 6 6

⦿ N= 4 ≠ number of rows
⦿ Select minimum uncovered element = 2
⦿ Subtract from uncovered element and add in element that
covered twice
1 2 3 4 5

A 0 5 M 1 1

B 0 0 8 0 3

C 4 4 0 1 M

D 7 3 8 0 0

E 5 3 0 4 4

Draw number of lines to cover zero


1 2 3 4 5

A 0 5 M 1 1

B 0 0 8 0 3

C 4 4 0 1 M

D 7 3 8 0 0

E 5 3 0 4 4

⦿ N= 4 ≠ number of rows
⦿ Select minimum uncovered element = 1
⦿ Subtract from uncovered element and add in element
that covered twice
1 2 3 4 5

A 0 4 M 0 0

B 1 0 9 0 2

C 4 3 0 0 M

D 8 3 9 0 0

E 5 2 0 3 3

Draw number of lines to cover zero


1 2 3 4 5
A 0 4 M 0 0
B 1 0 9 0 2
C 4 3 0 0 M
D 8 3 9 0 0
E 5 2 0 3 3

⦿ N=5 = number of rows


1 2 3 4 5
Assignment:

A 0 4 M 0 0 A->1 8
B->2 9
C->4 6
B 1 0 9 0 2 D-> 5 7
E -> 3 10
-----------------------------
C 4 3 0 0 M cost = 40

D 8 3 9 0 0

E 5 2 0 3 3
example
• A solicitor firm employs typist on hours basis for their daily work. There

are 5 typists, their charges and speed are different . According to an

earlier understanding , only one job is given to one typist and typist is

paid for all hours even when he works for a fraction of an hour .find

least cost allocation for the following data


Typist Rate/hr Number of pages
(Rs) typed/hr Number of pages
J1=199
A 5 12
J2=175
B 6 14
C 3 8 J3=145

D 4 10 J4=298

E 4 11 J5=178
199/12=17*5=85

P Q R S T

A 85 75 65 125 75

B 90 78 66 132 78

C 75 66 57 114 69

D 80 72 60 120 72

E 76 64 56 112 68

You might also like