Vous êtes sur la page 1sur 58

Assignment Problem

A. R. Dani

12/08/21 1
The Assignment Problem
• In many business situations, management needs to
assign - personnel to jobs, - jobs to machines, -
machines to job locations, or - salespersons to
territories.
• Consider the situation of assigning n jobs to n
machines.
• When a job i (=1,2,....,n) is assigned to machine j
(=1,2, .....n) that incurs a cost Cij.
• The objective is to assign the jobs to machines at the
least possible total cost.

12/08/21 2
Introduction
• This is a special type of transportation problem
in which each source should have the capacity
to fulfill the demand of any of the
destinations.
• In other words any operator would be able
perform any job regardless of his skills,although
the cost( or the time taken) will be more if the
job does not match with operator’s skill.

12/08/21 3
The Assignment Problem
• This situation is a special case of the
Transportation Model And it is known as the
assignment problem.
• Here, jobs represent “sources” and machines
represent “destinations.”
• The supply available at each source is 1 unit
And demand at each destination is 1 unit.

12/08/21 4
The Assignment Problem

The assignment model can be expressed


mathematically as follows:
Xij= 0, if the job j is not assigned to machine i
1, if the job j is assigned to machine i
12/08/21 5
General format of assignment problem
Let m be the number of jobs as well as the operators, and tij
be the processing time of the job i if it is assigned to the
operator j. Here the objective is to assign the jobs to the
operators such that the total processing time is minimized.
Operators
1 2 … j … m
1 t11 t12 t1j t1m
2
Job .
i ti1 tij tim
.
12/08/21 m tm1 tm2 tmj tmm 6
• Examples of assignment problem

Row entity Column entity Cell entity


jobs operators Processing time
Programmer program Processing time

operators machine Processing time

Drivers Routes Travel time


Teachers Subjects Students pass
percentage
12/08/21 7
The Assignment Problem

12/08/21 8
Assignment problem as a zero-one ( Binary)
programming problem .
• Min Z= c11x11++cijXij+.+cmmXmm = m m

• Subject to x11+…………...+x1m =1 Min Z   Cij X ij


i 1 j 1

x21+…………...+x2m =1 m

…….. X
j 1
ij  1 for i  1,....m

xm1+…………...+xmm =1
x11+…………...+xm1 =1 m

X ij  1 for j  1,....m
x12+…………...+xm2 =1 i 1

………………..
x1m+…………...+xmm =1
xij.=0 or 1 for i=1,2….m and j=1,2…..m.
12/08/21 9
Types of assignment problems

• As in transportation problems assignment


problems also can be balanced ( with equal
number of rows and columns) or unbalanced.
• When it is unbalanced the necessary number of
row/s or column/s are added to balance it. That
is to make a square matrix.
• The values of the cell entries of the dummy rows
or columns will be made equal to zero.

12/08/21 10
The Assignment Problem Example
• Ballston Electronics manufactures small electrical
devices.
• Products are manufactured on five different
assembly lines (1,2,3,4,5).
• When manufacturing is finished, products are
transported from the assembly lines to one of the
five different inspection areas (A,B,C,D,E).
• Transporting products from five assembly lines to
five inspection areas requires different times (in
minutes)

12/08/21 11
The Assignment Problem Example

Under current arrangement, assignment of


inspection areas to the assembly lines are 1 to A, 2
to B, 3 to C, 4 to D, and 5 to E.
This arrangement requires 10+7+12+17+19 = 65 man
minutes.
12/08/21 12
The Assignment Problem Example
• Management would like to determine whether
some other assignment of production lines to
inspection areas may result in less cost.
• This is a typical assignment problem. n = 5 And
each assembly line is assigned to each inspection
area.
• It would be easy to solve such a problem when n
is 5, but when n is large all possible alternative
solutions are n!, this becomes a hard problem.

12/08/21 13
The Assignment Problem Example
• Assignment problem can be either formulated
as a linear programming model, or it can be
formulated as a transportation model.
• However, An algorithm known as Hungarian
Method has proven to be a quick and efficient
way to solve such problems.
• This technique is programmed into many
computer modules such as the one in CPLEX,
MATLAB,SAS
12/08/21 14
The Assignment Problem Example

The Optimum solution for this problem is as


follows:

