Jacques Desroslers* Yvan Dumas** and Françols Soumls ...... [5) DESROSIERS, J., DIJMAS, Y. and SOUMIS, F., The Multiple Vehicles Many to Many Routing ...
A DYNAMIC PROGRAMMING METHOD FOR THE LARGE SCALE SINGLE VEHICLE DIAL-A—RIDE PROBLEM WITH TIME WINDOWS by Jacques Desroslers* Yvan Dumas** and Françols Soumls***
*
Qépartement de l’enseignement des méthodes quantitatives, Ecole des Hautes Etudes Commerciales de Montréal
**
Département d’informatique et de recherche opérationnelle, Université de Montréal
k
cole Polytechnique de Montréal and Centre de rehcherche sur les transports, Université de Montréal
Université de Montréal Centre de recberche sur les transports Publication #361 Ecole des Hautes Etudes Commerciales Cahier du GERAD # 84-12 Août 1984 Révisé en février 1985 -
-
—
SUMMARY
The single vehicle dial—a—ride problem wlth time window constraints
for
both
pick—up
and
delivery
locations,
and
precedence and capacity constraints is solved using a forward dynaniic programniing algorlthm. The total distance is minimized. The development of criteria for the elimination of infeasible states results in solutions times vkiich increase ltnearly with problem size.
Key rds : dial—a—ride, dynaniic programming, routing, schedul ing.
1.
INTRODUCTION The problem examined in this article is the “Single Vehicle Dial—a
Ride Problem”. In this problem, a vehicle picks up people at their place of origin and takes theni to their destination iile flot exceeding vehicle capacity and respecting time wtndow constraints at the origins and destina-. tions. The objective is to find the itinerary which minimizes the total distance travelled. 1.1
Literature review The single vehicle problem has been studied by Sexton and Bodin
[13]; they investigated the dial—a-ride problem in iich each customer specifies a desired time for pick—up or delivery. The resuit is a heuristic routing and scheduling algorithm based on Benders’
decomposition vkiich
minlmizes total customer inconvenience and is known to produce high quality solutions. Psaraftis [8] developed a backward dynamic programming method for the single vehicle problem, but rather than imposing time wlndow con— straints at the origins and destinations, he imposed a “maximum position wlth the respect to the ordering of pick-up and delivery times r)• Armstrong and 2 3 requested. Computatton ttme for n customers is O(n
shift”
Garfinkel [1] also developed a backward recursion procedure for this prob— lem using a maximum position shift fonnulatiori rather than time windows; their procedure is much more powerful for heavily constrained problems. It allows a great reduction in the number of states generated, but the algo—
rithm cannot optimally solve the case where dock time is used to define tue constraints. Psaraftis developed a forward dynaniic programming [9) with true dock time windows at both pick-up and delIvery locations. The objective function minimizes the the total
time needed to service ah
custociers. Unfortunately, this algoritiin ls independent of the tightness of
the time window constraints, and, in practice it cannot solve problems with ) 2 more than around eight to ten customers. This author also analyzes an 0(n heuristic [10] for the single vehicle problem.
—2— Badin et ai. £3], in their state of the art article, describe three
aigorithms for the multi—vehicle problem : the NEIGUT/NBS aigorithni (a sequentiai insertion procedure), the MIT algorithm [7] (a concurrent proce dure) and the Bodin/Sexton algorithm £4] (a clustering/concurrent insertion procedure).
Two other algorithms have recentiy been deveiopped at the
Université de Montrêai : the rk of Roy et al. Ui, 12] is also based on a concurrent insertion procedure wliile the Desrosf ers et al. algorithm [5] is a “mini ciuster first-routing second” approach using a column generation
scheme. This
paper
probleni with dock
presents
an
optimal
tue windows
using
solution
ta
the
forward dynamic
single vehicle programming and
significantiy reducing the number of states generated. We also use the two dimensionai
(time,
cost)
labeling
introduced
in
[6]
for
solving
the
shortest path problem with time windows by dynamic programming. We minimize
the total distance travelied and flot the total time required ta serve ah customers. The algorithm proposed can efficiently solve problems 0f up to
40 service requests and is presentiy used ta optimize the routes con— structed In a large scale multi—vehicle problem [2, 5]. 1.2
Formulation Consider a set of ri service requests. Associated with each request
we have 1) an origin node I with a departure time
value C.
>
Intervai
tAi,Bt], an integer
1 representing the number of peopie ta be picked up and
, the time required ta handie pick-up; 1 M 2) a destination node n value and
1 C,.,.. , . 1 M,
=
—Cj
+ j
with an arrivai time Interval
[A+j, B+j],
a
representing the riumber of people ta be dropped off
the time required to handie dehivery.
—3—
In addition to these 2n nodes, vehicle 0 C
departure
point
(with
time
have a node O to represent the window
, 0 [A
] 0 B
and
the
integer
O representing the number of passengers in the vehicle), and the
node 2n
1 for the vehicle arrivai point (with the Interval [A2fl+l, ) 21 B and C 21 = —C ). D and T 0 13 respectiveiy denote the distance traveiled +
and the travel ttme between nodes I and 3. The formulation includes fiow variables
X.,
time variables t 1
and
vehicle ioad variables y , where 1
X.. 13
ri =1
LO
if the route uses arc (1,3) otherwise,
tj : arrivai time at node I, 1 : the number of passengers In the vehicle on its departure from node I. y The shortest route satisfylng precedence constraints, time window constraints
and
vehicle
capacity
constraints
is
the
solution
of
the
following probiem Min Z
2n
2n+i
1=0
3=1
. x 1 D . 1
=
(1)
‘
n Subject to
X 0 3
=
1
(2)
j=i 2n ÷ 1 x = 1 2 1 2n
: 1=0
x
.
J
(3)
‘
i=n+1
2n+1 1 X
=
j=
x = 4 1 Çj
(4) =
binary j
=
0,i,...,2n 1,...,2n+i
(5)
-4-
1 A 1 t x.. 13
1 t
1 B
t. 1
+
M.1
T..
+
13
—
1—
->‘
—
+
C
3
(6)
I
n 9 1...
(7)
0,1,...,2n 1,...,2n+1
(8)
i=1,...,2n+1
(9)
01,..,2n 1,...,2n+1
(10)
=
j
=
1 =
—
j
0,1,...,2n+1
j = .
1 = y ; 0 C 0y C 1 X
j =
3j ’
j
=
This formulation Includes a flow problem structure (1-5) where each node Is vlsited only once (4) with a single vehîcle departing from node O (2) and terminating at node 2n+1 (3). The problem also includes time window constralnts (6), origin-destinatlon precedence constraints (7) and vehicle capaclty constraints (9). Constraints (8) describe the relation between the flow variables and the time variables, while constraints (10) describe the relation between the flow variables and vehicle load at each node. The problem
is
constraints
essentially
a
travelling
salesman
problem with
additional
with the non—linear constraints (8) ensuring sub—tour elimina—
tion. In fact, these constraints require increasing times at each of the nodes along the route thus preventing sub-tour formation. By minimizing the total distance travelled, riding time wlthln the vehicle is flot minirnized In equatton (8). ThIs objective function is less general than others proposed for minimizing user inconvenience. Using the definition of tirne windows given In Roy et al. Eh], it is however possible to take into account user Inconvenience issues. For exam— ple if a request j has a desired departure tirne A , the latest Urne the 1 vehicle may arrive at the origin node is defined as B 1
=
1 A
+
Œ,
with
Œ
45 minutes depending on the priority of the request. The lower and upper
—5—
bounds of the time window at the destination node n 1 A
+
1 M
+
, 1 T
and
1 B+
=
A+i
+ Œ +
3
with
+
1 are given by A+j
and
3= 0.5
=
where
(cz+) Is also constrained to be at last 15 minutes but flot more than 60
minutes. By defining the time windows in this way,
re
respect the constraint
on the maximum deviation fron the desired service time
(parameter cz).
Constraints on the maximum excess travel time and on maximum total travel
time are relaxed, but are controlied by the sum of the parameters (cz+). With this definition, the time windows are sufficiently large that the problem does flot reduce to visiting a sequence of origin-destination pairs. The solution method described in the following section is however appropriate for any objective function which can be written as a linear function of the xij variables (distance and/or time). 2.
SOLUTION METHOI)
The problem is solved using a forward dynamic programming method. The vehicle is initially located at the departure node 0. At the first iteration, the states are made up of routes visiting a single node froin among the origins. At each subsequent iteration k (2
‘
k
2n), the states
are constructed from the states of the previous iteration and are made up of routes visiting one additlonai node from among the origins and destina tions. At the last iteration (k=2n+1), the vehicle must go to the arrivai node 2n+1. We have improved the efficiency of this method, even for large scale problem, by eliminating states (section 3) which are incompatible with vehicle capacity, precedence and time window constraints. 2.1
Deflnition of states At iteration k (kk2n),
define a state (S,1) If
node O, there exlsts a route wtilch visits ail the nodes In S
starting at {1,...,2n}
and terminates at node ItS; S is a non—ordered set of cardinality k.
-6—
The
state
(S,i)
is
ante-feasibie
an
if there exists
order of
visiting the nodes in S ending with node I which respects vehicle capacity, precedence, and time window constraints. The state (S,i) Is post—feasible if, beginning at node j,
there exists an order of visiting the nodes in
whIch respects the same constraints. In the proposed algorithm, we elimi— nate ail
states kiIch are flot ante-feasible. Only some of the non-.post
feasibie states are eiimlnated : we do flot eliminate states wtiich uld be more costly to identify than the savings likely to be achieved. 2.2
Definitiori of labels For the state (S,i), there are several routes from node O to node j.
These routes have the same vehicle ioad at node I, regardless of the order in ich the nodes of S are visited : this load is denoted by y(S). ever, the routes differ in
tenns
How—
of the arrivai time at node j and the
distance traveiled (cost) to reach this node, depending on the order In which the nodes are vlsited. Denote by (Sai) a given route correspond ing to a state (S,i). For each route, we define a (time, cost) label as (t(S,I),
z(S,i)),
where
t(S,I)
and
z(S,i)
represeflt
respective—
iy the arrival time at node I and the distance travelled to reach this node after vtsiting the nodes of S in the order described by Sa. At state (Si) only some of the labels (or routes) are stored. A label Is eliminated if it caflnot be part of the minimum cost route from O
{3} and let (t(R,j), z(R,3)) be the label associated with a route from O to 3
to 2n+1, using the following optlmalIty prfnctple : let R
S U
visiting the nodes of R; if this is a minimum cost route from among ail routes arriving at node
3 3 at times t
t(R,3) and if the arc (1,3) Is
last In this route, then the sub—route from O to t is a minimum cost route from aliong ah
routes arriving at node i at times tit(R,3)
-
(Mj + ). 13 T
—7—
It Is therefore sufficient to store the labels assoctated with the
minimum cost routes from O to i visiting the set S for each arrivai time 1. We may therefore eliminate for state (S,i) the labels dominated using the following partial ordering relation
on the (time, cost) pairs
(t’,z) t
(t,z)
t’
and z
z’.
(11)
The label (t’,z’) is eliminated in the present case if there exists another label with both a lesser (or equal) time and a lesser (or equal) cost. This partial ordering relation reduces the size 0f the set of labels to be stored at each state (Si). This set is given by H(S,i)
{(t(S,i), Z(S,i)), cxtQ(S,i)}
(12)
where Q(S,i) corresponds to the set of non-eliminated routes visiting the nodes of S ending at node i. The labels associated with a state are placed in a list with times in strictiy increasing order. It can then be shown, based on the partial ordering relation, that the costs will be in strictly decreasing order. The efficient management of these lIsts is described in [6] for a dynamic programming algorithm applied to the shortest path problem with time window constraints on the nodes. 2.3
Recursion The flrst Iteration Is carried out by visiting the orfglns from node
O. The set 0f states is then
{({j},j)
jE{1,...,n}}
For each state, information on the load
(13) time and cost is easily
obtained y({j})
=
0 C
+
C
j{1,...,n}
(14)
-8-
H({3},j) Each
•
{(max [A 0 , A 3
03 D ], 0 T 3 }
+
j{1,...n}
(15)
state contains a single orlgln to be vlsited, the load is
obtalned by addlng to the initial vehicle load the number of people to be picked up at the origin visited. Only one route is possible between node O and this origin : there is thus only one (time, cost) label associated with a state. At subsequent Iteratlons, 2 addlng one node to the total
2n, new states are constructed by
k
vlslted at the preceding Iteration.
(S U {j},j) be such a state with
Let
The load at node j Is given by
y(S U {j})
=
y(S)
3 C
+
(16)
To obtain the iist of labels at state (S U
{j},j),
must adjust
the time and cost of each label in H(S,i) for ail states (S,i) which are used to construct state (S U {j},j) when node
j is added to the state
(Si). The new set of labels is obtained from the previous one by the following function {(max [A , t 3 1 If t 1 3 1 f , 1 ({(t ) }) z 3
+
+
1 M
1 M
+
+
13 T
], 1 T 3
Zj +
)} 1 D 3
3 B (17)
=
O
otherwlse
A new (time, cost) label can be created if starting at node I at time t,
It is possible to arrive at node
bound 0f the time window at node for state (S U
3 (the upper j before time B
j). From a given state (S,i), ve obtain
{j},j) the set of labels
(H(S,i)) 1 F 3
=
U ({(t(S,i), z(SŒl))}) 3 fj XEQ(S,l)
Finally, starting wlth ah
(18)
the states (S,i) whlch can be used to
construct the new state (S U {j},3), we obtain a new llst of labels
—9-
H(S U {j},j) where the symbol]
(19)
H(S,I’,q F ( U 1
=
represents the elimination of labels according to the
partial ordering relation.
In the tests carried out, a reduction in the
. 1 number of labels occurred at each translation by the function f At the final iteration 2n
1}, 2n
+
+
k
=
2n
+
1, there is only one state ({1,...,
1). Ail nodes have been visited from the departure point ta
the arrivai point. The minimum value of the objective function is given in the label wlth the smaliest cost, i.e. the iast in the iist K({1,...,2n+1}, if this set is non-empty.
2n+1)
If the set is
infeasibie. This can be detected at
empty, the problem is
any given iteration if no labels are
created. 3.
STATE ELIMINATION As the algorlthm ts based on dynamic programming, it is useful to
limit the number
0f
states created. Based on a state (S,i) to v4iich node j
is to be added, the first four elimination tests described for state (S U {j},j) are independent of the terminai node i, while the next four tests depend on the labels in H(S,I).
To simplify the execution of the tests,
information on the states Is stored in a three levei
structure. At the
first level, we have the set S and its ioad y(S). At the second level, for the given set S,
have the terminai nodes iS used to form the states
(SI). At the third level, for a state (S,?), the reduced set of labels H(S,i)
is stored.
A simple exampie of this structure is presented in
section 4.1. 3.1
Ellmination criteria based on the set S only Let S be a set at iteration k-1 to which we wish to add a node j to
form state (S U {j},j) at iteration k. We eliminate this state if one of the following criteria is flot respected.
-
10
-
#1 : node j must flot have been prevlously vlsited : #2 : 1f
jE
J Is a destination, then the origin node j-n must have been previ.
ously vislted (precedence constraint) : if je{n+1,...,2n} then j—neS. #3 : if j 15 an origin, vehicle capaclty constraints must be respected
If je{1,...,n} then y(S) #4 : time tj
=
+
Cj
C.
Aj Is the eariiest time at hIch node j can be vistted.
Given this time, It must be posible ta visit each subsequent unvisited node 9. e S U A
+
M
+
{j} v’i1le respecting the time constratnt , for ail 9. e S U {j}. 2 B
Crlterlon #4 Is flot tested for ail unvisited nodes. The nodes are preordered in decreasing order of their upper bounds; it is reasonabie to belleve that this order wIll be relattvely similar to the optimal order for visiting the nodes. The test ls carrled out for the most probable nodes vlsited at iteration k+1, I.e. unvislted nodes ranked from k-2 to k+4. If one of these nodes cannot be vlsited after j, then state (S U {j},j) is rejected. 3.2
Elimlnation criterla based on the state (S,l) Let
arrivai
(S,i)
be
time at node
a state I
k—1
at iteration
arid
given by the first label
tj
be the earltest
in H(S,l).
The state
(S U {j},j) wlll be eiiminated if It Is impossible to create labels. The following four crlterla are based successlvely on the visiting time at node j, on the vIsit of one node after j
on the visit after j of twa destina
tion iose orlgins have already been visited, and on the visit after j of two new origlns. 1 #5 : time constraint must be respected : t
+
1 M
+
tij
Bj.
—
11
—
The reader will note that criteria #1, 2, 3 and 5 determtne whether a state (S U {j},j) Is or is flot ante-feasible, while criterion #4 and the following criteria #6, 7 and 8 determine ether this state Is flot post feasible. For the three following criteria, the earliest time at which . T +M t + ] can be visited after j is denoted by tj = max [A 1
j
suppose that node j I s visited at time tj it must be possible S U {j} while respecting the time ta visit each unvisited node
#6 : If
.
constraints : tj
+
Mj
+
, for ail 1 B
1 Tj
9.
€
S U
{j}. This criterion
tlghtens criterlon #4 and Is tested in the same y. #7 : If ve suppose that node j k visIted at time tj It must be possible 2 whose origins 1 and n+1 ta visit ail pairs of destinations n+.z 1 and 12 have been previously visited vèile respecting the time t n+9. , 1 and 2 n+2 constraints. With two visiting permutations for the following must be satisfied
] 11 max EA. , tj+Mj+Tj,+ 11
+
1 M 1
+
1 ,+ 1 T 12
+
12 M÷
+
2 1 , T 1
or ] 12 max LA,,.,. , t+M+Tj,,,+ 12 with 11, 1
E
S U
{j}
2 , fl+1 1 and n+2
E
11 B,.,.,.
S U {j}.
. The desti n+t 2 , 1 (n+1 Criterion #7 is tested for only one pair ) nations are preordered in non—decreasing order of their upper bounds : the two
first
unvIsIted
destinations
whose
origins
have
been
are
visited
chosen. #8 : If node j pairs
of
k visited at time tj it must be possible te visit ail unvisited
origlns
1 t
constraints. With twa visiting must satisfy
and 12
whIle
permutations
respecting
the
time
, 2 1 and n+1 for n+.z
—
max [A , tj 11
12
—
+
M
+
] 11 T,
+
M 1 1
+
T 1 912
B 1 2
+
Mj
+
J 12 Tj,
+
M 1 2
+
, 2 T 1 2 1
1 B
or max EAt , tj 2 wlth
11, -2
{1,...,n}
£
n
S U {j}.
Criterion #8 is tested for only one pair
12). The origins
, 1 (iL
are preordered in non-decreasing order of their upper bounds
: the twa
first unvisited origins are chosen. Note that criterion #6 (and the same applies to criterion #8) cannot be improved by also considering the destination corresponding ta the unvis Ited origin. We would then have to satisfy max tAs, tj But +
the
Mj
+
time
). 1 T 1
+
] 1 Tj
+
Intervals This
is
a
1 M
+
are
,÷ 1 T aiways
condition