Download as pdf or txt
Download as pdf or txt
You are on page 1of 32

Operations Research I

Assignment problems

Ing. Lenka Skanderová, Ph.D.


• Description
• Mathematical model
• Solution procedures
Description and definition •

Hungarian algorithm
Transportation vs. Assignment problem

• Assignees are assigned to do the tasks

• Asignee:
• Employee, machine, vehicle, etc.

The assignment problem satisfies these assumptions:


1. The number of assignees equals to the number of tasks
2. Each assignee can be assigned to do only one task
3. Each task is processed by only one assignee
4. There is a cost 𝑐𝑖𝑗 associated with the assignee 𝑖 performing task 𝑗
5. The objective: to determine how all 𝑛 task will be processed to minimize the
total cost

[1]

Operations research I 2/32


• Description
• Mathematical model
• Solution procedures
Prototype example •

Hungarian algorithm
Transportation vs. Assignment problem

• JOB SHOP COMPANY bought 3 new machines. There are 4 available locations in the shop
where a machine could be installed. Some of locations are more desirable than others for
particular machines because of their proximity to work centers that will have a heavy
work flow to and from these machines.

• Objective: To assign each machine to the available location to minimize the total cost of
material handling.
Location
1 2 3 4
1 13 16 12 11
Machine
2 15 - 13 20
3 5 7 10 6

Material-handling cost data ($) for Job Shop Company [1]

Operations research I 3/32


• Description
• Mathematical model
• Solution procedures
Prototype example •

Hungarian algorithm
Transportation vs. Assignment problem

• Objective: To assign each machine to the available location to minimize the total cost of
material handling.

Task (Location)
1 2 3 4
Assignee 1 13 16 12 11
(Machine)
2 15 M 13 20
3 5 7 10 6
4(D) 0 0 0 0

Cost table for the Job Shop Company assign. problem

no. of task = no. of assignees


[1]

Operations research I 4/32


• Description
• Mathematical model
• Solution procedures
Mathematical model •

Hungarian algorithm
Transportation vs. Assignment problem

• Decision variables:
1 if assignee 𝑖 performs task 𝑗
𝑥𝑖𝑗 = ቊ binary variables
0 if not
for 𝑖 = 1,2, … 𝑛 and 𝑗 = 1,2, … , 𝑛

• Binary variables are used in the decision yes/no problems

• In the assignment problems:


• yes/no problem formulation: Should assignee 𝑖 perform task 𝑗?

[1]

Operations research I 5/32


• Description
• Mathematical model
• Solution procedures
Mathematical model •

Hungarian algorithm
Transportation vs. Assignment problem

• 𝑍 denotes total cost

• The assignment model is:


𝑛 𝑛

Minimize 𝑍 = ෍ ෍ 𝑐𝑖𝑗 𝑥𝑖𝑗


𝑖=1 𝑗=1
subject to
𝑛

෍ 𝑥𝑖𝑗 = 1 for 𝑖 = 1, 2, … , 𝑛 each assignee performs exactly


𝑗=1 one task
𝑛
each task is assigned exactly to
෍ 𝑥𝑖𝑗 = 1 for 𝑖 = 1, 2, … , 𝑛
one assignee
𝑖=1
and 𝑥𝑖𝑗 ≥ 0 for all 𝑖 and 𝑗 (𝑥𝑖𝑗 binary, for all 𝑖 and 𝑗) [1]

Operations research I 6/32


• Description
• Mathematical model
• Solution procedures
Solution procedures •

Hungarian algorithm
Transportation vs. Assignment problem

1. General simplex method


• For smaller problems

• In the previous case, the dummy machine would not be added

• The constraints to the number of machines assigned to each location


would be
3

෍ 𝑥𝑖𝑗 ≤ 1 for 𝑗 = 1,2, … 𝑛


𝑖=1

2. Transportation simplex method


• Corst table would be converted to a parameter table for an equivalent
transportation problem
[1]

Operations research I 7/32


• Description
Param. table for the assign. problem •

