You are on page 1of 56

Chapter-5

Transportation Model
ME F344 Engineering Optimization
Dr. Priyank Upadhyaya

Dr. Priyank Upadhyaya 1


Transportation Problem
The data of the model 𝑆1
 Factories: 𝐹1 and 𝐹2
 Supply: 𝐹1 2000 and 𝐹2 (2500) 𝐹1
 Distribution stores: 𝑆1 , 𝑆2 and 𝑆3 𝑆2
 Demand: 𝑆1 (1500), 𝑆2 (2000) and 𝑆3 (1000)
 Unit transportation cost of the commodity from
each factory to each store 𝐹2
• 𝐹1 𝑆1 = $8 𝐹1 𝑆2 = $6 𝐹1 𝑆3 = $10 𝑆3
• 𝐹2 𝑆1 = $10 𝐹2 𝑆2 = $4 𝐹2 𝑆3 = $9
4500
Minimize cost: 8𝑥11 + 6𝑥12 + 10𝑥13 + 10𝑥21 + 4𝑥22 + 9𝑥23 Balanced Problem
Dr. Priyank Upadhyaya
Demand = Supply 2
Transportation Problem
𝑐𝑖𝑗 : Unit cost for 𝑥𝑖𝑗 : Number of units
transportation from 𝑖 𝑡ℎ
𝑚 Sources 𝑛 Desinations
transported from 𝑖 𝑡ℎ
source to 𝑗𝑡ℎ destination source to 𝑗𝑡ℎ destination
𝑐11 : 𝑥11
𝑎1 1 1 𝑏1

𝑎𝑖 : Capacity of 𝑖 𝑡ℎ source 𝑏𝑗 : Demand at 𝑗𝑡ℎ destination

𝑎2 2 2 𝑏2
Units …… Units
of

……
of
Supply demand
𝑎𝑚 𝑚 𝑐𝑚𝑛 : 𝑥𝑚𝑛
𝑛 𝑏𝑛

Dr. Priyank Upadhyaya 3


Transportation Problem
The Transportation Model
𝑚 𝑛

Minimize 𝑧= 𝑐𝑖𝑗 𝑥𝑖𝑗


𝑖=1 𝑗=1

Subjected to constraints
𝑛

𝑥𝑖𝑗 = 𝑎𝑖 Balanced Model


𝑚 𝑛
𝑗=1
𝑚 𝑎𝑖 = 𝑏𝑗
𝑥𝑖𝑗 = 𝑏𝑗 𝑖=1 𝑗=1

𝑖=1
Dr. Priyank Upadhyaya 4
Example 5.1-1
MG Auto has three plants in Los Angeles, Detroit and New Orleans and two major distribution
centers in Denver and Miami. The capacities of three plants during the next quarter are 1000,
1500 and 1200 cars. The quarterly demands at the two distribution centers are 2300 and
1400 cars. The mileage chart between the plants and the distribution canters is given in Table.
The trucking company in charge of transporting the cars charges 8 cents per mile per car.

Mileage Chart Cost Chart


