Transportation, Assignment, and
Transshipment Problems
The Transportation Problem:
• The Network Model and a
• Linear Programming Formulation
The Assignment Problem:
• The Network Model and a
• Linear Programming Formulation
The Transshipment Problem:
• The Network Model and a
• Linear Programming Formulation
Transportation, Assignment, and Transshipment
Problems: “Network Models”
A network model is one which can be represented by
a set of nodes,
a set of arcs, and
functions (e.g. costs, supplies, demands, etc.)
associated with the arcs and/or nodes.
1
More “Network Models”
Transportation, assignment, and transshipment
problems of this chapter, as well as the
shortest route, minimal spanning tree, and maximal
flow problems and
PERT/CPM problems are all examples of network
problems.
Transportation, Assignment,
and Transshipment Problems
Each of these three models (transportation,
assignment, and transshipment models) can be
formulated as linear programs and solved by general
purpose linear programming codes.
For each of the three models, if the right-hand side of
the linear programming formulations are all integers,
the optimal solution will be in terms of integer values
for the decision variables.
However, there are many computer packages which
contain separate computer codes for these models
which take advantage of their network structure.
4
2
Transportation Problem
The transportation problem seeks to minimize the total
shipping costs of transporting goods
from m origins (each with a supply si)
to n destinations (each with a demand dj),
when the unit shipping cost from an origin, i, to a
destination, j, is cij.
Transportation Problem
Network Representation
1 d1
c11
s1 1 c12
c13
2 d2
c21
c22
s2 2
c23
3 d3
SOURCES DESTINATIONS
3
Transportation Problem
LP Formulation
The linear programming formulation in terms of
the amounts shipped from the origins to the
destinations, xij, can be written as:
Min cijxij
ij
s.t. xij < si for each origin i
j
xij = dj for each destination j
i
xij > 0 for all i and j
7
The Transportation Problem
Assess your understanding:
Write the objective function for the general LP
formulation of the Transportation Problem using
only words -- do not use any mathematical symbols.
Write contraints for the general LP formulation of the
Transportation Problem using only words -- do not
use any mathematical symbols.
4
Transportation Problem: Special Situations
LP Formulation Special Cases or Situations.
Special-case modifications to the linear programming
formulation can be made, such as:
• Minimum shipping guarantees from i to j:
xij > Lij
• Maximum route capacity from i to j:
xij < Lij
• Unacceptable routes:
delete the variable
Transportation Problem
To solve the transportation problem by its special
purpose algorithm, it is required that the sum of the
supplies at the origins equal the sum of the demands
at the destinations.
• If the total supply is greater than the total
demand, a dummy destination is added with
demand equal to the excess supply, and shipping
costs from all origins are zero.
• Similarly, if total supply is less than total demand,
a dummy origin is added.
When solving a transportation problem by its special
purpose algorithm, unacceptable shipping routes are
given a cost of +M (a very large number).
10
10
5
Transportation Problem
A transportation tableau is given below. Each cell
represents a shipping route (which is an arc on the
network and a decision variable in the LP
formulation), and the unit shipping costs are given in
an upper right hand box in the cell.
D1 D2 D3 Supply
15 30 20
S1 50
30 40 35
S2 30
Demand 25 45 10
11
11
Formulation Practice
Write the formulation for the following
Transportation Problem:
D1 D2 D3 Supply
15 30 20
S1 50
30 40 35
S2 30
Demand 25 45 10
12
12
6
Transportation Problem
The transportation problem is solved in two phases:
• Phase I — Obtaining an initial feasible solution
• Phase II — Moving toward optimality
In Phase I, the Minimum-Cost Procedure can be used
to establish an initial basic feasible solution without
doing numerous iterations of the simplex method.
In Phase II, the Stepping Stone Method, using the
MODI method for evaluating the reduced costs may
be used to move from the initial feasible solution to
the optimal one.
13
13
Transportation Algorithm
Phase I - Minimum-Cost Method
• Step 1: Select the cell with the least cost. Assign to
this cell the minimum of its remaining row supply or
remaining column demand.
• Step 2: Decrease the row and column availabilities
by this amount and remove from consideration all
other cells in the row or column with zero
availability/demand. (If both are simultaneously
reduced to 0, assign an allocation of 0 to any other
unoccupied cell in the row or column before deleting
both.) GO TO STEP 1.
14
14
7
Transportation Algorithm
Phase II - Stepping Stone Method
• Step 1: For each unoccupied cell, calculate the
reduced cost by the MODI method described below.
Select the unoccupied cell with the most
negative reduced cost. (For maximization problems
select the unoccupied cell with the largest reduced
cost.) If none, STOP.
• Step 2: For this unoccupied cell generate a stepping
stone path by forming a closed loop with this cell
and occupied cells by drawing connecting
alternating horizontal and vertical lines between
them.
Determine the minimum allocation where a
subtraction is to be made along this path.
15
15
Transportation Algorithm
Phase II - Stepping Stone Method (continued)
• Step 3: Add this allocation to all cells where
additions are to be made, and subtract this allocation
to all cells where subtractions are to be made along
the stepping stone path. (Note: An occupied cell on
the stepping stone path now becomes 0
(unoccupied).
If more than one cell becomes 0, make only
one unoccupied; make the others occupied with 0's.)
GO TO STEP 1.
16
16
8
Transportation Algorithm
MODI Method (for obtaining reduced costs)
Associate a number, ui, with each row and vj with
each column.
• Step 1: Set u1 = 0.
• Step 2: Calculate the remaining ui's and vj's by
solving the relationship cij = ui + vj for occupied cells.
• Step 3: For unoccupied cells (i,j), the reduced cost =
cij - ui - vj.
17
17
Example: BBC
Building Brick Company (BBC) has orders for 80
tons of bricks at three suburban locations as follows:
Northwood — 25 tons, Westwood — 45 tons, and
Eastwood — 10 tons. BBC has two plants, each of
which can produce 50 tons per week.
How should end of week shipments be made to fill
the above orders given the following delivery cost per
ton:
Northwood Westwood Eastwood
Plant 1 24 30 40
Plant 2 30 40 42
18
18
9
Example: BBC
Initial Transportation Tableau
Since total supply = 100 and total demand = 80, a
dummy destination is created with demand of 20 and 0
unit costs.
Northwood Westwood Eastwood Dummy Supply
24 30 40 0
Plant 1 50
30 40 42 0
Plant 2 50
Demand 25 45 10 20
19
19
Example: BBC
Initial Transportation Tableau
Since total supply = 100 and total demand = 80, a
dummy destination is created with demand of 20 and 0
unit costs.
Northwood Westwood Eastwood Supply
24 30 40
Plant 1 50
30 40 42
Plant 2 50
Demand 25 45 10
20
20
10
Transportation Problem
Assess your understanding:
Write the objective function for the Example
Problem.
Write the Constraints for the Example Problem.
Think of an example of this type of problem
(“transportation”) that might occur in your field of
expertise.
21
21
Example: BBC
Least Cost Starting Procedure
• Iteration 1: Tie for least cost (0), arbitrarily select x14.
Allocate 20. Reduce s1 by 20 to 30 and delete the
Dummy column.
• Iteration 2: Of the remaining cells the least cost is 24
for x11. Allocate 25. Reduce s1 by 25 to 5 and
eliminate the Northwood column.
• Iteration 3: Of the remaining cells the least cost is 30
for x12. Allocate 5. Reduce the Westwood column to
40 and eliminate the Plant 1 row.
• Iteration 4: Since there is only one row with two
cells left, make the final allocations of 40 and 10 to x22
and x23, respectively.
22
22
11
Example: BBC
Iteration 1
• MODI Method
1. Set u1 = 0
2. Since u1 + vj = c1j for occupied cells in row 1, then
v1 = 24, v2 = 30, v4 = 0.
3. Since ui + v2 = ci2 for occupied cells in column 2,
then u2 + 30 = 40, hence u2 = 10.
4. Since u2 + vj = c2j for occupied cells in row 2, then
10 + v3 = 42, hence v3 = 32.
23
23
Example: BBC
Iteration 1
• MODI Method (continued)
Calculate the reduced costs (circled numbers on the
next slide) by cij - ui + vj.
Unoccupied Cell Reduced Cost
(1,3) 40 - 0 - 32 = 8
(2,1) 30 - 24 -10 = -4
(2,4) 0 - 10 - 0 = -10
24
24
12
Example: BBC
Iteration 1 Tableau
Northwood Westwood Eastwood Dummy ui
24 30 40 0
Plant 1 25 5 +8 20 0
30 40 42 0
Plant 2 -4 40 10 -10 10
vj 24 30 32 0
25
25
Example: BBC
Iteration 1
• Stepping Stone Method
The stepping stone path for cell (2,4) is (2,4), (1,4),
(1,2), (2,2). The allocations in the subtraction cells are 20
and 40, respectively. The minimum is 20, and hence
reallocate 20 along this path. Thus for the next tableau:
x24 = 0 + 20 = 20 (0 is its current allocation)
x14 = 20 - 20 = 0 (blank for the next tableau)
x12 = 5 + 20 = 25
x22 = 40 - 20 = 20
The other occupied cells remain the same.
26
26
13
Example: BBC
Iteration 2
• MODI Method
The reduced costs are found by calculating
the ui's and vj's for this tableau.
1. Set u1 = 0.
2. Since u1 + vj = cij for occupied cells in row 1, then
v1 = 24, v2 = 30.
3. Since ui + v2 = ci2 for occupied cells in column 2,
then u2 + 30 = 40, or u2 = 10.
4. Since u2 + vj = c2j for occupied cells in row 2, then
10 + v3 = 42 or v3 = 32; and, 10 + v4 = 0 or v4 = -10.
27
27
Example: BBC
Iteration 2
• MODI Method (continued)
Calculate the reduced costs (circled numbers on the
next slide) by cij - ui + vj.
Unoccupied Cell Reduced Cost
(1,3) 40 - 0 - 32 = 8
(1,4) 0 - 0 - (-10) = 10
(2,1) 30 - 10 - 24 = -4
28
28
14
Example: BBC
Iteration 2
• Stepping Stone Method
The most negative reduced cost is = -4 determined
by x21. The stepping stone path for this cell is
(2,1),(1,1),(1,2),(2,2). The allocations in the subtraction
cells are 25 and 20 respectively. Thus the new solution
is obtained by reallocating 20 on the stepping stone
path. Thus for the next tableau:
x21 = 0 + 20 = 20 (0 is its current allocation)
x11 = 25 - 20 = 5
x12 = 25 + 20 = 45
x22 = 20 - 20 = 0 (blank for the next tableau)
The other occupied cells remain the same.
29
29
Example: BBC
Iteration 3
• MODI Method
The reduced costs are found by calculating
the ui's and vj's for this tableau.
1. Set u1 = 0
2. Since u1 + vj = c1j for occupied cells in row 1, then
v1 = 24 and v2 = 30.
3. Since ui + v1 = ci1 for occupied cells in column 2,
then u2 + 24 = 30 or u2 = 6.
4. Since u2 + vj = c2j for occupied cells in row 2, then
6 + v3 = 42 or v3 = 36, and 6 + v4 = 0 or v4 = -6.
30
30
15
Example: BBC
Iteration 3
• MODI Method (continued)
Calculate the reduced costs (circled numbers on the
next slide) by cij - ui + vj.
Unoccupied Cell Reduced Cost
(1,3) 40 - 0 - 36 = 4
(1,4) 0 - 0 - (-6) = 6
(2,2) 40 - 6 - 30 = 4
31
31
Example: BBC
Iteration 3 Tableau
Since all the reduced costs are non-negative, this is
the optimal tableau.
Northwood Westwood Eastwood Dummy ui
24 30 40 0
Plant 1 5 45 +4 +6 0
30 40 42 0
Plant 2 20 +4 10 20 6
vj 24 30 36 -6
32
32
16
Example: BBC
Optimal Solution
From To Amount Cost
Plant 1 Northwood 5 120
Plant 1 Westwood 45 1,350
Plant 2 Northwood 20 600
Plant 2 Eastwood 10 420
Total Cost = $2,490
33
33
Assignment Problem
An assignment problem seeks to minimize the total cost
assignment of m workers to m jobs, given that the cost
of worker i performing job j is cij.
It assumes all workers are assigned and each job is
performed.
An assignment problem is a special case of a
transportation problem in which all supplies and all
demands are equal to 1; hence assignment problems
may be solved as linear programs.
The network representation of an assignment problem
with three workers and three jobs is shown on the next
slide.
34
34
17
Assignment Problem
Network Representation
c11
1 1
c12
c13
c21
c22
2 2
c23
c31
c32
3 c33 3
WORKERS JOBS
35
35
Assignment Problem
Linear Programming Formulation
Min cijxij
ij
s.t. xij = 1 for each worker i
j
xij = 1 for each job j
i
xij = 0 or 1 for all i and j.
36
36
18
The Assignment Problem:
Assess your understanding:
Write the objective function for the general LP
formulation of the Assignment Problem using only
words -- do not use any mathematical symbols.
Write contraint for the general LP formulation of the
Assignment Problem using only words -- do not use
any mathematical symbols.
37
37
Assignment Problem--Special Considerations:
Special considerations can include:
A modification to the right-hand side of the first
constraint set can be made if a worker is permitted to
work more than 1 job.
number of workers does not equal the number of jobs —
add dummy workers/jobs with 0 assignment costs as
needed. (note: this may not be necessary if a
worker/job is allowed more than one job/worker)
worker i cannot do job j — assign cij = +M (where +M =
some very large number--implying a very large cost!).
38
38
19
Assignment Problem--Special Considerations:
Additional special considerations can include:
maximization objective — create an opportunity loss
matrix subtracting all profits for each job from the
maximum profit for that job before beginning the
Hungarian method
39
39
Hungarian Method
The Hungarian method solves minimization assignment
problems with m workers and m jobs.
Step 1: For each row, subtract the minimum number in
that row from all numbers in that row.
Step 2: For each column, subtract the minimum
number in that column from all numbers in that
column.
40
40
20
Hungarian Method (continued)
Step 3: Draw the minimum number of lines to cover all
zeroes. If this number = m, STOP — an assignment can
be made.
Step 4: Determine the minimum uncovered number (call
it d).
• Subtract d from uncovered numbers.
• Add d to numbers covered by two lines.
• Numbers covered by one line remain the same.
• Then, GO TO STEP 3.
41
41
Hungarian Method
Finding the Minimum Number of Lines and
Determining the Optimal Solution
• Step 1: Find a row or column with only one unlined
zero and circle it. (If all rows/columns have two or
more unlined zeroes choose an arbitrary zero.)
• Step 2: If the circle is in a row with one zero, draw a
line through its column. If the circle is in a column
with one zero, draw a line through its row. One
approach, when all rows and columns have two or
more zeroes, is to draw a line through one with the
most zeroes, breaking ties arbitrarily.
• Step 3: Repeat step 2 until all circles are lined. If this
minimum number of lines equals m, the circles
provide the optimal assignment.
42
42
21
Example: Hungry Owner
A contractor pays his subcontractors a fixed fee
plus mileage for work performed. On a given day the
contractor is faced with three electrical jobs associated
with various projects. Given below are the distances
between the subcontractors and the projects.
Project
A B C
Westside 50 36 16
Subcontractors Federated 28 30 18
Goliath 35 32 20
Universal 25 25 14
How should the contractors be assigned to minimize
total costs?
43
43
Example: Hungry Owner:
Network Representation (note the “dummy” project)
50
West. 36
A
0 16
28
30
Fed. B
18
0
35 32
20
Gol. C
0
25 25
14
Univ. Dum.
0
44
44
22
The Assignment Problem:
Assess your understanding:
Write the LP formulation for the Hungry Owner
problem.
Think of and describe an “assignment” problem that
occurs in your field of expertise.
45
45
Example: Hungry Owner
Initial Tableau Setup
Since the Hungarian algorithm requires that there
be the same number of rows as columns, add a Dummy
column so that the first tableau is:
A B C Dummy
Westside 50 36 16 0
Federated 28 30 18 0
Goliath 35 32 20 0
Universal 25 25 14 0
For Practice: Write the Formulation for this problem.
46
46
23
Example: Hungry Owner
Step 1: Subtract minimum number in each row from all
numbers in that row. Since each row has a zero, we
would simply generate the same matrix above.
Step 2: Subtract the minimum number in each column
from all numbers in the column. For A it is 25, for B it
is 25, for C it is 14, for Dummy it is 0. This yields:
A B C Dummy
Westside 25 11 2 0
Federated 3 5 4 0
Goliath 10 7 6 0
Universal 0 0 0 0
47
47
Example: Hungry Owner
Step 3: Draw the minimum number of lines to cover all
zeroes. Although one can "eyeball" this minimum, use
the following algorithm. If a "remaining" row has only
one zero, draw a line through the column. If a
remaining column has only one zero in it, draw a line
through the row.
A B C Dummy
Westside 25 11 2 0
Federated 3 5 4 0
Goliath 10 7 6 0
Universal 0 0 0 0
Step 4: The minimum uncovered number is 2 (circled).
48
48
24
Example: Hungry Owner
Step 5: Subtract 2 from uncovered numbers; add 2 to all
numbers covered by two lines. This gives:
A B C Dummy
Westside 23 9 0 0
Federated 1 3 2 0
Goliath 8 5 4 0
Universal 0 0 0 2
49
49
Example: Hungry Owner
Step 3: Draw the minimum number of lines to cover all
zeroes.
A B C Dummy
Westside 23 9 0 0
Federated 1 3 2 0
Goliath 8 5 4 0
Universal 0 0 0 2
Step 4: The minimum uncovered number is 1 (circled).
50
50
25
Example: Hungry Owner
Step 5: Subtract 1 from uncovered numbers. Add 1 to
numbers covered by two lines. This gives:
A B C Dummy
Westside 23 9 0 1
Federated 0 2 1 0
Goliath 7 4 3 0
Universal 0 0 0 3
51
51
Example: Hungry Owner
Step 4: The minimum number of lines to cover all 0's is
four.
52
52
26
Example: Hungry Owner
There is a minimum-cost assignment. The optimal
assignment is:
Subcontractor Project Distance
Westside C 16
Federated A 28
Universal B 25
Goliath (unassigned)
Total Distance = 69 miles
53
53
Example: the 400-meter relay
Doc Councillman is putting together a relay team for the
400-meter relay. Each swimmer must swim 100 meters of
breaststroke, backstroke, butterfly, or freestyle. Doc
believes that each swimmer will attain the times given in
Table 51. To minimize the team’s time for the race, which
swimmer should swim which stroke?
54
54
27
Example: the 400-meter relay
55
55
Transshipment Problem
Transshipment problems are transportation problems
in which a shipment may move through intermediate
nodes (transshipment nodes)before reaching a
particular destination node.
Transshipment problems can be converted to larger
transportation problems and solved by a special
transportation program.
Transshipment problems can also be solved by general
purpose linear programming codes.
The network representation for a transshipment
problem with two sources, three intermediate nodes,
and two destinations is shown on the next slide.
56
56
28
Transshipment Problem
Network Representation
3 c36
c13 c37
s1 1 c14 6 d1
c15 c46
4 c47
c23 c24
c56 7 d2
s2 2
c25
5 c57
SOURCES INTERMEDIATE DESTINATIONS
NODES
57
57
Transshipment Problem
Linear Programming Formulation
xij represents the shipment from node i to node j
Min cijxij
ij
s.t. xij < si for each origin i
j
xik - xkj = 0 for each intermediate
i j node k
xij = dj for each destination j
i
xij > 0 for all i and j
58
58
29
The Transshipment Problem :
Assess your understanding:
Write the objective function for the general LP
formulation of the Transshipment Problem using
only words -- do not use any mathematical symbols.
For each set of constraints stated above, state what it
means -- using only words -- do not use any
mathematical symbols.
59
59
Example: Transshipping
Thomas Industries and Washburn Corporation
supply three firms (Zrox, Hewes, Rockwright) with
customized shelving for its offices. They both order
shelving from the same two manufacturers, Arnold
Manufacturers and Supershelf, Inc.
Currently weekly demands by the users are 50 for
Zrox, 60 for Hewes, and 40 for Rockwright. Both
Arnold and Supershelf can supply at most 75 units to
its customers.
Additional data is shown on the next slide.
60
60
30
Example: Transshipping
Because of long standing contracts based on past
orders, unit costs from the manufacturers to the
suppliers are:
Thomas Washburn
Arnold 5 8
Supershelf 7 4
The cost to install the shelving at the various
locations are:
Zrox Hewes Rockwright
Thomas 1 5 8
Washburn 3 4 4
61
61
Example: Transshipping
Network Representation
ZROX
Zrox 50
5 1
75 Arnold Thomas 5
8 8
ARNOLD Hewes 60
3 4
7
Super Wash-
75
Shelf 4 Burn 4
Rock-
Wright 40
62
62
31
Example: Transshipping
Linear Programming Formulation
• Decision Variables Defined
xij = amount shipped from manufacturer i to supplier j
xjk = amount shipped from supplier j to customer k
where i = 1 (Arnold), 2 (Supershelf)
j = 3 (Thomas), 4 (Washburn)
k = 5 (Zrox), 6 (Hewes), 7 (Rockwright)
Note: A common mistake in Formulation is to define
the decision variable as Xijk -- implying that you have
2x2x3 = 12 decisions, when in fact, you only have
(2x2) + (2x3) = 10 decisions.
63
63
Example: Transshipping
Objective Function Defined
• Minimize Overall Shipping Costs:
Min 5x13 + 8x14 +
7x23 + 4x24 +
1x35 + 5x36 + 8x37 +
3x45 + 4x46 + 4x47
64
64
32
Example: Transshipping
Constraints Defined
Amount Out of Arnold: x13 + x14 < 75
Amount Out of Supershelf: x23 + x24 < 75
Amount Through Thomas: x13 + x23 - x35 - x36 - x37 = 0
Amount Through Washburn: x14 + x24 - x45 - x46 - x47 = 0
Amount Into Zrox: x35 + x45 = 50
Amount Into Hewes: x36 + x46 = 60
Amount Into Rockwright: x37 + x47 = 40
Non-negativity of Variables: xij > 0, for all i and j.
65
65
Example: Sun Co Oil
Sunco Oil produces oil at two wells. Well 1 can produce as many as 150,000 barrels
per day, and well 2 can produce as many as 200,000 barrels per day. It is possible to
ship oil directly from the wells to Sunco’s customers in Los Angeles and New York.
Alternatively, Sunco could transport oil to the ports of Mobile and Galveston and then
ship it by tanker to New York or Los Angeles. Los Angeles requires 160,000 barrels
per day, and New York requires 140,000 barrels per day. The costs of shipping 1,000
barrels between two points are shown in Table 61. Formulate a transshipment model
(and equivalent transportation model) that could be used to minimize the transport
costs in meeting the oil demands of Los Angeles and New York.
66
66
33
Example: Sun Co Oil
67
67
Example: Sun Co Oil (2)
In Previous Problem, assume that before being shipped to Los
Angeles or New York, all oil produced at the wells must be
refined at either Galveston or Mobile. To refine 1,000 barrels of
oil costs $12 at Mobile and $10 at Galveston. Assuming that
both Mobile and Galveston have infinite refinery capacity,
formulate a transshipment and balanced transportation model to
minimize the daily cost of transporting and refining the oil
requirements of Los Angeles and New York.
68
68
34
Example: Sun Co Oil (2)
69
69
35