Mathematical model
Solution procedures
• Hungarian algorithm
formulated as transport. problem • Transportation vs. Assignment problem

Cost per unit distributed


Destination (location)
Supply
1 2 3 4
1 13 16 12 11 1
Source 2 15 M 13 20 1
(machine)
3 5 7 10 6 1
4(D) 0 0 0 0 1
Demand 1 1 1 1

[1]

Operations research I 8/32


• Description
Drawbacks of the transportation •

Mathematical model
Solution procedures
• Hungarian algorithm
simplex method • Transportation vs. Assignment problem

• Resulting optimal solution:


• 𝑥13 = 0, 𝒙𝟏𝟒 = 𝟏, 𝒙𝟐𝟑 = 𝟏, 𝒙𝟑𝟏 = 𝟏, 𝑥41 = 0, 𝑥42 = 1, 𝑥43 = 0
• Machine 1 to location 4
• Machine 2 to location 3
• Machine 3 to location 1

• We can see a lot of degenerate basic variables (𝑥𝑖𝑗 = 0) and the assignment to
a dummy location

• Transportation problem has generally 𝑚 + 𝑛 − 1 basic variables (𝑚 is number


of sources and 𝑛 is the number of destinations). In this case 2𝑛 − 1 basic
variables. Exactly 𝑛 variables equals to 1. ⇒ there is 𝑛 − 1 degenerate
variables
[1]

Operations research I 9/32


• Description
Drawbacks of the transportation •

Mathematical model
Solution procedures
• Hungarian algorithm
simplex method • Transportation vs. Assignment problem

• Resulting optimal solution:


• 𝑥13 = 0, 𝒙𝟏𝟒 = 𝟏, 𝒙𝟐𝟑 = 𝟏, 𝒙𝟑𝟏 = 𝟏, 𝑥41 = 0, 𝑥42 = 1, 𝑥43 = 0
• Machine 1 to location 4
• Machine 2 to location 3
• Machine 3 to location 1

• Degenerate variables often cause the large number of wasted iterations


(nothing is changed)

• The second problem: the transportation simplex method is a general method,


it does not exploit the additional special structure in the assignment problem

• Solution: Specialized method for assignment problems → Hungarian algorithm


[1]

Operations research I 10/32


• Description
Hungarian algorithm •

Mathematical model
Solution procedures

Example •
Hungarian algorithm
Transportation vs. Assignment problem

• JOB SHOP COMPANY bought 3 new machines. There are 4 available locations in the shop
where a machine could be installed. Some of locations are more desirable than others for
particular machines because of their proximity to work centers that will have a heavy
work flow to and from these machines.

• Objective: To assign each machine to the available location to minimize the total cost of
material handling.
Task (Location)
1 2 3 4
Assignee 1 13 16 12 11
(Machine)
2 15 M 13 20
3 5 7 10 6
4(D) 0 0 0 0 [1]

Operations research I 11/32


• Description
Hungarian algorithm •

Mathematical model
Solution procedures

Example •
Hungarian algorithm
Transportation vs. Assignment problem

• It converts the original cost table into a series of equivalent cost tables [1]

• Final equivalent cost table is one consisting of only positive or zero elements
where all assignments can be mate to the zero element positions.
• The key step of method:

• We can add or subtract any Task (Location)


constant to any row or 1 2 3 4
column without changing
Assignee 1 13 16 12 11
the original problem
(Machine)
2 15 M 13 20
• The optimal solution for a 3 5 7 10 6
new cost table must be
optimal for the original 4(D) 0 0 0 0
table

Operations research I 12/32


• Description
Hungarian algorithm •

Mathematical model
Solution procedures

Example – row reduction •
Hungarian algorithm
Transportation vs. Assignment problem

• Beginning:
• We will subtract the smallest value in each row from each value in the row

Task (Location) Task (Location)


