download

Course
Year
: D0744 - Deterministic Optimization
: 2009
Assignment
Meeting 15
Introduction
• Consider the problem of assigning n assignees to n
tasks. Only one task can be assigned to an assignee,
and each task must be assigned.
• There is also a cost associated with assigning an
assignee i to task j, cij.
• The objective is to assign all tasks such that the total
cost is minimized.
Bina Nusantara University
3
Assignment in General LP
In general the LP formulation is given as
n
Minimize
n
 c
i 1 j 1
n
x
ij
xij
 1, i  1,
,n
Each supply is 1
 xij  1, j  1,
,n
Each demand is 1
j 1
ij
n
i 1
Bina Nusantara University
xij  0 or 1, ij
4
Example
• Assign people to project assignments
• Assign jobs to machines
• Assign products to plants
• Assign tasks to time slots
Bina Nusantara University
5
To fit the assignment problem definition, the
following assumptions must be satisfied:
• The number of assignees and the number of tasks are
the same (denoted by n).
• Each assignee is to be assigned to exactly one task.
• Each task is to be assigned to exactly one assignee.
• There is a cost cij associated with assignee i performing
task j.
• The objective is to determine how all n assignments
should be made to minimize the total cost.
Bina Nusantara University
6
a – assignee
t – tasks
Flow Diagram
a1
c11
1
1
t1
c12
a2
t2
2
2
3
3
t3
n
t4
a3
an
n
Bina Nusantara University
assignees
cnn
tasks
7
Cost Matrix
Let the following represent the standard assignment
problem cost matrix, c:
Tasks
Assignees
Bina Nusantara University
1
1
c 11
2
c 12
…
…
n
c 1n
2
…
n
c 21
…
c n1
c 22
…
c 2n
c n2
…
c nn
8
Conversion to Standard Cost Matrix
Consider following cost matrix, how do you convert to
satisfy the standard definition of the assignment problem?
Tasks
Assignees
Bina Nusantara University
1
2
3
1
10
4
2
2
9
1
3
8
5
8
4
7
6
-
9
Cont’d
Add “big M” to avoid incompatible assignments, and add a
dummy assignee (or task) to have equal assignees and
tasks.
Tasks
Assignees
Bina Nusantara University
1
2
3
4
1
10
4
2
0
2
9
M
1
0
3
8
5
8
0
4
7
6
M
0
10
Math Formulation
m
Minimize
s.t.
n
Z   cij xij
Total Cost
i 1 j 1
n
x
j 1
ij
n
x
i 1
ij
1

1

i
j
xij  0
( xij is binary, for all i and j )
Does this formulation look familiar?
Is this a Linear Program?
Bina Nusantara University
11
Hungarian Method
Consider following cost matrix
Tasks
Assignees
Bina Nusantara University
1
2
3
4
1
14
2
7
2
2
5
12
8
4
3
8
6
3
6
4
7
5
9
10
Row Minimum
5
2
3
2
12
Cont’d
Reduce by Row Minimum
Tasks
Assignees
Column Min
Bina Nusantara University
1
2
3
4
1
9
0
4
0
0
2
0
10
5
2
0
3
3
4
0
4
0
4
2
3
6
8
2
13
Cont’d
Reduced by Column Minimum
Tasks
Assignees
Bina Nusantara University
1
2
3
4
1
9
0
4
0
2
0
10
5
2
3
3
4
0
4
4
0
1
4
6
14
Cont’d
Reduce by Minimum of uncovered cells (1):
Tasks
Assignees
Bina Nusantara University
1
2
3
4
1
10
0
5
0
2
0
9
5
1
3
3
3
0
3
4
0
0
4
5
15
Cont’d
Solution is now optimal since minimum number of lines to
cover all 0 is 4 (equal to n).
Tasks
Assignees
1
2
3
4
1
10
0
5
0
2
0
9
5
1
3
3
3
0
3
4
0
0
4
5
A3 -> T3, A1 -> T2, A2 -> T4, A4 -> T1
Z = 3 + 5 + 5 + 2 = 15
Bina Nusantara University
16
Summary of Hungarian Method
•
•
•
Step 1 – Find the minimum element in each row. Construct a new matrix by
subtracting from each cost the minimum cost in its row. For this new matrix,
find the minimum cost in each column. Construct a new matrix by
subtracting from each cost the minimum cost in its column.
Step 2 – Draw the minimum number of lines (horizontal or vertical) that are
needed to cover all the zeros in the reduced cost matrix. If n lines are
required, an optimal solutions is available among the covered zeros in the
matrix. If fewer than n lines are needed, proceed to step 3.
Step 3 – Find the smallest nonzero element (call its value k) in the reduced
cost matrix that is uncovered by the lines drawn in Step 2. Now subtract k
from each uncovered element of the reduced cost matrix and add k to each
element that is covered by two lines. Return to step 2.
Bina Nusantara University
17