Denver Miami Denver Miami
Los Angeles 1000 2690 Los Angeles $80 $215
Detroit 1250 1350 Detroit $100 $108
New Orleans 1275 850 New Orleans $102 $68
Dr. Priyank Upadhyaya 5
Example 5.1-1
Minimize cost 𝑧 = 80𝑥11 + 215𝑥12 + 100𝑥21 + 108𝑥22 + 102𝑥31 + 68𝑥32
Transportation Tableau
Denver Miami Supply 
$80 $215
Los Angeles 1000 𝑥11 + 𝑥12 = 1000
𝑥11 𝑥12
$100 $108
Detroit 1500 𝑥21 + 𝑥22 = 1500
𝑥21 𝑥22
$102 $68
New Orleans 1200 𝑥31 + 𝑥32 = 1200
𝑥31 𝑥32
Demand 2300 1400 3700
𝑥11 + 𝑥21 + 𝑥31 = 2300 𝑥12 + 𝑥22 + 𝑥32 = 1400
Dr. Priyank Upadhyaya 6
Example 5.3-1
SunRay Transportation Company ships truckloads of grain from three silos to four
mills. The supply (in truckloads) and the demand together with unit transportation
cost on different routes are summarized in the transportation mode in table below.
Transportation Tableau
Mill-1 Mill-2 Mill-3 Mill-4 Supply 
𝑐11 $10 𝑐12 $2 𝑐13 $20 𝑐14 $11
Silo-1 15
𝑥11 𝑥12 𝑥13 𝑥14
𝑐21 $12 𝑐22 $7 𝑐23 $9 𝑐24 $20
Silo-2 25
𝑥21 𝑥22 𝑥23 𝑥24
𝑐31 $4 𝑐32 $14 𝑐33 $16 𝑐34 $18
Silo-3 10
𝑥31 𝑥32 𝑥33 𝑥34
Demand 5 15 15 15 50
Dr. Priyank Upadhyaya 7
Starting Solution
1. Northwest-Corner Method: Start at the northwest corner cell and allocate
as much as possible to the selected cell keeping a track on demand and
supply limits.
Transportation Tableau
Mill-1 Mill-2 Mill-3 Mill-4 Supply 
𝑐11 $10 𝑐12 $2 𝑐13 $20 𝑐14 $11
Silo-1 15
𝑥11 5 𝑥12 10 𝑥13 0 𝑥14 0
𝑐21 $12 𝑐22 $7 𝑐23 $9 𝑐24 $20
Silo-2 25
𝑥21 0 𝑥22 5 𝑥23 15 𝑥24 5
𝑐31 $4 𝑐32 $14 𝑐33 $16 𝑐34 $18
Silo-3 10
𝑥31 0 𝑥32 0 𝑥33 0 𝑥34 10
Demand 5 15 15 15 50
Dr. Priyank Upadhyaya 8
Starting Solution
2. Least Cost Method: Finds a better starting solution by targeting the cheapest
routes. It assigns as much as possible to the cell with the smallest unit cost.
Transportation Tableau
Mill-1 Mill-2 Mill-3 Mill-4 Supply 
𝑐11 $10 𝑐12 $2 𝑐13 $20 𝑐14 $11
Silo-1 15
𝑥11 0 𝑥12 15 𝑥13 0 𝑥14 0
𝑐21 $12 𝑐22 $7 𝑐23 $9 𝑐24 $20
Silo-2 25
𝑥21 0 𝑥22 0 𝑥23 15 𝑥24 10
𝑐31 $4 𝑐32 $14 𝑐33 $16 𝑐34 $18
Silo-3 10
𝑥31 5 𝑥32 0 𝑥33 0 𝑥34 5
Demand 5 15 15 15 50
Dr. Priyank Upadhyaya 9
Starting Solution
3. Vogel Approximation Method (VAM): Improved version of least-cost
method. Produces better starting solution (not always).
Transportation Tableau
Mill-1 Mill-2 Mill-3 Mill-4 Supply Row Penalty
𝑐11 $10 𝑐12 $2 𝑐13 $20 𝑐14 $11
Silo-1 15 10 − 2 = 8 9 9
𝑥11 0 𝑥12 15 𝑥13 0 𝑥14 0
𝑐21 $12 𝑐22 $7 𝑐23 $9 𝑐24 $20
Silo-2 25 9−7=2 2 11
𝑥21 0 𝑥22 0 𝑥23 15 𝑥24 10
𝑐31 $4 𝑐32 $14 𝑐33 $16 𝑐34 $18
Silo-3 10 14 − 4 = 𝟏𝟎 2 2
𝑥31 5 𝑥32 0 𝑥33 0 𝑥34 5
Demand 5 15 15 15 50
10 − 4 = 6 7−2=5 16 − 9 = 7 18 − 11 = 7
5 7 7
10
Dr. Priyank Upadhyaya
The Dual Linear Program
Primal Problem
Basic 𝒛 𝒙𝟏 𝒙𝟐 𝒔𝟏 𝒔𝟐 𝒔𝟑 𝒔𝟒 RHS
𝒛 1 0 0 0 0 0.681 0.0921 77.3
𝒙𝟏 0 1 0 0 0 0.389 -0.185 20.4
𝒔𝟐 0 0 0 0 1 1.3 -1.73 56.7
𝒙𝟐 0 0 1 0 0 -0.195 0.259 6.49
𝒔𝟏 0 0 0 1 0 -1.73 0.824 9.59
𝑠3 = 𝑠4 = 0 𝑦3 ≠ 0 𝑦4 ≠ 0
Dual Problem 𝒛 𝒚𝟏 𝒚𝟐 𝒚𝟑 𝒚𝟒 𝒔𝟏 𝒔𝟐 RHS

