Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
& ASSIGNMENT
PROBLEMS
Dr. Mukesh Kumar Mehlawat
Department of Operational Research,
University of Delhi
INTRODUCTION
THE TRANSPORTATION
PROBLEM
To find the most economical way of allocating 𝑚 sources to 𝑛
destinations, given:
• Capacity of each source;
• Demand of each destination;
• Transportation cost to ship one unit from a source to a destination.
Capacity of each source
Demand of each
destination
Since the cost of shipping is significant, the company wants to minimize the
transportation cost. Given the data, determine the optimal shipping plan to
minimize the total shipping cost.
A TYPICAL TRANSPORTATION
PROBLEM
Destination A Destination B Destination C Production
Source 1 $8/unit $9/unit $4/unit 72 units
Source 2 $5/unit $6/unit $8/unit 38 units
Source 3 $7/unit $9/unit $6/unit 46 units
Source 4 $5/unit $3/unit $7/unit 19 units
Demand 110 units 34 units 31 units 175 Total demand
Total production = EQUAL
BALANCED / UNBALANCED
TRANSPORTATION PROBLEM
• 3 plants
• 4 warehouses
• Objective is to determine a minimum cost shipping plan that meets the production
and allocation requirements
EXAMPLE: DATA
• 3 plants
• 4 warehouses
• Objective is to determine a minimum cost shipping plan that meets the production
and allocation requirements
75 P1
W2 - 65
125 P2
W3 - 70
100 P3
W4 - 85
Formulate the problem as a linear program.
VISUAL REPRESENTATION
• Decision variables
𝒙𝒊𝒋 : Number of units to be shipped from plant 𝒊 to warehouse 𝒋
• Constraints
• Production constraint at each plant
• Allocation constraint at each warehouse
• Non-negativity constraints for the number of units to be shipped
• Objective function
To minimize the total shipping cost (𝒁)
FORMULATION
Minimize 𝑍 = 464𝑥11 + 513𝑥12 + 654𝑥13 + 867𝑥14 + 352𝑥21 + 416𝑥22 +
690𝑥23 + 791𝑥24 + 995𝑥31 + 682𝑥32 + 388𝑥33 + 685𝑥34
𝑠. 𝑡.
𝑥11 + 𝑥12 + 𝑥13 + 𝑥14 = 75 Production
𝑥21 + 𝑥22 + 𝑥23 + 𝑥24 = 125 Constraints
𝑥31 + 𝑥32 + 𝑥33 + 𝑥34 = 100
𝑥11 + 𝑥21 + 𝑥31 = 80
𝑥12 + 𝑥22 + 𝑥32 = 65 Allocation
𝑥13 + 𝑥23 + 𝑥33 = 70 constraints
𝑥14 + 𝑥24 + 𝑥34 = 85
𝑥𝑖𝑗 ≥ 0, 𝑖 = 1,2,3; 𝑗 = 1,2,3,4 Non-negativity constraints
LINEAR PROGRAMMING
FORMULATION
𝑚 𝑛
where:
𝑚: number of origins
𝑚: number of destinations
𝑥𝑖𝑗 : quantity shipped from origin 𝑖 to destination 𝑗
𝑐𝑖𝑗 : unit cost of shipping from origin 𝑖 to destination 𝑗
𝑠𝑖 : supply at origin 𝑖
𝑑𝑗 : demand at destination 𝑗
GENERAL TRANSPORTATION
PROBLEM
SOLVING A
TRANSPORTATION
PROBLEM
After all it’s a linear program!
• Simplex method for LP
• Using Excel Solver, LINGO and other relevant software
TRANSPORTATION PROBLEMS:
SPECIAL STRUCTURE
Constraint matrix as it appears in the Simplex Table
𝒙𝟏𝟏 𝒙𝟏𝟐 𝒙𝟏𝟑 𝒙𝟏𝟒 𝒙𝟐𝟏 𝒙𝟐𝟐 𝒙𝟐𝟑 𝒙𝟐𝟒 𝒙𝟑𝟏 𝒙𝟑𝟐 𝒙𝟑𝟑 𝒙𝟑𝟒
1 1 1 1
1 1 1 1
1 1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
TRANSPORTATION PROBLEMS:
SPECIAL STRUCTURE
More efficient special-purpose
algorithms than LP (though
applicable) exist for solving the
Transportation and Assignment
applications.
As in the simplex algorithm, they
involve :
SPECIAL- finding an initial solution
PURPOSE testing this solution to see if it
is optimal
ALGORITHMS developing an improved
solution
This process continues until an
optimal solution is reached.
Unlike the simplex method, the
Transportation and Assignment
methods are simpler in terms of
computation.
Streamlined versions of the
simplex method are important
IMPORTANCE for two reasons:
OF SPECIAL-
Their computation times are
generally 100 times faster
PURPOSE
than the simplex algorithm.
They require less computer
ALGORITHMS memory (and hence can
permit larger problems to be
solved).
SPECIAL-PURPOSE ALGORITHMS
FOR TRANSPORTATION PROBLEM
Factories Warehouses
(Sources) (Destinations)
Factory 2 $8 $4 $3
Factory 3 $9 $7 $5
SETTING UP A TRANSPORTATION
PROBLEM
Capacity
constraint
TO
FROM
Store A Store B Store C Total
$5 $4 $3
Factory 1 100
$8 $4 $3
Factory 2 300
$9 $7 $5
Factory 3 300
$8 $4 $3
2 200 100 300 1
$9 $7 $5
3 100 200 300 2
$8 $4 $3
2 300 1
$9 $7 $5
3 300 2
VAM Step 6:
Return to step 2 for the rows and columns remaining and
repeat the steps until an initial feasible solution has been
obtained
◼ In this case column B now has the greatest difference,
3
◼ We assign 200 units to the lowest-cost square in the
column, B
◼ We recompute the differences and find the greatest
difference is now in row 2
◼ We assign 100 units to the lowest-cost square in the
column, C
VOGEL’S APPROXIMATION METHOD
$8 $4 $3
2 200 300 1
$9 $7 $5
3 X 300 2
TO TOTAL
FROM
A B C AVAILABLE
$5 $4 $3
1 100 X X 100
$8 $4 $3
2 X 200 100 300
$9 $7 $5
3 X 300
TO TOTAL
FROM
A B C AVAILABLE
$5 $4 $3
1 100 X X 100
$8 $4 $3
2 X 200 100 300
$9 $7 $5
3 200 X 100 300
Transportation
Problems If total supply is greater than total demand, a
dummy destination (warehouse), with demand
exactly equal to the surplus, is created
Unbalanced
Transportation
Any units assigned to a dummy destination
represent excess capacity
Problems
75 P1
W2 - 65
125 P2
W3 - 100
100 P3
W4 - 85
75 P1
W2 - 65
125 P2
W3 - 100
100 P3
W4 - 85
30 D
What would be the cost associated with these arcs?
75 P1
W2 - 65
125 P2
W3 - 100
100 P3
0
0 W4 - 85
0
30 D 0
75 P1
W2 - 65
125 P2
W3 - 70
150 P3
W4 - 85
75 P1
W2 - 65
125 P2
W3 - 70
150 P3
W4 - 85
75 P1
W2 - 65
125 P2
W3 - 70
150 P3
0 W4 - 85
0 0
D - 50
APPLICATION: PRODUCTION
SCHEDULING
1. Source 𝒊:
2. Destination 𝒋:
3. Supply at source 𝒊, 𝒔𝒊 :
4. Demand at destination 𝒋, 𝒅𝒋 :
REQUIRED INFORMATION
1. Source 𝒊: Production in month 𝑖
INFORMATION IN PRODUCTION
SCHEDULING SCENARIO
D1 -10
25 P1
35 P2 1.11
D2 -15
30 P3 1.10
D3 -25
10 P4
D4 -20
NETWORK FIGURE
TRANSPORTATION PROBLEMS: MORE
APPLICATIONS
MWD administers water distribution in a large region. Water is imported from three rivers
and is then resold to four cities in the region.
It is possible to supply any of these cities from any of the rivers except for City 4 which
can not be supplied water from River 3. Water distribution costs differ for different city-
river combinations and are given in the table below.
MWD is committed to provide each city a certain minimum amount of water to meet its
essential needs. Each city also has an upper limit on the amount of water that it can
receive which depends on its storage capacity.
Cost (tens of Rs) per Acre Foot
City 1 City 2 City 3 City 4 Supply
River 1 16 13 22 17 50
River 2 14 13 19 15 60
River 3 19 20 23 --- 50
Minimum needed 30 70 0 10 (in units of Mn
Requested 50 70 30 acre feet)
Determine the distribution plan if all the available water is to be distributed in such a
way as to at least meet the essential needs of each city while minimizing the total cost
to MWD.
WATER DISTRIBUTION AT MWD
Preferred distribution plan would be to meet each
city’s requested demand
Can never meet City 4’s requested demand
Repeat the process until all the artificial variables leave the basis
So much to get to a “feasible” solution!
River 2 14 14 13 19 15 60 1
River 3 19 19 20 23 M 50 0
Dummy M 0 M 0 0 50 20 0
Demand 30 20 70 30 60
Select x44 = 30
Column 2 14 0 19 15
Difference
VOGEL’S APPROXIMATION METHOD
River 2 14 14 13 19 15 60 1
River 3 19 19 20 23 M 50 0
Dummy M 0 M 0 0 20 0
Demand 30 20 70 30 60 40
Select x45 = 20
Column 2 14 0 19 15
Difference
VOGEL’S APPROXIMATION METHOD
River 2 14 14 13 19 15 60 1
River 3 19 19 20 23 M 50 0
Dummy M 0 M 0 0 20 0
Demand 30 20 70 20 30 40
Select x13 = 50
Column 2 2 0 19 2
Difference
VOGEL’S APPROXIMATION METHOD
River 2 14 14 13 19 15 60 20 1
River 3 19 19 20 23 M 50 0
Dummy M 0 M 0 0 20 0
Demand 30 20 20 30 40
Select x25 = 40
Column 5 5 7 19 M – 15
Difference
VOGEL’S APPROXIMATION METHOD
River 2 14 14 13 19 15 20 1
River 3 19 19 20 23 M 50 0
Dummy M 0 M 0 0 20 0
Demand 30 20 20 0 30 40
Select x23 = 20
Column 5 5 7 19 M – 15
Difference
VOGEL’S APPROXIMATION METHOD
River 2 14 14 13 19 15 20 1
River 3 19 19 20 23 M 50
Dummy M 0 M 0 0 20 0
Demand 30 20 20 0 30 40
Select x31 = 30
Column 7 19 M – 15 x32 = 20, x33 = 0
Difference
OPTIMALITY TEST
City 1 City 1
City 2 City 3 City 4 Supply
(min) (extra)
16 16 13 40 22 17 10 50
River 1
River 2 1430 14 13 30 19 15 60
19 19 20 20 23 30 M 50
River 3 0
Dummy M 0 M 0 0 50 50
Demand 30 20 70 30 60
REVISITING MWD’S DISTRIBUTION PROBLEM
City 1 City 1
City 2 City 3 City 4 Supply
(min) (extra)
16 16 13 22 17 50
River 1 10
40
14 14 13 19 15 60
River 2
30 30
19 19 20 23 M 50
River 3 30
0 20
M 0 M 0 0 50
Dummy
50
Demand 30 20 70 30 60 𝑍 = 2570
COMPUTING DUAL VARIABLES
City 1 City 1
City 2 City 3 City 4 Supply 𝑢𝑖
(min) (extra)
16 16 13 22 17 50
River 1 10
40
14 14 13 19 15 60
River 2
30 30
19 19 20 23 M 50
River 3 30
0 20
M 0 M 0 0 50
Dummy
50
Demand 30 20 70 30 60 𝑍 = 2570
𝒗𝒋
CHECKING OPTIMALITY CONDITIONS: NOT
OPTIMAL
City 1 City 1
City 2 City 3 City 4 Supply 𝑢𝑖
(min) (extra)
16 16 13 22 17 50 -5
River 1
+2 +2 40 +4 10
14 14 13 19 15 60 -5
River 2
30 0 30 +1 -2
19 19 20 23 M 50 0
River 3 +2 30
0 20 M - 22
M 0 M 0 0 50 -22
Dummy
M+3 +3 M+4 -1 50
Demand 30 20 70 30 60 𝑍 = 2570
𝒗𝒋 19 19 18 23 22
CHECKING OPTIMALITY CONDITIONS:
INCOMING VARIABLE
City 1 City 1
City 2 City 3 City 4 Supply 𝑢𝑖
(min) (extra)
16 16 13 22 17 50 -5
River 1
+2 +2 40 +4 10
14 14 13 19 15 60 -5
River 2
30 0 30 +1 -2
19 19 20 23 M 50 0
River 3 +2 30
0 20 M - 22
M 0 M 0 0 50 -22
Dummy
M+3 +3 M+4 -1 50
Demand 30 20 70 30 60 𝑍 = 2570
𝒗𝒋 19 19 18 23 22
CHECKING OPTIMALITY CONDITIONS:
OUTGOING VARIABLE
City 1 City 1
City 2 City 3 City 4 Supply 𝑢𝑖
(min) (extra)
13 22 17 50 -5
River 1 16
+2
16
+2 +
40 +4 -
10
14 14 13 19 15 60 -5
River 2
30 0 -
30 +1 -2 +
19 19 20 23 M 50 0
River 3 +2 30
0 20 M - 22
M 0 M 0 0 50 -22
Dummy
M+3 +3 M+4 -1 50
Demand 30 20 70 30 60 𝑍 = 2570
𝒗𝒋 19 19 18 23 22
NEW BASIC FEASIBLE SOLUTION
City 1 City 1
City 2 City 3 City 4 Supply 𝑢𝑖
(min) (extra)
16 16 13 22 17 50
River 1
50
14 14 13 19 15 60
River 2
30 20 10
19 19 20 23 M 50
River 3 30
0 20
M 0 M 0 0 50
Dummy
50
Demand 30 20 70 30 60 𝑍 = 2550
𝒗𝒋
CHECKING OPTIMALITY CONDITIONS:
COMPUTING DUAL VARIABLES
City 1 City 1
City 2 City 3 City 4 Supply 𝑢𝑖
(min) (extra)
16 16 13 22 17 50 -5
River 1
50
14 14 13 19 15 60 -5
River 2
30 20 10
19 19 20 23 M 50 0
River 3 30
0 20
M 0 M 0 0 50 -20
Dummy
50
Demand 30 20 70 30 60 𝑍 = 2550
𝒗𝒋 19 19 18 23 20
CHECKING OPTIMALITY CONDITIONS
City 1 City 1
City 2 City 3 City 4 Supply 𝑢𝑖
(min) (extra)
16 16 13 22 17 50 -5
River 1
+2 +2 50 +4 +2
14 14 13 19 15 60 -5
River 2
30 0 20 +1 10
19 19 20 23 M 50 0
River 3 +2 30
0 20 M - 20
M 0 M 0 0 50 -20
Dummy
M+1 +1 M+2 -3 50
Demand 30 20 70 30 60 𝑍 = 2550
𝒗𝒋 19 19 18 23 20
CHECKING OPTIMALITY CONDITIONS:
INCOMING VARIABLE
City 1 City 1
City 2 City 3 City 4 Supply 𝑢𝑖
(min) (extra)
16 16 13 22 17 50 -5
River 1
+2 +2 50 +4 +2
14 14 13 19 15 60 -5
River 2
30 0 20 +1 10
19 19 20 23 M 50 0
River 3 +2 30
0 20 M - 20
M 0 M 0 0 50 -20
Dummy
M+1 +1 M+2 -3 50
Demand 30 20 70 30 60 𝑍 = 2550
𝒗𝒋 19 19 18 23 20
CHECKING OPTIMALITY CONDITIONS:
OUTGOING VARIABLE
City 1 City 1
City 2 City 3 City 4 Supply 𝑢𝑖
(min) (extra)
16 16 13 22 17 50 -5
River 1
+2 +2 50 +4 +2
14 14 13 19 15 60 -5
River 2
30 - 0 20 +1 +
10
19 19 20 23 M 50 0
River 3 +0 20 +2 30 - M - 20
M 0 M 0 0 50 -20
Dummy
M+1 +1 M + 2 -3 + -
50
Demand 30 20 70 30 60 𝑍 = 2550
𝒗𝒋 19 19 18 23 20
NEW BASIC FEASIBLE SOLUTION
City 1 City 1
City 2 City 3 City 4 Supply 𝑢𝑖
(min) (extra)
16 16 13 22 17 50
River 1
50
14 14 13 19 15 60
River 2
20 40
19 19 20 23 M 50
River 3 0
30 20
M 0 M 0 0 50
Dummy
30 20
Demand 30 20 70 30 60 𝑍 = 2460
𝒗𝒋
COMPUTING DUAL VARIABLES
City 1 City 1
City 2 City 3 City 4 Supply 𝑢𝑖
(min) (extra)
16 16 13 22 17 50 -8
River 1
50
14 14 13 19 15 60 -8
River 2
20 40
19 19 20 23 M 50 0
River 3 0
30 20
M 0 M 0 0 50 -23
Dummy
30 20
Demand 30 20 70 30 60 𝑍 = 2460
𝒗𝒋 19 19 21 23 23
CHECKING OPTIMALITY CONDITIONS
City 1 City 1
City 2 City 3 City 4 Supply 𝑢𝑖
(min) (extra)
16 16 13 22 17 50 -8
River 1
+5 +5 50 +7 +2
14 14 13 19 15 60 -8
River 2
+3 +3 20 +4 40
19 19 20 23 M 50 0
River 3
30 20 -1 0 M - 23
M 0 M 0 0 50 -23
Dummy
M+4 +4 M+2 30 20
Demand 30 20 70 30 60 𝑍 = 2460
𝒗𝒋 19 19 21 23 23
CHECKING OPTIMALITY CONDITIONS:
INCOMING VARIABLE
City 1 City 1
City 2 City 3 City 4 Supply 𝑢𝑖
(min) (extra)
16 16 13 22 17 50 -8
River 1
+5 +5 50 +7 +2
14 14 13 19 15 60 -8
River 2
+3 +3 20 +4 40
19 19 20 23 M 50 0
River 3
30 20 -1 0 M - 23
M 0 M 0 0 50 -23
Dummy
M+4 +4 M+2 30 20
Demand 30 20 70 30 60 𝑍 = 2460
𝒗𝒋 19 19 21 23 23
CHECKING OPTIMALITY CONDITIONS:
OUTGOING VARIABLE
City 1 City 1
City 2 City 3 City 4 Supply 𝑢𝑖
(min) (extra)
16 16 13 22 17 50 -8
River 1
+5 +5 50 +7 +2
14 14 13 19 15 60 -8
River 2
+3 +3 20 - +4 +
40
19 19 20 23 M 50 0
River 3
30 20 -1 + 0- M - 23
M 0 M 0 0 50 -23
Dummy
M+4 +4 M+2
+30 -
20
Demand 30 20 70 30 60 𝑍 = 2460
𝒗𝒋 19 19 21 23 23
DEGENERATE CASE: NO CHANGE IN THE
OBJECTIVE FUNCTION VALUE
City 1 City 1
City 2 City 3 City 4 Supply 𝑢𝑖
(min) (extra)
16 16 13 22 17 50 -7
River 1
+4 +4 50 +7 +2
14 14 13 19 15 60 -7
River 2
+2 +2 20 +4 40
Optimal
20
Solution!! 50 0
River 3 19 19 23 M
30 20 0 +1 M - 22
M 0 M 0 0 50 -22
Dummy
M+3 +3 M+2 30 20
Demand 30 20 70 30 60 𝑍 = 2460
𝒗𝒋 19 19 20 22 22
ASSIGNMENT
PROBLEM
What is the impact of degeneracy?
UNANSWERED QUESTIONS
𝑚 𝑛
where:
𝑚: number of origins
𝑚: number of destinations
𝑥𝑖𝑗 : quantity shipped from origin 𝑖 to destination 𝑗
𝑐𝑖𝑗 : unit cost of shipping from origin 𝑖 to destination 𝑗
𝑠𝑖 : supply at origin 𝑖
𝑑𝑗 : demand at destination 𝑗
where:
𝑚: number of origins
𝑚: number of destinations
𝑥𝑖𝑗 : quantity shipped from origin 𝑖 to destination 𝑗
𝑐𝑖𝑗 : unit cost of shipping from origin 𝑖 to destination 𝑗
SPECIAL CASE OF
TRANSPORTATION PROBLEM
WHAT CAN BE SAID ABOUT THE SPECIAL
CASE?
𝑥𝑖𝑗: integer
In fact “binary” i.e., either 0 or 1
So what do we do?
But before that lets look at the applications of this special case
Problem of allocating assignees to tasks
• Assignee could be people, machines, plants, time slots
etc.
ASSIGNMENT PROBLEMS:
APPLICATIONS
ASSIGNMENT PROBLEMS:
APPLICATIONS
A company must decide the location for its three
new machines. There are four slots available in the
shop. Some of these slots are more desirable than
others for particular machines due to their
proximity to work centers that will have a heavy
workflow to and from these machines. There is no
workflow between the new machines. The
objective is to minimize the total cost of material
handling.
Machine 1 13 16 12 11
Machine 2 15 --- 13 20
Machine 3 5 7 10 6
ASSIGNMENT PROBLEMS:
APPLICATIONS
Optimal solution
Machine 1 13 16 12 11
Machine 2 15 --- 13 20
Machine 3 5 7 10 6
HUNGARIAN METHOD:
SPECIAL ALGORITHM FOR
ASSIGNMENT PROBLEMS
Observations
Each row will have exactly
one allocation
Each column will have exactly
one allocation
If possible, optimal solution
would consist of allocating to
the lowest cost elements in
HUNGARIAN each row
If this cost table has any column without a zero element, perform a
column reduction by subtracting the smallest number in each such
column from every number in the column.
HUNGARIAN METHOD
1 2 3 4
1 13 16 12 11
2 15 M 13 20
3 5 7 10 6
Dummy 0 0 0 0
HUNGARIAN METHOD: AN
EXAMPLE
1 2 3 4
1 2 5 1 0
2 2 M 0 7
3 0 2 5 1
Dummy 0 0 0 0
1 2 5 1 0
2 2 M 0 7
3 0 2 5 1
Dummy 0 0 0 0
HUNGARIAN METHOD: AN
EXAMPLE
1. Subtract the smallest number in each row from
every number in the row (it’s called row
reduction).
What if it doesn’t?
HUNGARIAN METHOD
1 2 3 4 5
1 80 0 30 120 0
2 80 0 30 120 0
3 60 60 M 80 0
4 60 60 M 80 0
5 0 90 0 0 M
Complete set of assignments is not possible with zero cost; at
most three assignments are possible.
1 2 3 4 5
1 80 0 30 120 0
2 80 0 30 120 0
3 60 60 M 80 0
4 60 60 M 80 0
5 0 90 0 0 M
1 2 3 4 5
1 50 0 0 90 0
2 50 0 0 90 0
3 30 60 M 50 0
4 30 60 M 50 0
5 0 120 0 0 M
Complete set of assignments is still not possible with zero cost; at
most four assignments are possible. So REPEAT this procedure.
1 2 3 4 5
1 20 0 0 60 0
2 20 0 0 60 0
3 0 60 M 20 0
4 0 60 M 20 0
5 0 150 30 0 M