Professional Documents
Culture Documents
a r t i c l e i n f o a b s t r a c t
Article history: We present a variable neighborhood search approach for solving the one-commodity pickup-
Received 3 June 2011 and-delivery travelling salesman problem. It is characterized by a set of customers such that each of
Accepted 17 January 2012 the customers either supplies (pickup customers) or demands (delivery customers) a given amount of
Available online 25 January 2012
a single product, and by a vehicle, whose given capacity must not be exceeded, that starts at the depot
and must visit each customer only once. The objective is to minimize the total length of the tour. Thus,
Keywords: the considered problem includes checking the existence of a feasible travelling salesman’s tour and
Combinatorial optimization
designing the optimal travelling salesman’s tour, which are both NP-hard problems. We adapt a collec-
Metaheuristics
Variable neighborhood search
tion of neighborhood structures, k-opt, double-bridge and insertion operators mainly used for solving
Pickup-and-delivery travelling salesman the classical travelling salesman problem. A binary indexed tree data structure is used, which enables
problem efficient feasibility checking and updating of solutions in these neighborhoods. Our extensive computa-
tional analysis shows that the proposed variable neighborhood search based heuristics outperforms the
best-known algorithms in terms of both the solution quality and computational efforts. Moreover, we
improve the best-known solutions of all benchmark instances from the literature (with 200 to 500
customers). We are also able to solve instances with up to 1000 customers.
Ó 2012 Elsevier B.V. All rights reserved.
1. Introduction only once. The vehicle capacity must not be exceeded after visiting
a pickup customer. Moreover, any delivery customer may be
The one-commodity pickup-and-delivery travelling salesman served if the load on the vehicle is bigger than or equal to its de-
problem (1-PDTSP for short) was introduced by Hernández-Pérez mand. The 1-PDTSP consists of finding a minimum length Hamilto-
(2004a). Similar extended variants of the travelling salesman prob- nian route for the vehicle which satisfies all the customer
lem (TSP) were suggested earlier (see, e.g., Chalasani and Motwani requirements. It is not assumed whether the vehicle leaves the de-
(1999), Gendreau et al. (1999), Mosheiov (1994) and Savelsbergh pot empty or fully loaded, and the initial load of the vehicle has to
and Sol (1995)). Surveys can be found in Parragh et al. (2008a) be determined.
and Parragh et al. (2008b). The 1-PDTSP has several applications in routing a single com-
Problem description. 1-PDTSP is a routing problem which gen- modity through a circular network in a graph connecting different
eralizes the classical TSP as follows. A set of locations and travel sources and destinations. A real-world application of the 1-PDTSP
distances or costs between them are given; one specific location is shown by Anily and Bramel (1999) in the context of inventory
is considered to be the vehicle depot and all others are identified reposition. Consider a set of retailers owned by the same firm
as customers. The customers are divided into delivery and pickup and located at different sites. At a given moment, due to the ran-
customers, according to type of services they require. A unique dom nature of demands, some retailers can have an excess of their
commodity or a product has to be transported from some custom- inventory, and the others can be in need for additional stock. If the
ers to the others, and each delivery/pickup customer requires/pro- firm decides to transfer the inventory from the first group of retail-
vides a given amount of this commodity. A vehicle with a given ers to the second, then determining the cheapest Hamiltonian
capacity starts and ends at the depot and must visit each customer route to serve all the retailers with a capacitated vehicle is exactly
the 1-PDTSP. Clearly, this is a simple variant of a more realistic
problem where several commodities could be considered, or sev-
⇑ Corresponding author.
eral capacitated vehicles used in transportation.
E-mail addresses: nenad.mladenovic@brunel.ac.uk (N. Mladenović), draganu@mi.
sanu.ac.rs (D. Urošević), said.hanafi@univ-valenciennes.fr (S. Hanafi), aleksandari@
Notation. We now introduce the notation used throughout this
gmail.com (A. Ilić). article. Let G = (V, E) be a complete and undirected graph with
0377-2217/$ - see front matter Ó 2012 Elsevier B.V. All rights reserved.
doi:10.1016/j.ejor.2012.01.036
N. Mladenović et al. / European Journal of Operational Research 220 (2012) 270–285 271
vertex set V = {1, 2, . . . , n}. Vertex 1 represents the depot. The other VND which consists of vertex-exchange neighborhoods: forward
vertices from 2 to n represent customers, where each vertex is and backward insertion operators (shifting only one customer from
associated with non-zero demand qi. If qi > 0,i is a pickup customer, the current position in the tour to any other position).
otherwise, it is a delivery customer. The depot can be considered as Recently Zhao et al. (2009a) proposed a genetic algorithm (GA)
P
a customer whose demand q1 ¼ ni¼2 qi . If q1 > 0, q1 represents the which on average gave better results than the GRASP/VND heuris-
initial load of the vehicle, otherwise q1 represents the final load tic. The authors in fact suggest a hybrid heuristic which within stan-
after visiting all customers. In other words, the pickup/delivery de- dard GA operators uses several local searches and ant colony ideas.
mand at the depot balances the other pickup/delivery demands. After initializing the parameters used in the algorithm, the genetic
The travel cost c(i, j) for each edge (i, j) 2 E is given. It can be as- algorithm starts from a random population of individuals (feasible
sumed that travel costs between locations are proportional to their tours) followed by 2-opt local optimization, and iterates for some
distances. The capacity of the vehicle is denoted by Q > 0. A vehicle fixed number of generations. A new pheromone-based method for
with the capacity Q must visit each customer only once, and its a crossover operator is described, which utilizes both global and lo-
capacity must not be exceeded after visiting a pickup customer cal information (edge length, adjacency relations, demands of cus-
and its load must be bigger than (or equal to) the demand of a tomers) to construct an offspring. In the proposed GA, the
delivery customer before the visit. The 1-PDTSP should determine pheromone trails are updated on the basis of the globally best solu-
the tour that starts and ends at the depot and has a minimum tion. They use 3 vertex exchange move as the mutation operator as
length. Note that typically it holds follows: select three customers at random, then exchange their
( ) positions in the tour, and chose the best feasible one among 5 pos-
X X sible. Furthermore, the authors propose a better iterative probabi-
max jqi j 6 Q 6 max qi ; qi :
i2V
i2V;qi >0 i2V;qi <0
listic method for constructing the initial solution based on the
nearest neighbors to each of the customers. A similar heuristic is
The left inequality means that no feasible tour can be found if the developed in Zhao et al. (2009b) for another similar PDTSP version.
vehicle capacity is less than the maximum customer demand. The Chalasani and Motwani (1999) have studied k-delivery TSP. This
second inequality makes this problem different from the standard problem can be considered as a special case of the 1-PDTSP, where
TSP. both delivery and pickup amount are equal to one unit. In the
Previous work. The 1-PDTSP is NP-hard since it coincides with capacitated dial-a-ride problem (CDARP) (also named the single-
the travelling salesman problem when the vehicle capacity is large vehicle many-to-many dial-a-ride problem), there is one-to-one
enough. Even more, the problem of checking the existence of a fea- correspondence between pickup and delivery customers, and the
sible solution is NP-complete in the strong sense (Hernández- vehicle should move one unit of a commodity from its origin to
Pérez, 2004). its destination with a limited capacity Q (see Guan (1998)). An-
Hernández-Pérez and Salazar-González (2004b) described an other related problem is the TSP with backhauls (TSPB) (see Gend-
exact branch-and-cut algorithm able to solve instances with up to reau et al. (1997)), where an uncapacitated vehicle must visit all
60 customers. In Hernández-Pérez (2004a), the same authors pro- the delivery customers before visiting a pickup customer. Also,
posed two heuristic approaches to deal with larger instances, where many more general PDTSPs may be transformed to the PDTSP
the first heuristic is a simple local search developed to provide an (Pop and Pop-Sitar 2011).
initial upper bound for the branch-and-cut algorithm. The second The rest of our paper is organized as follows. In Section 2, we
approach is more elaborated algorithm based on ‘incomplete opti- give rules of general variable neighborhood search heuristics for
mization’, and the branch-and-cut algorithm is applied to a re- solving the 1-PDTSP. In Section 3, we describe our data structure
stricted search space obtained by considering only a subset of and show the complexity of updating the feasibility of the solution
variables associated with promising edges of the graph. Moreover, when different neighborhood structures are used. Section 4 con-
the branch-and-cut execution is truncated by imposing a limit to sists of computational results on the benchmark and some new
the number of levels in the search tree exploration. A primal heuris- large instances. Section 5 provides the conclusions of the paper.
tic is also embedded in the branch-and-cut to build feasible integer
solutions from the information given by fractional solutions. They
2. General variable neighborhood search for 1-PDTSP
applied this heuristic periodically during the tree search process.
In Hernández-Pérez and Salazar-González (2007), the authors
In this section we first give the steps of the general variable
pointed out a close connection between the 1-PDTSP and the clas-
neighborhood search (GVNS) metaheuristic, and then describe
sical capacitated vehicle routing problem (CVRP), where a homoge-
the algorithmic components that we designed for solving 1-PDTSP:
neous capacitated vehicle fleet located in a depot must collect a
the initialization process, the three neighborhood structures used
product from a set of pickup customers. The authors presented
as local search procedures and the two neighborhoods used in
new inequalities for the 1-PDTSP adapted from the recent inequal-
the Shaking step.
ities for the CVRP. They implemented these inequalities in a
branch-and-cut framework to solve the 1-PDTSP to its optimality.
The algorithm proposed in Hernández-Pérez et al. (2009) for 2.1. General variable neighborhood search
solving the 1-PDTSP is a hybrid algorithm which combines the
Greedy Randomized Adaptive Search Procedure (GRASP) and Vari- Variable neighborhood search (VNS) (Mladenović and Hansen,
able Neighborhood Descent (VND) paradigms. The GRASP meta- 1997) is a metaheuristic, or a framework, for building heuristics
heuristic is a multi-start procedure consisting of a loop whose basic idea is systematic change of neighborhood structures
embedding, a construction phase and a local search phase. The best within the local search algorithm. To construct different neighbor-
overall solution is kept as the final result. The two local search hood structures and to perform a systematic search, one needs to
operators are adaptations of the 2-opt and 3-opt edge-exchange supply the solution space with some (quasi)-metrics and then to
operators for TSP (see e.g., Johnson and McGeoch (1997)). The induce neighborhoods from them. Different neighborhood struc-
GRASP loop is iterated until the stopping condition is met tures can be exploited in both deterministic and stochastic ways.
(a combination of the total number of iterations and computation The basic VNS combines both approaches. Stochastic approach is
time). Then, a post-optimization phase starts from the best solu- used when choosing a point from the kth neighborhood at random,
tion found so far. This post-optimization phase is the second and deterministic approach when using local search algorithm. If a
272 N. Mladenović et al. / European Journal of Operational Research 220 (2012) 270–285
2.3. Neighborhood structures for the 1-PDTSP 2.4. Local search and Shaking
In a local search algorithm a neighborhood structure is designed A complete local search is organized as Variable neighborhood
by introducing moves from one solution to another. The final solu- descent through the 2-opt neighborhood (N1), forward and back-
tion provided by a local search is a local optimum which can not be ward insertion neighborhoods (N2 and N3), i.e. the parameter ‘max
improved by using the neighborhood structure under consider- from Algorithm 3 has the value 3. We call it Seq-VND. We also de-
ation. Fundamental neighborhood structures for the TSP based on signed another local search – Mixed-nested VND (see also Ilić et al.
edge exchanges and node insertion moves can also be extended (2010) for details). Let x be the current solution; we take solution x0
efficiently for 1-PDTSP. Classical heuristics of this type are the k- from 3-opt or double-bridge neighborhoods of x at random and
exchanges (Lin and Kernighan, 1973), also called k-opt, which are then apply Seq-VND (which consists of 2-opt, forward and back-
successfully used in local searches for assignment, routing and ward insertion neighborhoods) starting from the solution x0 . If such
scheduling problems (see, e.g. Gamboa et al. (2006), Laporte an obtained solution is of better quality than the incumbent x, we
(1992) and Rego et al. (2011)). move to it and re-centre the search around it (x x0 ). Otherwise,
274 N. Mladenović et al. / European Journal of Operational Research 220 (2012) 270–285
Fig. 1. Double-bridge (a) and 3-opt without change of direction (b) and with change of direction (c).
we repeat the complete procedure, i.e. we again choose a new solu- for a given value v and index i, add v to the element Li, 1 6 i 6 n;
tion at random followed by the Seq-VND. The maximum number for a given interval [i, j], find maximum/minimum among values
of such unsuccessful trials is set to 200. Therefore, this local search Li, Li+1, . . . , Lj, 1 6 i 6 j 6 n.
is not fully deterministic.
Shaking is performed by using two well known neighborhoods We store the data structure in the array Tree (see Algorithms 5
designed for solving TSP: 3-opt and double-bridge (see Fig. 1). We and 7 for the maximum case). The structure is space-efficient in the
get a random point from N k neighborhood by performing k3-opt 3- sense that it needs merely the same amount of storage as a simple
opt moves and kdb double-bridge moves, where k3-opt is a randomly array of n elements. For vehicle loads, we will use a binary indexed
chosen parameter from [k/2, k] and kdb = k k3-opt(k = 1, 2, . . . , kmax). tree data structure to compute the maximum and minimum values
The 3-opt and double-bridge moves are performed so that feasibil- in the intervals of vehicle loads. The structure Tree is a complete
ity is kept (assuming that the incumbent solution is feasible). binary tree with the root node 1. Its leafs correspond to the ele-
Otherwise, a random point from 3-opt or from double-bridge ments from the array L moving from left to right in the last level.
neighborhoods is generated. Therefore, the elements of the array L are stored at the positions
which start from 2p to 2p + n 1, where p is the depth of the binary
tree defined as the smallest integer such that 2p P n. The internal
3. An efficient implementation of GVNS for 1-PDTSP nodes of the Tree store the aggregated values (sum, max, min, . . .)
of the leafs in the subtrees rooted at these nodes. Here we just
From the point of view of implementation, the main difference use min and max. This implies that the value of the internal node
between the 1-PDTSP and TSP is that in the 1-PDTSP problem some i is just the cumulative value of its two children. The parent of
permutations of customers do not represent a feasible tour. There- the node i is b2i c, while the left and the right children of the node
fore, we need to design a data structure that will allow us to effi- i are 2i and 2i + 1, respectively. By definition, it follows that the
ciently check the feasibility of provided tours. In this section we number of nodes in BIT is at most 2n, while the depth is dlog2ne.
describe the implementation of feasibility checking on all neigh- For the updating procedure, we simply need to traverse the ver-
borhood structures used within our VND, i.e., within our GVNS. tices from the leaf to the root and update the values in the parent ver-
tices. For the query procedure, we consider the parents of the left (i)
and the right (j) vertices and the intervals they cover, and then iter-
3.1. 2-opt with feasibility checking atively calculate max/min in [i, j]. It is easy to notice that the max/
min operators can be replaced by any distributive function such as
As mentioned in previous section, we use so called neighbor-list sum, product, etc. The binary indexed tree is updated after setting
implementation of 2-opt (Johnson and McGeoch, 1997; Hansen the element Li to the new value v as described in Algorithm 5.
and Mladenović, 2006). Note that in Irnich (2008) the neighbor-list In our algorithms we use fast binary operators. The bitwise
is called sequential implementation. In addition, to finding better exclusive OR operator (xor) used in Algorithm 7 compares each
TSP tour, it is necessary to check for each solution from the 2-opt bit of its first operand with the corresponding bit of its second
neighborhood of the current one if it is feasible. This means to pro- operand. If one bit is 0 and the other bit is 1, the corresponding re-
vide an efficient data structure for feasibility checking which can sult bit is set to 1. Otherwise, the corresponding result bit is set to
be relatively easily updated. In Irnich et al. (2006) such a data 0. The bitwise AND operator (and), also used in these algorithms,
structure was proposed. Its worst case complexity for updating compares each bit of its first operand with the corresponding bit
and feasibility checking is in O(n4/3) and O(1), respectively. The of its second operand. If both compared bits are equal to 1, the cor-
memory requirement is O(n4/3). In order to do this more efficiently, responding result bit is set to 1. Otherwise, the corresponding re-
here we propose the use of a binary indexed tree (BIT) data struc- sult bit is set to 0. Furthermore, we use in Algorithm 5 operator
ture. This data structure will allow us to check the feasibility of div for integer division of left-hand side by right-hand side.
the neighbor tour in O(log n). If a better solution is found, we need
to construct (update) a new BIT structure in O(n) time.
BIT is an efficient data structure introduced by Fenwick (1994) Algorithm 5: Updating the binary indexed tree, after setting
for maintaining the cumulative frequencies (or partial summa- the element Li to the new value v.
tions). The basic idea is that each integer can be represented as
1 Input The value v, element index i and p = max{s : 2s < n}.
the sum of certain powers of two, and therefore a cumulative
2 i i + 2p+1 1;
frequency can also be represented as the sum of certain sets of
3 Tree[i] v;
cumulative sub-frequencies. The operations to access this data
4 while i > 0 do
structure are based on the binary coding of the index.
5 Tree[i div 2] max (Tree[i], Tree[i xor 1]);
Let L be an array of n elements. The binary indexed tree sup-
6 i i div 2;
ports the following basic operations:
N. Mladenović et al. / European Journal of Operational Research 220 (2012) 270–285 275
Algorithm 7: Calculating the maximum value in interval Li, Property 3.4. Checking the feasibility of the 2-opt move for 1-PDTSP
Li+1, . . . , Lj. with BIT structure is in O(log n).
xH ¼ ð1; 11; 17; 14; 19; 4; 8; 20; 15; 18; 12; 6; 16; 10; 2; 9; 13; 5; 7; 3; 1Þ;
Proof. To begin with, we need to use the offset 2p 1 in order to
get the nodes in BIT which correspond to the indices i and j. Value
x ¼ ð1; 11; 17; 14; 19; 4; 8; 20; 15; 18; 12; 6; 2; 10; 16; 9; 13; 5; 7; 3; 1Þ;
i will represent the leftmost subtree, while the value j will LðxH Þ ¼ ð8; 3; 8; 0; 10; 7; 8; 1; 7; 1; 3; 3; 4; 9; 6; 7; 3; 4; 0; 0Þ;
represent the rightmost subtree that has a nonempty intersection LðxÞ ¼ ð8; 3; 8; 0; 10; 7; 8; 1; 7; 1; 3; 3; 0; 5; 6; 7; 3; 4; 0; 0Þ:
of the given interval. Nodes i and j will always be at the same level
276 N. Mladenović et al. / European Journal of Operational Research 220 (2012) 270–285
Tours xw and x are presented in Fig. 2 and their associated BIT Property 3.5. Feasibility checking of insertion moves for 1-PDTSP is in
structures for the loads L(xw) and L(x) in Fig. 3. Observe that the O(log n) time.
optimal tour xw is derived from the suboptimal x by one 2-opt
move by considering the edges (6, 16) and (2, 9), i.e. by reversing
the part 16, 10, 2. This 2-opt move changes the values in three Proof. Let us divide insertion moves into forward and backward
leaves of the binary indexed tree (as shown in Fig. 3) which corre- insertion moves. We prove here the property for the forward inser-
sponds to Nodes 13, 14, 15, and their parents. Also note that the tion move. We traverse the customers i from 1 to n in this order.
optimal tour crosses itself, which is not possible for the Euclidean After moving the customer i to the position j > i, we have the fol-
TSP optimal tour. lowing loads
L1 ; L2 ; . . . ; Li1 ; Liþ1 qxi ; Liþ2 qxi ; . . . ; Lj1 qxi ; Lj
3.3. Insertion feasibility checking qxi ; Lj ; Ljþ1 ; . . . ; Ln :
For the feasibility checking of Insertion (forward and backward) Of course, we need to calculate the maximum and minimum
moves, the binary indexed structure is also used. values of the new loads. It can be done by calculating
N. Mladenović et al. / European Journal of Operational Research 220 (2012) 270–285 277
maxfL1 ; . . . Li1 g; maxfLiþ1 ; . . . Lj g qxi and max{Lj, . . . , Ln} as well as Seq-GVNS. The second uses Mix-VND as a local search, and we de-
by calculating the minimum. If we use BIT structure, it can be done note it by Mix-GVNS. Three neighborhoods are used in both
in O(log n). h sequential and mixed VND routines: 2-opt, forward insertion and
The overall complexity for an Insertion local search is O(n2). backward insertion. For the 2-opt, we use the tree data structure
since it allows us fast feasibility checking and updating (see Prop-
3.4. Maintaining the feasibility of 3-opt and double bridge moves erties 3.1, 3.2, 3.3, 3.4 and the illustrative example in Figs. 2 and 3).
For insertion moves, we use the same tree data structure (see Prop-
Once feasibility is reached, it would be preferable to maintain it erty 3.5). In order to keep the feasibility of the incumbent solution,
both in the local search and Shaking steps of GVNS. The next two after the perturbation, we design special kinds of random 3-opt
properties give sufficient conditions for maintaining the feasibility and double-bridge moves (see Properties 3.6 and 3.7). The kth Shak-
of random moves in 3-opt and double-bridge neighborhoods. ing step consists of k (k = 1, 2, . . . , kmax) repetitions of random 3-
The size of the 3-opt neighborhood is O(n3). Once three arbi- opt⁄ or double-bridge moves such as to preserve feasibility (see
trary edges from the current tour are deleted, there are 8 possible Fig. 1). After local search a move is made if and only if a better solu-
ways to add three new edges to obtain a new tour. One of them, tion is found.
which does not change the orientation, is presented in Fig. 1. We For both GVNS methods, we use two usual parameters which
denote this special 3-opt by 3-opt⁄. Assume that we choose three should be estimated by the user: tmax – the total running time of
non-consecutive customers from the tour xi1 ; xi3 ; xi5 , and let the heuristic, kmax = 8 – the total number of neighborhoods used
xi2 ; xi4 ; xi6 be their successors on the tour, respectively. Without loss in the outer loop (the Shaking step). Note that ‘max (the total num-
of generality, assume that the depot is located between the cus- ber of local search routines used in the Seq-VND) is equal to 3.
tomers xi6 and xi1 .
Property 3.6. If Li1 ¼ Li3 ¼ Li5 holds for the vehicle loads, then we can 4. Computational results
perform the 3-opt⁄ modification without violating the feasibility
condition. In this section the computational results of presented GVNS
methods and their comparison with algorithms from the literature
are given. All tests were carried out on the Intel Core 2 Duo T5800
Proof. It is enough to show that the loads for the customers 2.0 GHz with 2 GB RAM running the Linux operating system. The
involved in the move remain the same. For example, the new loads algorithms were coded in C++ programming language and com-
for the vertices xi4 ; xi2 ; xi6 remain the same, piled with -O2 optimization. The memory used by our algorithm
L0i4 ¼ qx1 þ þ qxi þ qxi ¼ Li1 þ qxi ¼ Li3 þ qxi ¼ Li4 ; is as small as O(n2) and so it stays, under 1 MB, for even the largest
1 4 4 4
test cases. The parallel capability of the Intel Core 2 Duo processor
L0i2 ¼ qx1 þ þ qxi þ qxi þ þ qxi þ qxi ¼ Li5 þ qxi has not been used.
1 4 5 2 2
¼ Li1 þ qxi ¼ Li2 ; L0i6 ¼ qx1 þ þ qxi þ qxi þ þ qxi Different methods compared in this section were coded at dif-
2 1 4 5
ferent computers. Here is the list of methods and performances
þ qxi þ . . . þ qxi þ qxi ¼ Li3 þ qxi ¼ Li5 þ qxi ¼ Li6 : of the used computers:
2 3 6 6 6
Li4 ¼ qx1 þ þ qxi þ qxi þ þ qxi þ qxi ¼ Li7 þ qxi ¼ Li3 þ qxi ¼ Li4 ; 4.1. Test instances
1 6 7 4 4 4
L0i2 ¼ qx1 þ þ qxi þ qxi þ þ qxi þ qxi þ þ qxi þ qxi ¼ Li5 þ qxi All experiments were tested on the benchmark instances of 1-
1 6 7 4 5 2 2
¼ Li1 þ qxi ¼ Li2 ; L0i8 ¼ qx1 þ þ qxi þ qxi þ þ qxi þ qxi þ þ qxi PDTSP proposed in Hernández-Pérez et al. (2009). They are taken
2 1 6 7 4 5
from http://webpages.ull.es/users/hhperez/PDsite/#XM94. These
þ qxi þ qxi þ qxi ¼ Li3 þ qxi ¼ Li7 þ qxi ¼ Li8 : benchmark instances for n 6 500 are randomly generated in the
2 3 8 8 8
following way. The n 1 customers are randomly located in the
Therefore, we prune our Shaking method by choosing four cus-
square [500, 500] [500, 500], each customer having a corre-
tomers such that Li1 ¼ Li5 and Li3 ¼ Li7 , this way preserving
sponding demand qi(2 6 i 6 n) randomly chosen from the interval
feasibility.
[10, 10]. The depot is located in the origin (0, 0) with demand
P
q1 ¼ ni¼2 qi . The travel cost c(i, j) is computed as the rounded
3.5. Sequential and Mixed General VNS for 1-PDTSP Euclidean distance d(i, j) between points i and j(c(i, j) = bd(i, j)c).
The vehicle capacities take values from the set {10, 20, 40}. For each
Finally, we summarize briefly our two new heuristics for solv- n and Q, 10 random instances are generated. They are denoted by
ing 1-PDTSP, both given in Algorithm 1. The first heuristic uses A, B, . . ., I. In order to save the space, we report the average values
Seq-VND as a local search (see Algorithm 3), and we denote it by obtained on those 10 problem instances. However, the detailed
278 N. Mladenović et al. / European Journal of Operational Research 220 (2012) 270–285
results can be found in the Appendix and on our web page: http:// best known objective function value. The distance between any
www.mi.sanu.ac.rs/nenad/pdtsp. two tours is calculated as the number of their different edges.
All the instances may be divided into two classes: small in- The comparison between local searches is clearly illustrated in
stances with a value of n from {20, 30, 40, 50, 60}, and large in- Fig. 4. Besides the large differences between local searches ob-
stances with n from {100, 200, 300, 400, 500}. Note that, for a served in Table 1, from the distance-to-target diagram we can also
given number of customers n, the smaller Q, the more difficult see that local minima are clustered into 3 groups. However, the
problem is obtained. On the other hand, if Q is too large (let us insertion local searches do not enable recognition of the cluster
say Q = 1000), the solution of the 1-PDTSP coincides with the solu- closest to the global optimum.
tion of the TSP. Similarly to the above, we constructed instances BIT or not BIT. One of the core ideas of the paper is the usage of
with n = 1000 customers. Thus, we tested our code on the instances the BIT data structure in order to check the feasibility of 2-opt
which are two times larger than the largest ones used in the past. neighborhood solutions for the 1-PDTSP. It is shown to be in
The optimal solutions for all small instances are known since O(log n) instead of O(n) for list-based implementation. But as the
they are obtained by the branch-and-cut algorithm in Hernán- runtime complexity is not the best measure for showing that the
dez-Pérez and Salazar-González (2004b). For large instances, opti- application of BIT outperforms the list-based approach at the rele-
mal solutions are not known. However, the best known results can vant instance sizes, we performed the appropriate tests.
be found in Hernández-Pérez et al. (2009) and Zhao et al. (2009a). In Table 2 the summary results for instances with n = 100, 200,
300, 400, 500 and 1000 with and without BIT data structure are gi-
4.2. Preliminary experimentation ven. We tested Mix-GVNS since it appears to be our best method.
The second column of Table 2 contains information regarding the
Multi-start local searches. To see the impact of each neighbor- total number of 2-opt neighborhood exploration within tmax = n
hood on the solution quality, we run 1000 times six local search second of Mix-GVNS. Column 3 and 4 contain the number of
heuristics: (a) forward insertion; (b) backward insertion; (c) 2- improvements and the number of feasibility checks during the
opt; (d) Seq-VND, (e) Seq-VND3 (uses full 3-opt as the last in the search, respectively. In column 5, the ratio between the number
VND list) and (f) Mix-VND. These heuristics are tested on type A in- of feasibility checks and the number of 2-opt moves, i.e. the num-
stances with n = 200 and n = 400, in both Q = 10. The results are re- ber of updating of BIT structure, is given. In column 6, the corre-
ported in Table 1, where columns 5, 6 and 7 give minimum, sponding objective function values are reported. The next six
average, and maximum % deviation from the best known solution, columns of Table 2 give the same information but now using list-
respectively. The last column reports the average computing time based data structure.
spent to reach local minima (in seconds). It appears that at the instance size n = 100 a list-based approach
Regarding the solution quality of a single neighborhood struc- outperforms BIT approach in terms of columns 2, 3, 4, and 7, 8, 9,
ture, it appears that the 2-opt significantly outperforms both for- although the same objective function value is obtained (11699).
ward and backward insertion. According to Table 1 the algorithm However, the quality of BIT data structure increases with n for
Mix-VND is the best procedure as it attains the lowest average per- n P 200: the larger the number of 2-opt feasibility checks, the lar-
centage deviation from the objective function value of the best ger the number of successful 2-opt moves are got; the larger the
known solution. However, Mix-VND requires the highest average total number of 2-opts, the smaller (better) objective function val-
computing time. It is also clear that including 3-opt in Seq-VND ues are got. Note that BIT data structure dos not need additional
is not beneficial enough - for just 2% better average performance, parameters.
more than 5 times as much computation time is spent. So we Order of neighborhoods. In Table 3, the results for multistart
decided to keep Seq-VND and Mix-VND in our further experiments. Seq-VND and Seq-GVNS, that use Seq-VND as their local search,
Results on instances with n = 200 are also illustrated on a dis- are given. Different numbers and different orders of neighborhoods
tance-to-target diagram (Fig. 4), where each local minimum is rep- are investigated. The minimal and average percentage deviation in
resented by the point (ui, vi), i = 1, . . . , 1000. The best known 20 reruns, as well as average CPU time are reported for these two
solution is in origin, ui is the distance of local minima i to the best methods.
known solution, and vi represents its percent deviation from the It can be observed that the best quality VND local search is the
one using four neighborhood structures in the following order: 2-
opt, forward insertion, backward insertion and 3-opt. However, it
Table 1 uses approximately three times more CPU times.
Comparison of different local search algorithms on two A type instances, Q = 10, and On the other hand, the percentage deviation of corresponding
n = 200, 400.
Seq-GVNS is not better than the results obtained by (2-opt, for-
Name n Q Local Min % Max % Avg. % Avg. ward insertion, backward insertion) Seq-VND local search. For that
search dev dev dev time reason, we decided to use in our final version VND with only 3
n200q10A 200 10 Forward- 95.650 255.517 181.195 0.088 neighborhood structures in the order 2-opt, forward insertion,
insertion backward insertion.
Backward- 94.753 252.827 186.318 0.081
Test of Nested VND and on boost parameterb. In order to save
insertion
2-opt 13.882 242.910 32.433 0.138 the space, we did not perform tests for the pure Nested VND since
Seq-VND 12.275 242.910 27.808 0.163 we found its behavior to be very similar to the one presented in our
Seq-VND– 8.991 242.910 24.309 0.478 previous paper, i.e., Ilić et al. (2010). The same hold for the boost
3 parameter b.
Mix-VND 1.269 242.910 12.958 2.989
n400q10A 400 10 Forward- 78.320 218.770 165.603 0.385 4.3. Main computational results
insertion
Backward- 81.881 218.770 169.416 0.317
insertion The results of GVNS for small and large instances are presented
2-opt 12.078 217.104 21.852 0.831 in Tables 4 and 5, respectively. For each Q 2 {10, 20, 40}, we report
Seq-VND 10.684 217.104 18.954 0.769 the best and the average lengths of the vehicle tour, and the execu-
Seq-VND-3 8.951 203.738 16.035 4.062
tion time (in seconds) when the best value reported in the table is
Mix-VND 1.492 217.104 6.573 26.569
obtained. As indicated in Algorithm 1, the stopping condition
N. Mladenović et al. / European Journal of Operational Research 220 (2012) 270–285 279
250 250
Local search forward-opt Local search Seq-VND2
200 200
150 150
100 100
50 50
0 0
0 50 100 150 200 0 50 100 150 200
distance between local optimum and best known distance between local optimum and best known
250 250
Local search backward-opt Local search Seq-VND3
200 200
150 150
100 100
50 50
0 0
0 50 100 150 200 0 50 100 150 200
distance between local optimum and best known distance between local optimum and best known
250 250
Local search 2-opt Local search Mix-VND
% deviation of local optimum over best known
% deviation of local optimum over best known
200 200
150 150
100 100
50 50
0 0
0 50 100 150 200 0 50 100 150 200
distance between local optimum and best known distance between local optimum and best known
Fig. 4. Distribution of 1000 local minima on distance-to-target diagram for different local search algorithms.
Table 2
Mix-GVNS with BIT and without BIT structure, within tmax = n seconds.
tmax = n seconds is used. For small instances with n 6 60, we report The optimal solutions for all small instances are known, they
the optimal length of the vehicle tours. are obtained by the branch-and-cut algorithm in Hernández-Pérez
280 N. Mladenović et al. / European Journal of Operational Research 220 (2012) 270–285
Table 3
% deviation from best know by heuristics with different order of neighborhoods (within Seq-VND and Seq-GVNS)
Table 4
% deviation from optimal values and running times on small 1-PDTSP benchmark instances of Seq-GVNS, Mix-GVNS (suggested in this paper), GRASP/VND (Hernández-Pérez
et al., 2009) and GA (Zhao et al., 2009a).
Parameters Opt. value Av. in 10 Seq-GVNS Mix-GVNS GRASP/VND GA Running time (in seconds)
n Q Best Av. Best Av. Best Av. Best Av. Seq-GVNS Mix-GVNS GRASP/VND
20 10 5402.50 0.00 0.38 0.02 0.68 0.00 0.00 0.00 0.00 0.03 0.47 0.07
20 4237.30 0.00 0.10 0.00 0.10 0.00 0.00 0.01 0.10 0.03
40 3977.40 0.00 0.37 0.00 0.28 0.00 0.00 0.01 0.04 0.02
30 10 6576.10 0.00 0.03 0.00 0.00 0.00 0.01 0.00 0.00 0.14 0.70 0.33
20 5017.20 0.00 0.00 0.00 0.00 0.00 0.00 0.04 0.11 0.08
40 4604.50 0.00 0.00 0.00 0.00 0.00 0.00 0.01 0.04 0.05
40 10 7189.30 0.00 0.07 0.00 0.00 0.00 0.40 0.00 0.04 0.78 1.95 0.80
20 5500.10 0.00 0.00 0.00 0.00 0.00 0.00 0.10 0.15 0.15
40 5142.50 0.00 0.00 0.00 0.00 0.00 0.00 0.03 0.18 0.09
50 10 8681.70 0.00 0.58 0.00 0.06 0.01 1.14 0.00 0.39 1.37 4.06 1.51
20 6537.70 0.00 0.09 0.00 0.00 0.00 0.16 0.48 1.29 0.34
40 5945.90 0.00 0.01 0.00 0.00 0.00 0.00 0.14 0.83 0.17
60 10 9165.80 0.00 0.70 0.00 0.11 0.15 2.03 0.00 0.74 2.22 7.02 2.40
20 6956.00 0.03 0.12 0.00 0.00 0.08 0.34 0.73 2.81 0.49
40 6361.70 0.00 0.00 0.00 0.00 0.00 0.00 0.26 0.88 0.26
Average 6086.38 0.00 0.16 0.00 0.08 0.02 0.27 0.00 0.23 0.42 1.38 0.45
Table 5
% deviation from best known values and running times on large 1-PDTSP benchmark instances of Seq-GVNS, Mix-GVNS (suggested in this paper), GRASP/VND (Hernández-Pérez
et al., 2009) and GA (Zhao et al., 2009a).
Parameters Best known Av. in 10 Seq-GVNS Mix-GVNS GRASP/VND GA Running time (in seconds)
n Q Best Av. Best Av. Best Av. Best Av. Seq-GVNS Mix-GVNS GRASP/VND
100 10 12718.60 0.29 1.52 0.00 0.35 1.88 4.62 0.96 1.85 9.96 23.79 8.85
20 9357.60 0.02 0.96 0.00 0.18 0.65 2.55 5.89 14.95 2.22
40 8165.40 0.00 0.20 0.00 0.04 0.00 0.57 1.84 5.97 0.69
200 10 18578.80 0.42 2.21 0.00 1.05 4.81 7.50 2.70 4.09 49.74 75.69 41.77
20 13319.00 0.50 2.32 0.00 0.91 4.58 6.86 37.60 67.58 17.37
40 11214.80 0.08 0.97 0.00 0.31 1.34 3.18 18.00 42.32 4.35
300 10 22935.30 0.83 2.39 0.00 1.47 5.30 7.67 4.20 5.62 104.61 122.83 117.86
20 16313.40 0.88 2.60 0.00 1.43 6.60 8.62 38.74 115.93 50.90
40 13671.40 0.41 1.40 0.00 0.56 2.85 4.80 24.91 88.63 12.89
400 10 25467.20 0.27 1.94 0.00 1.12 5.66 7.68 4.02 5.82 165.95 165.44 220.40
20 18407.00 0.61 2.06 0.00 1.30 6.49 8.61 69.41 152.36 91.73
40 15602.90 0.49 1.28 0.00 0.70 3.41 5.20 48.67 144.29 23.92
500 10 28774.20 0.00 1.54 0.10 1.28 5.80 7.76 5.57 7.37 124.14 209.76 391.01
20 20927.00 0.17 1.70 0.00 1.38 6.53 8.43 107.01 194.76 164.77
40 17495.50 0.41 1.50 0.00 0.86 4.47 6.10 89.81 193.52 43.98
Average 16863.21 0.36 1.64 0.01 0.86 4.04 6.01 3.49 4.95 59.75 107.85 79.51
1000 10 44744.20 0.96 19.74 0.00 1.52 – – 349.59 393.22 –
20 31661.10 1.64 3.57 0.00 1.56 7.69 8.95 478.08 441.03 618.33
40 25450.00 1.20 2.66 0.00 1.28 6.64 8.14 474.72 430.16 440.00
Average of all 19.711.30 0.51 2.81 0.01 0.96 4.39 6.31 3.49 4.95 122.15 160.12 132.41
N. Mladenović et al. / European Journal of Operational Research 220 (2012) 270–285 281
Table 6
Comparison of the results on large instances; best values obtained for each instance are boldfaced.
and Salazar-González (2004b). For large instances, optimal the hybrid GRASP/VND metaheuristic algorithm from Hernán-
solutions are not known. However, the best known results can be dez-Pérez et al. (2009) (the best solution, average solution and
found in Hernández-Pérez et al. (2009) and Zhao et al. (2009a). execution time in seconds). Results reported in Table 5 for
Note that the CPU times for GA are missing in Tables 4 and 5, since n = 1000 are obtained on our computer by using executive ver-
Zhao et al. (2009a) have not reported their computing times. Also sion of the code kindly provided to us by the authors (see
there are no reported objective values for Q P 20. Though, the Acknowledgement).
authors find their GA method to be faster than the hybrid heuristic the genetic algorithm from Zhao et al. (2009a) (best solution,
algorithm of Hernández-Pérez et al. (2009). average solution and standard deviation).
In this study, we also compare our GVNS with
From Table 4, it can be noticed that Mix-GVNS is the best meth-
UB2 – heuristics from Hernández-Pérez (2004a) (only the best od for solving small size instances. However, GA performs better
solution found); just for the smallest instances (with n = 20 and Q = 10).
282 N. Mladenović et al. / European Journal of Operational Research 220 (2012) 270–285
Table 7
Comparison of the results on large instances for Q = 20; best values obtained for each instance are boldfaced.
Clearly, our approach improves the best known solutions for all example, consider the average line of Table 5 for n = 200
large benchmark instances (n P 200), as showed in Tables 6–8. Fur- and Q = 10. Then compare the value of 18774.23 (average
thermore, in Table 9 we compare the hybrid GRASP/VND metaheu- of averages) with values of 19515.5, 19472.1, 19080.3 (the
ristic with our GVNS algorithm. For Q = 10 the hybrid GRASP/VND average of best solutions) obtained by methods UB2,
metaheuristic has failed to find a feasible solution, while in all other GRASP/VNS and GA, respectively.
cases our GVNS finds better solutions (5 percent on average). (iii) The solution qualities of GA are slightly better than those
Based on these results, we conclude that: obtained by GRASP/VND. However, instances with larger Q
are not tested, and CPU times of GA heuristic are not
(i) the GVNS based heuristics improves the best known solu- reported.
tions in all benchmark instances. (iv) Using our Seq-VNS and Mix-VNS we were able to get solu-
(ii) For some problem sizes, the average solution (out of 20) tions, in small amount of time, for the largest problems ever
obtained by Seq-GVNS and Mix-GVNS is of better quality considered in the literature, i.e., for instances with n = 1000
than the best ones obtained by the other two methods. For customers.
N. Mladenović et al. / European Journal of Operational Research 220 (2012) 270–285 283
Table 8
Comparison of the results on large instances for Q = 40; best values obtained for each instance are boldfaced.
Table 9
Comparison of basic VNS and GRASP/VND for n = 1000; best values obtained for each instance are boldfaced.
These results are very encouraging, and we are considering Brimberg, J., Hansen, P., Mladenović, N., 2010. Attraction probabilities in variable
neighborhood search. 4OR 8, 181–194.
as future research topics the application of a similar GVNS
Chalasani, P., Motwani, R., 1999. Approximating capacitated routing and delivery
methodology to related pickup-and-delivery problems. problems. SIAM Journal on Computing 28, 2133–2149.
Fenwick, P.M., 1994. A new data structure for cumulative frequency tables.
Software – Practice and Experience 24 (3), 327–336.
Acknowledgements Gamboa, D., Rego, C., Glover, F., 2006. Implementation analysis of efficient heuristic
algorithms for the travelling salesman problem. Computers & Operations
Research 33 (4), 1154–1172.
The present research work has been supported by Research Gendreau, M., Laporte, G., Vigo, D., 1999. Heuristics for the travelling salesman
Grant 174010 of the Serbian Ministry of Science and Environmen- problem with pickup and delivery. Computers & Operations Research 26, 699–
tal Protection, International Campus on Safety and Intermodality in 714.
Gendreau, M., Hertz, A., Laporte, G., 1997. An approximation algorithm for the
Transportation, the Nord-Pas-de-Calais Region, the European travelling salesman problem with backhauls. Operations Research 45, 639–641.
Community, the Regional Delegation for Research and Technology, Guan, D.J., 1998. Routing a vehicle of capacity greater than one. Discrete Applied
the Ministry of Higher Education and Research, and the National Mathematics 81, 41–57.
Hansen, P., Mladenović, N., 2006. First vs. best improvement: an empirical study.
Center for Scientific Research. The authors gratefully acknowledge Discrete Applied Mathematics 154, 802–817.
the support of these institutions. We are grateful to Inmaculada Hansen, P., Mladenović, N., Pérez, J.A.M., 2008. Variable neighborhood search.
Rodrǵuez-Martín and Juan José Salazar-González for providing us European Journal of Operational Research 191, 593–595.
Hansen, P., Mladenović, N., Pérez, Moreno J.A., 2010. Variable neighborhood search:
with the executable version of the algorithm proposed in Hernán-
algorithms and applications. Annals of Operations Research 175, 367–407.
dez-Pérez et al. (2009). We gratefully acknowledge the insightful Hernández-Pérez, H., 2004. Travelling salesman problems with pickups and
comments and suggestions from the three referees which helped deliveries. PhD Thesis, University of La Laguna, Spain.
to improve this article. Hernández-Pérez, H., Salazar-González, J.J., 2004a. Heuristics for the one-
commodity pickup-and-delivery travelling salesman problem. Transportation
Science 38, 245–255.
Hernández-Pérez, H., Salazar-González, J.J., 2004b. A branch-and-cut algorithm for a
Appendix A. detailed results for large instances travelling salesman problem with pickup and delivery. Discrete Applied
Mathematics 145, 126–139.
Hernández–Pérez, H., Salazar-González, J.J., 2007. The one-commodity pickup and
Tables 6–9.
delivery travelling salesman problem: Inequalities and algorithms. Networks
50, 258–272.
Hernández-Pérez, H., Rodríguez-Martín, I., Salazar-González, J.J., 2009. A hybrid
References GRASP/VND heuristic for the one-commodity pickup-and-delivery travelling
salesman problem. Computers & Operations Research 36, 1639–1645.
Anily, S., Bramel, J., 1999. Approximation algorithms for the capacitated travelling Ilić, A., Urosević, D., Brimberg, J., Mladenović, N., 2010. Variable neighborhood
salesman problem with pickups and deliveries. Naval Research Logistics 46, search for solving the uncapacitated single allocation p-hub median problem.
654–670. European Journal of Operational Research 206, 289–300.
N. Mladenović et al. / European Journal of Operational Research 220 (2012) 270–285 285
Irnich, S., Funke, B., Grunert, T., 2006. Sequential search and its application to Parragh, S.N., Doerner, K.F., Hartl, R.F., 2008a. A survey on pickup and delivery
vehicle-routing problems. Computers & Operations Research 33, 2405–2429. problems. Part I: Transportation between customers and depot. Journal für
Irnich, S., 2008. A unified modeling and solution framework for vehicle routing and Betriebswirtschaft, 58 21–51.
local search-based metaheuristics. INFORMS Journal on Computing 20 (2), 270– Parragh, S.N., Doerner, K.F., Hartl, R.F., 2008b. A survey on pickup and delivery
287. problems. Part II: Transportation between pickup and delivery locations.
Johnson, D.S., McGeoch, L.A., 1996. The travelling salesman problem: a case study in Journal für Betriebswirtschaft 58, 81–117.
local optimization. In: Aarts, E.H.L., Lenstra, J.K. (Eds.), Local Search in Pop, P., Pop-Sitar, C., 2011. A new efficient transformation of the generalized VRP
Combinatorial Optimization. Wiley, New York. into the classical VRP. Yugoslav Journal of Operations Research 21, 187–198.
Johnson, D.S., McGeoch, L.A., 1997. The travelling salesman problem: a case study in Rego, C., Gamboa, D., Glover, F., Osterman, C., 2011. Travelling salesman problem
local optimization. In: Aarts, E.J.L., Lenstra, J.K. (Eds.), Local search in heuristics: leading methods, implementations and latest advances. European
combinatorial optimization. Wiley, Chichester, UK. Journal of Operational Research 211 (3), 427–441.
Laporte, G., 1992. The travelling salesman problem: an overview of exact and Savelsbergh, M.W.P., Sol, M., 1995. The general pickup and delivery problem.
approximate algorithms. European Journal of Operational Research 59 (2), 231– Transportation Science 29, 17–29.
247. Zhao, F., Li, S., Sun, J., Mei, D., 2009a. Genetic algorithm for the one-commodity
Lin, S., Kernighan, B.W., 1973. An effective heuristic algorithm for the travelling pickup-and-delivery travelling salesman problem. Computers & Industrial
salesman problem. Operations Research 21, 498–516. Engineering 56, 1642–1648.
Mladenović, N., Hansen, P., 1997. Variable neighborhood search. Computers & Zhao, F., Sun, J., Li, S., Liu, W., 2009b. A hybrid genetic algorithm for the travelling
Operations Research 24, 1097–1100. salesman problem with pickup and delivery. International Journal of
Mosheiov, G., 1994. The travelling salesman problem with pick-up and delivery. Automation and Computing 6, 97–102.
European Journal of Operational Research 79, 299–310.