12/08/21 15
Hungarian Method Example

Step 1: Select the smallest value in each row.


Subtract this value from each value in that row

Step 2: Do the same for the columns that do not


have any zero value.

12/08/21 16
Hungarian Method Example

If not finished, continue


with other columns.
12/08/21 17
Hungarian Method Example
Step 3: Assignments are made at zero values.
• Therefore, we assign job 1 to machine 1; job 2
to machine 3, and job 3 to machine 2.
• Total cost is 5+12+13 = 30.
• It is not always possible to obtain a feasible
assignment as in here.

12/08/21 18
Hungarian Method Example 2

12/08/21 19
Hungarian Method Example 2
• A feasible assignment is not possible at this
moment.
• In such a case, The procedure is to draw a
minimum number of lines through some of
the rows and columns, Such that all zero
values are crossed out.

12/08/21 20
Hungarian Method Example 2

The next step is to select the smallest uncrossed out element. This
element is subtracted from every uncrossed out element and added
to every element at the intersection of two lines.

12/08/21 21
Hungarian Method Example 2
• We can now easily assign to the zero values.
Solution is to assign (1 to 1), (2 to 3), (3 to 2)
and (4 to 4).
• If drawing lines do not provide an easy
solution, then we should perform the task of
drwaing lines one more time.
• Actually, we should continue drawing lines
until a feasible assignment is possible.

12/08/21 22
The Traveling Salesman Problem
• In the traveling salesman problem, there are m
locations (or nodes)
• And unit costs (Cij) are associated with traveling
between locations i and j.
• The goal is to find the cycle that minimizes the total
(traveling) distance required to visit all locations
(nodes) without visiting any location twice.
• The Traveling salesman begins its journey from
his/her home city And visits other cities (in no
particular order) before returning home.

12/08/21 23
The Traveling Salesman Problem
Example:
• Emergency management set up a home office
at Northridge in response to an Earthquake in
California.
• The director is responsible for visiting each of
4 local offices and return to home office to file
his reports.

12/08/21 24
The Traveling Salesman Problem
Following table gives estimated travel times
between each pair of offices (in minutes)

12/08/21 25
The Traveling Salesman Problem
• The director wishes to visit each local office
and return to home office in the shortest
time.

• This is a Symmetric traveling salesman


problem Because the travel time between
each pair of offices is the same in either
direction.

12/08/21 26
The Traveling Salesman Problem
Network representation of the problem

12/08/21 27
The Traveling Salesman Problem
Cycle Total Cost (distance in minutes)
1. H-O1-O2-O3-O4-H 210
2. H-O1-O2-O4-O3-H 195 … The shortest cycle
3. H-O1-O3-O2-O4-H 240
4. H-O1-O3-O4-O2-H 200
5. H-O1-O4-O2-O3-H 225
A problem with m nodes
6. H-O1-O4-O3-O2-H 200 (locations) has (m-1)!
7. H-O2-O3-O1-O4-H 265 Possible cycles.
8. H-O2-O1-O3-O4-H 235 For symmetric problems,
9. H-O2-O4-O1-O3-H 250 this number is divided by
10. H-O2-O1-O4-O3-H 220
11. H-O3-O1-O2-O4-H 260
2.
12. H-O3-O2-O1-O4-H 260

12/08/21 28
The Traveling Salesman Problem
• Here, there are 5 nodes, m=5, therefore there are (5-
1)! / 2= 4! / 2 = 12 possible cycles for this problem.
• As the table indicates, the optimal cycle is H-O1-O2-
O4-O3-H with a traveling time of 195 minutes.
• Of course, This trial approach can only be used for
small problems.
• For example, the number of possible cycles is
181,440 for a problem with 10 nodes.
• For a problem with 15 nodes, it is 840 trillion. (A
typical NP hard problem)

12/08/21 29
The Traveling Salesman Problem
• Basically, the traveling salesman problem can
be considered as being similar to the
Assignment Problem.

• Each node is assigned to another, and there is


only 1 assignment for each node.

12/08/21 30
The Traveling Salesman Problem

However, when solved in this way, instead of


resulting in a Single Cycle, the solution is in the
form of separated cycles. The optimum result is
two cycles:
(H-O2-O1-H) and (O3-O4-O3)
12/08/21 31
The Traveling Salesman Problem

