Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
2 views

Assignment Problem Lecture # 6

The document outlines the Assignment Problem, detailing its formulation and the Hungarian Method for finding optimal assignments. It includes step-by-step instructions for the algorithm, illustrated with two examples involving job assignments and salespersons to regions, showcasing how to minimize costs and time. The final results of both examples provide the optimal assignments and their respective total costs or times.

Uploaded by

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

Assignment Problem Lecture # 6

The document outlines the Assignment Problem, detailing its formulation and the Hungarian Method for finding optimal assignments. It includes step-by-step instructions for the algorithm, illustrated with two examples involving job assignments and salespersons to regions, showcasing how to minimize costs and time. The final results of both examples provide the optimal assignments and their respective total costs or times.

Uploaded by

Mohamed Ayman
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

Lecture “6”

Assignment Problem

1- Formulation of the problem


Let there are n jobs and n persons are available with different skills. If
the cost of doing jth work by ith person is cij. Then the cost matrix is
given in the table 1 below:

Mathematical Model for Assignment Problem


2- Assignment Algorithm (Hungarian Method)

The Hungarian algorithm consists of the four steps below. The first
two steps are executed once, while Steps 3 and 4 are repeated until an
optimal assignment is found. The input of the algorithm is an n by n
square matrix with only nonnegative elements.

Step 1: Subtract row minima

For each row, find the lowest element and subtract it from each element in that
row.

Step 2: Subtract column minima

Similarly, for each column, find the lowest element and subtract it from each
element in that column.

Step 3: Cover all zeros with a minimum number of lines

Cover all zeros in the resulting matrix using a minimum number of horizontal
and vertical lines. If number of lines are equal to n , an optimal assignment
exists among the zeros. then go to step 5.

If number of lines less than n , continue with Step 4.

Step 4: Create additional zeros

Find the smallest element (call it k) that is not covered by a line in Step 3.
Subtract k from all uncovered elements, and add k to all elements that are
covered twice. Then Steps 3 and 4 are repeated until an optimal assignment is
found.

Step 5: assign optimal cells

Select a matching by choosing a set of zeros so that each row or column


has only one selected.
Example 1:
Three jobs A B C are to be assigned to three machines X Y Z. The processing
costs are as given in the matrix shown below. Find the allocation which will
minimize the overall processing cost.

X Y Z

A 19 28 31

B 11 17 16

C 12 15 13

Solution
Step 1: Subtract row minima
We start with subtracting the row minimum from each row. The smallest
element in the first row is, for example, 19. Therefore, we subtract 19 from each
element in the first row. The resulting matrix is:

X Y Z

A 0 9 12

B 0 6 5

C 0 3 1

Step 2: Subtract column minima

Similarly, we subtract the column minimum from each column, giving the
following matrix:
X Y Z

A 0 6 11

B 0 3 4

C 0 0 0

Step 3: Cover all zeros with a minimum number of lines


We will now determine the minimum number of lines (horizontal or vertical)
that are required to cover all zeros in the matrix. All zeros can be covered using
2 lines:

X Y Z

A 0 6 11

B 0 3 4

C 0 0 0

Because the number of lines required (2) is lower than the size of the matrix
(n=3), we continue with Step 4.

Step 4: Create additional zeros


First, we find that the smallest uncovered number is 6. We subtract this number
from all uncovered elements and add it to all elements that are covered twice.
This results in the following matrix:
X Y Z

A 0 3 8

B 0 0 1

C 3 0 0

Now we return to Step 3.


Step 3: Cover all zeros with a minimum number of lines
Again, We determine the minimum number of lines required to cover all zeros
in the matrix. Now there are 3 lines required:

X Y Z

A 0 3 8

B 0 0 1

C 3 0 0

Because the number of lines required (3) is equal to the size of the matrix (n=3),
we continue with Step 5.

Step 5: assign optimal cells

Select a matching by choosing a set of zeros so that each row or column has
only one selected. The following zeros cover an optimal assignment:
X Y Z

A 0 3 8

B 0 0 1

C 3 0 0

This corresponds to the following optimal assignment in the original cost


matrix:

X Y Z

A 19 28 31

B 11 17 16

C 12 15 13

Thus, machine X is assigned to job A, machine Y is assigned to job B and


machine Z is assigned to job C. The total cost of this optimal assignment is to
19 + 17 + 13 = 49.

Example 2:
The pharmaceutical firm has five salespersons, whom the firm wants to assign
to five sales regions. Given their various contacts, the salespersons are able to
cover the regions in different amounts of time. The amount of time (days)
required by each salesperson to cover each city is shown in the following table.
Which salesperson should be assigned to each region to minimize total time?
Identify the optimal assignments and compute total minimum time.
Regions

A B C D E

1 17 10 15 16 20

2 12 9 16 9 14

3 11 16 14 15 12

4 14 10 10 18 17

5 13 12 9 15 11

Solution
Step 1: Subtract row minima

We start with subtracting the row minimum from each row. The smallest
element in the first row is, for example, 10. Therefore, we subtract 10 from each
element in the first row. The resulting matrix is:

A B C D E

1 7 0 5 6 10

2 3 0 7 0 5

3 0 5 3 4 1

4 4 0 0 8 7

5 4 3 0 6 2
Step 2: Subtract column minima
Similarly, we subtract the column minimum from each column, giving
the following matrix:

A B C D E

1 7 0 5 6 9

2 3 0 7 0 4

3 0 5 3 4 0

4 4 0 0 8 6

5 4 3 0 6 1

Step 3: Cover all zeros with a minimum number of lines


We will now determine the minimum number of lines (horizontal or vertical)
that are required to cover all zeros in the matrix. All zeros can be covered using
4 lines:

A B C D E

1 7 0 5 6 9

2 3 0 7 0 4

3 0 5 3 4 0

4 4 0 0 8 6

5 4 3 0 6 1

Because the number of lines required (4) is lower than the size of the matrix
(n=5), we continue with Step 4.
Step 4: Create additional zeros

First, we find that the smallest uncovered number is 1. We subtract this number
from all uncovered elements and add it to all elements that are covered twice.
This results in the following matrix:

A B C D E

1 6 0 5 5 8

2 3 1 8 0 4

3 0 6 4 4 0

4 3 0 0 7 5

5 3 3 0 5 0

Now we return to Step 3.


Step 3: Cover all zeros with a minimum number of lines
Again, We determine the minimum number of lines required to cover all zeros
in the matrix. Now there are 5 lines required:

A B C D E

1 6 0 5 5 8

2 3 1 8 0 4

3 0 6 4 4 0

4 3 0 0 7 5

5 3 3 0 5 0
Because the number of lines required (5) equals the size of the matrix (n=5), an
optimal assignment exists among the zeros in the matrix. Therefore, go to step
5.
Step 5: assign optimal cells

Select a matching by choosing a set of zeros so that each row or column has
only one selected. The following zeros cover an optimal assignment:

A B C D E

1 6 (0) 5 5 8

2 3 1 8 (0) 4

3 (0) 6 4 4 0

4 3 0 (0) 7 5

5 3 3 0 5 (0)

This corresponds to the following optimal assignment in the original cost


matrix:

A B C D E

1 17 10 15 16 20

2 12 9 16 9 14

3 11 16 14 15 12

4 14 10 10 18 17

5 13 12 9 15 11
Thus, salesperson 1 is assigned to Region B, salesperson 2 is assigned to Region
D, salesperson 3 is assigned to Region A, salesperson 4 is assigned to Region C
and salesperson 5 is assigned to Region E. The total time of this optimal
assignment is to 10 + 9 + 11 + 10 + 11 = 51 days.

You might also like