1 2 3 4 1 2 3 4
1 13 16 12 11 -11 1 2 5 1 0
2 15 M 13 20 -13 2 2 M 0 7
3 5 7 10 6 -5 3 0 2 5 1
4(D) 0 0 0 0 -0 4(D) 0 0 0 0

We will get zero in every row.

[1]

Operations research I 13/32


• Description
Hungarian algorithm •

Mathematical model
Solution procedures

Example – column reduction •
Hungarian algorithm
Transportation vs. Assignment problem

• The second step:


• If there is a column whithout zero value, we will subtract the smallest value in
each column from each value in the column

Task (Location) • We have zero in every row and every


1 2 3 4 column
1 2 5 1 0
• If the zero elements provide a complete
2 2 M 0 7 set of assignments, the assignments
3 0 2 5 1 constitute an optimal solution
4(D) 0 0 0 0

• Optimal solution:
• Machine 1 to location 4, Machine 2 to location 3, Machine 3 to location 1 [1]

Operations research I 14/32


• Description
Hungarian algorithm •

Mathematical model
Solution procedures
Example 2 – creation of additional zero •

Hungarian algorithm
Transportation vs. Assignment problem
elements

• We do not add or subtract a constant to the row or column, we add or subtract a


constant from a combination of rows and columns.

1 2 3 4 5 • We draw a line through some rows


1 80 0 30 120 0 and columns to cover all the zeros
2 80 0 30 120 0
• The not crossed out minimum
3 60 60 M 80 0 element is 30 in two top positions in
4 60 60 M 80 0 column 3

5 0 90 0 0 M • We will subtract 30 from each value in


We prefer to make a minimal the table to create the zero values at
number of lines these positions
[1]

Operations research I 15/32


Hungarian algorithm •

Description
Mathematical model
• Solution procedures
Example 2 – creation of additional zero • Hungarian algorithm
• Transportation vs. Assignment problem
elements

• We will get negative values in some columns and rows. To restore the previous zero
elements and eliminate negative ones, we will add 30 to each row or column with a
line covering it – row 3 and columns 2 and 5
1 2 3 4 5 1 2 3 4 5

1 50 -30 0 90 -30 1 50 0 0 90 0

2 50 -30 0 90 -30 2 50 0 0 90 0

3 30 30 M 50 -30 3 30 60 M 50 0

4 30 30 M 50 -30 4 30 60 M 50 0

5 -30 60 -30 -30 M 5 0 120 0 0 M

• The shortcut:
• Subtract value 30 from elements without a line through them and add 30 to [1]
every element liying at the intersection of two lines

Operations research I 16/32


• Description
Hungarian algorithm •

Mathematical model
Solution procedures

Example 2 – Repeat the process •
Hungarian algorithm
Transportation vs. Assignment problem

• We do not have an optimal solution, it is possible to make 4 assignments, but we


neet 5

1 2 3 4 5 1 2 3 4 5
1 50 0 0 90 0 1 50 0 0 90 30
2 50 0 0 90 0 2 50 0 0 90 30
3 30 60 M 50 0 3 0 30 M 20 0
4 30 60 M 50 0 4 0 30 M 20 0
5 0 120 0 0 M 5 0 120 0 0 M

We can find several optimum The optimal solution


solution in thus table
[1]

Operations research I 17/32


Transportation or Assignment Problem?

Operations research I
• Description

Transport. or Assign. Problem? •



Mathematical model
Solution procedures
• Hungarian algorithm
Example – description • Transportation vs. Assignment problem

BETTER PRODUCTS CO. wants to produce 4 new products using 3 plants


• All products require the comparable production effort per unit

• The available production capacity


of plants is measured by the Unit Cost ($) Capacity
number of units of any product for Product available
that can be produced per day
1 2 3 4
• Each plant can produce each 1 41 27 28 24 75
product except Plant 2, which Plant 2 40 29 - 23 75
cannot produce product 3
3 37 30 27 21 45
• The variable costs per unit differ Production 20 30 30 40
from plant to plant rate
[1]

Operations research I 19/32


• Description

Transport. or Assign. Problem? •



