implementing vehicle routing algorithms

36
Implementing Vehicle Routing Algorithms 8. L. Golden T. L. Magnanti H. 0. Nguyen Massachusetts Institute of Technology Cambridge, Massachusetts ABSTRACT Heuristic prog&ng aZgorithms frequently address large The aZgoz4thms can be improved by using e f f i c i e n t data probZems and require manipuZation and operation on massive data sets. structures. for vehicle routing, comparing techniques of Clarke and Wright, GiZZett and Mi2 Zer, and Qagi, and presenting modifications and extensions which pennit problems involving hundreds of demand points to be soZved i n a matter of seconds. multi-depot routing algorithm is developed. illustrated with a routing study for an urban newspaper with an evening circulation exceeding 100,000. With this i n mind, we consider heuristic algorithms In addition, a me results are I. INTRODUCTION An essential element of any logistics system is the alloca- tion and routing of vehicles for the purpose of collecting and delivering goods and services on a regular basis. amples include newspaper delivery 1201, schoolbus routing 151, municipal waste collection [41, fuel oil delivery 1161, and truck dispatching in any of a number of industries. may involve a single depot or multiple depots; the objectives may be aimed at cost minimization (distribution costs, and vehicle or depot acquisition costs) or service improvement (in- creasing distribution capacities, reducing distribution time, and related network design issues). Constraints may be imposed upon Common ex- The system (i) the depots (numbers, possible locations, and production capabilities), Networks, 7: 113-148 @ 1977 by John Wiley & Sons, Inc. 113

Upload: b-l-golden

Post on 15-Jun-2016

242 views

Category:

Documents


9 download

TRANSCRIPT

Page 1: Implementing vehicle routing algorithms

Implementing Vehicle Routing Algorithms 8. L. Golden T. L. Magnanti H. 0. Nguyen Massachusetts Institute of Technology Cambridge, Massachusetts

ABSTRACT

Heuristic prog&ng aZgorithms frequently address large

The aZgoz4thms can be improved by using e f f i c i en t data probZems and require manipuZation and operation on massive data sets. structures. for vehicle routing, comparing techniques o f Clarke and Wright, GiZZett and M i 2 Zer, and Qagi, and presenting modifications and extensions which pennit problems involving hundreds o f demand points t o be soZved i n a matter o f seconds. multi-depot routing algorithm i s developed. illustrated with a routing study fo r an urban newspaper with an evening circulation exceeding 100,000.

With th i s i n mind, we consider heuristic algorithms

In addition, a m e results are

I. INTRODUCTION

An essential element of any logistics system is the alloca- tion and routing of vehicles for the purpose of collecting and delivering goods and services on a regular basis. amples include newspaper delivery 1201, schoolbus routing 151, municipal waste collection [41, f u e l oil delivery 1161, and truck dispatching in any of a number of industries. may involve a single depot or multiple depots; the objectives may be aimed at cost minimization (distribution costs, and vehicle or depot acquisition costs) or service improvement (in- creasing distribution capacities, reducing distribution time, and related network design issues). Constraints may be imposed upon

Common ex-

The system

(i) the depots (numbers, possible locations, and production capabilities),

Networks, 7: 113-148 @ 1977 by John Wiley & Sons, Inc. 113

Page 2: Implementing vehicle routing algorithms

114 GOLDEN, MAGNANTI AND NGUYEN

(ii) the vehicle fleet (types and numbers of vehicles, and vehicle capacities),

(iii) the delivery points (demand requirements, service constraints on delivery time, and order splitting),

(iv) the routing structure (maximum route time or route distance, link capacities, and preferences for radial routes, or routes with points closer together),

regulations) ,

distribution or acquisition lag times).

