Professional Documents
Culture Documents
1 Introduction
In this paper we consider the case of a courier company facing orders which
come up continuously over time. The courier service is organized by geo-
graphical areas. Each area has a central hub which provides the vehicles for
servicing the orders within the same area.
Each order settled to a hub consists of a pick-up and a delivery request
(the parcel is collected from an origin and delivered to a destination). If an
order consists of a delivery request that has a destination hub different from
the hub of its pick-up request, then its transshipment is made overnight.
For a courier service, the time of the pick-up and delivery requests usu-
ally depends on the arrival time of the order at the call-center of the hub.
The customer can freely set the deadline for the delivery of his/her parcel.
However, the delivery within the morning of the day following the settlement
of the order is satisfied only if the order is received by the call-center of the
hub before a given time t. In such a case the pick-up is guaranteed within the
end of the day in which the order was settled. If the order is released later
than time t, then the delivery is no more guaranteed by tomorrow, but may
be shifted till the day after tomorrow within the chosen deadline. This is due
to the fact that the courier company is not able to guarantee the collection of
the parcel within the day and such parcel may need a night to be transhipped
to its destination hub, if different from the original one.
The service is organized in two non-overlapping shifts (morning and after-
noon). Each request has a deadline established by the customer independently
from the shift. However, if the pick-up request of an order takes place in a
shift, the corresponding delivery cannot be accomplished before the successive
shift when directed to a different hub. For this reason each hub simultane-
ously faces both types of requests, the pick-up and the delivery ones without
coupling constraints. Moreover, all those requests whose service deadline is
successive to the ending time of the current shift have not to be obligatorily
serviced in the current shift and may be postponed to some later shift.
Some requests (usually the pick-up part of an order) may arrive on-line
over time, while the delivery requests are typically known at the beginning
of a shift. More precisely, each request is characterized by a release time.
For a pick-up request which occurs in real time in a shift, the release time
corresponds to the time at which the order is received by the call-center, while
for a delivery request such time can be associated to the instant at which the
corresponding pick-up is executed. Notice that all the requests, with release
time in some earlier shifts, are known at the beginning of the current one.
These are delivery requests of orders whose pick-up has taken place in an
earlier shift or pick-up requests of orders received by the call-center in some
earlier shift and not yet serviced.
The problem can be classified as a dynamic vehicle routing problem due to
the uncertainty which comes from the occurrence of new requests which have
to be assigned to vehicles in real time. The main objective of the problem is
the optimization of the operational costs in the long period. This is obtained
in the short period, namely in the shift, through the determination of a set
of routes which maximizes the total value of the requests serviced by the
vehicles within the shift duration.
Very recent works dealing with real time vehicle dispatching have ap-
peared in the literature. In (Gendreau et al. 1999) the authors deal with a
dynamic vehicle routing problem also motivated by a courier service appli-
cation. For this problem the authors propose a tabu search algorithm im-
plemented on a parallel platform. With respect to our problem the authors
do not distinguish between pick-up and delivery requests. Moreover, in their
problem a new request is rejected if it has no feasible insertion. In our case
new requests might be postponed to future shifts but cannot be refused.
With respect to (Gendreau et al. 1999), in (Ichoua et al. 2000) the authors
include diversion issues: once a driver is on a route to his next destination he
can diverse his direction to serve new customer requests. Through empirical
evaluation the authors show how to divert a vehicle from its current destina-
tion may result in potential savings. Our problem formulation also includes
diversion issues.
Traditionally, dynamic problems have been handled by heuristic solution
algorithms. One of the most common approaches has been the adaptation
89
2 Problem Description
We will focus our attention on the problem handled by a single hub over
time.
The courier service in a hub is organized in shifts which do not overlap
each other. Let as and bs denote the starting and ending time of the shift s
(i.e. at as the vehicles leave the hub and at bs they have to be back), while
bs - as = hs is the length of the shift. For each shift, the planner has to
face two types of requests, the pick-up and the delivery. Each request r is
characterized by a release time tT and a hard time window [eT> iT], where eT
is the earliest time for the service and iT is the latest one.
A request time window can be either completely contained in a shift or
may overlap consecutive shifts. If iT > bs then the request r is postponable
with respect to shift s, otherwise the request is unpostponable.
We will identify as off-line requests with respect to shift s all those re-
quests whose order was settled in some earlier shift, i.e. if tT < as. On the
contrary, we define as on-line request with respect to shift s the request r
such that as ~ tT < bs , that is the request arrives during the shift. Notice
that both on-line and off-line requests (either deliveries or pick-ups) may be
either postponable or unpostponable according to their time windows.
Delivery requests (either on-line or off-line) have to be assigned to a vehi-
cle. The assignment cannot be modified during the current shift. This means
that when the parcel is loaded on a vehicle the corresponding delivery must
be accomplished by the same vehicle. It is worth noticing that on-line deliv-
ery requests can only arise when an order involves both the pick-up and the
delivery within the same area. The on-line delivery request (postponable or
90
- In the long term (over all the shifts) we have to define the service policy
with the objective of minimizing the operational costs. At this aim a
priority is assigned to every request at the beginning of each shift. The
priority is a value depending on the request urgency. Such value may
be modified over time and should increase as the request deadline is
approaching.
- During the shift we have to choose the set of requests to be served and the
requests to be put off to a successive shift as well as the route for each ve-
hicle. Note that at this stage we cannot formulate a classical optimization
problem since each decision, at least in principle, should be revised when
a new on-line request is released. At this stage the minimization of the
operational costs might result in a suboptimal policy implying that only
the requests which cannot be postponed are served even when vehicles
and time are available.
- As several on-line requests may be released in a short time, it is sensible
to periodically revise the decisions (say every 10 minutes). At a given time
(say 10:20 am) we record the on-line requests occurred in the previous
period (between 10:10 and 10:20) and then we take the decisions on the
basis of all the available information. This means that at this stage a
classical optimization problem can be formulated and solved. A critical
issue is the identification of the objective function which guides the long
term minimization of the operational costs. We have chosen to maximize
the total value (the sum of the priorities defined at the first stage) of the
requests which can be feasibly served from the current time to the end
of the shift.
From now on, we will focus on the latter stage. Let M = {VI, ... , v m }
be the set of vehicles available for the service. Let P = {PO,PI, ".,Pm} be
the position of the hub and of vehicles VI, ... , V m , in any time instant. We
define as Ru and Rp the set of unpostponable and postponable requests,
while R = Ru U Rp is the total set of requests. Each request r has a positive
value W r . To each vehicle Vh is assigned a set Dh of delivery requests, where
Uh=I, ... ,mDh ~ R is the total set of the delivery requests.
91
3 A Solution Algorithm
The present section is devoted to the description of the main algorithm and
its subroutines.
The handling of the routes is based on the insertion (extraction) of single
requests in (from) one route. Such operations are implemented as a personal
version of the GENIUS algorithm proposed for the TSPTW by Gendreau
et al. (1998). The algorithm consists of a tour construction phase (GENI)
followed by a re-optimization phase (US) and is constructed so to always
preserve time windows feasibility. The GENI algorithm is based on a set of
92
rules to insert, one at the time, a set of vertices into a tour which starts
from and ends to the depot. The insertion is performed after the evaluation
of a number of different insertion rules. Every time the algorithm is unable
to further insert any of the remaining vertices, it extracts a vertex from the
tour, appends it to the list of vertices still to be inserted and starts again to
insert. The extraction of a vertex is performed by applying the best among
different extraction rules.
Our implementation of GENI solves a variant of the classical TSPTW
looking for a path instead of a tour. Indeed, it builds a path from an initial
position Ph (current position of vehicle Vh) to a final destination Po (the hub).
Moreover, while the original implementation finds either a solution visiting all
the vertices or fails, our implementation always returns a path visiting a set of
serviced vertices and provides a list (possibly empty) of excluded vertices. We
implement the insertion/extraction rules in two routines identified as Insert
and Extract, respectively. These routines have two arguments: a set of routes
and a set of vertices (requests). If a single vertex and a single route are passed
to the Insert or Extract routines, the GENI algorithm is applied.
If a single vertex has to be inserted into (extracted from) a set of routes,
then its insertion (extraction) cost is first evaluated for each route and then
the vertex is inserted into (extracted from) the route with minimum insertion
(extraction) cost. The insertion (extraction) cost is defined as the difference
between the length of the route after the insertion (extraction) and the length
before. The insertion cost is expected to be positive for insertions and negative
for extractions.
Insert(S, r)
INPUT: a set of routes S and a request r.
OUTPUT: success or failure and the set of augmented routes S.
s* = null
6* = 0
S' = copy of S
for each s' E S'
c = length(s')
apply GENI to insert r in s'
if insertion is successful
6 = length( s') - c
if (s* == null or 6 < 6*), {6* = 6; s* = s' }
end for
if ( s* == null), return failure
else
update S
return success
end Insert
93
Insert(S, I)
INPUT: a set of routes S and a list of requests I.
OUTPUT: the set of augmented routes S and the list I
of requests failed to be inserted.
for i = 1 to iIi
r = first request in I
remove r from I
if (Insert(S,r) == jailure),append r to I
end for
end Insert
ShiftRoutine
if = InitialSolutionO
while (WallClockO + OptTime ~ bs )
InitialTime = WallClockO;
update sets Rp and Ru
94
Notice that when WallClockO + OptTime > bs the loop is not iterated
and the vehicles follow the current solution to the end. However, OptTime
is meant to be "small" and the excluded requests are those with release time
close to the end of the shift. In practice it is sensible to assume that such
requests will be postponable for the current shift. Moreover, at each iteration
a guess on future position of the vehicles has to be made. Such guess is
difficult in practice. However, using small values of OptTime should help in
reducing estimation errors. Such errors will not propagate if, at each iteration
of the ShiftRoutine, the actual position of the vehicles is considered.
MakeFeasible (J;.)
INPUT: a solution J;..
OUTPUT: either a new feasible solution J;.' or failure.
failureCounter = 0
I = requests of Ru not in solution J;.
sort I by non decreasing insertion cost
M axFailure = 111/2 + 1
J;.'=J;.
/ / Phase 1
repeat
I nsert(J;.', I)
if (I = 0), return J;.'
else / / some requests could not be inserted
failureCounter + +
if (failureCounter 2:: M axFailure) , exit loop
LocalSearch_Cost(J;.')
end repeat
/ / Phase 2
L p = list of all postponable requests in J;.'
Lu = list of all unpostponable pick-up requests in J;.'
sort Lp and Lu by non decreasing extraction cost
append Lu to Lp and make a single list L
while (ILl> 0)
r = first request in L
remove r from L
Extract(J;.', r)
if (r is unpostponable), append r to I
Insert(J;.', I)
if (I = 0), return J;.'
end while
return failure
end MakeFeasible
selected in a neighborhood of the current one and the local search is started
from scratch. If the alternative solution is too close to the current one, the
local search is likely to get back to the same local optimum. On the other
hand if the alternative solution is too far from the current one, the search
could move away from a promising area. The aim of a variable neighborhood
scheme is to select the alternative solution in neighborhoods with variable ra-
dius. If intensification is required the initial radius will be minimum and then
will be increased as the local search fails. If diversification is required, the
initial radius will be maximum and then decreased as the local search fails.
The variable neighborhood search scheme was first proposed by Miladenovic
and Hansen (1997) and applied in various cases (see for instance Hertz and
Mittaz 2001).
The V N LocalSearch starts with the radius set to the minimum value.
At each iteration of the V N Local Search procedure an alternative solution
J!..' in the neighborhood of the current solution J!.. is selected. Then a local
search is performed starting from J!..'. If the local search fails to find a solution
better than J!.., then the radius of the neighborhood is increased and a new
alternative solution J!..' is selected. If the local search succeeds, the current
solution is updated and the radius is set to its minimum value. The solution
neighborhood Nk(J!..) of radius k is defined as the set of solutions obtained
by removing k postponable requests and inserting as much as possible of the
requests which were not included. In our implementation we randomly select
one neighbor by means of the Neighbor routine. Such routine sorts the list of
postponable requests in the current solution according to the non decreasing
order of the extraction costs; then k requests are randomly selected out of
the first 2k. The selected requests are then extracted and labelled as tabu.
Finally, the Insert routine is executed with the list of postponable requests
which are not tabu.
VNLocaISearch(J!..)
INPUT: a solution J!...
OUTPUT: a final solution J!..*.
kmax = maximum value of the radius
k=l
J!..* = J!..
while (k ~ kmax )
J!..' = N eighbor(J!..*, k)
Local Search_V alue(x')
if (z' > z*) / / z', z* are the values of solutions J!..', J!..*
J!..* = J!..'
k=l
else
k:= k +1
97
end if
end while
return J!..*
end VNLocalSearch
LocalSearch_Value(J!..)
INPUT: one solution J!...
OUTPUT: a final solution J!..*.
J!..* = J!..
z* = value of J!..*
do
Zl = z*
LocaISearch_Cost(J!..*)
sort Ru and Rp by decreasing values
Insert(J!..*, Ru)
I nsert(J!..* , Rp)
z* = value of J!..*
while (z* > Zl)
end LocalSearch_Value
its corresponding i request. If the new solution is feasible and has a total
length less than the current one, then the current solution is updated and
the procedure is iterated. Otherwise the routine stops.
4 An Illustrative Example
In the following we provide a simple instance to show how the algorithm
works as an illustrative example.
We consider the case of a hub with only two vehicles, i.e. m = 2. Requests
are distributed over the Euclidean plane where the hub is located at the origin.
The distances are Euclidean. The requests have the same value and the time
needed to travel a unitary distance is unitary. The shift is assumed to start
at time 0 and end at time 44.
Table 1 shows the main information associated to each request: the first
column identifies the request, while the second one shows its type (a pick-up
(P) or a delivery (D) request). The third column provides the request coor-
dinates in the plane, the fourth one shows its time window measured in units
of time and, finally, the last column indicates the release date representing
the point in time in which the request occurs. If the release date is null this
means that the request was one of the off-line requests available at the begin-
ning of the shift. Request 0 indicates the depot and its coordinates. The time
window of the depot determines the duration of the shift. All the requests
are unpostponable, but request 4 whose time window closes at time 88.
°
r Delivery tr
(depot) (0,0) [0,44]
1
2
D
P
(0,8)
(8,11)
[8,9]
[30,33] °°
3
4
D
P
(9,-5)
(0,-5)
[19,21]
[5,88] °°
5 P (8,8) [25,33] 1
6 P (3,-3) [5,6] 2
7 P (4,-3) [6,7] 2
8 P (8,15) [26,30] 3
o 1 2 3 4 5 6 7 8
o 0 8.00 13.60 10.30 5.00 11.31 4.24 5.00 17.00
1 8.00 0 8.54 15.81 13.00 8.00 11.40 11.70 10.63
2 13.60 8.54 0 16.03 17.89 3.00 14.87 14.56 4.00
3 10.30 15.81 16.03 0 9.00 13.04 6.32 5.39 20.02
4 5.00 13.00 17.89 9.00 0 15.26 3.61 4.47 21.54
511.31 8.00 3.00 13.0415.26 0 12.0811.70 7.00
6 4.24 11.40 14.87 6.32 3.61 12.08 0 1.00 18.68
7 5.00 11.7014.56 5.39 4.47 11.70 1.00 0 18.44
8 17.00 10.63 4.00 20.02 21.54 7.00 18.68 18.44 0
1 and before the service of request 2. Similarly, for the vehicle which serves
requests 3 and 4.
o
route 2
4 3
.2 route 1
1
p----.--~I
5
o
route 2
3
4
Fig. 2. New solution at time 2 after the release of the request 5 at time 1.
.2 route 1
~I 5
1
~
route 2
. .0
4 3
Fig. 3. New solution at time 3 after the release of the requests 6 and 7 at time 2.
101
route 1
1
o
route 2
4 3
Fig. 4. New solution at time 4 after the release of the request 8 at time 3.
updated at time 2. This due to the fact that by the end of the re-optimization
the vehicles will have been travelling for 1 unit of time. The result of this
re-optimization is shown in Figure 2 where the request 5 is inserted in route 1
by the first phase of the M akeFeasible routine. Notice that the same request
could have been inserted in route 2 without excluding the request 4, but at
a larger cost. Similarly, in Figure 3, the new requests 6 and 7 which arrived
at time 2 are added to route 2 at time 3.
5 Conclusions
References