Mathematical model
Solution procedures
• Hungarian algorithm
Example – management question • Transportation vs. Assignment problem

BETTER PRODUCTS CO. wants to produce 4 new products using 3 plants


• All products require the comparable production effort per unit

• Each plant can produce each product


except Plant 2, which cannot Unit Cost ($) Capacity
produce product 3 for Product available
• Management question: 1 2 3 4
1 41 27 28 24 75
1. Permit product splitting – the Plant 2 40 29 - 23 75
same product is produced by
more than 1 plant 3 37 30 27 21 45
Production 20 30 30 40
2. Prohibit product splitting rate
[1]

Operations research I 20/32


• Description

Transport. or Assign. Problem? •



Mathematical model
Solution procedures
• Hungarian algorithm
Example – management question • Transportation vs. Assignment problem

• Management question:

1. Permit product splitting – the same product is produced by more than 1 plant
• Transportation problem

2. Prohibit product splitting


• Imposes a constraint that can only increase the cost of an optimal solution
• Advantage: eliminates some hidden costs associated with product splitting
that are not reflected in the table
• In the case of the 2nd option every plant should assigned at least one of the
products.
• Assignment problem

[1]

Operations research I 21/32


• Description

Transport. or Assign. Problem? •



Mathematical model
Solution procedures
• Hungarian algorithm
Example – Option 1 – Dummy variable and 𝑀 • Transportation vs. Assignment problem

Transportation problem [1]

Unit Cost ($) Capacity


for Product available
1 2 3 4
1 41 27 28 24 75
Plant 2 40 29 M 23 75 75 +75 + 45 = 195
3 37 30 27 21 45
Production 20 30 30 40 The total capacity exceeds the
rate total production rate ⇒ we will
use the dummy product with
production rate 75
20 + 30 + 30 + 40 = 120

Operations research I 22/32


• Description
Transport. or Assign. Problem? •

Mathematical model
Solution procedures
Example – Option 1 – Optimal solution •

Hungarian algorithm
Transportation vs. Assignment problem
mathematically
Transportation problem

Unit Cost ($) Capacity • Optimal solution:


for Product available
1 2 3 4 5(D) • 𝑥12 = 30
• 𝑥13 = 30
1 41 27 28 24 0 75 • 𝑥15 = 15
Plant 2 40 29 M 23 0 75 • 𝑥24 = 15
3 37 30 27 21 0 45 • 𝑥25 = 60
• 𝑥31 = 20
Production 20 30 30 40 75 • 𝑥34 = 25
rate

• We can use the transportation simplex method [1]

Operations research I 23/32



Transportat. or Assign. Problem? •

Description
Mathematical model
Solution procedures
Example – Option 1 – Optimal solution in •

Hungarian algorithm
Transportation vs. Assignment problem
words
Transportation problem

• Optimal solution:

• Plant 1 will produce all of products 2 and 3


𝑥12 = 30, 𝑥13 = 30

• Plant 2 will produce 37.5% of product 4


𝑥24 = 15

• Plant 3 will produce 62.5% od product 4 and all of product 1


𝑥31 = 20, 𝑥34 = 25

• Total cost is 𝑍 = $3260 per day [1]

Operations research I 24/32


• Description
Transport. or Assign. Problem? •

Mathematical model
Solution procedures
• Hungarian algorithm
Example – Option 2 – model creation • Transportation vs. Assignment problem

[1]
Transportation problem

• Each plant must be assigned to produce at least one product

• 4 producst X 3 plants Unit Cost ($) Capacity


for Product available
• The capacity of Plant 3 is
1 2 3 4
sufficient to produce only 1
product 1 41 27 28 24 75
Plant 2 40 29 - 23 75
• One of the plants 1 and 2 will
3 37 30 27 21 45
produce 2 products
Production 20 30 30 40
rate

Operations research I 25/32


• Description
Transport. or Assign. Problem? •

Mathematical model
Solution procedures
• Hungarian algorithm
Example – Option 2 – preparation of table • Transportation vs. Assignment problem

