Professional Documents
Culture Documents
Heuristics - For - The - One-Commodity - Pickup-and-Delive Salazar
Heuristics - For - The - One-Commodity - Pickup-and-Delive Salazar
discussions, stats, and author profiles for this publication at: https://www.researchgate.net/publication/220413201
CITATIONS READS
71 137
2 authors:
Some of the authors of this publication are also working on these related projects:
All content following this page was uploaded by Juan José Salazar González on 04 June 2017.
The user has requested enhancement of the downloaded file. All in-text references underlined in blue are added to the original document
and are linked to publications on ResearchGate, letting you access and read them immediately.
TRANSPORTATION SCIENCE informs ®
Vol. 38, No. 2, May 2004, pp. 245–255
issn 0041-1655 eissn 1526-5447 04 3802 0245 doi 10.1287/trsc.1030.0086
© 2004 INFORMS
T his paper deals with a generalisation of the well-known traveling salesman problem (TSP) in which cities
correspond to customers providing or requiring known amounts of a product, and the vehicle has a given
upper limit capacity. Each customer must be visited exactly once by the vehicle serving the demands while
minimising the total travel distance. It is assumed that any unit of product collected from a pickup customer can
be delivered to any delivery customer. This problem is called one-commodity pickup-and-delivery TSP (1-PDTSP).
We propose two heuristic approaches for the problem: (1) is based on a greedy algorithm and improved with
a k-optimality criterion and (2) is based on a branch-and-cut procedure for finding an optimal local solution.
The proposal can easily be used to solve the classical “TSP with pickup-and-delivery,” a version studied in
literature and involving two commodities. The approaches have been applied to solve hard instances with up
to 500 customers.
Key words: pickup and delivery; traveling salesman; heuristics; branch and cut
History: Received: August 2002; revision received: March 2003; accepted: March 2003.
approach applied to solve instances with up to 40 cus- (TSPB) (see, e.g., Gendreau et al. 1997), where an
tomers, but there are in literature many other prob- uncapacitated vehicle must visit all the delivery cus-
lems closely related. We next point out some of them, tomers before visiting a pickup customer. See Savels-
starting with the problems involving one commodity bergh and Sol (1995) for other references and variants
and then the related problems involving several com- (including time windows, and so on) of the so-called
modities. general pickup and delivery problem.
Chalasani and Motwani (1999) study the special Another known problem is the TSPPD, introduced
case of the 1-PDTSP, where the delivery and pickup by Mosheiov (1994), and where the product collected
quantities are all equal to one unit. This problem from pickup customers must be transported to the
is called Q-delivery TSP if Q is the capacity of the depot and the product delivery to the demand cus-
vehicle. Anily and Bramel (1999) consider the same tomers should be transported from the depot, all done
problem with the name capacitated traveling salesman using a capacitated vehicle on a Hamiltonian route.
problem with pickups and deliveries (CTSPPD). They pro- Seen from this point of view, the TSPPD concerns
pose heuristic algorithms, which could be applied a many-to-one commodity and another one-to-many
to a 1-PDTSP instance with general demands if the different commodity, and a classical application is
Hamiltonian requirement on the route were relaxed, the collection of empty bottles from the customers
or directly to a 1-PDTSP instance if the demand val- being delivered to a warehouse and full bottles being
ues are +1 or −1. In other words, as noticed in Anily delivered from the warehouse to the customers. An
and Bramel (1999), CTSPPD can be considered the important difference when comparing TSPPD with
“splitting version” of the 1-PDTSP. Moreover, Anily 1-PDTSP is that PDTSP is feasible if, and only if, the
and Bramel (1999) give an important application of vehicle capacity is at least the maximum of the total
the CTSPPD in the context of inventory repositioning, sum of the pickup demands and of the total sum of
and this application leads to the 1-PDTSP if the vehi- the delivery demands (i.e., K ≤ Q). This constraint
cle is required to visit each retailer exactly once, an
is not required for the feasibility of the 1-PDTSP in
important constraint to guarantee a satisfactory ser-
which the vehicle capacity Q could even be equal
vice policy when the customer is external to the firm.
to the biggest customer demand maxni=1 qi . As men-
Anily and Hassin (1992) introduce the swapping
tioned by Mosheiov (1994), a TSPPD instance can be
problem, a more general problem, where several com-
assumed to be in “standard form,” which means that
modities must be transported from many origins to
the capacity of the vehicle coincides with the total
many destinations with a vehicle of limited capac-
sum of products collected in the pickup customers
ity following a non-necessary Hamiltonian route, and
and with the total sum of product delivered in the
where a commodity can be temporarily stored in an
delivery customers (i.e., K = Q). Hence, it is always
intermediate customer. This last feature is named
preemption or drop in the process of transportation. possible to assume that in a feasible TSPPD route,
The swapping problem on a line is analyzed in the vehicle starts at the depot fully loaded, it delivers
Anily et al. (1999). In the capacitated dial-a-ride prob- and picks up amounts from the customers, and fin-
lem (CDARP) (also named single-vehicle many-to-many ishes at the depot again fully loaded. This condition of
dial-a-ride problem), there is a one-to-one correspon- traversing the depot with a full (or empty) load is also
dence between pickup customers and delivery cus- presented in the other problems, like the CTSPPD,
tomers, and the vehicle should move one unit of a where the vehicle cannot go immediately from the
commodity (say, a person) from its origin to its des- depot to a pickup customer, but it does not necessar-
tination with a limited capacity Q (see, e.g., Psaraftis ily occur in general with the 1-PDTSP as observed.
1983, Guan 1998). When Q = 1, the nonpreemp- Anily and Mosheiov (1994) present approximation
tive CDARP is known as the stacker crane problem algorithms for the TSPPD, here renamed TSP with
(see, e.g., Frederickson et al. 1978). When there is delivery and backhauls (TSPDB), and Gendreau et al.
no vehicle capacity, the nonpreemptive CDARP is (1999) propose several heuristics tested on instances
called the pickup and delivery traveling salesman prob- with up to 200 customers. Baldacci et al. (1999) deal
lem (PDTSP) (see, e.g., Kalantari et al. 1985, Kubo with the same problem, here named TSP with deliv-
and Kasugai 1990, Healy and Moll 1995, Renaud ery and collection (TSPDC) constraints, and present an
et al. 2000, Renaud et al. 2002). In Kalantari et al. exact algorithm based on a two-commodity network
(1985), the PDTSP is referred to as traveling sales- flow formulation, which was able to prove optimal-
man problem with pickup and delivery (TSPPD) and in ity of some TSPPD instances with 150 customers,
Healy and Moll (1995), the PDTSP is referred to as even if it was not able to prove optimality of other
CDARP. The PDTSP is a particular case of the TSP TSPPD instances with 25 customers. Hernández-Pérez
with precedence constraints (see, e.g., Bianco et al. 1994). and Salazar-González (2004) present a branch-and-cut
Another related problem is the TSP with backhauls algorithm for the exact solution of TSPPD instances
Hernández-Pérez and Salazar-González: Heuristics for the Traveling Salesman Problem
Transportation Science 38(2), pp. 245–255, © 2004 INFORMS 247
Swapping Problem m many to many no yes 1 yes Anily et al. (1999), Anily and Hassin (1992)
Stacker Crane Problem m one to one no no 1 yes Frederickson et al. (1978)
CDARP m one to one no no k yes Guan (1998), Psaraftis (1983), Savelsbergh and Sol (1995)
PDTSP m one to one yes no
yes Kalantari et al. (1985), Kubo and Kasugai (1990),
Renaud et al. (2002), Renaud et al. (2000)
TSPPD, TSPDB, TSPDC 2 one to many yes no k yes Anily and Mosheiov (1994), Baldacci et al. (1999),
Gendreau et al. (1999), Mosheiov (1994)
TSPB 2 one to many yes no
yes Gendreau et al. (1997)
CTSPPD, Q-delivery TSP 1 many to many no no k yes Anily and Bramel (1999), Chalasani and Motwani (1999)
1-PDTSP 1 many to many yes no k no Hernández-Pérez and Salazar-González (2004)
with up to 75 customers and of 1-PDTSP instances then solving a larger problem with the Hamiltonian
with up to 40 customers. requirement. This is, for example, the case of the
On the one hand, Chalasani and Motwani (1999) CTSPPD in Anily and Bramel (1999) and Chalasani
observe that when the vehicle capacity is large and Motwani (1999), where the proposed algorithms
enough, then their problem (i.e., the Q-delivery TSP are developed for a particular case of the 1-PDTSP
or CTSPPD with Q =
) is a special case of the with unit demands. Hence, the feature on Hamiltoni-
TSPPD. This implies that the uncapacitated version anity referred to in Table 1 regards the original prob-
of the 1-PDTSP, with the additional requirement that lem with general demand values and not the larger
the vehicle must leave the depot with a full load, problem with unit demands when Q <
.
can be approximated by the methods developed in Clearly, the 1-PDTSP is an -hard optimization
Mosheiov (1994) and in Anily and Mosheiov (1994). problem in the strong sense because it coincides with
On the other hand, Anily and Bramel (1999) observe TSP when the vehicle capacity is large enough. Addi-
that a TSPPD instance can also be transformed into a tionally, checking if there is a feasible solution of a
CTSPPD instance and, therefore, algorithms for solv- 1-PDTSP instance is a strongly -complete prob-
ing the 1-PDTSP can be easily adapted to solve the lem. The idea is based on the fact that this decision
TSPPD. This was the main motivation for our work. problem includes the 3-Partitioning Problem (3PP),
which is -complete in the strong sense (see Garey
This extensive and nonexhaustive list of single-
and Johnson 1979) and defined as follows. Let us con-
vehicle problems is summarised in Table 1 with res-
sider a number P and a set I of 3m positive inte-
pect to the following features:
ger numbers
p1 p3m such that P /4 < pi < P /2
Problem name: it is the short name of the problem.
and i∈I pi = mP . The 3PP requires the existence of
#: number of commodities.
a partition
of I into m disjoint sets I1 Im such
Origins-destinations: it is the number of pickup that i∈Ik pi = P for all k ∈
1 m. For each 3PP
customers and delivery customers of a commodity instance, there is an associated 1-PDTSP defined by
(“many to many” if there are several origins and sev- 3m pickup customers, each one with a demand pi , by
eral destinations. “One to one” if there is one origin m delivery customers, each one with demand −P , and
and one destination, and so on). by a vehicle of capacity P . The problems of checking
Hamiltonian: “yes” means that the problem looks feasibility for both instances coincide.
for a Hamiltonian tour, and “no” means that a cus- Finding good feasible 1-PDTSP solutions is much
tomer can be visited more than once. more complicated than finding good heuristic solu-
Pre-emption: “yes” means that an intermediate drop tions for the TSP, thus, justifying the aim of this
is allowed, and “no” means that a unit of product article. Section 2 describes a simple initial heuris-
should be loaded once in the vehicle. tic algorithm by extending some TSP procedures.
Q: it is the assumption on the vehicle capacity Section 3 describes a more elaborate procedure based
(a unit value, a general value k or the uncapacitated on a branch-and-cut algorithm as proposed by Fis-
situation). chetti and Lodi (2002) for general mixed integer
Load: “yes” means that the vehicle should leave the programming models. An extensive computational
depot with a full or empty load, and “no” means that analysis is presented in §4, where 1-PDTSP and
the initial load should be also computed. TSPPD instances with n ≤ 500 are heuristically solved.
References: some papers on the problem.
An important remark is that some capacitated prob- 2. First Heuristic for 1-PDTSP
lems with no Hamiltonian requirement are addressed As mentioned in the introduction, contrary to what
in some papers by splitting each customer with happens in the TSP, finding a feasible solution (opti-
demand q into q customers with unit demand, and mal or not) for the 1-PDTSP is a problem with a hard
Hernández-Pérez and Salazar-González: Heuristics for the Traveling Salesman Problem
248 Transportation Science 38(2), pp. 245–255, © 2004 INFORMS
Tour improvement procedures are adaptations of could use an available exact procedure to find the
the 2-opt and 3-opt exchanges of edges described in Lin best solution in a restricted feasible region within an
(1965) and Johnson and McGeoch (1997) for the TSP. iterative framework.
These implementations avoid looking at all possible Given two integer numbers h and k, let us assume
exchanges for one that shortens the tour, in the spirit that a 1-PDTSP tour T h is known, and let xeh e ∈ E be
of work of Lin and Kernighan (1973), and are based its incident vector and E h the edges in T h . We define
on a data structure that quickly identifies allowable k-neighborhood of T h the set T h k of all 1-PDTSP
candidates for the exchanges (see also Helsgaun 2000) solutions that differ from T h in no more than k edges.
for a sophisticated variant. In our implementation, for In other words, T h k is the set of the solutions of
each vertex i, the data structure stores a list of 15 the ILP model plus the additional constraint
remaining vertices j in order of increasing distance dij ,
thus, defining allowable edges i j to be inserted in 1 − xe ≤ k (1)
e∈E h
exchanges.
The execution of the proposed approach is repeated Note that T h 0 = T h 1 =
T h , and =
for each initial vertex v1 when n < 100. For larger T h n is the set of all feasible 1-PDTSP tours. One is
instances, to keep the required computational effort then interested in developing a procedure to find the
small, only 100 vertices i with biggest qi are consid- best solution in T h k for some k. The first heuristic
ered as initial vertices v1 . Therefore, this heuristic can described in §2 contains an improvement procedure
be seen as a multistart approach. In our experiments, that iteratively finds a good solution T h+1 exploring
we have observed that the loss of quality involved (partially) T h k for k = 3. The initial tour T 1 is
in using truncated neighbor lists is not a major issue provided by the heuristic procedure described in §2.
in practice, as also noticed in Johnson and McGeoch Clearly, the direct extension of this improvement pro-
(1997). A pseudocode describing the overall proce- cedure to deal with some k > 3 could find better solu-
dure is next given. tions, but it could require too much computational
Step 1. Let N0 be the set of initial vertices in the effort. Still, by modifying the branch-and-cut code in
multistart procedure. Hernández-Pérez and Salazar-González (2004) to take
Step 2. Select v1 ∈ N0 , apply the greedy algorithm into account constraint (1), one could expect to suc-
−
→
starting from v1 and let T be the output. ceed exploring T h k for some 3 < k < n.
−
→ −
→ Let us denote T h , the tour obtained with the h-th
Step 3. If T is feasible 1-PDTSP solution, set T ∗ =
−
→ −
→ call to the branch-and-cut algorithm. As noted by
T and go to Step 4; otherwise, set T = T and go to
Fischetti and Lodi (2002), the neighborhoods T h k
Step 5.
for all T h are not necessarily disjoint subsets of .
Step 4. Apply 2-opt procedure and 3-opt procedure to
−
→∗ −
→ −
→ Nevertheless, it is quite straightforward to also mod-
T , obtaining a new tour T minimising infeas T , ify the branch and cut to avoid searching in already
−
→ −
→ −
→∗
subject to infeas T < 2K/n and cost T ≤ cost T . If explored regions. To this end, the branch-and-cut
−
→
no T is found, go to Step 6; otherwise, go to Step 3. algorithm at iteration h can be modified to take into
Step 5. Apply 2-opt procedure and 3-opt procedure over account the original ILP model, constraint (1), and the
−
→ −
→ −
→ additional inequalities
T , obtaining a new tour T minimising infeas T , sub-
−
→ −
→ −
→ −
→
ject to infeas T < infeas T and cost T ≤ cost T ∗ . If 1 − xe ≥ k + 1 (2)
−
→
no T is found, go to Step 6; otherwise, go to Step 3. e∈E l
−
→ −
→
Step 6. If T ∗ improves the current best tour T 1 , for all l = 1 h − 1. Then, at iteration h, it explores
−
→
update T 1 . Set N0 = N0 \
v1 . If N0 =
, go to Step 1; a totally different region, defined by T h k\
−
→ h−1 l
otherwise, stop with the output T 1 . l=1 T k. The last iteration is the one where no
new solution was found.
Fischetti and Lodi (2002) also noticed that by explo-
3. Incomplete Optimisation Algorithm ring the remaining feasible 1-PDTSP region (i.e.,
for 1-PDTSP \ hl=1 T l k if iteration h is the last iteration),
The branch-and-cut algorithm proposed in the procedure would be an exact method. Because
Hernández-Pérez and Salazar-González (2004) was the remaining region tends to create a difficult prob-
able to solve to optimality instances with up to 40 lem for a branch-and-cut algorithm on medium-large
vertices. When trying to solve bigger instances, the instances and because we are only interested in good
same approach is not expected to finish within a solutions in short time, our approach does not execute
reasonable computing time. Nevertheless, as pro- this additional exploration.
posed in Fischetti and Lodi (2002) for solving general Solving each iteration could be, in some cases, a
mixed integer linear programming (ILP) models, one difficult task in practice, hence, Fischetti and Lodi
Hernández-Pérez and Salazar-González: Heuristics for the Traveling Salesman Problem
250 Transportation Science 38(2), pp. 245–255, © 2004 INFORMS
(2002) suggest the imposition of a time limit on each suggests that considering constraint (2) in our branch-
branch-and-cut execution and the modification of the and-cut executions is not so relevant for our heuristic
value of k when it is achieved. In our implementa- aims.
tion, we found better results by reducing the number To further speed the execution of the branch-and-
of variables given to the branch-and-cut solver. More cut solver, one could replace (1) by 4 ≤ e∈E h 1 − xe
precisely, instead of starting each branch-and-cut exe- ≤ k, since the primal heuristic procedure almost guar-
cution with all possible variables, we only allow the antees that T h is the best tour in T h 3. When k
fractional solutions to use variables associated with is a small number (as in our implementation, where
the subset E of promising edges. Subset E is ini- k = 5), we have also experimented with the replace-
tialised with the 10 shortest edges i j, according ment of each branch-and-cut execution with the
to the distance dij described in §2, for each vertex i. previous constraint by a sequence of branch-and-cut
In our experiments, we did not find advantages in executions, each one with the equality e∈E h 1 − xe
enlarging E even with the new edges in E h of the = l, for each l = 4 5 k, going to the next iteration
current solution. In this way, the branch-and-cut exe- as soon as a better tour T h+1 is found. We did not
cution of iteration h will not explore T h k. find in our experiments any clear advantage in imple-
Also, to avoid heavy branch-and-cut executions, we menting these ideas, hence, each iteration consists of
impose a limit of, at most, six node-deep levels when one branch-and-cut execution solving ILP model with
going down in the decision tree exploration. This idea the additional constraint (2).
uses the fact that the applied branch-and-cut algo-
rithm, as mentioned in Hernández-Pérez and Salazar- 4. Computational Results
González (2004), tends to explore a large number of The heuristic algorithms described in §§2 and 3 have
nodes, each one in a short time, hence, the idea tries been implemented in ANSI C, and ran on a personal
to diversify the fractional solutions feeding the primal computer AMD 1,333 MHz. under Windows 98. The
heuristic described in the next paragraph. Whenever software CPLEX 7.0 was the linear programming (LP)
the branch-and-cut execution at iteration h ends with solver in our branch-and-cut algorithm.
a tour T h+1 better than T h , the next iteration is per- We tested the performance of the approaches both
formed. on the 1-PDTSP and on the TSPPD using the random
An element of primary importance for this more generator proposed in Mosheiov (1994) as follows.
elaborated heuristic is the primal heuristic applied We have generated n − 1 random pairs in the square
inside the branch-and-cut algorithm. It is a proce- −500 500 × −500 500, each one corresponding to
dure to find a feasible 1-PDTSP solution by using the location of a customer and associated with a ran-
the information in the last fractional solution, and it dom demand in −10 10. The depot was located in
is executed every six iterations of the cutting plane (0,0) with demand q1 = − ni=2 qi . The travel cost cij
approach and before every branching phase of the was computed as the Euclidean distance between i
branch-and-cut procedure. To implement it, we have and j. We generated 10 random instances for each
slightly modified the heuristic described in §2 to con- value of n in
20 30 60 100 200 500 and for
sider a given fractional solution xe∗ e ∈ E , where each different value of Q in
10 15 45 1000.
E is the set of edges with a variable in the model. The solution of the 1-PDTSP instances with Q = 1000
More precisely, the new procedure to build an initial coincided with the optimal TSP tour in all the gen-
1-PDTSP solution chooses edges from E ∗ =
e ∈ E erated instances. The case Q = 10 was the smallest
capacity because for each n, there is a customer in an
xe∗ > 0 to be inserted in a partial tour T . The par-
instance with demand ±10. Also, for each value of
tial tour T is initialised with n degenerated paths
n, 10 TSPPD instances were generated, each one with
of G, each one Pi consisting in only one vertex vi .
the smallest possible capacity
The edges are chosen from E ∗ in decreasing order
integer solution value OPT for the small instances, relation between TSP and OPT also gives an idea of
and the optimal value TSP of the TSP instance for the added difficulty of solving a 1-PDTSP with respect
the medium-large instances. The reason for comput- to a TSP. The column headings have the following
ing the value TSP for large instances is to show meanings:
how it relates to LB on our benchmark instances. n: is the number of vertices;
The use of value TSP as lower bound is done in Q: is the capacity of the vehicle. Word “TSPPD”
Gendreau et al. (1999) and, therefore, we also include means that it is a TSPPD instance with the tightest
it in our tables to facilitate comparison. Moreover, the capacity;
Hernández-Pérez and Salazar-González: Heuristics for the Traveling Salesman Problem
252 Transportation Science 38(2), pp. 245–255, © 2004 INFORMS
UB1/OPT: (in Table 2) is the average percentage of UB1-t: is the average CPU time (in seconds) of the
the first heuristic over the optimal value for the small first heuristic;
instances; UB2/OPT: (in Table 2) is the average percentage of
UB1/TSP: (in Table 3) is the average percentage of the incomplete optimisation algorithm over the opti-
the first heuristic over the TSP optimal value for the mal value for the small instances;
large instances; UB2/TSP: (in Table 3) is the average percentage of
UB1/LB: is the average percentage of the first the incomplete optimisation algorithm over the TSP
heuristic over the lower bound; optimal value for the large instances;
Hernández-Pérez and Salazar-González: Heuristics for the Traveling Salesman Problem
Transportation Science 38(2), pp. 245–255, © 2004 INFORMS 253
tour found T h+1 at iteration h for each h = 0 1 5. Table 4 Statistics on TSPPD Instances from Gendreau et al. (1999)
In particular, it shows the cost value of T h+1 , the time Derived from VRP Test Instances
in seconds where it was found during iteration h, the T S2/T SP T S2-t UB1/T SP UB1-t UB2/T SP UB2-t B&C
number E h+1 \E of edges in T h+1 not in E (the set of
0 100.51 3.10 100.20 0.12 100.05 0.93 1.50
edges associated with variables given to the branch-
0.05 103.45 2.18 100.80 0.17 100.61 0.87 1.54
and-cut solver), and the number E h+1 \E h of edges in 0.1 104.34 2.31 100.93 0.21 100.72 1.07 1.62
T h+1 not in T h . From the table, one observes that the 0.2 106.16 2.26 101.08 0.27 100.90 1.02 1.54
primal heuristic can generate a new tour T h+1 using
edges even outside E .
We have generated 1,000 instances, from which 100 of their best heuristic algorithm (TS2) and our two
are TSPPD instances and 100 are TSP instances. Not heuristics (UB1 and UB2) solving the same instances
one of the remaining 800 1-PDTSP instances resulted on the same computer. Each table corresponds to the
in being infeasible, because both our heuristic algo- average results on the instances obtained modifying
rithms found feasible solutions, even when Q = 10. instances of the classical vehicle routing problem and the
Moreover, we also imposed a time limit of 1,800 randomly generating Euclidean distance instances,
seconds to the overall execution of the incomplete respectively, we have also observed similar perfor-
optimisation algorithm, but this limit was never mances of our code on the randomly generated sym-
achieved, and no average time was bigger than 1,000 metric instances. An immediate observation is that
seconds. our two heuristic approaches provide better results in
Finally, to test the performance of our heuristic less computational effort. A relevant remark from our
approaches solving TSPPD instances, we have run experiments is that the TSPPD instances considered
the computer codes of the instance generator and the in Gendreau et al. (1999) are very close to the TSP
tabu search heuristic used in Gendreau et al. (1999) instances, thus, they are easier to be solved than
on their three families of TSPPD instances. Tables 4 the 1-PDTSP instances with the same number of
and 5 show the average percentages of gaps and times customers.
Table 5 Statistics on the Randomly Generated Euclidean TSPPD Instances from Gendreau et al. (1999)