1 9.59 56.7 0 0 20.4 6.49 77.3


0 1.73 -1.3 1 0 -0.389 0.195 0.681
0 -0.824 1.73 0 1 0.185 -0.259 0.0921
MODI(modified distribution) Method
Starting solution from Northwest method.
Current cost 𝑧 = 5 × 10 + 10 × 2 + 5 × 7 + 15 × 9 + 5 × 20 + 10 × 18 = $520
Transportation Tableau
𝑣1 = 𝑣2 = 𝑣3 = 𝑣4 =
Iteration: 0
Mill-1 Mill-2 Mill-3 Mill-4 Supply
$10 $2 $20 $11
𝑢1 = Silo-1 5 10 0 0 15

$12 $7 $9 $20
𝑢2 = Silo-2 0 5 15 5 25

$4 0 $14 $16 $18


𝑢3 = Silo-3 0 0 10 10

Demand 5 15 15 15 50
12
Dr. Priyank Upadhyaya
MODI: Multipliers Interation-1
Calculate multipliers 𝑢𝑖 and 𝑣𝑗 for current basic variables using 𝑢𝑖 + 𝑣𝑗 = 𝑐𝑖𝑗 .
Arbitrarily take 𝑢1 = 0.
Transportation Tableau
𝑣1 = 10 𝑣2 = 2 𝑣3 = 4 𝑣4 = 15
Iteration: 1
Mill-1 Mill-2 Mill-3 Mill-4 Supply
$10 $2 $20 $11
𝑢1 = 0 Silo-1 5 10 0 0 15

$12 $7 $9 $20
𝑢2 = 5 Silo-2 0 5 15 5 25

$4 0 $14 $16 $18


𝑢3 = 3 Silo-3 0 0 10 10

Demand 5 15 15 15 50
13
Dr. Priyank Upadhyaya
MODI: Opportunity cost Interation-1
Calculate the opportunity cost 𝑢𝑖 + 𝑣𝑗 − 𝑐𝑖𝑗 for all non-basic variables. Find the
highest opportunnity cost. If all 𝑢𝑖 + 𝑣𝑗 − 𝑐𝑖𝑗 ≤ 0 ⇒ we found the optimum cost.
Transportation Tableau
𝑣1 = 10 𝑣2 = 2 𝑣3 = 4 𝑣4 = 15
Iteration: 1
Mill-1 Mill-2 Mill-3 Mill-4 Supply
$10 $2 $20 $11
𝑢1 = 0 Silo-1 5 10 0 0 15
-$16 $4
$12 $7 $9 $20
𝑢2 = 5 Silo-2 0 5 15 5 25
$3
$4 $14 $16 $18
𝑢3 = 3 Silo-3 0 0 0 10 10
$9 -$9 -$9
Demand 5 15 15 15 50
𝑥31 becomes entering variable Dr. Priyank Upadhyaya
Highest Opportunity Cost 14
MODI: How to make Loop
If 𝑥31 ships 𝜃 units then the maximum vale of 𝜃 is determined based on two conditions.
 Demand and supply
 Shipments from all sources should be positive.

Guidelines to follow
 Construct a closed loop that starts and ends at the entering variable cell.
 The loop consists of horizontal and vertical segments only (no diagonals).
 Corners of the loop (excluding entering variable) must coincide with a current basic variable.
 To satisfy the demand and supply, we must alternate between adding and subtracting 𝜃
from subsequent corners.
 Loop can be clockwise or anticlockwise.
 Calculate the maximum value from the cells 𝑥𝑖𝑗 − 𝜃 ≥ 0.