However, as we said before, using this assignment


approach alone Will result in separate cycles.
To prevent separate cycles, additional constraints
must be added to the model given above.
12/08/21 32
The Traveling Salesman Problem
• For example, to state that the sub-cycle (H-O2-O1-H)
is not feasible, the single connections of (H-O2); (O2-
O1) and (O1-H) are not allowed to enter the
solution at the same time.
• If we give the index number 5 for the Home office,
the following constraint makes sure that the sub-
cycle of (H-O2-O1-H) is not feasible:
• X52 + X21 + X15  2
• (because this sub-cycle can only be feasible if X52, X21,
and X15 are all equal to 1 at the same time. This
constraint makes this occasion impossible)
12/08/21 33
The Traveling Salesman Problem
• As another example, to state that sub-cycle of (O1-
O2-O3-O4-O1) is not feasible:
• X12 + X23 + X34 + X41  3
• To develop the LP model for traveling salesman
problem, all possible unfeasible sub-cycles should be
eliminated by employing additional constraints in the
similar manner.
• For our example problem we should add the
following constraints, accordingly:
• For single node sub-cycles: X11  0, X22  0, X33  0, X44
 0, X55  0.
12/08/21 34
The Traveling Salesman Problem
• For two node sub-cycles:
X12 + X21  1 X13 + X31  1
X14 + X41  1 X15 + X51  1
X23 + X32  1 X24 + X42  1
X25 + X52  1 X34 + X43  1
X35 + X53  1 X45 + X54  1
• For three node sub-cycles:
X12 + X23 + X31  2 X12 + X24 + X41  2
X12 + X25 + X51  2 X13 + X34 + X41  2
X13 + X35 + X51  2 X14 + X45 + X51  2
X23 + X34 + X42  2 X23 + X35 + X52  2
X24 + X45 + X52  2 X34 + X45 + X53  2

12/08/21 35
The Traveling Salesman Problem
• For four node sub-cycles:
X12 + X23 + X34 + X41  3
X12 + X23 + X35 + X51  3
X12 + X24 + X45 + X51  3
X13 + X34 + X45 + X51  3
X23 + X34 + X45 + X51  3

12/08/21 36
Example : Assign the 5 operators to the 5 jobs such
that the total processing time is minimized.

Operator
1 2 3 4 5
job

1 10 12 15 12 8
2 7 16 14 14 11
3 13 14 7 9 9
4 12 10 11 13 10
5 8 13 15 11 15

12/08/21 37
Hungarian method
• Consists of two phases.
• First phase: row reductions and column
reductions are carried out.
• Second phase :the solution is optimized in
iterative basis.

12/08/21 38
Phase 1: Row and column
reductions
• Step 0: Consider the given cost matrix
• Step 1: Subtract the minimum value of each
row from the entries of that row, to obtain
the next matrix.
• Step 2: Subtract the minimum value of each
column from the entries of that column , to
obtain the next matrix.
• Treat the resulting matrix as the input for
phase 2.

12/08/21 39
Phase 2: Optimization
• Step3: Draw a minimum number of lines to cover all the
zeros of the matrix.
• Procedure for drawing the minimum number of lines:
• 3.1 Row scanning
1 Starting from the first row ,if there’s only one zero in a
row mark a square round the zero entry and draw a
vertical line passing through that zero. Otherwise skip
the row.
2.After scanning the last row, check whether all the zeros
are covered with lines. If yes go to step 4. Otherwise do
column scanning. Ctd
12/08/21 40
• 3.2 Column scanning.
1. Starting from the first column: if there’s
only one zero in a column mark a square
round the zero entry and draw a horizontal
line passing through that zero. otherwise
skip the column.
2.After scanning the last column, check
whether all the zeros are covered with
lines. If yes go to step 4. Otherwise do row
scanning. ctd 

12/08/21 41
• Step 4: check whether the number of squares marked is
equal to the number of rows/columns of the matrix.
• If yes go to step 7. Otherwise go to step 5.
• Step 5: Identify the minimum value of the undeleted cell
values ,say ‘x’. Obtain the next matrix by the following
steps.
5.1 Copy the entries covered by the lines ,but not on the
intersection points.
5.2 add x to the intersection points
5.3 subtract x from the undeleted cell values.
Step 6: go to step 3.
Step 7: optimal solution is obtained as marked by the
squares
12/08/21 42
Maximization problem
• If the problem is a maximization problem
,convert the problem into a minimization
problem by multiplying by -1.
• Then apply the usual procedure of an
assignment problem.

