Jacques Desrosiers and Yvan Dumas. GERAD, Ecole des Hautes Etudes Commerciales de Montreal. 5255, rue Decelles, Montreal, Quebec, Canada.
THE SHORTEST PATH PROBLEM FOR THE CONSTRUCTION OF VEmCLE
ROUTES
WITH
PICK-UP,
DELIVERY
AND
TIME
CONSTRAINTS
Jacques Desrosiers and Yvan Dumas GERAD, Ecole des Hautes Etudes Commerciales de Montreal 5255, rue Decelles, Montreal, Quebec, Canada
ABSTRACT This article examines a constrained shortest path problem which occurs when a vehicle route must be designed to cover transportation requests, each requiring pick-Up and delivery.
The additional constraints relate to the capacity of the
vehicle and time intervals within which pick-up and delivery must occur. propose a dynamic programming algorithms for this problem.
We
This problem arises
for the generation of feasible routes during the solution by column generation of the problem in which routes for many vehicles must be constructed. Key words: I
Constrained shortest path, dynamic programming, column generation
INTRODUCTION In this paper we present an algorithm for a constrained shortest path
problem in the context of goods transportation with pick-up and delivery subject to time constraints. admissible
routes
This shortest path problem can be used to generate
during
the
solution
by
column
generation
of the
route
construction problem with many vehicles [61. The set of transportation reguests is denoted by D transportation request i is associated: H. A. Eiselt et al. (eds.), Advances in Optimization and Control © Springer-Verlag Berlin Heidelberg 1988
{I, ... , n}.
With each
145
a pick-up location (denoted by i+) and a delivery location (denoted bye); a quantity of goods to be transported; handling times at pick-up and delivery locations; time intervals within which pick-up and delivery must take place (called time windows), With each vehicle
~
is associated;
a departure location and an arrival location (which may be different); a vehicle capacity; a time interval defining the hours during which the vehicle is available, and thus the maximum length of a route; a fixed cost of use, a travel speed, and a travel cost as a function of the load carried. For
a
given vehicle,
transportation requests.
an
admissible
route
links
together
a subset of
It must therefore satisfy constraints associated with time
windows, pairing (both pick-up and delivery locations must be visited), priority (pick-up must take place prior to delivery) and vehicle capacity.
If necessary,
waiting prior to visiting a location is permitted in order to satisfy time window constraints. There are two families of solution methods for constrained shortest path problems:
Lagrangian methods in which a multiplier is associated with each
constraint and in which classical shortest path problems are solved; and dynamic programming.
For the shortest path problem with time windows only, dynamic
programming methods have been used, e.g. a Ford-Bellman type algorithm ([II, [8)) and a primal dual reoptimization algorithm ([2)).
The travelling salesman
problem with pick-up, delivery and time windows is similar to the problem examined here in terms of its constraints.
Dynamic programming algorithms ([31,
(9)), and a Benders decomposition approach ([10], (11)), have been developed to deal with this problem in the context of the transportation of the handicapped.
146
We propose a forward dynamic programming algorithm to solve the shortest path problem with pick-up and delivery subject to time constraints.
In the
presentation, we emphasize the numerous state elimination criteria which result from the additional constraints.
2
THE MATHEMATICAL PROBLEM
2.1
Notation For a given vehicle, the shortest path problem is defined on a network made
up of the following elements.: departure and arrival nodes of the vehicle;
sand t :
D+
{i+
D-
{C
I I
E D}
the set of pick-up nodes;
E D}
the set of delivery nodes;
N = D+ U D- u {s, t} 2 I s;; N :
the set of nodes in the network; the set of admissible arcs (see Section 2.3).
In the formulation, we use flow variables, time variables and load variables:
x.. , (i, j) IJ
T., 1
E
I :
flow variable taking the value 1 if the vehicle uses arc (i, j) and 0 otherwise;
E
N
time variable
representing the
arrival time at
node i;
Y., 1
E
N
load variable representing the quantity of goods in the vehicle after visiting node i;
The parameters of the shortest path problem are defined as follows: d.+ > 0, i ED: 1
the quantity of goods to d.-
=
-d.+ and d
l I S
=
d
t
=
be transported (set 0);
pick-up and delivery time windows; time
interval
available;
C
vehicle capacity;
during
which
the
vehicle is
147
t. . IJ
0., (i, j)
~
e I
time required to travel on arc (i, j) including handling time at node ij
cij ~ 0, (i, j)
g(Y)
~
e I
travel cost on arc (i, j)j
0, :
weighting
factor
on
the
travel
cost (non
decreasing function of the load transported). tr. ~ 1
e N
0,
dual variable associated with the nodes of the networkj
cIJ.. (Y.), 1
(i, j) e I
marginal
cost
g(Y.)c .. 1
of
arc
(i, j),
defined as
tr ..
IJ
I
By solving the linear relaxation of a set partitioning problem corresponding to the many vehicles route construction problem, we obtain the dual variables i
e D and
'Jr., 1
These are transferred to the nodes of the network for the s generation of new admissible columns by associating to pick-up nodes tr.+ = 'Jr., i 'Jr.
e D and to delivery nodes
tr.1
= 0, i
1
E
D.
associated with the departure node takes the values tr s
2.2
I
In the same way, the dual variable
=
'Jr
s
while ut
=
o.
Formulation The formulation of the shortest path problem with pick-up and delivery
subject to time window constraints is as follows:
E
Min
(.. I,J )eI
c.. IJ
(1)
(Y.)X.. 1 IJ
subject to
= s
EX .. - EX .. . IJ . Jl J
X..IJ
J
binary
E• X.+ 1. J
J
1-: (i, j)
E XJl.. -
. 'J
e D+ u D -
i e D
E
(2)
= t I
(3)
(4)
148
T. + t 1
Ys T
s
OJ 0 :5
=
Y.1
1
~
Y.
X ..
==1~
T.
IJ
(5)
e N
(6)
i e N
(7)
Y.1 + d. J
(i, j) e I
(8)
T. + t ..
(i, j) e I.
(9)
:5 C
a . ai :5 Ti :5 b. 1 s'
X.. IJ
eD
T..+.- :5 1
1 1
J
J
~
1
IJ
The objective function (1) minimizes the marginal cost of a path or admissible route.
Relations (2) and (3) represent the standard constraints of
a shortest path problem form s to t.
Constraints (4) (pairing constraints)
ensure that both the pick-up and the delivery nodes are visited for any request in the route, while relations (5) establish the priority constraints. Constraints (6) and (7) indicate the initial conditions at the departure node s, and set limits on vehicle capacity and the time interval at each node respectively. Constraints (8) and (9) give the relations between the path followed and the
load
and
schedule
of
the
vehicle
respectively.
These
non-linear
constraints can be linearized ([41, [12]), but they are better treated in the present form using the dynamic programming method.
Along with the time
window constraints, constraints (9) allow waiting time efore visiting node j. This waiting time is not penalized and one possible evaluation of the times of arrival at the nodes of a path is given by:
X.. == 1 IJ
~
T. == max {a., T. + t..} J
J
1
IJ
(i, j) e I.
(10)
Note finally that constraints (9) impose increasing visiting times at the nodes of the path:
the optimal path will be elementary, i.e. without cycles.
149
2.3
Network Construction The set N of nodes of the network is made up of pick-up and delivery
nodes as well as the vehicle departure and arrival nodes: N -= D+ U D- u {s, t}. The set I of admissible arcs is a subset of N2j it is made up of arcs which satisfy a priori certain constraints of the problem.
The additional
constraints are used to eliminate the following inadmissible arcs: a)
priority:
(s, e) and
(e,
b)
pairing:
(i+, t), i
D;
c)
vehicle capacity:
E
i+), i
E
Dj
if d.+ + d.+ > C, i, JED, i '" j, then the following J
1
arcs are eliminated (i+, /), (j+, i+), (i+, j-), (/, i-)
(e,
r)
and
(j-, e); if a. + t .. > b., (i, j)
d)
time windows:
e)
time windows and pairing of reguests:
1
J
IJ
I, then the arc (i, j) is eliminated;
E
fQr two requests i, JED, i "" j,
arcs are eliminated if they cannot be part of any path including both the pick-Up
and delivery nodes for the two
request, i.e. if time window
constraints are not satisfied: (i+,
r)
is eliminated if the path j+ -+ i+ -+ j
-+ i
with T.+
a.+ is
.+ -+ j
with T.+
a.+ is
J
infeasible;
(e, /)
is eliminated if the path i+ -+
-+J
J
1
1
infeasible; (i+, /) is eliminated if the paths i+ -+ j+ -+ -+ i
(e,
1
is eliminated if the paths i+ -+ /
and j+ -+ i+ -+
f)
same location:
-+ j
= a.+ are infeasible 1
with T.+
r)
and i+ -+ /
-+ j
e
-+
r
-+ j
-+
with T.+
a.+
1
1
= a.+ are infeasible.
with T.+ J
J
when the travel cost between nodes i and j is zero (c.. IJ
0), this criterion allows the a priori imposition of a visiting order for the nodes i and j without losing optimality; arc (i, j) (u-, v-), u, v
E
E
{(u+, v +), (u+, v -),
D} is eliminated if b. + T.. > b. + T .. and a. ~ aJ., with I
1
J
IJ -
at least one strict inequality, or if b. + T..
IJ
Jl
b. + T .. , a. J
Jll
1
a. and i < j. J
150
The proof is presented in [3). (i, i) where i e N and (t, s).
g)
elementary path:
3.
SOLUTION ALGORITHM FOR AN ELEMENTARY PATH The technique used to solve the constrained shortest path problem is This technique provides an integer solution and takes
dynamic programming.
advantage of the numerous additional constraints.
In the next section, we give a
technical
programming
description
of the forward
dynamic
algorithm.
functional equation is not stated as it needs supplementary notations.
The
The reader
may refer to [6, pp. 22-241 for a more complete formulation. 3.1
Definition of Labels
~,
We denote by
the path k from the departure node s to node l.
This
path is admissible if it is elementary, if it respects the time window, priority and capacity constraints, and if it satisfies the pairing constraints when l label
(S~, T~, Z~)
is associated with the path
set of nodes visited,
T~ e
is the sum of the costs.
~,
leN, where
S~ ~
[al' b l1 is the time of arrival at node l and
t.
A
N is the
Z~ e
This information is sufficient to calculate the load
R
Y~
of the vehicle at node l, as
~l = Ed.. k
ieSl
(11)
I
The dynamic programming approach considers for each label, the state
T~)
with a cost of
Z;.
k' k' T. , Z. ). J J
S.k' J
~
to a
with associated label
(S~',
An attempt may be made to extend a path
node j if arc (l, j) e I, to obtain a new path
t'J
(S~,
J
This label is calculated as follows: Sk u l
{n,
(12)
151
if
T~' J
$
b.j
(13)
J
(14)
~.
The conditions expressed by relations (12) and (13) ensure that the path
J
does not revisit the node j and that the time window at node j is respected.
To
be admissible, this path must also satisfy the following constraints concerning capacity (15), priority (16) and pairing if j = t (17);
(15)
.+
I
E
Sk l'
if j if j
=
The algorithm is initialized by the path f the optimal solution will be given by
~*
1
s
i ,.
(16)
t.
(17)
whose label is ({s}, a, 0) and s
ending at node t with minimum cost
Z;'" : its label will be of the form (N, T;*, Z;*).
3.2
Label Elimination In the following paragraphs, we present three state elimination methods based
respectively on the notion of dominance between labels, on the notion of a non post-feasible label, and on the order of treatment of the labels.
The elimination
of a label results in the elimination of the associated path.
3.2.1
Dominance Between Labels For two different paths
~
and
same set of nodes, if path
~
finishes earlier than path
extension of
~.
is also feasible
lower than the cost of
~ •,
~.
ending at node l and having visited the
for~.
the path
~',
then any feasible
If in addition, the cost of path
~•
~
is
and its associated label can be
eliminated as it cannot form part of the optimal path.
152
Proposition 1:
k If two labels are such that Sl k' k' k' label (S l ' T l ' Zl ) can be eliminated.
Proposition 1 requires that the paths nodes:
~
and
~'
visit the same set of
this implies that the load in the vehicle at node l will be the same for k
both paths, i.e. Yl =-
__k'
Yi. .
Proposition 2 is an extension of proposition 1 which
allows dominance between labels when the set of nodes visited on the path a subset of the nodes visited on the path k zero at node l for both paths (i.e. Yl
~',
is
and if the load in the vehicle is
= Yk' l .... 0).
The label elimination
presented in proposition 2 is valid as any feasible extension of for
~
~'
is also feasible
~.
Proposition 2: k If two labels are such that Sl
k' k k' k k' k Sl ' Tl < Tl and Zl ~ Zl and if Yl __k' k' k' k' == 0, then the label (S l ' T l ' Zl ) can be eliminated. C
Y"i 3.2.2
Non Post-Feasible Label A label associated with a path
~,
admissible from node s to node l, which
cannot be extended from node l to the return node t while respecting the time window and pairing constraints is called a !!2!!. post-feasible label; it can be eliminated.
This concept was introduced in [3J, in the context of transportation
of the handicapped.
Labels are tested for non post-feasibility when the vehicle
load is non-zero, i.e. when pick-Up nodes have been visited but the corresponding delivery nodes have not been visited so far.
The results of the following
proposition is more powerful than those used for the a priori elimination of arcs (Section 2.3) because the time of arrival solution process. nodes.
T~
at node l is known during the
Proposition 3 deals with pairing with one and two delivery
153
Proposition 3: A)
(s~, T~, z~)
A label
such that
T~
> al , i+ e
s~
C e s~
and
is
eliminated if the extension l -+ C is infeasible. k Tk Zk) h th Tk .+.+ Sk d·-·-.1 Sk . A Iabel (Sl' l' l suc at l > al , I ,J e l a n I , J " l IS
B)
eliminated if both the extensions l -+ i
-+ j
and l -+
r
-+ i
are
infeasible. 3.2.3
Order of Treating the Labels At iteration of K of the algorithm, we construct paths visiting K nodes
based on the paths generated in the preceding iteration.
Once the labels from
iteration K -1 have been treated, it is not necessary to store them to generate new labels.
However, because of the application of proposition 2, it is necessary
to retain the labels from preceding iterations for which the vehicle load is zero at nodes leD -.
For paths finishing at the arrival node t, we store only the label
associated with the least cost admissible path. 4.
SOLUTION ALGORITHM FOR A NON-ELEMENTARY PATH In the context of the construction of vehicle routes using a set partitioning
formulation, the columns correspond to admissible routes, and it is not necessary that the paths be elementary.
If a path includes a cycle, thus satisfying a
transportation request i more than once, the coefficient corresponding to this request in the column will be an integer value greater than 1.
This column
cannot therefore become part of the integer solution of the set partitioning problem and will be rejected in a branch-and-bound ([5], [6]). 4.1
Definition of the Labels Let
R(S~)
be the subset of
S~
containing the pick-Up nodes which have been
visited, but whose corresponding delivery nodes have not yet been visited: -=
{i+ e
S~ I C ~ S~).
A label
~
R(S~)
is then associated with the admissible path
154
k k k (R(S i)' T i' Zi)'
This path is extended in the same way as that described in
relations (11-17) replacing
S~
by
R(S~).
The associated label contains sufficient
information to allow the verification of the constraints on time windows, priority, pairing and capacity. as
R(S~)
However, it is not sufficient to construct elementary labels
contains no information on the transportation requests whose pick-up
and delivery nodes have both been visited. The algorithm is initialized by the path fl whose label is (ifJ, a, 0). s s
The
optimal solution (with the possibility of cycles) will be given by the path
¢*
with a minimal value Z:*j its label will be of the form (ifJ, T:*, Z:*). 4.2
Label Elimination Label elimination due to dominance is carried out as a function of time and
cost using the sets obtained with R(.). ProEosition 4: k k' k If two labels are such that R(Si) = R(Sl ), Ti
:s
k' Zk Tl and i
:s
k' k' then the label (R(S l ), Rl ' Zk' ) can be eliminated. l Proposition 4 generalizes both proposition 1 and 2. the paths
~
and
~'
visit the same set of nodes:
In fact, in proposition 1, k k' hence R(Sl) = R(Sl j in
proposition 2, the fact that the vehicle load is zero at node i implies that
R(S~)
k'
= R(Si ) = ifJ· ProEosition 5: k
k'
k
If two labels are such that R(S l) c R(S l ), T l
if the costs cij' (i, j) eliminated.
E
:s
k' k T land Zl
:s
k' Zland
k' k' k' I are Euclidean, then the label (R(S l ), T i ' Zl ) ca.n be
155
Proposition 5 can also be proved under the hypothesis that the costs
cIJ..(Y.)I
are Euclidean; however, it is stronger in the above form and it is in this form that we use it in the algorithm.
In this new algorithm, label elimination can
also be carried out using the concept of the non post-feasible label applying proposition 3. 5.
CONCLUSIONS The interest of this constrained shortest path problem derives from its
appearance as a generator subproblem in the solution by column generation of vehicle routing problem with pick-up and delivery subject to time constraints. The algorithm described in Section 4 has been implemented, while that described in Section 3 (elementary path) has not, as this did not seem practically justified. Certain key results on the behaviour of the algorithm are given here; further details are available in [6]. The algorithm was tested as a subroutine of the column generation method for the routing problems suggested by Guinet [7] and for some extensions of these, as well as for random problems. transportation request (40 to 112 nodes).
The problem size varied from 19 to 55 These problems are highly constrained
in terms of capacity (di 2! C /3) and the vehicle availability constraints allow up to 5 requests to be satisfied (i.e. 10 pick-up and delivery nodes can be visited in a route).
Some problems are unconstrained by time windows on the nodes; only
the interval of availability of the vehicle defines the time constraints.
In such
cases, several a priori elimination criteria for arcs (Section 2.3) are without effect, as are the label elimination criteria of Proposition 3. The performance of the algorithm is sensitive to the size of the network, the quantities transported as compared with vehicle capacity, the size of the time windows and the number of significant figures in the time values.
The problems
for which the number of labels generated is limited are easily solved; this is the case for problems whose time windows are small (up to 30% of the vehicle availability interval).
156
This article has emphasized the necessity of controlling the number of controlling the number of labels generated and stored:
this is a key factor in the
efficiency of this dynamic programming approach.
When the constraints are
restrictive, this algorithm can generate admissible routes for large scale problems (over 50 transportation requests) in a reasonable time. REFERENCES [1].
M.
Desrochers
Algorithm
and F.
for
the
Soumis,
Shortest
"A Generalized Permanent Labelling
Path
Problem
with
Time
Windows" ,
Publication #394A, Centre de recherche sur les transports, Universite de Montreal, 28 pages, 1985. [2].
M. Desrochers and F. Soumis,
"A Reoptimization Algorithm for the
Shortest Path Problem with Time Windows", Publication #397A, Centre de recherche sur les transports, Universite de Montreal, 24 pages, 1985. [3].
J. Desrosiers, Y. Dumas and F. Soumis,
"A Dynamic Programming
Method for the Large Scale Single Vehicle Dial-a-Ride Problem with Time
Windows" ,
Publication
#361,
to
appear
in
American Journal of Mathematical and Management Science. [4].
J. Desrosiers, P. Pelletier and F. Soumis,
"Plus court chemin avec
contraintes d'horaires", R.A.I.R.O. Recherche operationnelle, 17, 357-377, 1983. [5].
J.
Desrosiers,
F.
Soumis
and
M.
Desrochers,
"Routing with Time
Windows by Column Generation", Networks, 14, 545-565, 1984. [6].
Y. Dumas, "Confection d'itineraires de vehicules en vue du transport de plusieurs origines
a
plusieurs destinations", Publication #434, Universite
de Montreal, 96 pages, 1985.
157
(7].
A. Guinet, "Le systllme T.I.R.:
un systllme d'etablissement de tournees
industrielles routillres, tMse de doctorat en informatique et automatique appliquee", Universite Claude Bernard [8].
a Lyon,
1984.
A. Kolen, A. Rinnooy Kan and H. Triene Kens, "Vehicle Routing with Time Windows", Working Paper, Erasmus University, Rotterdam, 14 pages, 1985.
[9].
H. Psaraftis, "A Dynamic Programming Solution to the Single Vehicle Many-to-Many Immediate Request Dial-a-Ride Problem", Transportation Science, 14, 130-154, 1980.
[10].
T. Sexton and L.
Bodin,
"Optimizing Single Vehicle Many-to-Many
Operations with Desired Delivery Times:
I. Scheduling", Transportation
Science, 19, 378-410, 1985. [11].
T.
Sexton and L. Bodin,
Operations
with
"Optimizing Single Vehicle Many-to-Many
Desired
Delivery
Times:
II.
Routing" ,
Transportation Science, 19, 411-435, 1985. [12].
M.
Solomon,
Constraints:
"Vehicle
Routing
and
Scheduling with
Time Window
Models and Algorithms", Ph. D. Thesis, Dept. of Decision
Sciences", University of Pennsylvania, 1983.