15
Dr. Priyank Upadhyaya
MODI: Loop Interation-1
 Entering variable: 𝑥31
 Only one closed loop possible.
Transportation Tableau
𝑣1 = 10 𝑣2 = 2 𝑣3 = 4 𝑣4 = 15
Iteration: 1
Mill-1 Mill-2 Mill-3 Mill-4 Supply
$10 $2 $20 $11
𝑢1 = 0 Silo-1 𝟓−𝜽 𝟏𝟎 + 𝜽 0 0 15

$12 $7 $9 $20
𝑢2 = 5 Silo-2 0 𝟓−𝜽 15 𝟓+𝜽 25

$4 $14 $16 $18


𝑢3 = 3 Silo-3 𝟎+𝜽 0 0 𝟏𝟎 − 𝜽 10

Demand 5 15 15 15 50
Dr. Priyank Upadhyaya 16
MODI: Max 𝜃 Iteration-1
 Entering variable: 𝑥31 , Only one closed loop possible.
 From 5 − 𝜃 ≥ 0 and 10 − 𝜃 ≥ 0 ⇒ Maximum value of 𝜃 = 5
Transportation Tableau
𝑣1 = 10 𝑣2 = 2 𝑣3 = 4 𝑣4 = 15
Iteration: 1
Mill-1 Mill-2 Mill-3 Mill-4 Supply
$10 $2 $20 $11
𝑢1 = 0 Silo-1 𝟓−𝟓 𝟏𝟎 + 𝟓 0 0 15

$12 $7 $9 $20
𝑢2 = 5 Silo-2 0 𝟓−𝟓 15 𝟓+𝟓 25

$4 $14 $16 $18


𝑢3 = 3 Silo-3 𝟎+𝟓 0 0 𝟏𝟎 − 𝟓 10

Demand 5 15 15 15 50
17
Dr. Priyank Upadhyaya
MODI: Iteration-1 Solution
 Either 𝑥11 or 𝑥22 leaves. We choose 𝑥11 to leave.
Transportation Tableau
𝑣1 = 10 𝑣2 = 2 𝑣3 = 4 𝑣4 = 15
Iteration: 1
Mill-1 Mill-2 Mill-3 Mill-4 Supply
$10 $2 $20 $11
𝑢1 = 0 Silo-1 𝟎 𝟏𝟓 0 0 15

$12 $7 $9 $20
𝑢2 = 5 Silo-2 0 𝟎 15 𝟏𝟎 25

$4 $14 $16 $18


𝑢3 = 3 Silo-3 𝟓 0 0 𝟓 10

Demand 5 15 15 15 50

18
Dr. Priyank Upadhyaya
MODI: Cost Iteration-1
Current cost 𝑧 = 15 × 2 + 0 × 7 + 15 × 9 + 10 × 20 + 5 × 4 + 5 × 18 = $475

Transportation Tableau
𝑣1 = 𝑣2 = 𝑣3 = 𝑣4 =
Iteration: 1
Mill-1 Mill-2 Mill-3 Mill-4 Supply
$10 $2 $20 $11
𝑢1 = Silo-1 𝟎 𝟏𝟓 0 0 15

$12 $7 $9 $20
𝑢2 = Silo-2 0 𝟎 15 𝟏𝟎 25

$4 $14 $16 $18


𝑢3 = Silo-3 𝟓 0 0 𝟓 10

Demand 5 15 15 15 50
19
Dr. Priyank Upadhyaya
MODI: Multipliers Iteration-2
Calculate multipliers 𝑢𝑖 and 𝑣𝑗 for current basic variables using 𝑢𝑖 + 𝑣𝑗 = 𝑐𝑖𝑗 .
Arbitrarily take 𝑢1 = 0. Only 𝑣1 changes.
Transportation Tableau
𝑣1 =1 𝑣2 = 2 𝑣3 = 4 𝑣4 = 15
Iteration: 2
Mill-1 Mill-2 Mill-3 Mill-4 Supply
$10 $2 $20 $11
𝑢1 = 0 Silo-1 𝟎 𝟏𝟓 0 0 15

