Assignment Problems
RK Jana
CASE STUDY ON PRIYA FOOD PRODUCTS
LIMITED
OBJECTIVE: OPTIMAL ASSIGNMENT OF PRODUCTS TO MANUFACTURING
SETUPS TO MINIMIZE THE PRODUCTION COST
PRIYA FOOD PRODUCTS LIMITED
It is a premier biscuit brand of India founded in 1988.
They manufacture 32 verities of biscuits including big hits like Butter Bite, Nice-T, Milkose, Marie, Cream Cracker etc.
By maintaining a good quality in all it's products, Priya has earned itself an enviable distinction of being one of the most effective quality
conscious biscuit manufacturer in the Eastern Region. Their team of food technologists keep exploring new ways of improving taste, quality
and developing new varieties.
PRIYA FOOD PRODUCTS LTD. HAS 5 MANUFACTURING SETUPS. EACH SETUP CAN BE USED TO
PRODUCE FIVE VARIETY OF PACKED BISCUITS AND SNACKS AT A TIME.
THE FIVE VARIETY OF PACKED BISCUITS & SNACKS ARE AS FOLLOWS
BUTTER BITE NICE – T PRIYA KRAX MASALA ROYAL COOKIES
CHOCOLATE
COCONUT WAFER BISCUIT STRAWBERRY
CASHEW
THE COST (RS. ‘000 PER HOUR) TO MAKE A BRAND ON THESE SETUPS
VARY ACCORDING TO THE FOLLOWING TABLE
PRODUCT S1 S2 S3 S4 S5
PRIYA BUTTER BITE
B1 4 6 7 5 11
PRIYA NICE – T COCONUT
B2
7 3 6 9 5
PRIYA KRAX
B3 WAFER BISCUIT STRAWBERRY 8 5 4 6 9
MASALA CASHEW
B4 9 12 7 11 10
ROYAL COOKIES CHOCOLATE
B5 7 5 9 8 11
SOLUTION:-OF ASSIGNMENT PROBLEM (USING HUNGARIAN METHOD)
STEP 1 (ROW REDUCTION) STEP 2(COLUMN REDUCTION)
BRANDS S1 S2 S3 S4 S5 BRANDS S1 S2 S3 S4 S5
B1 0 2 3 1 7 B1 0 2 3 0 5
B2 4 0 3 6 2 B2 4 0 3 5 0
B3 4 1 0 2 5 B3 4 1 0 1 3
B4 2 5 0 4 3 B4 2 5 0 3 1
B5 2 0 4 3 6 B5 2 0 4 2 4
STEP 3 (APPLY LINE TEST) STEP 4
BRANDS S1 S2 S3 S4 S5 BRANDS S1 S2 S3 S4 S5
B1 0 2 3 0 5 B1 0 3 4 0 5
B2 4 0 3 5 0 B2 4 1 4 5 0
B3 4 1 0 1 3 B3 3 1 0 0 2
B4 2 5 0 3 1 B4 1 5 0 2 0
B5 2 0 4 2 4 B5 1 0 4 1 3
DRAWING MINIMUM NUMBER OF HORIZONTAL & VERTICAL LINES TO COVER ALL SUBTRACTING SMALLEST UNCOVERED NUMBER FROM EACH UNCOVERED
ZEROS NUMBER & ADDING IT TO NUMBER LYING AT THE INTERSECTION OF LINES
DRAWN
BRANDS S1 S2 S3 S4 S5 BRAND B1 TO SETUP S1 4
B1 0 3 4 0 5 BRAND B2 TO SETUP S5 5
B2 4 1 4 5 0 BRAND B3 TO SETUP S4 6
B3 3 1 0 0 2 BRAND B4 TO SETUP S3 7
B4 1 5 0 2 0 BRAND B5 TO SETUP S2 5
B5 1 0 4 1 3 TOTAL COST 27
STEP 5 ( SINCE THE NUMBER OF LINES IS 5 WHICH IS EQUAL TO THE STEP 6 (OPTIMAL ASSIGNMENT AND
ORDER OF THE MATRIX, OPTIMAL ASSIGNMENT IS POSSIBLE ) THEIR COST)
Outline
Introduction to assignment problems
Mathematical formulation of assignment problems
Relation between transportation and assignment
models
The Hungarian method
Multiple optimal solution
Unbalanced assignment problem
Travelling salesman problem
Software for solving assignment problems
8
Examples
• Assign people to project assignments
• Assign jobs to machines
• Assign products to plants
• Assign tasks to time slots
9
The Assignment Problem
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.
10
Assumptions in AP
• 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.
11
The Flow Diagram
a1 1 c11 1 t1
c12
a2 2 2 t2
a3 3 3 t3
an n cnn n t4
Assignees Tasks 12
The Cost Matrix in AP
Let the following represent the standard assignment problem
cost matrix, c:
Tasks
1 2 … n
1 c 11 c 12 … c 1n 1
Assignees 2 c 21 c 22 … c 2n 1
… … 1
n c n1 c n2 … c nn 1
1 1 1 1
13
LP Formulation
m n
Minimize Z cij xij
i 1 j 1
s.t. n
x
j 1
ij 1 i
x
i 1
ij 1 j
xij 0
( xij 0 or 1, i and j )
14
The 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 horizontal and/or vertical lines to
cover all the zeros of the reduced cost matrix.
(a) If number of lines drawn are equal to the order of the cost
matrix, then the optimal assignment is reached. Go to Step 3.
(b) If number of lines drawn are less than order of the cost matrix,
then go to Step 4.
15
Continued…
Step 3: Examine all rows containing only one zero. Mark this zero with a
box as an assignment will be made there. Perform similar operation in
columns. There will be only one zero in each row & each column.
Obtain the optimal assignment & corresponding minimum cost.
Step 4: Find the smallest nonzero element (say, its value is k) in the
reduced cost matrix that is uncovered by the lines drawn in Step 2.
Subtract k from each uncovered element of the matrix and add k to each
element that is covered by two lines. Return to step 2.
16
Example 1
Assign jobs 1,2, 3, 4 to machines 1, 2, 3, 4. The
processing times for different jobs in machines are
given below. Find the optimum assignment of jobs to
machines.
Job 1 Job 2 Job 3 Job 4
Machine 1 14 5 8 7
Machine 2 2 12 6 5
Machine 3 7 8 3 9
Machine 4 2 4 6 10
17
Continued…
Row
Reduction
Job 1 Job 2 Job 3 Job 4
Machine 1 9 0 3 2
Machine 2 0 10 4 3
Machine 3 4 5 0 6
Machine 4 0 2 4 8
18
Continued…
Column
Reduction
Job 1 Job 2 Job 3 Job 4
Machine 1 9 0 3 0
Machine 2 0 10 4 1
Machine 3 4 5 0 4
Machine 4 0 2 4 6
19
Continued…
Job 1 Job 2 Job 3 Job 4
Machine 1 9 0 3 0
Machine 2 0 10 4 1
Machine 3 4 5 0 4
Machine 4 0 2 4 6
20
Continued…
Find the smallest nonzero element (say, k) in the
reduced cost matrix that is uncovered by the lines.
Subtract k from each uncovered element, and add k to
each element that is covered by two lines.
21
Continued…
Job 1 Job 2 Job 3 Job 4
Machine 1 10 0 3 0
Machine 2 0 9 3 0
Machine 3 5 5 0 4
Machine 4 0 1 3 5
22
Continued…
Job 1 Job 2 Job 3 Job 4
Machine 1 10 0 3 0
Machine 2 0 9 3 0
Machine 3 5 5 0 4
Machine 4 0 1 3 5
Need 4 lines, so we have the optimal assignment and we stop
23
Continued…
Job 1 Job 2 Job 3 Job 4
Machine 1 10 0 3 0
Machine 2 0 9 3 0
Machine 3 5 5 0 4
Machine 4 0 1 3 5
Optimal assignment
x12 1, x33 1, x41 1, x24 1
M1 J2, M2 J4, M3 J3, M4 J1
Minimum processing time = 15 units 24
Example 2
Assign workers W1, W2, W3, W4 to jobs J1, J2, J3, J4.
Time taken (in min) by different workers for different
jobs are given below. Find the optimum assignment.
J1 J2 J3 J4
W1 45 40 51 67
W2 55 40 61 53
W3 49 52 48 64
W4 41 45 60 55
W1 J2, W2 J4, W3 J3, W4 J1, Time = 182 min.
25
Example 3
M1 M2 M3 M4
A 5 3 1 8
B 7 9 2 6
C 6 4 5 7
D 5 7 7 6
A M3, B M4, C M2, D M1, Min Cost = 16 units
26
Special Cases
Special Cases
• Number of assignees exceeds the number of tasks:
xij < 1 for each assignee i
j
• Number of tasks exceeds the number of assignees:
Add enough dummy assignees to equalize the
number of assignees and the number of tasks.
The objective function coefficients for these
new variable would be zero.
27
Continued…
Consider following AP. Convert it to the standard definition of AP.
Tasks
1 2 3 4
1 10 9 8 7
Assignees 2 4 - 5 6
3 2 1 8 -
Add “big M” to avoid incompatible assignments, and add a dummy
assignee to have equal assignees and tasks.
Tasks
1 2 3 4
1 10 9 8 7
Assignees 2 4 M 5 6
3 2 1 8 M
4 0 0 0 0 28
Example 4
M1 M2 M3 M4
J1 10 24 30 15
J2 16 22 28 12
J3 12 20 32 10
J4 9 26 34 16
J1 M3, J2 M2, J3 M4, J4 M1, Min Cost = 71 units
J1 M3, J2 M4, J3 M2, J4 M1, Min Cost = 71 units
J1 M2, J2 M3, J3 M4, J4 M1, Min Cost = 71 units 29
Example
An airline company has drawn up a new flight schedule
involving 5 flights. To assist in allocating 5 pilots to the
flights, it has asked them to state their preference score
by giving each flight a number out of 10. The higher the
number, the greater is the preference. Certain of these
flights are unsuitable to some pilots owing to domestic
reasons. These have been marked with ×. What should
be the allocation of the pilots to flights in order to meet
as many preferences as possible.
30
Continued…
F1 F2 F3 F4 F5
P1 8 2 × 5 4
P2 10 9 2 8 4
P3 5 4 9 6 ×
P4 3 6 2 8 7
P5 5 6 10 4 3
31
Continued…
This is a maximizing type problem. So, we need to
convert it to a minimization type problem by subtracting
all the matrix elements from the highest score element
10. Replacing × by M (a large positive number), the
reduced score matrix is obtained as:
F1 F2 F3 F4 F5
P1 2 8 M 5 6
P2 0 1 8 2 6
P3 5 6 1 4 M
P4 7 4 8 2 3
P5 5 4 0 6 7
32
Continued…
Optimum assignment (with maximum score 40) using
the Hungarian method is obtained as:
Pilot Flight Score
P1 F1 8
P2 F2 9
P3 F4 6
P4 F5 7
P5 F3 10
33
Travelling Salesman Problem
• A salesman goes from one city to another city and returns
to the starting city after visiting each city only once.
• The travel cost from each city to every other city is given.
• The objective is to find a route such that the total cost of
travel is minimum.
• Travel from a city to itself is not allowed. Hence (i, i)
cells in the cost matrix is assigned as ∞.
• The travel should be a cycle passing through all the cities
and no city to be visited twice.
• If the optimum assignment does not satisfy the route
condition, we make adjustments in the assignment and
make it a cycle with minimum possible increase in the total
cost. 34
Example 6
A salesman has to visit five cities A, B, C, D and E. The
distance (in 100 km) between two cities are given
below. The salesman starts from city A and returns to it
after visiting all the other cities in a cycle. Which route
the salesman should travel such that total distance travel
is minimum.
A B C D E
A -- 4 7 3 4
B 4 -- 6 3 4
C 7 6 -- 7 5
D 3 3 7 -- 7
E 4 4 5 7 --
35
Continued…
Assign ∞ value to the diagonal cells and consider the
assignment problem as follow:
A B C D E
A ∞ 4 7 3 4
B 4 ∞ 6 3 4
C 7 6 ∞ 7 5
D 3 3 7 ∞ 7
E 4 4 5 7 ∞
36
Continued…
After performing row and column operations, and
drawing minimum number of lines to cover all the
zeros, the optimum table is obtained as follows:
A B C D E
A ∞ 0 2 0 0
B 0 ∞ 1 0 0
C 2 1 ∞ 3 0
D 0 0 3 ∞ 4
E 0 0 0 4 ∞
37
Continued…
The assignment is done as follows:
A B C D E
A ∞ 0 2 0 0
B 0 ∞ 1 0 0
C 2 1 ∞ 3 0
D 0 0 3 ∞ 4
E 0 0 0 4 ∞
A D B C E A, Total distance = 21 (21,00) km.
38
Example 7
A salesman has to visit six cities A, B, C, D, E and F. The
distance (in 100 km) between two cities are given. The
salesman starts from city A and returns to it after visiting all
the other cities in a cycle. Which route the salesman should
travel such that total distance travel is minimum.
A B C D E F
A -- 5 12 6 4 8
B 6 -- 10 5 4 3
C 8 7 -- 6 3 11
D 5 4 11 -- 5 8
E 5 2 7 8 -- 4
F 6 3 11 5 4 --
A B F E C D A, Total distance = 30 (30,00) km. 39