(v) operator scheduling and assignments (union

and (vi) system dynamics (inventory holdings, and

Applications emphasizing various of these characteristics lead to a continuum of overlapping models including location models such as median and minimax location, scheduling models such as crew scheduling, distribution models such as minimum cost flow or shortest paths, or location-distribution models such as warehouse location. In this paper, we consider models of the routing type with fixed depots, constrained for the most part by fleet, delivery point, and route structure restrictions. Our purposes are three-fold. By synthesizing and extending the results presented-in Golden 1201 and Nguyen 1353, we first for- mulate integer progrming models of these problems, building upon the traveling salesman problem as the "core" model. We then review the most promising heuristic solution procedures for these problems suggested in the literature. Finally, we suggest particularly fast implementations of the Clarke-Wright heuristic procedure. Our method uses efficient data handling capabilities such as heap structures to enhance both computa- tions and storage. Our results indicate that algorithmic modi- fications of this nature can greatly extend the size of problems amenable to analysis.

an urban newspaper with an evening circulation exceeding 100,000. This problem contains nearly 600 drop points for newspaper bun- dles and was solved with 20 seconds of execution time on an IBM 370/168. Fast computations of this nature permit the algorithm to be used as an operational tool and to be used interactively to study modeling assumptions such as demand patterns. It could be used, for example, as in our newspaper study, to investigate performance measures associated with operating policies like the pre-routing of important drop points on special routes. In ad- dition, fast implementation suggests that the heuristic might be

We have applied the algorithm to a distribution system for

Page 3: Implementing vehicle routing algorithms

VEHICLE ROUTING ALGORITHMS 115

used as a subroutine for more general problems in order to in- corporate other of the distribution characteristics delineated above, or to perform on-line dynamic routing.

We believe that our computational experience is indicative of implementations for heuristic algorithms in general. cause these algorithms frequently replace computationally expen- sive or intractable fonnal.optimization procedures by simple, but usually extensive, addition and comparison operations, data organization can be important. Improving data access for each basic operation can lead to order of magnitude improvements in overall running time.

Be-

11. FORMULATIONS

f i e Traveling Salesman Problem

Most vehicle routing models are variants and extensions of the ubiquitous Traveling Salesman Problem; for a very thorough overview of this problem see Bellmore and Nemhauser 131. Sup- pose we are given the matrix of pairwise distances or costs d ij between node i and node j for the n nodes 1, 2, ..., n. We as- sume dii = OJ for i = 1, 2, ..., n. tour of the n nodes beginning and ending at the origin, node 1, which gives the minimum total distance or cost. let

The problem is to form a

For notation,

n = the number of nodes in the network v = the set of nodes

1 if arc {i, j) is in the tour xij = ( 0 otherwise

dij = the distance on arc (i, j 1.

An assignment-based formulation of the problem selects the ma- trix X = (x..) of decision variables solving:

13

n n

n subject to 1 xij = bj = 1 (j = 1, ..., n) (1.2)

i=l

Page 4: Implementing vehicle routing algorithms

116 GOLDEN, MAGNANTI AND NGWEN

x = (Xi j ) E s (1.4)

x = O o r 1 (i = 1, ..., n; j = 1, ..., n ) . (1.5) i j

The set S is selected t o prohibi t subtour solutions sa t i s - fying the assignment constraints (1.21, (1.31, and (1.5). Sev- eral a l te rna tes have been proposed f o r S including

(1) s = {(xi j l : 1 1 xij 1. 1 f o r every nonempty ~ E Q j tQ proper subset

Q of V);

(2) s = {(x . . I : 1 1 xij 5 - 1 for every nonempty ieQ jeQ subset Q of

(2, 3, . . . I n)) ;

(31 s = {(x 1: yi - y . + nx < n - 1 f o r 2 < i f j < n - - i j - f o r some real num- bers yi).

i j 3

Note t h a t S contains nearly 2n subtour breaking constraints i n

(1) and ( 2 ) , but only n2 - 3n + 2 constraints i n the ingenious formulation (3) proposed by Miller, Tucker, and Zemlin 1331. Algorithmically, the constraints i n (2) have proved very useful, however, fo r Lagrangian approaches to the Traveling Salesman Problem, a s i n i t i a t e d by Held and Karp 1221, 1231. For other approaches, both heu r i s t i c and optimal, see Lin 1301, Lin and Kernighan [311, Christofides and Eilon 191, L i t t l e 1321, and Shapiro 1423.

h i c l e routing model with one depot and with one vehicle whose capacity exceeds t o t a l demand. This model can be extended by considering more vehicles, more depots, d i f f e ren t vehicle capac- i t i e s , and additional route r e s t r i c t ions .

The Traveling Salesman Problem can be interpreted a s a ve-

The Mult-iple TraveZing Salesman Problem

The Multiple Traveling Salesmen Problem (MTSP) is a gener- a l iza t ion of the Traveling Salesman Problem (TSP) and comes closer t o accommodating more r e a l world problems; it has proved t o be an appropriate model f o r the problem of bank messenger scheduling, where a crew of messengers picks up deposits a t branch banks and returns them t o the cent ra l o f f ice f o r processing 1431.

Page 5: Implementing vehicle routing algorithms

VEHICLE ROUTING ALGORITHMS 117

Given M salesmen and n nodes i n a network the MTSP i s t o find M subtours (each of which includes the origin) such tha t every node (except the origin) is v is i ted exactly once by ex- act ly one salesman, so tha t the t o t a l distance traveled by a l l M salesmen is minimal. = 1

for i # 1 and j # 1 i n model (1.1) - (1.51, we obtain a MTSP formulation.

Three different papers published i n 1973 and 1974 indepen- dently derived equivalent TSP formulations of the MTSP 121, [371, 1431 and consequently showed tha t the M-salesmen problem is no more d i f f i c u l t than i t s one-salesman counterpart (see [131 a l so) . The equivalence is obtained by creating M copies of the or igin, each connected t o the other nodes exactly as was the or iginal origin (with the same distances). The M copies are not con- nected, o r are connected by arcs each with distances exceeding

I f we l e t al = bl = M and ai = b j

n n 1 1 Idij I. I n t h i s way, an optimal single salesman tour i n

the expanded network w i l l never use an arc connecting two copies of the origin. Then, by coalescing the copies back in to a s in - gle node, the single salesman tour decomposes into M subtours as required i n the MTSP.

i=l j=1

VehicZe Dispatching

The vehicle dispatching problem was f i r s t considered by Dantzig and Ramser [123 who developed a heuris t ic approach using l inear programming ideas and aggregation of nodes. is t o obtain a set of delivery routes from a central depot t o the various demand points, each of which has known requirements, t o minimize the t o t a l distance covered by the en t i re f l ee t . Ve- hicles have capacit ies and maximum route t i m e constraints. All

The problem

vehicles s t a r t and f in i sh a t t o the following formulation hicle routing problem (VRP):

Minimize

subject t o i=l k=l

the for

di j

= 1

central depot. t h i s problem as

k i j X

We w i l l refer the generic ve-

(2.1)

( j = 2 , ...) n ) (2.2)

Page 6: Implementing vehicle routing algorithms

118 GOLDEN, MAGNANTI AND NGUYEN

(i = 2, ..., n) (2.3) j=1 k=l

k k k (k = 1, ..., NV) (2.6) n

i=l j=l

where

n = N V =

'k - T = k

-

- Qi - - - k

ti

k t i j

d i j xk = i j

- - - -

x =

! x;j L 1 j = 2

X E S

k i j x = O o r 1

(k = 1, ..., NV) (2.7)

(k = 1, ..., NV) (2.8)

(2.9)

fo r a l l i, j , k. (2.10)

number of nodes number of vehicles capacity of vehicle k

maximum time allowed fo r a route of vehicle k

demand a t node i ( Q , = O )

time required fo r vehicle k t o deliver o r co l lec t a t node k i (t = 0 ) 1

t rave l time fo r vehicle k from node i t o node j (t = O D )

shortest distance from node i t o node j

k ii

1 i f a r c ( i , j ) is traversed by vehicle k 0 otherwise

N V k 1 xij, specifying connec- matrix w i t h components xij k=l

t ions regardless of vehicle type.

Page 7: Implementing vehicle routing algorithms

VEHICLE ROUTING ALGORITHMS 119

Equation (2.1) s t a t e s t h a t t o t a l distance is to be mini- mized. Alternatively, we could minimize costs by replacing

d by a cost coeff ic ient ck which depends upon the vehicle i j i j type. Equations (2.2) and (2.3) ensure t h a t each demand node is served by one vehicle and only one vehicle. nuity is represented by equations (2.41, i.e., i f a vehicle en ters a demand node, it must exit from t h a t node. (2.5) are the vehicle capacity constraints; s imilar ly , equa- t ions (2.6) are the t o t a l elapsed route t i m e constraints. For instance, a newspaper delivery truck may be r e s t r i c t ed from spending more than one hour on a tour i n order t h a t the maxi- mum t i m e in te rva l from press t o street be made as short as possible. Equations (2.7) and (2.8) make cer ta in t h a t vehicle ava i l ab i l i t y is not exceeded. Finally, the subtour-breaking constraints (2.9) can be any of the equations specified pre- viously. Since (2.2) and (2.4) imply (2.31, and (2.4) and (2.7) imply (2.81, f r o m now on we consider the generic model to include (2.1) - (2.10) excluding (2.3) and (2.81, which a re redundant. We assume that max Q < min Pk. That is, the

l< i<n demand a t each node does not exceed the capacity of any truck. Observe t h a t when vehicle capacity constraints (2.5) and route t i m e constraints (2.6) are nonbinding, and can be ignored, t h i s model reduces t o a multiple t ravel ing salesman problem by

m u t e conti-

Equations

l<k<NV -- --

w k eliminating constraints (2.4) and subs t i tu t ing x = 1 xij i j k=l i n the objective function and remaining constraints.

node is serviced, i t s requirements are sa t i s f i ed . A more cum- bersome mixed integer programming heterogeneous f lee t problem formulation w a s given i n 1957 by Gamin [161 i n which t h i s assumption is relaxed. Balinski and Quandt [ l l provide another formulation i n terms of. a set covering problem.

In our generic model we have assumed that when a demand

n Observe t h a t since 1 xk is 1 o r 0 depending upon whether

j=2 l j o r not the kth vehicle is used, a fixed acquisit ion cost

n fk 1 xk can be added t o the model when it is formulated with

j -2 l j an objective function t o investigate trade-offs between routing and acquisit ion costs.

Page 8: Implementing vehicle routing algorithms

120 GOLDEN, MAGNANTI AND NGUYEN

We can, without difficulty, generalize the generic model to the multicommodity case where several different types of products must be routed simultaneously over a network in order to satisfy demands at delivery points for the various products r201.

the vehicle dispatching model. If we define a as the arrival

time at node j then restrictions on delivery deadlines a earliest delivery times a

nonlinear equations:

Furthermore, we can incorporate timing restrictions into

and j

j can be represented by the following

-j

k k k a = 1 1 (ai + t. + tij) xij 1 j k i

(j = 1, . . . I n)

a = O 1

(j = 2, . . . I n). < a < a j - j 2j -

Alternatively, the above nonlinear constraints can be re- placed by the linear constraints

k ij where T = max Tk. When x = 0, these constraints are re-

dundant. When xk = 1, they determine a in terms of the ar-

rival time a

delivery time tk at node i, and the travel time tk

nodes i and j. to the size of the model (2.1) - (2.10).

lZk5.

ij j at the node i preceding node j on a tour, the

between

i

1 ij Of course, these constraints add considerably

Mu Z ti- Depot Vehic Ze Routing

The integer programming formulation of the vehicle routing problem is altered in minor ways to incorporate multiple depots.

Page 9: Implementing vehicle routing algorithms

VEHICLE ROUTING ALGORITHMS 121

Letting nodes 1, 2, ..., M denote the depots, we obtain the for- mulation by changing the index in constraints (2.2) and (2.3) to (j=M+l, ..., n), by changing constraints (2.7) and (2.8) to

F 1 xk < 1 (k = 1, ..., NV) ij - i=l j=M+1

T 1 xk < 1 (k = 1, ..., NV) ip - p=l i=M+1

(2.7')

(2.8')

and by redefining our previous choices for the subtour breaking set S to be:

(1') s = {(Xijh c c xij 21 for every proper subset Q of V containing nodes 1, 2, ..., M);

iEQ j$Q

(21) s = {(xij): 1 1 xij 5 1 ~ 1 - 1 for every nonempty i€Q jsQ subset Q of

{M+1, M+2, ..., n)}; (3') s = {(Xijh yi - y. + nxij - < n - 1 for M+lli#jcn

for some real numbers yi}.

I

Conchding Coments on FormuZations

Hopefully, the formulations discussed in this section pro- vide a unified basis for viewing vehicle routing problems as generalized TSP's. The formulations indicate, for example, that Lagrangian approaches similar to those used by Held and Karp [221, 1231 can be applied to these problems by dualizing with respect to constraints (2.2) - (2.8). Procedures of this nature might prove useful when combined with good heuristics. In par- ticular, since the heuristic procedures provide feasible solu- tions to these problems and the Lagrangian approaches provide bounds to the minimum distance solution, the heuristic and dual approaches together bracket the optimal value for the objective function. This bracketing might conceivably help to evaluate the effectiveness of the heuristic approaches, or might be use- ful in obtaining optimal solutions to the problems via branch and bound methods.

Page 10: Implementing vehicle routing algorithms

122 GOLDEN, MAGNANTI AND NGUYEN

111. HEURISTIC SOLUTION TECHNIQUES FOR SINGLE DEPOT PROBLEMS

Proposed techniques for solving vehicle routing problems have fallen into two classes - those which solve the problem optimally by branch and bound techniques, and those which solve the problem heuristically. been viable only for very small problems, we concentrate on heuristic algorithms. Christofides claims that the largest vehicle routing problem of any complexity that has been solved exactly involved only 23 customers [lo]. The three vehicle routing heuristic methods which we will mention (Clarke and Wright [lll, Tyagi [461, and Gillett and Miller 1193) have been used for problems with up to 1000 customers.

the sense that at each step one set of tours is exchanged for a better set of tours. Initially, we suppose that every two de- mand points i and j are supplied individually from two vehicles (refer to Figure 1 below).

Since the optimal algorithms have

The Clarke-Wright algorithm is an "exchange" algorithm in

Fig. 1 Initial setup.

Now if instead of two vehicles, we used only one, then we would experience a savings in travel distance of (2dli + 2d - dij (see Figure 2 below).

) - (dli + d + d. ) = dli + d 1j lj I j lj

Fig. 2 Nodes i and j have been linked.

For every possible pair of demand points i and j there is a cor- responding savings sij. We order these savings from greatest to

least and starting from the top of the list we link nodes i and j where s represents the current maximum savings unless the

problem constraints are violated. Christofides and Eilon found from 10 small test problems that tours produced from the "savings" method averaged only 3.2 percent longer than the optimal tours 181.

ij

Page 11: Implementing vehicle routing algorithms

VEHICLE ROUTING ALGORITHMS 123

Tyagi [461 presents a method which groups demand points into tours based on a "nearest neighbor" concept. That i s , points are added t o a tour sequentially, each new addition being the closest point to the l a s t point added t o the tour. grouped the delivery points into m tours, the vehicle dispatch- ing problem reduces t o m Traveling Salesman Problems, one for each tour. Further details are provided i n Tyagi 1461 and Golden, Magnanti, and Nguyen 1211.

efficient buildup algorithm for handling up t o about 250 nodes. Rectangular coordinates for each demand point are required, from which we may calculate polar coordinates. We select a "seed" node randomly. W i t h the central depot as the pivot, we s t a r t sweeping (clockwise or counterclockwise) the ray from the central depot to the seed. as they are swept. I f the polar coordinate indicating angle is ordered for the demand points from smallest t o largest ( w i t h seed's angle 0) we enlarge routes as we increase the angle until capacity res t r ic ts us from enlarging a route by including an additional demand node. This demand point becomes the seed for the following route. Once w e have the routes, w e can apply TSP algorithms such as the Lin-Kernighan heuristic t o improve tours and obtain significantly better results. vary the seed and select the best solution.

Tyagi's method and G i l l e t t and Miller's method are essen- t i a l ly "cluster first - route second" (see Bodin [61) approaches. The Clarke and Wright algorithm can be viewed similarly, espe- cially when the resulting tours are improved via theLin-Kernighan TSP heuristic; Robbins, Shamblin, Turner and Byrd [401 provide computational experience for such a hybrid approach. Thomas [34] have proposed a "route f i r s t - cluster second" ap- proach which we do not explore i n this paper.

of the other two algorithms i n that demand points farther away from the central depot are considered early for linking. This property means that few of these "problem" nodes are l e f t t o be grouped a t the end when there are virtually no degrees of freedom.

The l i terature contains computational experience relating t o the Clarke and Wright 1111, and the Gillett and Miller [191 algorithms. On a 50-customer problem (which w i l l be mentioned la ter) the former algorithm had computation time of 6 seconds on an IBM 7090, the la t te r , 120 seconds on an IBM 360/67. However, the second objective value was slightly lower. A 250-location problem w i t h an average of 10 locations per route was solved i n just under 10 minutes of IBM 360/67 time using the Gil le t t and Miller algorithm.

Having

I n a recent paper, G i l l e t t and Miller [191 introduce an

Demand nodes are added t o a route

I n addition, w e can

Newton and

The Clarke and Wright algorithm overcomes a major deficiency

The Tyagi algorithm has been programmed by

Page 12: Implementing vehicle routing algorithms

124 GOLDEN, MAGNANTI AND NGWEN

Klincewicz 1281 on an IBM 370/168. The same 50-node problem was solved in 1 second of execution time yielding a rather high objective value. Several experiments with the Tyagi algorithm have confirmed the poor objective performance of this approach. Yellow's modification of the Clarke-Wright procedure appears computationally to be quite powerful; problems of 200 nodes have been solved in less than a minute and a problem with 1000 nodes was solved in five minutes on an IBM 360/50 1501. Webb, in ap- plying a similar sequential savings approach, reports having solved 400-customer problems in less than 6 seconds on aCDC6600 1473. Several basic questions arise since implementation is not discussed in the paper at all:

(i) What operations are included in this 6-second figure? What are the details of data storage and manip- ulation in this implementation?

handled?

(ii)

(iii) What kinds of vehicle routing problems can be

IV. A MODIFIED CLARKE-WRIGHT ALGORITHM WHICH IS VERY FAST

Probably the most popular of the heuristic solution tech- niques discussed in the last section is the Clarke-Wright "sav- ings" method which IBM has programmed as VSPX 1251, a flexible computer code to handle complex routing problems.

greatest positive savings s subject to the following restric- tions :

At each step in the Clarke-Wright algorithm we seek the

ij

(i) nodes i and j are not already on the same

(ii) neither i nor j are interior to an existing route;

tour ;

vehicle capacity is not exceeded;

time) is not exceeded.

(iii) vehicle availability is not exceeded; (iv) (v) maximum number of drops (or maximum route

In many applications, where the delivery or pickup time is a sizeable portion of total route time, it makes sense to limit the number of drops rather than the route time since travel times are so difficult to estimate. Nodes i and j, then, are linked together to form a new route, and the procedure is re- peated until no further savings are possible.

Page 13: Implementing vehicle routing algorithms

VEHICLE ROUTING ALGORITHMS 125

There have been modifications made to the basic approach, most notably those suggested by Beltrami and Bodin 141 and by Yellow 1503. In this paper, we emphasize data structuresandlist processing and discuss a new implementation of the Clarke-Wright algorithm which is motivated by (i) optimality considerations, (ii) storage considerations, and (iii) sorting considerations and program running time. We modify the basic Clarke-Wright algo- rithm in three ways:

(1) by using a route shape parameter y to define a modified savings

+ d -Ydij sij = dli 1j

and finding the best route structure obtained as the parameter is varied; by considering savings only between nodes that are "close" to each other; by storing savings sij in a heap structure to

reduce comparison operations and ease access.

(2)

(3)

Route Shape Parameter

The route shape parameter was introduced by Yellow [501, and When is an outgrowth of an algorithm developed by Gaskell 1171.

the parameter y increases from zero, greater emphasis is placed on the distance between points i and j rather than their position relative to the central depot. The search for the best route structure as y is varied provides heuristic solutions which are closer to the optimal solution than otherwise obtained via the traditional algorithm where Y = 1. modified algorithm to the 50-node problem in Christofides and Eilon 181, a solution of total distance 577 was obtained with a route shape parameter of 1.3, whereas the traditional Clarke- Wright solution is 585. Perhaps more importantly, the search over y promotes flexibility. In most applications there are "un- stated" goals and/or constraints. By varying the route shape parameter we can produce several "sufficiently good" tentative solutions from which a final solution may be chosen on the basis of these unstated considerations.

For example, in applying the

Storage

The Clarke-Wright algorithm was designed initially to handle a matrix of real inputs, distances and savings. 0ne.might argue that these variables can be rounded to integers to simplify com- putations. However, we felt that precision was important. In

Page 14: Implementing vehicle routing algorithms

126 GOLDEN, MAGNANTI AND NGUYEN

dealing with a 600-node problem a matrix form would require 360,000 storage locations for these inputs. This assumes an un- directed network with symmetric distances i n order that the d

terms can f i l l above the diagonal i n the matrix, and the sij

terms can f i l l below. Clarke-Wright algorithm we need not store the distances a t a l l . A t least some distances m u s t be kept in memory, havever, i n order t o vary the route shape parameter ( i n particular, the dis- tances from the origin to a l l other nodes must be stored).

Rather than consider a l l pairwise linkings, as in a matrix approach, we can become more selective and work with the link- ings of greatest interest and convenience. We have been inves- tigating a newspaper distribution problem of nearly 600 nodes; our computer system cannot s e t aside 360,000 internal storage locations (more than 1.5 million bytes). And if it were possi- ble, it would be inefficient t o calculate savings which could never be realized. Most of the potential linkings are infeasi- ble from a practical standpoint and our modified Clarke-Wright program reflects th i s observation. The topology of the network is stored i n the following manner. I n general, for each arc w e record i ts origin node, i t s destination node, and its length.

The approach requires 3A rather than n storage locations where n is the to ta l number of nodes and A the number of arcs under consideration. For undirected networks we can order the arcs lexicographically and save storage.

Given the x and y coordinates of the nodes i n the transpor- tation network, we can superimpose an a r t i f i c i a l grid of width W I D T H and height HEIGHT over the network. Furthermore, the grid

can be divided arbi t rar i ly into DIV2 rectangles i n such a way that each demand node is contained in a rectangle of w i d t h WIDTH/ DIV and height HEIGHT/DIV. Node I has box coordinates BX(1) and BY(1) . The se t of arcs we w i l l be working w i t h includes a l l arcs between the central depot (node 1) and other nodes (demand nodes), and a l l arcs between nodes which are no further apart than one box. I n other words, i f (BX(1) - BX(J) 1 > 1 or (BY (I) - BY(J ) I > 1 the arc (1,J) is ignored. The value of D I V influences the accu- racy of the heuristic algorithm and should be altered according to the problem. If the number of demand p o i n t s , n - 1 , is small D I V should be small: i f n is large D I V should be large. The smaller the parameter DIV, for a particular problem, the larger i s the number of arcs t o be considered.

i j

Of course, if we use only the traditional

2

Page 15: Implementing vehicle routing algorithms

VEHICLE ROUTING ALGORITHMS 127

Heap Structure

At each step of the algorithm, we must detenine the max- imum savings. quickly and conveniently by partially ordering the data in a heap structure and updating the structure at each step after altering the routes. More precisely, the savings s as denoted

by sl, s2, ..., s called a heap.

This comparison of savings can be accomplished

ij are arranged in a binary tree with k levels

The essential property of a heap is that s. > s m

i- 2i and si s ~ ~ + ~ - Below is a heap for k = 3 (sl = 25, s2 = 21,

s = 16, and so on). 3

Fig. 3

If the list does not completely fill the last level of the tree, then we can add positions in the last level with entries of - -. Clearly, s corresponds to the maximum savings possible of those

savings under consideration. First, the subroutine STHEAP of our implementation arranges

into a heap using the ideas in Williams [48] and ‘m S I I S2’ ... I

1

Floyd [141. STHEAP builds a heap in O(m1og m) comparisons and

interchanges in the worst case.

to arc (i,j) and that neither i nor j become interior points on a route upon linking nodes i and j. Setting s to zero we, in

effect, remove s1 from the heap since only positive savings are

considered.

its new home. remarkable ease by the subroutine OTHEAP, since s is always made

smaller and must therefore move down the binary tree.

already been moved to position k then the new entry s

2 Now, suppose that s1 corresponds

ij

Actually, we bubble s1 down the heap until it finds

A new heap can be constructed in this case with

1 If s1 has

is com- k pared with its sons only (s 2k and s2k+l) until s k- >max{s2k,~2k+ll

Page 16: Implementing vehicle routing algorithms

128 GOLDEN, MAGNANTI AND NGUYEN

o r the entry sk is a t the lowest leve l of the heap.

s < s = max{s2k,~2k+l) then sk and s are interchanged, and

s is compared again with i t s two new sons.

I f

k - m m

k I f node i (or j) becomes an i n t e r i o r point on a route when

nodes i and j are linked, then w e no longer t r y l inking node i (or j) with any other nodes i n the network. Conceptually, we can cross a l l en t r i e s s off the heap, where s is the savings

incurred by l inking an i n t e r i o r node t o another node. p l i sh t h i s task by (i) se t t i ng each such entry t o zero and (ii) having subroutine OTHEXP reconstruct a heap s t ruc ture s t a r t i ng from posit ion r. OTHEAP i s cal led a s many times as there a re adjacent nodes t o the in t e r io r node i (or j).

The f i r s t entry of the heap always represents the most promising l ink t o add t o the current routes, and by eliminating infeasible l inkings quickly by OTHEAP, the algorithm proceeds very rapidly u n t i l no additional savings can be realized. OTHEAP, exploi ts the simple observation that when an entry is changed it is always decreased t o zero.

requires data s t ructures which point from the heap s t ruc ture t o the location of the corresponding a rc data i n the or ig ina l prob- l e m data. These pointers a re being updated throughout the com- puter program a s the heap s t ruc ture i s al tered. Golden, Magnanti, and Nguyen provide fur ther d e t a i l s 1211.

r r W e accom-

Implementing the STHEAP and OTHEXP procedures e f fec t ive ly

Computationa2 ResuZts

The computer program has been p r o g r m e d i n the WATFIV ver- sion of FORTRAN. encouraging. A 50-node problem (mentioned e a r l i e r ) w a s solved on the IBM 370/168 a t M.I.T. using less than one second t o t a l execution t i m e , including a l l input and output operations. Nodes were read i n by coordinates, so a l l distances w e r e calculated within the program. Real i s t ic data fo r a newspaper d is t r ibu t ion problem w a s gathered fo r us by a loca l newspaper. edit ion has a c i t y c i rculat ion of about 100,000 with nearly 600 demand points where bundles of newspapers a re delivered. The t o t a l execution t i m e was 20 seconds and the routes produced were considered from reasonable t o very in te res t ing by the c i rcu la t ion department involved. We believe our program can be of consider- able value as a too l i n helping t o a l l ev ia t e newspaper dis t r ibu- t i on problems. It i s of i n t e re s t t h a t a major portion of the 20 seconds involved the determination of node adjacencies and distances.

Computational s tudies have been especial ly

The evening

Page 17: Implementing vehicle routing algorithms

VEHICLE ROUTING ALGORITHMS 129

Value of DIV

30 25 24 23 22

Below we report sensitivity analyses for the newspaper problem with respect to the following parameters:

Total Distance Number of Traveled Routes

306.19 22 272.55 17 259.67 15 267.11 17 261. a3 16

(i) box sizes (Table I); (ii) vehicle capacities (Table 11) i

(iv) route shape parameter (Table IV). (iii) maximum number of drops on a tour (Table 111);

Vehicle Capacity

In each case, only one parameter is varied at a time. dencies exhibited in Tables I, 11, and I11 agree with our in- tuition, whereas Table IV is a bit more interesting. The best choice for route shape parameter appears to be truly problem dependent (in this example, y = 1.0 and y = .4 are strong can- didates, taking both objective value and number of tours into account). Several parameters might be varied simultaneously in future parametric studies. This parametric analysis affords us the opportunity to choose the route structure most appealing in light of various (often conflicting) objectives.

The ten-

Total Distance Traveled

5000

Table I Testing box sizes.

262.32

1 1 1

Number of Routes

3000 3500 4000 4500

266.20 262.32 262.32 262.32

18 17 17 17 17

Table I1 Testing vehicle capacities (the capacity of the smaller of two types of vehicles was varied).

Page 18: Implementing vehicle routing algorithms

130 GOLDEN, MAGNANTI AND NGWEN

Maximum N u m b e r Total Distance of Drops Traveled

60 262 . 32 70 262 . 65 80 260.36 90 259.86

100 259.67

N u m b e r of Routes

1 7 16 15 15 15

Value of Y

.4

.6

.8 1.0 1.2 1.4 1.6

V. HEXJRISTIC SOLUTION TECHNIQUES FOR MULTI-DEPOT PROBLEMS

Total Distance N u m b e r of Traveled Routes

263.09 15 264.72 16 266.03 1 7 262.32 17 277.46 18 279.77 19 276.99 20

Whereas the VRP has been studied widely, the multi-depot problem has a t t r ac t ed less at tent ion. The relevant l i t e r a t u r e is represented by only a few papers. The exact methods f o r the s ingle depot VRP can be extended to the general case, but as i n the case for the s ing le depot= , because of storage and com- putation time, only s m a l l problems can be dealt with currently. Problems a r i s i n g i n practice are beyond the scope of these op- t i m a l algorithms. proaches have been developed f o r the multi-depot problem.

A first class of heu r i s t i c s generates one solut ion arbi- t r a r i l y and proceeds t o improve the solut ion by exchanging nodes one a t a t i m e between routes u n t i l no fur ther improvement is possible. Some typical examples are Wren and Holliday [491 and Cassidy and Bennett [71.

Three r e l a t ive ly successful heu r i s t i c ap-

Page 19: Implementing vehicle routing algorithms

VEHICLE ROUTING ALGORITHMS 131

The Wren and Holliday program has been run on Gaskell's ten sample cases and the authors report results comparable with other methods with respect t o computation time and accuracy. No tes t s involving more than 100 nodes are reported. Cassidy and Bennett report a successful case study using a similar approach.

veloped for the single depot VRP. algorithm [181 is an extension of the Gil le t t and Miller "sweep" algorithm discussed previously. depot problem i n two stages. F i r s t , locations are assigned t o depots. Then, several single depot VRP's are solved. Each stage is treated separately.

any node i, l e t

The two other approaches are extensions of heuristics de- The Gil le t t and Johnson

The method solves the multi-

Ini t ia l ly , a l l locations are i n an unassigned state. For

t '(i) be the closest depot to i, and

t" (i) be the second closest depot to i.

for each node i, the rat io

is computed and a l l nodes are ranked by increasing values of r (i) . are assigned to a depot: those which are relatively close to a depot are considered f i r s t . have been assigned from the l ist of r ( i ) , a small cluster is formed around every depot.

Locations i such that the rat io r( i) is close to 1, are assigned more carefully. I f two nodes j and k are already as- signed t o a depot t, inserting i between j and k on a route linked to t creates an additional distance equal to

The arrangement determines the order i n which the nodes

After a certain number of nodes

jk dji + dik - d

which represents a part of the to ta l distance (or cost). other words, the algorithm assigns location i to a depot t by inserting i between two nodes already assigned to depot t, i n the least costly manner.

The Sweep Algorithm is used t o construct and sequence routes in the cluster about each depot independently. A number of refinements are made t o improve the current solution.

I n

Page 20: Implementing vehicle routing algorithms

132 GOLDEN, MAGNANTI AND NGUYEN

Tillman and Cain's 1441 modified version of the Clarke- Wright algorithm starts with the initial solution consisting of servicing each node exclusively by one route from the closest depot. Let

= distance between demand nodes i and j , and di j k d. = distance between node i and depot k. 1

k N 1 2 min {d. ). The total distance of all routes is then D = i=l k

The method successively links pairs of nodes in order to de- crease the total distance traveled. One basic rule is assumed in the algorithm: the first assignment of nodes to the nearest terminal is temporary but once two or more nodes have been as- signed to a common route from a terminal, the nodes are not reassigned to another terminal. In addition, as in the original Clarke-Wright algorithm, nodes i and j can be linked only if neither i nor j are interior to an existing tour.

At each step, the choice of linking a pair of nodes i and j on a route from terminal k is made in terms of two criteria:

(i) a savings when linking i and j at k, (ii) a penalty for not doing so.

Nodes i and j can be linked only if no constraints are violated.

the case of a single depot.

every combination of demand nodes i and j and depot k, and rep- resent the decrease in total distance traveled obtained when linking i and j at k.

The computation of savings is not as straightforward as in

The savings sk are associated to ij

The formula is given by

k -k -k sij = di + d - dij j (4)

if i has not yet been given t 2 min {ai) - di -k - t a permanent assignment where di -

otherwise. k di

In the first case, node i is being reassigned from its closest

depot and the previously assigned distance 2 min Id.) is saved; t 1 t

Page 21: Implementing vehicle routing algorithms

VEHICLE ROUTING ALGORITHMS 133

i n t h e second case, node j is being in se r t ed between depot k and node i and the l i n k from i to k i s dropped from t h e cur ren t solution. Nguyen 1353 i l l u s t r a t e s formula (4) with an example.

are computed f o r i, j = 1, . . . , N (i # j ) The savings sk i j and k = 1, ..., M a t each step. They can be s tored i n M m a t r i - ces, each N by N.

Tillman and Cain 1443 introduce a penalty cor rec t ion f ac to r t o the Clarke-Wright procedure as follows. Suppose t h a t nodes i and j are l inked on a route from depot k a t a p a r t i c u l a r iter-

If, instead, nodes i and u w e r e l inked a t i o n with savings s

on a route from depot m a t a later i t e r a t i o n , t he savings would

be s . Assuming t h a t sk is se l ec t ed t o give maximum savings

ou t of node i, s . < sk and Om : s - s measures the oppor-

t u n i t y cost of using t h i s l a te r l i n k addition. Similarly, i f a t a later i t e r a t i o n , node j w e r e l inked t o node v on a rou te from

depot m, then Om = s - s would be t h e corresponding oppor-

t u n i t y cost. Using these observations, Tillman and Cain def ine

a penal ty pk

k a t the cur ren t i t e r a t i o n by:

i j '

m i u i j

m k m i u - i j i u i j i u

k m vj i j v j

f o r not s e l ec t ing l i n k ( i , j ) on a route from depot i j

m = min {Oin 1 a l l (u,m), u=l , . . . ,N; -1,. . . ,MI except .(j ck) } k

pi j

m + min (0 1 a l l ( v , m ) , ~ 1 , . . . ,N; ml,. . . ,M, except ( i , k ) }. v j

I n order t o incorporate the concepts of savings and penal- t i e s i n a simple way, Tillman and Cain suggest t h e expression

k k k f i j = a s i j + 8 Pij

where a and B are two selected (or var ied) p o s i t i v e weights. A t

each s t ep , t h e l i n k ( i , j ) a t k i s chosen which maximizes f and

which y i e lds a f e a s i b l e so lu t ion (with regard t o capacity and maximum route t i m e r e s t r i c t i o n s ) .

depot VRP a s w e l l , t o improve upon Clarke and Wright's o r i g i n a l

k i j

A penalty function can obviously be applied t o t h e s i n g l e

Page 22: Implementing vehicle routing algorithms

134 GOLDEN, MAGNANTI AND NGUYEN

algorithm. pically and the consideration of a penalty function might help much in overcoming this drawback. however, impose additional computational burdens.

The latter has the drawback of proceeding very myo-

The penalty calculations,

VI. ALGORITHM I FOR THE MULTI-DEPOT VRP

The algorithm proposed here is based on the savings method, and is motivated by a desire to find an algorithm capable of handling large size problems. Cain's approach for computing savings but excludes the idea of a penalty function. Our main contribution, at this stage, is a method of manipulating data which allows fast computation and minimizes storage requirements.

In most codes written for the VRP using the savings ap- proach, the necessity of storing the list of savings often has set the limit on the size of problems that is tractable to solve. In the Tillman and Cain approach to the multi-depot VRP, to each depot corresponds a matrix of savings and the total number of required storage locations grows quickly (even though the number of depots is generally small for transportation networks). In order to cope with the difficulty of accessing and storing such massive data sets efficiently, we have

Algorithm I uses Tillman and

(1) limited the amount of data that must be manipulated

(2) at each step, and exploited the synunetry of savings data.

The first objective has been met in two ways. First we have superimposed a grid structure, as described previously for the single depot VRP, whereby we only consider joining nodes.in adjacent boxes of the grid. computation brought about byethe grid, we have tried the idea on a problem with 50 nodes and 4 depots: without using a grid, Algorithm I took 2.04 seconds total CPU time and with a grid, it took 1.38 seconds while giving the same solution on an IBM 370/168.

each step of the algorithm. as the largest element in row I of all of the M matrices

In order to assess the economy of

Second, we have not manipulated all of the savings stj, at

Instead, we have defined ROWMAX (I)

k 1 3

Sk = (s . ,) for k = 1, 2, ..., M. At each step of the algorithm, the m a x i d l savings has been obtained by searching for the maxi- mum among the ROWMAX (I) for I = 1, ..., N-1. This can be ac- complished readily via heap structures, as we have noted pre- viously. The main advantage of using the auxiliary variable

Page 23: Implementing vehicle routing algorithms

VEHICLE ROUTING ALGORITHMS 135

ROWMAX and searching for the maximal savings among ROWMAX (I) for I = 1, ..., N-1 instead of searching directly through the whole list of savings is an economy of computation time. At each iteration of the algorithm, we have to update some rows and columns of the savings matrix. Typically, this operation involves changes only for a few elements of the vector ROWMAX. Updating the vector ROWMAX and then selecting its largest ele- ment involves considerably fewer comparisons than searching through the whole list of new savings.

ings sk associated with the linkage of nodes i and j at depot

k are symmetric in i and j. We can exploit this synnnetry by storing savings in rectangular rather than square matrix form and thereby eliminate redundancy. This is accomplished by

k splitting the savings matrix (s in half by a vertical cut ij and "folding" the subdiagonal elements to the right of the cut to fit in the superdiagonal elements to the left of the cut. Figures 4 and 5 illustrate this storage scheme. Note that the

k diagonal elements of (s,.) are always zero and do not have to

13 be stored. ferent when N is even and N is odd.

To conserve storage, we can utilize the fact that the sav-

ij

Also, note that the storage scheme is slightly dif-

Each element Sk (1,J) of the matrix Sk that we are storing

corresponds to a savings sk of S

which is stored in location (1,J) ij k according to the following rules:

if I < J = (N+1)/2. 10

Page 24: Implementing vehicle routing algorithms

136 GOLDEN, MAGNANTI AND NGWEN

1-1

- 1 N1

Fig. 4 Storing savings in rectangular form (note Nl=N/2 if N is even and N1 = (N+1)/2 if N is odd).

'2.1 - 3 ,7.6 '7.5 0

'3.1 '3.2'\'6,5 0 \

\ S 3 s \ 0 4.1 4.2 4.3 ' 5.1 5.2 5.3 5.4

5 5 S >. 5 5 5 5 6.1 6.2 6.3 6.4

7.1 7.2 7.3 7.4 5 5 5 5

~ = a s ' 5 5 S 2.1 '4.7 8.6 8.5

5 s', 5 5 3.1 3.2 \ 7.6 7.5

\

5 ' 5 '4.1 '4.2 4.3 ',6.5

\ '5.4

'6.4

57.4

8.1 8.2 8.3 8.4 5 5 3 5

Fig. 5 Examples of savings matrices.

A competing storage scheme involves storing the savings

associated with two depots together. The upper half of the k matrix contains entries associated with savings for depot 2k-1, and the lower half of the matrix contains savings associated with depot 2k as shown in Figure 6.

th

Page 25: Implementing vehicle routing algorithms

VEHICLe ROUTING ALGORITHMS 137

N

Fig. 6 Storing the savings for two depots together.

This scheme is not as compact as the previous method of storage,

since zero savings associated with s or s2k-l are kept along

the diagonal. Moreover, the l a s t matrix i n the storage scheme w i l l be only half f i l l ed with savings data when the number of depots is odd. Nevertheless, i n testing both storage schemes, we have found that this second method leads to a slightly faster implementation, since less manipulation of indices is required.

For large problems, a further economy is achieved by trans-

forming the sk into half-word integers, caution being taken i j against overflow. multiplying a l l real distances by a factor of 100.

2k ii 11

Round-off errors can be minimized by f i r s t

Some Computa~onal Results

The code we have written uses the second storage scheme described above and has been compiled i n 0.18 seconds on an IBM 370/168; it requires 8400 bytes of core. A problem of 200 nodes and 4 depots necessitates 200k of core menpry (using half-word integers for savings), 300 nodes and 4 depots take 400k, 200 nodes and 10 depots take 420k. sized problems. Results for some sample problems are summarized i n Table VI .

search has been studied. I n general there seems t o be no ap r io r i method for determining a best value of y for any given problem. The algorithm is fas t enough, however, so that we can try differ- ent values of y and then select the best solution produced. We have tried the idea on a 5O-node, 4-depot problem; results are given i n Table V.

We consider these to be medium-

As w i t h the single depot VRP a route shape parameter l ine

Page 26: Implementing vehicle routing algorithms

138 GOIDEN, MAG"T1 AND NGUYEN

Value of Y

.2 04 -6 -8

1.0 1.2 1.4 1.6 1-8 2.0

Solution Produced by Algorithm

Total Distance Traveled

584.63 559.89 512.09 509-77 509.30 508.07 518.10 536.40 560.40 587.28

Number of Routes

6 6 6 6 7 7 7

11 13 15

Table V Testing route shape parameter for multi-depot problems.

The advantage of th i s approach, as w e have pointed out previously, i s that we are given a few alternatives t o choose from and depending on the objective function, one solution or another can be selected. For example, i n the above i l lustra- tion, the sole criterion of m i n i m a l distance traveled would determine the choice of y = 1.2; but the consideration of dis- tance traveled combined with the number of routes might se t the value y = .8 as the best choice.

drawing the different routes produced for different values of y, it is usually possible t o combine some of them manually, simply by examining the various alternatives, t o produce an even better solution. For example, we worked a few minutes on the solution obtained w i t h y = 1.0, and obtained a solution w i t h 6 routes and a to ta l distance traveled of 487 units. We w i l l describe a computer code which performs a similar refin- ing operation l a t e r i n th i s paper.

the interactive approach t o VRP solving. method is its possibility of combining extensive and long com- putations done with a computer w i t h the intuition and judge- ment of the human mind. Krolak e t a l . [291 have conducted re- search i n this direction.

Another positive feature of the method is that af ter

The above idea is of course a simplistic application of The appeal of the

Page 27: Implementing vehicle routing algorithms

VEHICLE ROUTING ALGORITHMS 139

Problem

(1)

1 2 3 4 5

N u m b e r

I 1 1 I I

A l g o r i N u m b e r N u m b e r Load T o t a l Of N o d 0 8 Of Depot8 Capaci ty D i 8 t M C e

50 4 80 604.60 50 4 160 508.07 ( 3 )

100 2 100 1124.03 100 2 200 845.03 100 4 100 959.64

.ha I CPU

Time (2) i n wc

2.04(4) 9.08 3.15 3.18 6.16

I 6 I 100 I 7 I 100 I 901.83 I 3.15

SWOOP Algorithm T o t a l

D i 8 t M C O T*(2) ( 5 )

593.16 486.19 13.23

1066.65 51.24 778.87 227.67 L 939.45 52.40

i n 8ec

(1) P r o b l e m 1-5 are g iven by G i l l e t t and Johnmon I181 ( i n 11.91, #6, 7, 20, 21, 23). (2) On IBU 370/168. (3) 1 0 t r i a l s have been at tempted w i t h d i f f e r e n t value. of 'I, the b.8t 8 o l u t i o n i 8

( 4 ) (5) Figure8 reported i n I181 on and ISn 370/168.

g iven and CPY t i a i 8 total time. No g r i d ha8 been used f o r t h i 8 cam.

Table V I Computations with the Proposed Algorithm.

V I I . ALGORITHM 11: EXTENSION OF ALGORITHM I FOR LARGE PROBLEMS

The multi-depot VRP can be viewed as a two-step process: first, nodes have to be allocated to depots: then routes are bui l t which l i n k nodes assigned t o the same depot. is most efficient to deal with the two steps simultaneously as i n Algorithm I. nodes, this m e t h o d is no longer tractable computationally, and we might t r y to divide the problem into as many subproblems as there are depots and to solve each subproblem separately.

Algorithm 11 attempts to implement th i s philosophy while using the ratios r (i) introduced by G i l l e t t and Johnson [181. I f a given node i i s much closer to one depot than any other depot, i w i l l be served from i ts closest depot. When node i is equidistant from several depots, the assignment of i to a depot becomes more difficult . For every node i, w e determine the closest depot kl and the second closest depot k2. If the ra t io

r( i) = di /di

6 (056 51) , we assign i to kl; i n the case r( i) 2 6 we say that node i is a border node.

i f 6 = 1, a l l nodes are assigned to their closest depot. given problem, w e can f ix the number of border nodes as w e w i s h , by varying 6.

Ideally, it

When faced with larger problems, with say 1000

kl k2 is less than a certain chosen paramenter

Clearly, i f 6 = 0, a l l nodes are declared border nodes and For a

Page 28: Implementing vehicle routing algorithms

140 GOLDEN, MAGNANTI AND NGUYEN

The method proceeds as follows. In the f i r s t step, we ig- nore the nonborder nodes and Algorithm I is applied t o the set of border nodes. The algorithm a l loca tes the border nodes t o depots and simultaneously bui lds segments of routes connecting these nodes. A t the end of this first s tep , a l l nodes of our problem are assigned t o some depot and a l l border nodes are linked on some routes. The solut ion t o the VRP i s produced de- pot by depot using s ingle depot VRP techni,ques. The segments of routes which are b u i l t on border nodes are extended t o the remaining nodes.

how many border nodes Algorithm I can handle. which allows a maximal number of border nodes t o be considered involves the ordering of nodes by decreasing r a t i o s r ( i ) . A l - ternat ively, one can experiment with a l ist of increasing values of 6. As 6 increases from 0 t o 1 the number of border nodes decreases. The method described here has been implemented with real data taken from the d i s t r ibu t ion information of a loca l newspaper. The problem, with almost 600 nodes and 2 depots, ran i n under 55 seconds.

It is f e l t t h a t the eff ic iency of the method depends on One approach

V I I I . POST-PROCESSOR

In a previous sect ion w e mentioned the poss ib i l i t y of im- proving the solut ion obtained by Algorithm I by modifying the routes it produced. In t h i s section, we discuss a computerized procedure t o perform t h i s task.

VRP. An a rb i t r a ry or ien ta t ion is assigned t o each route so t h a t f o r each node i, we can define p r ( i ) t o be the node o r depot which precedes i on i ts route and f l ( i ) t o be the node o r depot which follows i on i t s route.

I f a node j is inserted,between nodes i and f l (i) , the re- duction i n distance t raveled can be computed as:

W e suppose t h a t i n i t i a l l y we are given a solut ion t o the

To any pa i r of nodes i and j , w e can consider the savings u corresponding t o the inser t ion of node j between i a n d f l ( i ) .

In addition, if node i is the first node served by a route , then the savings v

i and p r ( i ) has t o be taken i n t o account. I f the number of

i j

associated with the inser t ion of node j between i j

Page 29: Implementing vehicle routing algorithms

VEHICLE ROUTING ALGORITHMS 141

Post-Processor CPU Improved

routes is r, then the possible savings can be stored in a rec- tangular matrix W of dimension (N+r) x N. The first N rows correspond to savings u

ings v The post-processor searches for the largest element of W

which is feasible, and performs the indicated insertion. The operation is then repeated until no further reduction in total distance traveled is possible. The details are very much like those of Algorithm I and are not repeated here.

The post-processor uses a savings approach which differs from the Clarke and Wright algorithm in several respects [351. In general, updating the savings matrix is more cumbersome as many more savings might change in value. Typically, in the Clarke and Wright algorithm, iterations become shorter as the procedure progresses because the number of nodes to consider decreases, whereas in the post-processor, each iteration takes about the same amount of time.

With a code for implementing the ideas discussed, we have tried the approach with problems reported in Table VI. Results are summarized in Table VII.

Our method has produced solutions comparable with the ones reported by Gillett and Johnson while using much less computa- tion the. rithm required 227.67 seconds of CPU time; our solution was slightly higher while using only about 2% of the CPU time.

and the last r rows refer to the sav- ij We note that in general w # wji. ij' ij

In an exceptional case the Gillett and Johnson algo-

~~

Sweep Algorithm Solution I ;l?&

in sec

Algorithm I

Time in sec

1 2 3 4 5

604.60 2.04 508.07 9.08

1124.03 3.15 845.93 3.18 959.64 6.16

10.83 I 2i I :::: 1 593.77 I 593.16 I 9.34 21.42 486.65 486.19 13.23 56.55 4.26 1067.18 1066.65 51.24 29.35 2.70 815.68 778.87 227.67 21.35 12 3.09 938.45 939.45 52.48

Table VII Computations with the Post-Processor.

IX. COMPUTERIZED ROUTING OF NEWSPAPER DISTRIBUTION VEHICLES

In the newspaper logistics system where yesterday's product is worthless today, the allocation and efficient routing of ve- hicles for the purpose of delivering newspapers on a daily basis is of major importance. In this section, we describe briefly a study that we initiated for an urban newspaper.

Page 30: Implementing vehicle routing algorithms

142 GOLDEN, MAGNANTI AND NGUYEN

Medium to large size newspapers must service several hun- dred delivery points in and around a city, each with specific demands (in quantity of newspapers). Delivery deadlines or earliest delivery time constraints imposed by either the produc- tion department of the newspaper or customer requirements are major considerations. In addition, the vehicle fleet may con- tain different types of trucks with different capacities and there may be several afternoon editions of a newspaper.

During the period January 1974 to June 1975, while working with the American Newspaper Publishers Association, we investi- gated issues associated with newspaper delivery systems, par- ticularly the use of our single-depot computer code for specify- ing vehicle routes for bulk deliveries. The overall goal of our preliminary study was to determine if computerized approaches to newspaper vehicle routing and scheduling looked sufficiently promising from the viewpoints of delivery cost reductions and service quality improvements to warrant further, more detailed investigation.

In order to gain an understanding of routing in the real- world environment of newspapers, we studied the delivery system of a local newspaper - The Worcester Telegram, a paper with an evening city circulation of about 92,000. Worcester Telegram supplied us with listings of their vehicle routes within the city limits of Worcester, and appropriate in- formation concerning the associated drop points (approximately 600 in number). The data contained such items as numbers and sizes of delivery vehicles, vehicle capacities, present vehicle routes, and newspaper demands per drop point.

a rectangular grid structure, we specified drop points by coor- dinates keyed to the grid. from the input data were based, then, on Euclidean distances. This approach seemed to provide a very reasonable estimate for the true travel distances. to street maps manually by those people most familiar with the particular city.

routes which minimize the total distance traveled by the fleet while meeting demand requirements. this objective also tends to yield a small vehicle fleet and tends not to give excessive route times, even when route-time limitations are not explicitly specified by the user.

of their functional capacities. These capacities are often hazy figures, at best, but approximations suffice, particularly since

The staff at the

After using a detailed map of the geographic area to define

Vehicle routes that emerge as output

Routing data may then be transferred

The algorithm (presented in detail previously) aims to form

As our experience indicates,

The computer code allows vehicles to be loaded to the limits

Page 31: Implementing vehicle routing algorithms

VEHICLe ROUTING ALGORITHMS 143

various capacity assumptions can be tested readily due to the algorithm's rapid performance. be imposed upon any route, we have found i n our experimentation that these conditions usually are m e t even when they are not pre- specified. When they are not m e t , simple manual changes can be made t o the routing pattern to satisfy these conditions.

upon time when sequencing drop points for each route. ther testing, time schedules as w e l l as routing, must be looked a t , and factors that influence schedules, such as delivery prior- i t i e s and deadlines, t ra f f ic patterns, timing of production, and others, must be taken into account.

We began w i t h data from approximately 600 drop points. ever, in several cases when geographical locations were indis- tinguishable i n terms of rectangular coordinates we were able to aggregate two small drop points into one larger drop point. Ap- plication of our routing algorithm t o the Worcester Telegram (W-T) data yielded the following results:

Although maximum route times can

The algorithm ignores possible dependence of route patterns In fur-

How-

The drop points wi th in the city limits were covered by 13 routes i n contrast t o the 20 routes used i n the W-T solution.

Several of the computer-dictated routes tended t o follow present W-T routes; others did not. The routes generated from our algorithm consolidated the W-T routing patterns. The fact that the pro- posed routes often followed W-T routes was consid- ered reassuring by everyone involved.

A routing concept emerged that was dramatically different from the one i n use. Several of the computer-generated routes called for deadheading to and from an outlying area. Although contrary t o previous W-T practice, the W-T seemed quite receptive, and even enthusiastic towards these route structures.

I n general, vehicles were loaded to more than 50 percent of functional capacity; they averaged 67 percent capacity.

The Circulation Department of the Telegram appeared t o be pleased w i t h the results presented. They had invested an appre- ciable amount of time i n gathering data and seemed to feel their investment was indeed worthwhile. As a r e su l t of uncovering

Page 32: Implementing vehicle routing algorithms

144 GOLDEN, MAGNANTI AND NGUYEN

large amounts of input data early in the study, many hidden as- pects of their routing system were brought to light. W-T personnel decided not to wait for our results, in some cases, but rather to examine their own routing policies immediately in a way they had never before. This led to an alteration of sev- eral of their routes with an apparent improvement in efficiency. In addition, this self-evaluation resulted in a greater under- standing of their delivery systems, not only with regard to routing policies, but in organization of data.

of the proposed routes have been implemented, at least in part. Insofar as our research was of an exploratory nature and dealt primarily with the routing aspect, we feel that our efforts have been quite successful. Our investigation confirmed what we sus- pected at the outset - namely, there are deep, subtle questions involved and yet substantial improvements can be realized. Since there are so many variables that enter into a sound rout- ing policy, we believe that through a computerized approach this problem can be handled more intelligently than it has been in the past.

On the basis of our preliminary recommendations several

X . CONCLUSION

This paper has presented the vehicle routing problem and the multi-depot VRP, discussed various integer programming for- mulations, studied several heuristic approaches, and introduced very efficient algorithms which have been implemented success- fully. The indication is that the suggested procedures are efficient and can be used as effective decision-making tools for large scale vehicle routing problems encountered in practice.

ACKNOWLEDGEMENTS

We are grateful to Professor F. J. Reintjes for his partic- ipation in the ANPA funded study at MIT of newspaper delivery and to Mr. Richard Lakus, circulation manager of the Worcester Telegram, for his assistance.

REFERENCES

1. Balinski, M. and R. Quandt, an Integer Program for a Delivery Problem," Operations Research, Vol. 12, No. 2, 1964, pp. 300-304.

2. Bellmore, M. and S. Hong, "Transformation of Multisalesmen Problem to the Standard Traveling Salesman Problem," JACM, Vol. 21, NO. 3, July 1974, pp. 500-504.

Page 33: Implementing vehicle routing algorithms

VEHICLE ROUTING ALGORITHMS 145

3.

4.

5.

6.

7.

8.

9.

10.

11.

12.

13.

14.

15.

Bellmore, M. and G. Nemhauser, "The Traveling Salesman Problem: A Survey," Operations Research, Vol. 16, 1968, pp. 538-558.

Beltrami, E. and L. Bodin, "Networks and Vehicle Routing for Municipal Waste Collection," Networks, Vol. 4, No. 1, 1974, pp. 65-94.

Bennett, B. and D. Gazis, "School Bus Routing by Computer," Transportation Research, Vol. 6 , No. 4, December 1972, pp. 317-325.

Bodin, L., "A Taxonomic Structure for Vehicle Routing and Scheduling Problems," Comput. and Urban SOC., Vol. 1, 1975, pp. 11-29.

Cassidy, P. and H. Bennett, "TRAMP - A Multi-depot Vehicle Scheduling System, I' OpemtZonaZ Research Quarterzy, vol. 23, NO. 2, pp. 151-163.

Christofides, N. and S. Eilon, "An Algorithm for the Vehicle Dispatching Problem,'' OperationaZ Research QuarterZy, vol. 20, 1969, p. 309.

Christofides, N. and S. Eilon, "Algorithms for Large Scale TSP' S, OpemtionaZ Research QuarterZy, vol. 23, 1972, p. 511.

Christofides, N., "The Vehicle Routing Problem," NATO Con- ference on CombinatoriaZ OptifiizaHon, July 1974, Paris.

Clarke, G. and J. Wright, "Scheduling of Vehicles from a Central Depot to a Number of Delivery Points," Gperations Research, Vol. 12, No. 4, 1964, pp. 568-581.

Dantzig, G. and J. Ramser, "The Truck Dispatching Problem," Management Science, October 1959, pp. 81-91.

Eilon, S., C. Watson-Gandy and N. Christofides, Distribu- tion Management, Griffin, London, 1971.

Floyd, R., "Treesort Algorithm 113, ACM CoZZected AZgo- dthms, August 1962.

Gabbay, H., "An Overview of vehicular Scheduling Problems," TechnicaZ Report No. 103, M.I.T. Operations Research Center, September 1974.

Page 34: Implementing vehicle routing algorithms

146 GOLDEN, MAGNANTI AND NGUYEN

16.

17.

18.

19.

20.

21.

22.

23.

24.

25.

26.

27.

Gamin, W., H. Crandall, J. John and R. Spellman, "Appli- cations of Linear Progrming in the Oil Industry," M-ement Sdence, Vol. 3, NO. 4, July 1957, pp. 407-430.

Gaskell, T., "Bases for Vehicle Fleet Scheduling," Opera- tionaZ Research Quarter&, vol. 18, 1967, p. 281.

Gillett, B. and J. Johnson, "Sweep Algorithm for the Mul- tiple Depot Vehicle Dispatch Problem," presented at The O R S A / T W Meeting, San Juan, Puerto Rico, October 1974.

Gillett, B. and L. Miller, "A Heuristic Algorithm for the Vehicle Dispatch Problem, " Opercztions Research, Vol. 22, 1974, p. 340.

Golden, B., "Vehicle Routing Problems: Formulations and Heuristic Solution Techniques , It Technica 2 Report No. 11 3, M.I.T. Operations Research Center, August 1975.

Golden, B., T. Magnanti and H. Nguyen, "Implementing Ve- hicle Routing Algorithms, 'I TechnicaZ Report No. 11 5, M.I.T. Operations Research Center, September 1975.

Held, M. and R. Karp, "The Traveling-Salesman Problem and Minimum Spanning Trees," Operations Research, Vol. 18, NO. 6, 1970, pp. 1138-1162.

Held, M. and R. Karp, "The Traveling-Salesman Problem and Minimum Spanning Trees, Part 11," bkzthematicat Progranrming, Vol. 1, NO. 1, 1971, pp. 6-25.

Hudson, J., D. Grossman and D. Marks, "Analysis Models for Solid Waste Collection," M . I. T . C i V i i ? Engineering Report, September 1973.

IBM Corporation, "System 360Dehicle Scheduling Program Application Description - VSP," Report H20-0464, White Plains, New York, 1968.

Karg, L. and G. Thompson, "A Heuristic Approach to Solving Traveling Salesman Problems , 'I Mmrcrgement Sdence, Vol. 10, pp. 225-248.

Kershenbaum, A. and R. Van Slyke, "Computing Minimum Span- ning Trees Efficiently," Proc. of 1972 ACM Conference, Boston, August 1972.

Page 35: Implementing vehicle routing algorithms

VEHICLE ROUTING ALGORITHMS 147

28.

29.

30.

31.

32.

33.

34.

35.

36.

37.

38.

39.

40.

Klincewicz, J., "The Tyagi Algorithm for Truck Dispatching," UROP F i n d Pro,ject Report, M.I.T., 1975.

Krolak, P., W. Felts and J. Nelson, "A Man-Machine Approach Toward Solving the Generalized Truck Dispatching Problem," Transportation Sdence, vol. 6, NO. 2, 1972, p. 149.

Lin, S. , "Computer Solutions of the TSP," Be22 Systems TechicaZ Journal, vol. 44, 1965, p. 2245.

Lin, S. and B. Kernighan, "An Effective Heuristic Algorithm for the TSP," Operations Re~earch, Vol. 21, 1973, p. 498.

Little, J. D. C., K. Murty, D. Sweeney and C. Karel, "An Algorithm for the Traveling Salesman Problem," Operations Research, Vol. 11, No. 6, 1963, pp. 972-989.

Miller, C., A. Tucker and R. Zemlin, "Integer Programming Formulation of Traveling Salesman Problems, JACM, 7, 1960, pp. 326-329.

Newton, R. and W. Thomas, "Bus Routing in a Multi-School System," Computers and Operations Research, vol. 1, No. 2, 1974, pp. 213-222.

Nguyen, H., "Multi-Depot Vehicle Routing Problems," Master's Thesis, Sloan School of Management, M.I.T., 1975.

Orloff, C., "A Fundamental Problem in Vehicle Routing," Netuorks, vol. 4, NO. 1, 1974, pp. 35-64.

Orloff, C., "Routing a Fleet of M Vehicles to/from a Central Facility," Networks, Vol. 4, No. 2, 1974, pp. 147-162.

Orloff, C. and D. Caprera, "Reduction and Solution of Large Scale Vehicle Routing Problems, Princeton University, Transportation Program, July 1975.

TechnicaZ Report 75/TR- 7 ,

Pierce, J., "Direct Search Algorithms for Truck-Dispatching Problems, Part I," Tramportation Research, vol. 3, 1969, pp. 1-42.

Robbins, J., J. Shamblin, W. Turner and D. Byrd, "Develop- ment of and Computational Experience with a Combination Tour Construction-Tour Improvement Algorithm for Vehicle Routing Problems," presented at The O R S A / T h Meeting, Las Vegas, Nevada, November 1975.

Page 36: Implementing vehicle routing algorithms

148

41.

42.

43.

44.

45.

46.

47.

48.

49.

50.

GOLDEN, MAGNANTI AND NGUYEN

Russell, R., "An Effective Heuristic for the M-Tour Travel- ing Salesman Problem with Some Side Conditions," presented at The oRSA/TlNS Meeting, Las Vegas, Nevada, November 1975.

Shapiro, D., "Algorithms for the Solution of the Optimal Cost Traveling Salesman Problem," Sc. D. Thesis, Washington University, St. Louis, 1966.

Svestka, J. and V. Huckfeldt, "Computational Experience with an M-Salesmen Traveling Salesman Algorithm," Manage- m e n t Science, vol. 19, NO. 7, 1973, pp. 790-799.

Tillman, F. and T. Cain, "An Upper Bounding Algorithm for the Single and Multiple Terminal Delivery Problem," Manuge- ment Science, vol. 18, NO. 11, 1972, pp. 664-682.

Turner, W., P. Ghare and L. Fourds, "Transportation Routing Problem - A Survey," A I n Transactions, Vol. 6, No. 4, December 1974, pp. 288-301.

Tyagi, M., "A Practical Method for the Truck Dispatching Problem," J . of the Operations Research Society of Japan, Vol. 10, 1968, pp. 76-92.

Webb, M., "Relative Performance of Some Sequential Methods of Planning Multiple Delivery Journeys," Operational Re- search Quarterly, vol. 23, NO. 3, 1972, p ~ . 361-372.

Williams, J., "Algorithm 232: Heapsort," Corn. ACM, Vol. 7, NO. 6, 1964, pp. 347-348.

Wren, A. and A. Holliday, "Computer Scheduling of Vehicles from One or More Depots to a Number of Delivery Points," Operational Research QuarterZy, vol. 23, 1972, pp. 333-344.

Yellow, P., "A Computational Modification to the Savings Method of Vehicle Scheduling," Operational Research Quar- ter ly , vol. 21, 1970, p. 281.

Research of f i r s t author #as supported i n p a r t by the American Newspaper Publishers' Association and by the Department of Transportation, Contract DOT-TSC-2058. B. L. Golden i s now a t the University of Mwland, Co Z Zege Park, Maryland. Research of second author w a s supported i n p a r t by the Office of Naval Research, Contract N00014-75-C-0556 and by the Army Research Off ice , Durham, Contract DAHCO-73-C-0032.

Paper received September 24, 1975.