$12 $7 $9 $20
𝑢2 = 5 Silo-2 0 𝟎 15 𝟏𝟎 25

$4 $14 $16 $18


𝑢3 = 3 Silo-3 𝟓 0 0 𝟓 10

Demand 5 15 15 15 50
20
Dr. Priyank Upadhyaya
MODI: Opportunity cost Iteration-2
Calculate the opportunity cost 𝑢𝑖 + 𝑣𝑗 − 𝑐𝑖𝑗 for all non-basic variables.
𝑥14 becomes entering variable Highest Opportunity Cost
Transportation Tableau
𝑣1 = 1 𝑣2 = 2 𝑣3 = 4 𝑣4 = 15
Iteration: 2
Mill-1 Mill-2 Mill-3 Mill-4 Supply
$10 $2 $20 $11
𝑢1 = 0 Silo-1 𝟎 𝟏𝟓 0 0 15
−$𝟗 −$𝟏𝟔 $𝟒
$12 $7 $9 $20
𝑢2 = 5 Silo-2 0 𝟎 15 𝟏𝟎 25
−$𝟔
$4 $14 $16 $18
𝑢3 = 3 Silo-3 𝟓 0 0 𝟓 10
−$𝟗 −$𝟗
Demand 5 15 15 15 50
21
Dr. Priyank Upadhyaya
MODI: Loop, Max 𝜃 Iteration-2
Calculate the opportunity cost 𝑢𝑖 + 𝑣𝑗 − 𝑐𝑖𝑗 for all non-basic variables.
Max value of 𝜃 = 10 ⇒ 𝑥24 becomes leaving variable.

Transportation Tableau
𝑣1 = 1 𝑣2 = 2 𝑣3 = 4 𝑣4 = 15
Mill-1 Mill-2 Mill-3 Mill-4 Supply
$10 $2 $20 $11
𝑢1 = 0 Silo-1 𝟎 𝟏𝟓 − 𝜽 0 𝟎+𝜽 15
−$𝟗 −$𝟏𝟔 $𝟒
$12 $7 $9 $20
𝑢2 = 5 Silo-2 0 𝟎+𝜽 15 𝟏𝟎 − 𝜽 25
−$𝟔
$4 $14 $16 $18
𝑢3 = 3 Silo-3 𝟓 0 0 𝟓 10
−$𝟗 −$𝟗
Demand 5 15 15 15 50
22
Dr. Priyank Upadhyaya
MODI: Cost Iteration-2
Current cost 𝑧 = 5 × 2 + 10 × 11 + 10 × 7 + 15 × 9 + 5 × 4 + 5 × 18 = $435
Transportation Tableau
𝑣1 = 1 𝑣2 = 2 𝑣3 = 4 𝑣4 = 15
Iteration: 2
Mill-1 Mill-2 Mill-3 Mill-4 Supply
$10 $2 $20 $11
𝑢1 = 0 Silo-1 𝟎 𝟓 0 𝟏𝟎 15

$12 $7 $9 $20
𝑢2 = 5 Silo-2 0 𝟏𝟎 15 𝟎 25

$4 $14 $16 $18


𝑢3 = 3 Silo-3 𝟓 0 0 𝟓 10

Demand 5 15 15 15 50
23
Dr. Priyank Upadhyaya
MODI: Multipliers/Opportunity cost Iteration-3
Calculate the opportunity cost 𝑢𝑖 + 𝑣𝑗 − 𝑐𝑖𝑗 for all non-basic variables.

Transportation Tableau
𝑣1 = 1 𝑣2 = 2 𝑣3 = 4 𝑣4 = 15
Iteration: 3
Mill-1 Mill-2 Mill-3 Mill-4 Supply
$10 $2 $20 $11
𝑢1 = 0 Silo-1 𝟎 𝟓 0 𝟏𝟎 15
−$𝟗 −$𝟏𝟔
$12 $7 $9 $20
𝑢2 = 5 Silo-2 0 𝟏𝟎 15 𝟎 25
−$𝟔 −$𝟒
$4 $14 $16 $18
𝑢3 = 3 Silo-3 𝟓 0 0 𝟓 10
−$𝟗 −$𝟕
Demand 5 15 15 15 50

