The Transportation Method

advertisement
The Transportation Method
Although the transportation problem can be solved as an ordinary linear programming problem, its special
structure can be exploited, resulting in a special-purpose algorithm, the so-called transportation method.
The method was actually developed in 1941 by F.L. Hitchcock and therefore preceded the simplex
method by half a dozen years. Still, it can be viewed as a streamlined version of the simplex method. The
problem under consideration can be described as follows. At location, called origins, O1, O2, …, Om are
supplies of a certain commodity, in quantities si at origin Oi, i=1, …, m. All of this commodity is to be
transported to locations, called destinations D1, D2, …, Dn in quantities dj to Dj, j=1, …, n. Shipments of
the commodity from an origin to a destination can only be done directly between the two. The cost of
sending one unit of the commodity from origin Oi to destination Dj is given as cij. We assume that the
m
problem is balanced in the sense that total supply at the origins,
 s , equals the total demand at the
i 1
i
n
d
destinations,
j 1
j
. The purpose is to find a distribution plan that ships available quantities of the goods
out of the origins and to the destinations, so as to satisfy the demand constraints. Such a shipment plan
should have total minimal cost. To formalize, define xij as the quantity of the good shipped directly from
origin Oi to destination Dj. Then the problem can be formulated as
m
P: Min z =
n
 c x