12/08/21 43
Example : Assign 4 sales persons to four different
sales regions such that the total sales is maximized.

Sales
region
1 2 3 4

Sales person

1 10 22 12 14

2 16 18 22 10

3 24 20 12 18

4
12/08/21
16 14 24 20 44
Modified data , after multiplying the cell entries
by -1.

Sales
region
1 2 3 4

Sales person

1 -10 -22 -12 -14

2 -16 -18 -22 -10

3 -24 -20 -12 -18

4
12/08/21
-16 -14 -24 -20 45
After step 1

Sales
region
1 2 3 4

Sales person

1 12 0 10 8

2 6 4 0 12

3 0 4 12 6

4
12/08/21
8 10 0 4 46
• Cij is the cell entity of the cost matrix
• X rows which are not deleted up to node Pk
from the root node in the branching tree.
• Y columns which are not deleted up to node Pk
from the root node in the branching tree.

12/08/21 47
P0

P111 49 P12 1 44 P131 49 P141 44 P151 40

P212 43 P222 50 P232 49 P242 47

P323 51 P333 43
P343 47

P424 43 P444 48
12/08/21 48
• The optimum allocation will be
• Job operator time
• 1 5 8
• 2 1 7
• 3 3 7
• 4 2 10
• 5 4 11
• 43

12/08/21 49
Example :ROW SCANNING.
Operator
1 2 3 4 5
job

1 10 12 15 12 8

2 7 16 14 14 11

3 13 14 7 9 9

4 12 10 11 13 10

5 8 13 15 11 15

12/08/21 50
Example : Assign the 5 operators to the 5 jobs such
that the total processing time is minimized.
Operator
1 2 3 4 5
job

1 10 12 15 12 8

2 7 16 14 14 11

3 13 14 7 9 9

4 12 10 11 13 10

5 8 13 15 11 15

12/08/21 51
Example : Assign the 5 operators to the 5 jobs such
that the total processing time is minimized.
Operator
1 2 3 4 5
job

1 2 4 7 4 0

2 0 9 7 7 4

3 6 7 0 2 2

4 2 0 1 3 0

5 0 5 7 4 8

12/08/21 52
Example : Assign the 5 operators to the 5 jobs such
that the total processing time is minimized.
Operator
1 2 3 4 5
job

1 2 4 7 2 0

2 0 9 7 5 4

3 6 7 0 2 2

4 2 0 1 1 0

5 0 5 7 2 8

12/08/21 53
Example : Assign the 5 operators to the 5 jobs such
that the total processing time is minimized.
Operator
1 2 3 4 5
job

1 2 4 6 1 0

2 0 9 6 4 4

3 7 8 0 2 3

4 2 0 0 0 0

5 0 5 6 1 8

12/08/21 54
Example : Assign the 5 operators to the 5 jobs such
that the total processing time is minimized.
Operator
1 2 3 4 5
job

1 2 4 6 1 0

2 0 9 6 4 4

3 7 8 0 0 3

4 2 0 0 0 0

5 0 5 6 1 8

12/08/21 55
Example : Assign the 5 operators to the 5 jobs such
that the total processing time is minimized.
Operator
1 2 3 4 5
job

1 2 4 6 1 0

2 0 9 6 4 4

3 8 9 0 0 4

4 3 1 0 0 0

5 0 5 6 1 8

12/08/21 56
Example : Assign the 5 operators to the 5 jobs such
that the total processing time is minimized.
Operator
1 2 3 4 5
job

1 2 4 5 0 0

2 0 9 5 3 4

3 7 8 0 0 3

4 2 0 0 0 0

5 0 5 5 0 7

12/08/21 57
Example : Assign the 5 operators to the 5 jobs such
that the total processing time is minimized.
Operator
1 2 3 4 5
job

1 2 4 5 0 0

2 0 9 5 3 4

3 7 8 0 0 3

4 2 0 0 0 0

5 0 5 5 0 7

12/08/21

Vous aimerez peut-être aussi