All opportuity costs are negative Dr. Priyank Upadhyaya


24
MODI: Multipliers/Opportunity cost Iteration-3
Current cost 𝑧 = 5 × 2 + 10 × 11 + 10 × 7 + 15 × 9 + 5 × 4 + 5 × 18 = $435
Transportation Tableau
𝑣1 = 1 𝑣2 = 2 𝑣3 = 4 𝑣4 = 15
Iteration: 3
Mill-1 Mill-2 Mill-3 Mill-4 Supply
$10 $2 $20 $11
𝑢1 = 0 Silo-1 𝟎 𝟓 0 𝟏𝟎 15
−$𝟗 −$𝟏𝟔
$12 $7 $9 $20
𝑢2 = 5 Silo-2 0 𝟏𝟎 15 𝟎 25
−$𝟔 −$𝟒
$4 $14 $16 $18
𝑢3 = 3 Silo-3 𝟓 0 0 𝟓 10
−$𝟗 −$𝟕
Demand 5 15 15 15 50

Optimal cost is $435. Dr. Priyank Upadhyaya


25
Summary of MODI Method
 Step-1: Find a starting solution using either Northwest corner, Least cost or VAM.
 Step-2: Determine multipliers 𝑢𝑖 and 𝑣𝑗 for basic variables (known). Take 𝑢1 = 0.
 Step-3: Calculate opportunity cost 𝑢𝑖 + 𝑣𝑗 − 𝑐𝑖𝑗 of each non-basic (zero) variable.
 Step-4: Check if all opportunity costs are < 0, if YES then STOP. You already got optimum
cost. If NO then go to next step.
 Step-5: Find the maximum (+) opportunity cost and mark the cell as entering variable.
 Step-6: Draw a closed loop with corners on current basic variables. Assign ±𝜃 alternatively to
each corner in the loop starting from entering variable.
 Step-7: Calculate the maximum possible value of 𝜃 satisfying demand/supply.
 Step-8: Find the new solution by substituting the value of 𝜃.
 Step-9: Repeat until you stop in Step-4.
26
Dr. Priyank Upadhyaya
Unbalanced Model

• Demand > Supply


• Add Dummy Supply

27
Dr. Priyank Upadhyaya
Unbalanced Model
Supply > Demand
Add Dummy Supply
https://goo.gl/forms/yZtO0Ygq9yLZgy3D3

28
Dr. Priyank Upadhyaya
Assignment Problem
Joe Klyne's three children, John, Karen, and Terri, want to earn some money to take care of
personal expenses during a school trip to the local zoo. Mr. Klyne has chosen three chores
for his children: mowing the lawn, painting the garage door, and washing the family cars.
To avoid anticipated sibling competition, he asks them to submit (secret) bids for what they
feel is fair pay for each of the three chores. The understanding is that all three children will
abide by their father's decision as to who gets which chore. Table below summarizes the
bids received. Based on this information, how should Mr. Klyne assign the chores?

29
Dr. Priyank Upadhyaya
Assignment Problem

Calculate the row minimum

30
Dr. Priyank Upadhyaya
Assignment Problem
Calculate the row minimum

Subtract the row minimum from respective rows

31
Dr. Priyank Upadhyaya
Assignment Problem
Subtract the row minimum from respective rows

Calculated the column minimum from the updated table

32
Dr. Priyank Upadhyaya
Assignment Problem
Calculated the column minimum from the updated table

Subtract the column minimum from respective columns

Underlined
zero cells give
optimum
assignment
33
Dr. Priyank Upadhyaya
Assignment Problem
The optimum assignment table

Total Cost Calculation Karen mows ($9) + John paints ($10) + Terri washes ($8) = $27

Summation
of p’s and q’s

34
Dr. Priyank Upadhyaya
Example: Assignment

Dr. Priyank Upadhyaya 35


Example: Assignment
Calculate
the row
minimum

Calculate
the column
minimum

36
Dr. Priyank Upadhyaya
Example: Assignment
Calculate
the row
minimum