i 1 j 1
n
s.t.
x
j 1
m
x
i 1
ij
ij
(total transportation cost)
ij ij
= si, i=1, …, m
(supplies at origin)
= dj, j=1, …, n
(demands at destination)
xij  0, i=1, …, m; j=1, …, n.
Due to the balanced nature of the problem, there is no slack: all supplies at the origins are shipped out,
and all demands at the destinations are exactly satisfied. Therefore, the first set of constraints, referring to
original supplies, can be formulated as equations, and the same argument can be applied to the second set
of constraints that deal with the demands. For the balanced problem, it is easy to demonstrate that any of
the (m+n) structural constraints can be expressed in terms of the other (m+n1) constraints. In the lingo of
the simplex method, this indicates that there are only (m+n1) basic variables in a basic feasible solution.
This property is used in the transportation method, where there will never be more than (m+n1) positive
values of the variables in any solution. The numerical information (i.e., the three types of parameters, viz.,
the supplies si, the demands di, and the unit transportation costs cij can be summarized in the extended cost
matrix shown below:
s1
s2
d1
c11
c21
d2
c12
c22



dn
c1n
c2n
sm
cm1
cm2

cmn
A transportation plan is of exactly the same size, but the element in its row i and column j does not
denote the unit cost for shipments from Oi to Dj, but instead it expresses the quantity that is shipped
between these two points, i.e., the value of the variable xij. A typical transportation plan is shown below.
Note, by the way, that the sum of variables added in each row must equal the supply at that origin, while
the sum of the variables in the columns will exactly equal the demand at that destination.
s1
s2
d1
x11
x21
d2
x12
x22



dn
x1n
x2n
sm
xm1
xm2

xmn
We are now able to describe a method that finds a basic feasible solution for the problem, i.e., one with
(m+n1) basic variables.
The Least Cost Method
Step 1: Select the lowest cost element in the cost matrix whose route has not het been assigned a quantity.
Let this be element (i, j).
Step 2: Assign a value to the variable xij in the present transportation plan, which will exhaust the smaller
of the remaining supply at origin Oi and the demand at destination Dj. (It may happen that both are
simultaneously exhausted, which indicates the case of primal degeneracy).
Step 3: Modify the remaining supply of origin Oi and the remaining demand of destination Dj by xij and
eliminate from further consideration all unassigned values of either the row or the column, whichever
was exhausted. (In case both si and dj were exhausted simultaneously, chose either—but not both—to
set its remaining unassigned values to zero).
Step 4: Have (m+n1) elements received an allocation?
If yes: Stop, an initial basic feasible solution has been found.
If no: Go to Step 1.
Example: Consider a transportation problem with three origins and four destinations represented by the
following extended cost matrix with the supplies in the first column, the demands in the top row, and
the remaining elements being the unit transportation costs.
C:
si dj
40
55
30
35
9
6
1
20
2
4
6
50
8
10
3
20
3
4
11
In order to construct an initial solution, determine the element with the associated least cost. In this
example, c31 = 1 is that element, so that we start with the allocation of quantity units/shipped amounts by
setting x31:= min { s3, d1} = min {30, 35} = 30. In addition to setting the value of x31, this step also
requires to redefine the remaining supplies and demands as s3:= 0 and d1:= 35  30 = 5. Since there are no
remaining supplies, we can set all remaining elements in the third row equal to zero, i.e., x 32 = x33 = x34 :=
0. The present situation is then shown in the partially completed table below, in which elements without a
number have not been assigned yet:
T:
si dj
40
55
0
5
20
50
20
30
0
0
0
The next element that has not yet been assigned a value xij and has the lowest cost is c12 = 2. As a result,
we set x12 := min {s1, d2} = min {40, 20} = 20, which requires that we redefine supplies and demands as
s1 := s1  20 = 40  20 = 20 and d2 := d2  20 = 20  20 = 0, indicating that all unassigned values in the
second column will be set to zero. The result is shown in the partial transportation table below:
T:
si dj
20
55
0
5
30
0
20
0
0
50
20
0
0
The lowest cost element among the elements that have no transportation quantities assigned to them is c14
= 3 (note that while c33 = 3 as well, this element is not eligible, as it has already a transportation quantity
assigned to it). As a result, we set x14 := min {s1, d4} = min {20, 20} = 20. We can then update supplies
and demands as s1:= s1  20 = 20  20 = 0 and d4 := d4  20 = 20  20 = 0. Since the assigned quantity
simultaneously equals the remaining supply and demand, we have encountered a case of primal
degeneracy. This means that we arbitrarily choose to either set to zero the remaining elements in row 1 or
those in column 4. Here, we choose row 1. The result is shown in the transportation table below.
T:
si dj
0
55
0
5
0
30
0
20
0
0
50
0
0
20
0
0
Among the remaining three elements, c24 = 4 is the smallest element, so that we can set x24 := min {s2, d4}
= min {55, 0} = 0, so that we can set the transportation quantity to zero. Here, we will mark this element
with a star so as to indicate that it belongs to a basic variable, even though it has a zero value. Supplies
and demands are updated by subtracting zero from s2 and d4, respectively. the result is shown below.
T:
si dj
0
55
0
5
0
30
0
20
0
0
50
0
0
0
20
0*
0
The next remaining element with the lowest cost is c21 = 6, so that we can set x21 := min {s2, d1} = min
{55, 5} = 5, so that we have to revise supplies and demands as s2 := s2  5 = 55  5 = 50 and d1 := d1  5 =
0, so that all unassigned elements in the first row would have to be set to zero (there are none left,
though). The result is shown below.
T:
si dj
0
50
0
0
0
5
30
0
20
0
0
50
0
0
0
20
0*
0
Now the element in row 2 and column 3 is the only remaining element and we have to choose it
regardless of its cost. This leads us to set x23 = min {s2, d3} = min {50, 50} = 50. (Note that in the last
assignment, the remaining supply and demand must always be equal). We have now allocated m + n  1 =
3 + 4  1 = 6 basic variables (all those with positive transportation quantities and the zero labeled with a
star). All elements with a present zero value that are not labeled with a start belong to nonbasic variables.
The transportation quantities with the original supplies and demands are shown in the table T1 below.
T1:
si dj
40
55
30
35
0
5
30
20
20
0
0
50
0
50
0
20
20
0*
0
The cost of the present solution are computed by multiplying the costs of each transportation link with the
corresponding transportation quantities. In our example, we have
Cost(T) = c11x11 + c12x12 + …+ c34x34 = 9(0) + 2(20) + 8(0) + 3(20) + …+ 3(0) + 3(0) = 660.
To test whether or not a given basic feasible solution is optimal, we will use the modified distribution
(MODI) method. If a solution is optimal, MODI will indicate so and the process terminates. If, on the
other hand, the solution is not optimal, the MODI method will determine an improved solution. In order
to use MODI, we must first compute dual variables ui and vj for the rows i and columns j, respectively.
Form linear programming duality one can show that the relation cij = ui + vj must hold for each basic
element (i, j). While there are m + n dual variables, there are only (m+n1) equations to solve for them,
therefore one dual variable can be set to an arbitrary value.
Example: In the case of the numerical example above, we have
c12 = 2 = u1 + v2
c14 = 3 = u1 + v4
c21 = 6 = u2 + v1
c23 = 10 = u2 + v3
c24 = 4 = u2 + v4
c31 = 1 = u3 + v1
Since u2 occurs in three of the equations, we conveniently let u2 := 0, so that v1 = 6, v3 = 10, v4 = 4, so that
u1 = 3  v4 = 3  4 = 1, u3 = 1  v1 – 1  6 = 5, and v2 = 2  u1 = 2  (1) = 3.
The next step is to compute the so-called improvement index cij  ui  vj for all nonbasic variables. These
improvement indexes also allow for an optimality test: if all of them are nonnegative, then the current
solution is optimal. Otherwise, a nonbasic variable with a negative improvement index is chosen to enter
the basis.
Example: The improvement indexes for the solution found with the least cost method above are shown in
the table
C*1:
ui vj
1
0
5
6
4
0
0
3
0
1
8
10
1
0
2
4
0
0
12
The improvement index is negative for the elements (1, 3) and (3, 3), indicating that the present solution
is not optimal and that one of the two nonbasic variables x13 or x33 must enter the basis in order to improve
the solution. Here, we choose the ―most negative‖ element (3, 3) to enter the basis and increase its value
in the process from its present value of zero to some (yet) unknown value of ε. However, since the supply
of row 3 remains at 30, some other element in this row must have its allocation reduced accordingly. The
only candidate for such a reduction is (3, 1), whose present transportation quantity equals x31 = 30, which
will be reduced to 30  ε. Increasing this value, does balance row 3, but now the demand in column 1 is
reduced, so that we must add ε to some value in this column. The only basic variable in this column is in
element (2, 1) with x21 = 5, which is modified to 5 + ε.
Continuing in this fashion, element (2, 3) will have its allocation reduced to x 23 = 50  ε, which brings us
back to column 3, which is where we started. The process can be visualized in the table below, which
shows the aforementioned cycle of alternating ―+‖ and ―‖ signs (a so-called plus-minus cycle),
indicating which elements are to be increased and which are to be decreased (by ε). Note that each row
and each column has the same number of plus and minus signs, so that the problem, which was originally
balanced, remains balanced.
T1:
+


+
We will say that we move units on that cycle, if we add ε to all elements labeled with a ―+‖ sign and
subtract ε from all elements labeled with a ―‖ sign. Each element that we move on that cycle will change
the costs. This cost change Δ can be computed as the sum of the original costs of all elements labeled
with a ―+‖ minus the sum of the original costs of all elements labeled with a ―.‖ In the above table, the
cost change per unit that is moved on the cycle equals Δ = c21 + c33  c31  c23 = 6 + 3  1  10 = 2. This
per-unit cost change does not have to be computed each time, it may be read directly from the opportunity
*
cost matrix C* under the variable that enters the basis, in this case c33
= 2.
We are now able to determine the number of units ε that we will move on the cycle. Since each unit that
we so move will decrease the total costs by 2, we will move as many units on the cycle as possible. The
largest number of units we can move equals the minimal transportation quantity that has an entry labeled
with a ―.‖ In our example, ε = min {30, 50} = 30, meaning that the new solution will have costs that are
$60 lower than those of the previous solution.
The actual new solution is obtained by increasing and decreasing the transportation quantities according
to the labels: quantities without labels are left unchanged, those with a ―+‖ label are increased by ε, and
those with a ―‖ label are decreased by ε. The new and improved transportation plan is then as shown
below. Note that the variable that we started the cycle with (in our example x33) is the variable that enters
the new basis, while the variable that belongs to the element that determined the value of ε (x31 in our
example) is the basic variable that leaves the basis in this step.
T2:
si
dj
35
20
50
20
40
0
20
0
20
55
35
0
20
0*
30
0
0
30
0
Arbitrarily setting u2:= 0, the next opportunity cost matrix is then as follows:
C*2:
ui vj
1
0
7
6
4
0
2
3
0
1
10
10
1
0
0
4
0
0*
14
It is apparent that the only choice for the entering variable (i.e., the only negative opportunity cost
element) is x13, which is then where the plus-minus-cycle will start. The cycle is shown in the present
transportation plan, which is restated here for convenience. Note that other than the first ―+‖ labeled
element which is a nonbasic variable (the entering variable), the cycle only includes basic variables. Due
to degeneracy, this includes the variable x24 whose present value equals zero.
T2:
+


+
We are now able to move ε = min {20, 20} = 20 units on the cycle. As c13* = 1, each unit so moved
reduces the total cost by $1, so that the new solution costs $20 less than the previous solution. The new
solution is shown in the table below.
T3:
si
dj
35
20
50
20
40
0
20
20
0*
55
35
0
0
20
30
0
0
30
0
Note that the new transportation plan is still degenerate as on one hand, the degenerate element labeled
―*‖ was used, so that two variables increased simultaneously from zero to a positive value, but on the
other hand, ε was simultaneously determined by two elements, which both decreased to zero, so that only
one of them became nonbasic. Here, we arbitrary choose x23 as the leaving variable, so that x14 is still
basic and, in order to indicate this, we label it with ―*‖.
Arbitrarily setting u1 := 0, we determine the opportunity cost matrix for the transportation plan as
C*3:
ui vj
1
0
5
5
4
0
1
2
0
1
9
8
0
1
0
3
0*
0
13
Tableau C*3 includes only nonnegative improvement indexes and it indicates that the corresponding
transportation plan T3 is optimal. Its optimal solution includes shipments of magnitude x12  x13  20 ,
x21  35 , x24  20 , and x33  30 . The total transportation cost for this shipment plan is z = 2(20) + 8(20)
+ 6(35) + 4(20) + 3(30) = $580. As mentioned earlier, x14 = 0 and basic, indicating the presence of primal
degeneracy.
We will next consider unbalanced transportation problems and modify the above example accordingly. In
particular, suppose that destination D3 has a demand of only 35 rather than the original 50 units. The total
supply is assumed to be 125 as before, but now the total demand is only 110, so that 15 units will remain
unshipped. The question is then where these unshipped items will be after the demand has been satisfied.
We can handle this situation be simply creating a dummy destination that will take the missing 15 units,
so that the total supply again equals the total demand if the dummy destination is included in the
calculation. (Note that if the total supply is smaller than the total demand, we create a dummy supplier
instead, resulting in a situation, in which at least one demand destination will receive less than desired).
In our example, the dummy destination D5 takes on the remaining 15 units. The transportation costs to (or
from, in case of a dummy supply) the dummy destination are typically set equal to zero. However, given
that there are no actual costs incurred (that may differ between origins or destinations based on inventory
costs or penalties for undersupplying the demand) the assigned cost figures are arbitrary as long as they
are all equal.
Example: Suppose that the extended cost matrix including the dummy column (marked with a (d)) is
C:
si dj
40
55
30
35
9
6
1
20
4
7
1
35
8
10
6
20
5
8
11
15(d)
2
5
2
The unit costs in the D5 column indicate that each unshipped item incurs a cost of 2 if left at origin O1 or
O3, and 5, if left at O2. The transportation table determined with the least cost method is shown below in
table T1. The tie in the first allocation is broken in favor of (3, 1). The seven basic allocations are made in
the order x31 = 30, x15 = 15, x12 = 20, x14 = 5, x21 = 5, x24 = 15, and x23 = 35.
T1:
si dj
40
55
30
35
0
5
30
20
20
0
0
35
0
35
0
20
5
15
0
15(d)
15
0
0
The transportation table has exactly (m+n1) = 3+51 = 7 positive elements, so there is no primal
degeneracy at this point. Arbitrarily setting u1 := 0, the dual variables ui and vj as well as the opportunity
costs (improvement indexes) can be computed. The results are shown in the opportunity cost matrix C*1.
C*1:
ui vj
0
3
2
3
6
0
0
4
0
0**
1
7
1
0
1
5
0
0
8
2
0
0**
2
*
*
Note that two of the improvement indexes, viz., c22
and c25
happen to be zero, indicating dual
degeneracy. This is indicated by ―**‖ in the matrix above.
Since there is a negative element in the matrix, the solution displayed in T1 is not yet optimal. In order to
improve the solution, the variable x32 must enter the basis. The plus-minus-cycle is shown in the
transportation plan T1, which is shown again below for convenience.
T1:

+

+

+
The smallest element that is labeled with a ―‖ on the cycle is uniquely determined by x24 = 15, so that ε =
*
15. This results in the new transportation plan T2 below (which, incidentally, is c32
ε = (1)15 or $15
1
cheaper than its predecessor T .
T2:
si dj
40
55
30
35
0
20
15
20
5
0
15
35
0
35
0
20
20
0
0
15(d)
15
0
0
In order to test whether or not the transportation plan is optimal, we set up the opportunity cost matrix
C*2, which we obtain by arbitrarily setting u1 := 0. The matrix is then shown below.
C*2:
ui vj
0
2
3
4
5
0
0
4
0
1
0
8
0**
0
1
5
0
1
9
2
0
1
3
As there are no more negative elements in the opportunity cost matrix, the corresponding transportation
plan T2 is optimal. Note that the dummy destination receives all 15 leftover units from the first origin,
meaning that 15 units will be left at O1. However, since C*2 includes dual degeneracy, this indicates that
alternative optimal solutions exist.
We can find an alternative optimal solution by introducing the variable x13 into the basis, find the plusminus-cycle and shift as many units on it as usual. The cycle is shown in the transportation plan T 2 which
is again shown below for convenience.
T2:

+

+

+
The number of units that can be moved on the cycle is ε = min {35, 15, 5} = 5, so that the alternative
optimal solution is shown in T3 below.
T3:
si dj
40
55
30
35
0
25
10
20
0
0
20
35
5
30
0
20
20
0
0
15(d)
15
0
0
Again, the difference between the total supply and the total demand (15 units) are left all at origin 1. In
both cases the total costs can be calculated at $650.
Download