Assignment problem

• One of the plants 1 and 2 will produce 2 products


• Plant 1 and Plant 2 will be divided into two parts

• Now we have 5 plants and 4 products → dummy product will be added

• In the assignment problem the cost 𝑐𝑖𝑗 is the total cost associated with
assignee 𝑖 to perform the task 𝑗 → we must calculate them and to change
the table

[1]

Operations research I 26/32


• Description
Transport. or Assign. Problem? •

Mathematical model
Solution procedures
• Hungarian algorithm
Example – Option 2 – Table • Transportation vs. Assignment problem

Assignment problem
• In the assignment problem the cost 𝑐𝑖𝑗 is the total cost associated with assignee 𝑖
to perform the task 𝑗 → we must calculate them and to change the table

• Cost of Plant 1 producing one unit Unit Cost ($) Capacity


of product 1 is $41 for Product available
1 2 3 4
• Requirement to a daily production
1 41 27 28 24 75
of product 1 is 20 units
Plant 2 40 29 - 23 75
• Total daily cost of assigning plant 3 37 30 27 21 45
1 to product 1 is 20 *$41 = $820
Production 20 30 30 40
rate

Operations research I 27/32


• Description
Transport. or Assign. Problem? •

Mathematical model
Solution procedures
• Hungarian algorithm
Example – Option 2 – Table • Transportation vs. Assignment problem

Assignment problem

Unit Cost ($) • Plant 1 and Plant 2 can


for Product produce 2 products → they
1 2 3 4 5(D) have been splitted

1a 820 810 840 960 0 • Plant 3 must produce real


Plant 1b 820 810 840 960 0 product, therefore we have
2a 800 870 M 920 0 add M to the dummy
product
2b 800 870 M 920 0
3 740 900 810 840 M

[1]

Operations research I 28/32


• Description
Transport. or Assign.Problem? •

Mathematical model
Solution procedures
• Hungarian algorithm
Example – Option 2 – Optimal solution • Transportation vs. Assignment problem

Assignment problem

Unit Cost ($) • Optimal solution:


for Product
1 2 3 4 5(D) • Plant 1 will produce
products 2 and 3
1a 820 810 840 960 0
Plant 1b 820 810 840 960 0 • Plant 2 will produce
product 1
2a 800 870 M 920 0
2b 800 870 M 920 0 • Plant 3 will produce
3 740 900 810 840 M product 4

The total cost is 𝑍 = $3290 [1]

Operations research I 29/32


• Description
Transport. or Assign. Problem? •

Mathematical model
Solution procedures
• Hungarian algorithm
Comparison • Transportation vs. Assignment problem

Transportation problem Assignment problem

Optimal solution: Optimal solution:

• Plant 1 will produce products 2 and 3 • Plant 1 will produce products 2 and 3

• Plant 2 will produce product 4 • Plant 2 will produce product 1

• Plant 3 will produce product 4 and • Plant 3 will produce product 4


product 1

Total cost is 𝑍 = $3260 per day The total cost is 𝑍 = $3290

Both approaches provided very similar solution


[1]

Operations research I 30/32


• Description
Transport. or Assign. Problem? •

Mathematical model
Solution procedures
• Hungarian algorithm
Comparison – hidden costs • Transportation vs. Assignment problem

Transportation problem Assignment problem

Optimal solution: Optimal solution:

• Plant 1 will produce products 2 and 3 • Plant 1 will produce products 2 and 3
• Plant 2 will produce product 4 • Plant 2 will produce product 1
• Plant 3 will produce product 4 and • Plant 3 will produce product 4
product 1

Total cost is 𝑍 = $3260 per day The total cost is 𝑍 = $3290

Hidden costs associated with splitting of the product – they are not included in
the objective function → management must take into consideration the factors,
which cannot be included in the objective function
[1]

Operations research I 31/32


Literature

[1] Hillier and Lieberman: Introduction to Operations Research, 8th edition, 2005

Operations research I 32/32

You might also like