No feasible assignment (with all zero entries) can be secured


Child 1 and 3 can do only Chore 1
If we assign Chore 1 to Child 1 then Child 3 will not have any Chore assigned

37
Dr. Priyank Upadhyaya
Example: Assignment
Draw
minimum
number of
lines to cover
all zeros

In this case, 4 lines can cover all entries in the matrix


Therefore, our first goal should be to get less than 4 lines to cover all zeros.
Try to draw lines with more than 1 zero cell.

38
Dr. Priyank Upadhyaya
Example: Assignment
Select the smallest uncovered entry, subtract it from every uncovered entry, then add it
to every entry at the intersection of two lines.

Subtract it
from every
uncovered
entry
39
Dr. Priyank Upadhyaya
Example: Assignment
Select the smallest uncovered entry, subtract it from every uncovered entry, then add it
to every entry at the intersection of two lines.

Add it to
every entry
at the
intersection

Dr. Priyank Upadhyaya 40


Example: Assignment
If no feasible assignment can be found among the resulting zero entries, repeat the
process with lines and subtraction. Otherwise, determine the optimal assignment





Child 1 can do only Chore-1 With Child assigned, Child 2 can only do Chore 3
Child 2 still has two options Child left with only one option of Chore 4
Child 3 has only one option of Chore 2

Dr. Priyank Upadhyaya 41


Example: Assignment
Assignment Cost: (1,1) + (2,3) + (3,2) + (4,4) = $1 + $10 + $5 + $5 = $21

Summation of Ps and Qs
 First Iteration
 P: 1,7,4,5
 Q: 3
 Second Iteration
Add/Subtract: 1

Total = 1 + 7 + 4 + 5 + 3 + 1

Dr. Priyank Upadhyaya 42


Hungarian Method: Overview
1. Row Reduction: Subtract the the row minimum from respective row.
2. Column Reduction: Subtract the the column minimum from respective column.
3. Draw minimum number of lines to cover all the zeros
4. A test for optimality.
 Number of lines = order of matrix (n): Optimum solution
 Number of the lines is < n: go to 5
5. Find the smallest element uncovered element.
 Subtract it from all uncovered elements
 Add it to the elements where lines intersect
 Go back to 3.
Dr. Priyank Upadhyaya 43
Unbalance Assignment Problem
A company has five machines that are used for four jobs. Each job can be
assigned to one and only one machine. The cost of each job on each
machine is given in the following Table.

4 2
Dr. Priyank Upadhyaya 44
Add Dummy Job to Balance

4 2
4 2

Order of matrix = 5
Dr. Priyank Upadhyaya 45
Row Reduction

4 2

Dr. Priyank Upadhyaya 46


Column Reduction

Colum reduction gives


the same matrix
because every column
has zero in the last
row

Dr. Priyank Upadhyaya 47


Draw minimum Lines

Number of lines 4 < 5

Step 5 is needed

Dr. Priyank Upadhyaya 48


Add/Substract and Draw Lines

Step 5 is needed again Number of lines 4 < 5


Dr. Priyank Upadhyaya 49
Repeat: Add/Substract and Draw Lines

Optimum Solution Number of lines = 5


Dr. Priyank Upadhyaya 50
Assignment and Cost

Total Cost = 15

Dr. Priyank Upadhyaya 51


Example: Blocked Assignments
In a plant layout, four different machines M1, M2, M3 and M4 are to be erected in a
machine shop. There are five vacant areas A, B, C, D and E. Because of limited space,
Machine M2 cannot be erected at area C and Machine M4 cannot be erected at area A.
The cost of erection of machines is given in the Table.

Dr. Priyank Upadhyaya 52


High Fictitious Costs (big M)

Add high costs (denoted by H) to the cells where assignments are blocked

Dr. Priyank Upadhyaya 53


Row/Column Reduction

Numner of lines < Order of Matrix


Dr. Priyank Upadhyaya 54
Add Subtract 1

Numner of lines = Order of Matrix

Optimum Solution
Dr. Priyank Upadhyaya 55
Assignment

Total Cost = 10

Dr. Priyank Upadhyaya 56

You might also like