Regional Science and Urban Economics 11 (1981) 57-68. North-Holland
SOLVING THE GENERALIZED TRANSPORTATION PROBLEM* John ROWSE Queen’s University,
Kingston,
Ontario
K7L3N6,
Canada
Received April 1979 This paper advocates a mathematical programming approach for solving the classical transportation problem generalized to include non-linear demand and supply functions and nonlinear transport costs. Such an approach is made possible by the -c;Cnt public availability of a powerful optimizing system called MINOS, assembled for the 4ution of large programming problems for which the constraint set is linear a:.~! sps’ : Primal and dual program formulations for this generalized transportation prol+il are set out in the paper, and brief computational experience with the software system in Jving several illustrative problems is recorded.
I. introduction In a recent paper, MacKinnon (1975) advanced and discussed a versatile fixed-point algorithm for the solution of what he defined to be the generalized transportation problem, which essentially extended the familiar Hitchcock-Koopmans transportation problem to allow quantity demanded and supplied to exhibit price elasticity and transport costs to be non-linear. It is the purpose of this paper, however, to argue that a mathematical programming approach to the solution of the generalized transportation problem is both possible and desirable, due to the recent public availability of a powerful non-linear programming user-oriented solution system called MINOS. This mathematical programming system has features which render it highly attractive for solving non-linear transportation problems, flow constrained versions of such problems, and problem variants which include intermediate processing or transshipment. A minor qualification is that the of the transportation problem approach cannot solve generalizations featuring demand or supply correspondences, as can the algorithm of MacKinnon. *For necessary assistance in making the solution system MINOS operable on Burrouglls computing equipment and providing documentation on its use, I extend my thanks to Mike Saunders. For assistance with the computations of this paper, I also hxtend thanks to my conscientious research assistant, Robin Lindsey. Finally, while claiming responsibility for whatever errars remain in this paper, I extend thanks both to Mike Saunders and James MncKinnon for helpful comments on a preliminary draft, Readers seeking information on the availability of MINOS for research purposes should contact Dr. Michael A. Saunders a‘ ;hc Depnrtmenl of Operations Research, Stanford University.
58
.l. Roasts, Solcing thr gtwtdirtd
transportution
probkm
This paper is organized as follows. Foliowing brief review of programming approaches to the transportation problem, primal and dual program formulations of one particular type of generalized transportation problem are set out. Specific requirements of and advantages accruing from use of the MJNOS optimizing system are then listed, and computational experience with the solution of several small illustrative problems is recorded. Several final remarks conclude the paper.
2. Solution of the transportation problem
Following original problem formulation by Hitchcock (1941), Koopmans (1949). and Koopmans and Reiter (1951), solution of the transportation problem moved rapidly to exploit the potential of graph theory and thereby to realize rapid solution times, even for large problems. Subsequently, using theoretical economic background provided by Samuelson (1952) and later Smith (t963), Takayama and Judge, in a series of articles culminating in Takayama and Judge (1971) were able to cast a group of spatial equilibrium problems featuring linear demand and supply functions into a quadratic programming framework. In so doing they implicitly generalized the transportatioir problem to take account of linearly price dependent demands and supplies. (Although they did not treat the case of non-constant transport costs, it is clear that their programming framework could easily have been extended to include transport costs which were quadratic in transport flows.) Working independently, Hartwick (1970, 197 1) investigated the economic rent problem associatea with the transportation problem generalized to include linear demands and supplies. Srmultaneously and later, Murtagh and Saunders developed a non-linear programming solution system, which they subsequently designated MINOS, with the objective of solving large non-linear programming problems for which the constraint set was linccrr and spurs~. This work is described in detail in Murtagh and Saunders (1978). Supported by superb documentation [see Murtagh and Saunders (1977) and Saunders (1977)], MINOS became available publicly in 1977 and with it the potential for solving non-linear problems limited in scope only by the imagination and ingenuity of the applied economist. The generalized transportation problem, featuring explicit non-linear demand and supply functions, is only one of such problems. 3* The
gener&ed formulations
transportation
problem:
Primal
and
dual
program
Because there now exists a well documented solution system capable of sob ing linearly constrained optimization problems, the opportunity for sol\ ing generalized transportation problems should be apparent. The
3. Rows, Sol&g
the generalized transportation
probltm
59
mathematical programming framework for such problems is not immediately evident, however, and it is the purpose of this section to present primal and dual program formulations for one specific generalization of the transportation problem to illustrate the solution approach. Since many generalizations of the transportation problem are possible, it is necessary to select one specific generalization and examine it in detail; the approac!! for slightly different variations should then be apparent. The variant selected here exhibits non-linear demands and supplies at sinks and sources respectively, and non-linear convex unit costs for transport flows. The following notation is necessary for model formulation: --the quantity of product demanded at sink j, j = 1,. . ., J, zi -the quantity of product supplied by source i, i = 1,. . ., I, -the flow of commodity between sop.rce i -.nd sink j, zj -the amount of transport services required to ship one unit of the commodity from i to j, -the amount of transportation services provided, T p;(yj) -the inverse demand function for sink j, p;(zi) -the inverse supply function for source i, p,(T) -the inverse supply function for transportation services, Oj(~uj) -&pf(t)dt, the integral under the inverse demand function for sinkj,
Sj
to q+(q)
c;(T)
Yj?j,
-S2p;(t)dt,
the integral under the inverse supply function for source
i, t0 Zi, --JE~~(t)dt, the integral under the inverse supply transport services, to ‘I:
function
for
Assuming the demand and supply functions are monotonic and ‘well behaved’ and following Hartwick (1970), the primal flow problem may be set forth as follows, where the dual variables are defined in parentheses beside the constraints, max
WI such
that f:
-Zi+
"ij
i
IO
"ij
(jLi)
~
0
(Pi)
j=l,...,J, i =
1,..., I
(1) 1
(2)
j=l J
1
C C Ci,iriji=l
T 50
(3)
(T),
j=l
.YjzOo’ SizO,
I.ijzO,
j=l,...,J,
i=l....,I.
(4)
~crc Q measures aggregate consumers’ plus producers’ surplus, or net social
payoff. the welfare criterion to be maximized. Constraints (1) require that ail flows to sink .i must equal or exceed quantity demand there, constraints (2) rcqulrc’ that product supplied by source i must equal or exceed flows from that source. and constraint (3) requires that the supply of transportation services must equal or exceed demand for such services. For this latter constraint zz 1 Cijrij measures demand for transportation services by source i. so that I:=, z=, Ciirii measures overall demand for such services. The integrals tIj(_rj) may in fact be infinite for many types of demand for tr>O,Ocb
=
trpj
-b
(5) (6) (7)
61
Now the Kuhn-Tucker complementary slackness conditions state that if any dual variable (in this case, a prirncrl decision variable) is positive, then there must be no slack in the corresponding inequality. Hence the reason for the above-mentioned equality between the dual variables iVi,pi and z and the respective prices pi, rf and I)& when the associated primal decision variable was positive. Furthermore, if at the optimum rii is positive, then automatically !‘j and :, are also positive and hence, by complementary slackness (and several substitutions),
that is, delivered price must equal producer price plus transportation costs. Examination of 4 reveals that the terms iu the fi,rst set of square brackets measure consumers’ surplus from consuming yj. the terms in the second set producers’ surplus from supplying 3;, and the terms in the last set of square brackets producer?’ surplus from supplying transport services in the amount 7: If these consumers’ and producers’ surplus functions are expressed in terms of demand and supply prices instead of the primal consumption, production and flow variables, then p$ 1~; and p,. become the decision variables of (D) to be chosen optimally. Since demand and supply functions have been assumed to be monotonic and ‘well behaved’, il in terms of thcsc decision variables is convex and can therefore be minimized directly by MINOS to find a global optimum. For this modified program, the variables dual to the constraints are simply the consumption. production and flow variables, as bcforc. Generalization of this basic approach for different types of problems should be both evident and straightforward. For instance. i:’ the transportation probletn is to be modified only by the inclusion of increasing unit transport costs or by price-induced supply responses, then the primal objective must be a minimizing OIIC and the dual objel$:tivc a maximizing, enc. III the former cast only transport costs appear iI1 the primal objective function, while in the latter case both transport costs and supply costs qpear in the &jectivc. 4. Requirements and advantages of the use of MINOS type of generalized The preceding section has cast one particular transportation problem into a progran?ming form suitable for solution u ~IIP Rst 1:
1:
MINOS. This sect& is intended to acquaint the reader- with ~pcc~fic requirements and advantages of the use of this solution system. prior to the presentation of computational results. Two specific requirements for the use of MINOS are that the user be able to specify the non-linear functions to be included in the objective function and their derivatives and have a working knowledge of FORTRAN. By way of comparison, a restriction similar to the latter is also a requirement at present for using the programmed algorithm of MacKinnon (1975). For the practitioner, the greatest advantages for the use of the software system stem from its extensive user-oriented support documentation, compatability in inpul. formats with commercial linear programming systems, virtual machine independence in solution code, and problem restart capabilities that are especially useful for post-optimality economic analysis. Inasmuch as most of the burden of economic analysis associated with the transportation problem may well involve examination of the stability of optimum to parameter changes or the consequences for optimal flows and prices of perturbations in parameter values, this latter advantage can hardly be overemphasized. Furthermore, the solution package includes allowance for constraints on commodity flows arising from import or export quotas and ceilings or floors on allowable shipments, not strictly part of the gcncralizccl transportaltion problem but surely of interest for analyzing the consequences of interferences with the free flow of goods. Finally, the programming system allows for complication of the problem to embrace transshipment of goods and inclusion of a module allowing intermediate processing prior to shiipment of goods to final destinations.
5. Computational
exlperience
Paralleling the oomputational work of MacKinnon (1975), the first generalizeld transport:ation problem solved was the quadratic programming problem of Takayama and Judge (1971, 247--250). The methods were first, via the primal program. to maximize consumers’ plus producers’ surplus from consumption amd production, and second, via the dual program, to minimize for these activities the economic rent foregone [borrowing some terminology from Hartwick (1970)]. Both approaches yielded the same optimal llow and pric,e solution, as they must, and as MacKinnon found, the answers deviated i’ery slightly from those published. Since the forms of both programming problems were specilied by Takayam.a and Judge, no obstacles in formulation lxere csncountered in solving for optimal flows and prices. For each separate problem, when an optimum was attained by MINOS, as a computational check the quadratic dual objective function was formulated ;1m1claluated. For instance. in the primal problem where optimal flows were ttr be determined. tt,r: dual objective function in wrms of primrl jlows was
J. Row.c, Soloing the gtwrulized
trunspartation
problem
63
formulated [using Aoki (1971, 219-22111 and evaluated. Comparison of corresponding optimal values between the primal and dual programs revealed that the solution method retained high accuracy; each flow or price variable agreed to six digits, with agreement for nearly all variables being to seven digits. Next, the non-linear transportation problem assembled by MacKinnon to demonstrate the capabilities of his algorithm was solved. For convenience, that problem is restated here. Demand and supply functions at the five sinks and three sources, for a single good, are as follows:
Demand
SUPPlY ---
D, =20+340 P-o.7 L&=15+210 P-o.5 25 P-o.3 D,= 5+ 9oP-0.2 D 4= Dg= 10+200 P-O*l
-
s, -- 100 200 PY.5 s: . 50t 75 P, s,= 10-t 14 Pi*”
services are to be determined Price and quantity of transportation endogenously. The supply function for transportation services is given by t SOlog, P,. Prices for demands are delivered prices, and the delivered price of the good at sink j is given by P= min (pi +
c,jp4),
where C,, is the amount of transportation services required to ship one unit of the good from supply source i to demand sink j. (It should be noted that if two sources supply the same sink, then the delivered price of the good originating at each source must be the same.) Each sink requires transport services given by cf=, Ci,rip where “ij denotch the flow of the gc~~l i to j. Equilibrium, of course, requires that transport service demand equal supply. Matrix (Cij) is given by
0.0 0.3 0.4
0.2 0.0 0.5
0.3 0.2 0.6
0.7 0.6 0.7 1
b
.I. Rowe.
64
Solring
thr g~werdizcd
transportation
problem
By design. the generalized transportation problem examined in the third section is of the same form as the one to be solved. Because of the way transport costs were specified. however, P, could not be inverted to derive P4 as an elementary function of S4 and thus the problem could not be solved directly as a primal flow problem. Hence the dual problem was solved instead. Prior information was used to simplify the dual (D) very slightly before solution was attempted, however. Examination of the demand and supply functions hypothesized revealed that all quantities demanded yj and quantities supplied =i would be positive at the optimum. These facts, in conjunction with the structure of the matrix of unit transport requirements Ci, implied further that optimal T must be positive. Consequently, since constraints (5). (6) and (8) were known to be satisfied as equalities at the optimum. the dual program was simplified to
such that ~~ - I’~ -
Cij17I.
~
0
i=l....,I, j=l
@O.
where
C‘S
@o.
and PS stand
(10)
(~'ij)
pr2.O.
i=l
7..
. .
J.
. . . .. I
1
(11)
j=l,...,J.
for consumers’
surplus
and producers’
surplus
rcspcctively. Using only the default tolerances built into MINOS save for specification of a more accurate linesearch tolerance, the solution as given in table 1 was obtained. Except for rounding errors in the fourth decimal place for the quantity and flow figures, this solution is identical to the equilibrium solution set forth by MacKinnon. Solution time using the Burroughs I36700 at Queen’s University !;tood at 4.30 seconds CPU time, which included all central processing time necessary for problem input and solution output, and writing onto disk the informiltion specifying an optimal basis. Unfortunately, this CPU time requirement is not comparable with the 0.26 seconds CPU time required by the vector sandwich method on an IBM 360/91 at Princeton LJniversity because the latter time includes only execution time and the former time includes ‘overhead’ time necessary for all large software packages such as MINOS. As an illustration of the capilbilities of MINOS, two further problems, both variants of the non-linear transport problem, were solved. Fipst, the cc*nstant term in the demand function D, was assumed to increase from 20
J. NOWSC,Solving the generalized
transportation
problem
65
Table I Optimal supplies, demands ard prices. Source/ sink (1) (2) (3) (4) (5) -
Demand
SUPPlY Price
Quantity
Price
Quantity
1.879713 2.101250 2.322787 2.215372 -.-
374.2052 207.5938 59.5612 208.3859 -
2.544324 2.101250 2.322787 2.765861 3.430473
196,1(391 159.8707 19.4150 78.4305 186.8050
Matrix (rlj) of optimal flows
1
o.OOuO 186.8~350
WOOO ’ O.OOtIO 19.4150 40 :463 O.ooF30 lY..*,145 i33.7635 wOOO O.OOOO 38.2842
9.4388 159.8707
Table 2 Optimal supplies, demands and prices. Sourcej
Demand
SUPPlY
sink
Price
Quantity
Price
Quanlity
(1) (2) (3) (4) (5)
2.153940 2.395243 2.636545 2.413026 -.-
393.5262 229.6432 69.935 I 220.565 1 -
2.87784ti 2.395243 2.636545 3.119151 3.843058
262.2301 150.6890 18.6909 76.686 I 184.8084
Matrix (r,,) of optimal flows
_.
c 08.7178 53.5 73.3178 0.0000 123 150.6890 0.0000 0,OOOO 18.6909 O.OOOO 0.0000 ._.___ _____.._^_l
129.3659 0.00003 25.4419 51.2442 17.8814 0.0000 184.808
to 100, implying an exogenous increase in demand from this sink for all demand prices. Utilizing the optimal programming basis from the above solution, MINOS determined the new solution to be as given in table 2. By comparison of the two optimal solutions, the qualitative adjustments expected to stem from the exogenous change to D, are seen to be reflected in the quantitative results. Supplies from all sources expar.d (but only in aggregate by 693.1045 -641.3602 = 51.7443 units, compared with the exogenous demand increase of 80 units), all supply prices rise, all demand prices rise, and all quantities demanded save that for sink (I) decline. Tl.tre are also several interesting adjustments in flow intensities from different
sources: for instance. the flow from source (3) to sink (3) declines while the flow from this source to sink (4) expands. In determining this solution the availability of an advanced starting basis greatly reduced the number of MINOS iterations to optimum, but CPU time required declined only to 3.61 seconds. again including requirements of central processing time for data input and solution output. As a second illustration of the capabilities of MINOS, an import quota of 150 units was imposed on flows to sink (5) and simultaneously the constant term in D, was returned to 20. In programming terms, such a constraint was of the kwm (3a)
in Problem (P). for sink k = 5. The ‘consequences for the dual programs (D) and (D-1) of imposing this constraint are (a) in the dual objective function 4, where the term @(fJk appears, and ('b) in the constraint set, where one set of / constraints is modified to become i.,-~i-~Ci,-f’J,~O
(rin)
i= 1,...,1.
Again the optimal basis from the first problem was used as a starting point for solution.’ The optimum identified by MINOS was as given by table 3. Once again, the perturbation of the original problem had the expected qualitative results. All supply prices and quantities fell, since sink (5) no longer could absorb as much of the good as before. All delivered prices declined, save that of sink (5), which rose to reflect the fact that only 150 units of the good were available for distribution. Furthermore, one major substitution of suppliers occurred: source (2) was completely edged out of the market for supplying sink (1) because of a diversion of commodity flow from sink (5) to sink (1) by source (1). Use of an advanced starting basis proved of less help in speeding solution of this variant of the non-linear transport problem, however; CPU time slipped only slightly to 4.10 seconds from the original solution time. Interesting though they are, the small illustrative numerical examples presented in this section barely tax the capabilities of MINOS. Hence the ‘Smce the restart facihties of MlNOS are available for use only on problems of exactly the same dimenrrons as previously solved. the constrained version of the problem could be solved only if no additional variables or constraints were added. In fact, the original problem was formulated with the additional variable~9~ included. For the first two solutions recorded, Q,” was set well above its likely ,3ptimal value (namely at 1000) to ensure that no constraint on flows to srnk (5) was bindrng in each optimal solution. To derive the solution found by the restart option here. thus parameter l,alue was srmply reduced to IS0 and further iterations performed using MINOS.
J. Rowsc, Soloing the gmerulized
trunsportation
probkm
67
Table 3 Optimal supplies, demands and prices.
Source/ sink
(1) (2) 13) (4) (5)
suPPlY
Demand
Price
Quantity
Price
Quantity
1.705116 2.048806 2.239252 1.904466 -‘I
361.1602 203.6604 56.9118 188.3887 --
2.276456 2.048806 2.239252 2.620145 3.540133
211.1602 161.7131 19.6295 79.2297 15o.OOOo
Matrix (v,,) of optimal flows 0.0000 161.7131 0.0000 0.0000 63.348 1 0.0000 C211.1602 0.0000
o.oOOo 41.9473 o.OOoO 19.6295 37.2524 O.W.hJ 0.0000 2O.OW’ 10; loo0 1 0.0000 -_ o.ooOo-- 150.0000
computational experience recorded here really only scratches the surface of the solution potential of MINOS, which has been assembled for the purpose of solving large and sparse linearly constrained programming problems with one or two hundred non-linearities in the objective function. Indeed, its capabilities for solving large problems have yet to be explored thoroughly due to its present relative youthfulness. Further information on computational experience with MINOS, though not within the context of the. generalized transportation problem, is available in Murtagh and Saunders ( 1978, 59.-68). 6. Concluding remarks
With the advent of the software system MJNOS, solution of classes of mathematical programming problems for which the constraint set is linear, sparse and large is now a practical possibility. One of these classes is the generalized transportation problem, which includes as a special case quadratic programming commodity flow models featuring linear demand and supply functions and to which considerable attention in the regional science literature has heretofilre been directed. Circumstances for which MINOS should prove especially attractive for use will include those for which user orientation of the solution package is of major importance, considerable post-optimal analysis is to be carried out, constraints on commodity flows are a possibility, or the problems to be solved suggest compllzation through the introduction of processing or transshipment. Since MINOS is most efficient when the number of non-linearities is small. it could perhaps best be utilized when the normal transportation problem U’ complicated only by the inclusion of a small number of non-linearities. With
regard to specialized types of generalized transportation problems, it is certainly possible that other types of algorithms may be more attractive for use than is MIKOS. The network-oriented algori,thm of Rao and Shaftel (1978) may prove an attractive alternative. as might the vector sandwich method of MacKinnon (1973, the latter especially when the number of sources is small relative to the number of sinks or vice versa. Computational experience on these matters at present is lacking, unfortunately, so that delineation of subclasses of the generalized transportation problem for which different solution approaches have compairative advantages is not possible. Where user orientation is an important consideration, however, MINOS is ;tp! tr, possess a significant if not decisive ardvantage, whatever the Ir-;lnI;portatiorl variant to be solved. RefererWs A&I. %*t..1971.
Introduction to optimization techniques: Fundamentals and applications of ncmilnear programming (Macmillan, New York). Baltnrk~. ML.. and W.J. Baumol, 1968, The dual in nonlinear programming and its economic rntcrpretatron. Review of Economic Studies 35.. 237-256. liartwtrk. J.M.. 197!). A generalization of the transportation’ problem in linear programming and \patral p71w cqudibrtum. Discussion Paper no. 30 (Institute for Economic Research, Queen’s I.:mvt:ruit). Kmpston. OnI.). Hart&g&. J \I.. 1971. The generalized transportation problem as a quadratic program. Dtwur~ton Paper no. 35 tlnstttute for Economic Research, Queen’s University, Kingston. orrt Hd~d..
H.
b L 19.&l. 1 he dlstrtbutton of a product from several sources to numerous localities. J~rui~~.tlr,I ‘~1 ~~hernat~cs and Physics 20, 224-230. Kioctpm;m~. 1’ C‘ . 1949. Optimum utilization of the transportation system, Econometrica 17. Suppl. 1% 145 lit*C~pI:?.llli\. 1.f. ,md S Rctter. lY51. A model of transportation, in: T.C. Koopmans, ed.. Acts\ II~ anai>zls of production and allocation, ch. xiv (Yale University Press, New Haven. (=T). MacKmnon. J.C.. 1972, An algorithm for the generalized transportation problem, Regional S:tence and Urban Fconomics 5. 445-464. Murtagh. B.A. and M.A. Saunders, 1977, MINOS: A large scale nonlinear programming system Lker’s guide. Technical Report SOL 7’1-9 (Department of Operations Research, Stanford University, Stanford. CA). Murtagh. B.A. and M.A. Saunders. 1978, Large scale linearly constrained optimization. Mathematical Programming, 4 l-72. Rae. R.C. and T.L. Shaftel, 1978. Computational experience on an algorithm for the tranqortation problem with nonlinear objective functions. Working Paper no. 78-18 (School of Business. Queen’s University, Kingston. Ont.). Samuelson. P.A., 1952. Spatial price equilibrium and linear programmir ‘,merican Economic R<:\~ew 42. 283 303. Saunders. M.A.. 1977, MINOS system manual. Technical Report SOL 77-31 (Department 01 Operations Research. Stanford University. Stanford, CA). Smillb VA., 1963, Minimization of economic rent in spatial price equilibrium, Review of Economic Studies 30, 24 31. Tdwma, T. and G.C. Judge, 1971. Spatial and temporal price and allocation models (NorthHoliand. Amsterdam).