10
Efficient algorithms for the double traveling salesman problem with multiple stacks Marco Casazza a , Alberto Ceselli a, , Marc Nunkesser b a D.T.I., Universit a degli Studi di Milano, Via Bramante 65 - 26013 Crema (CR), Italy b Inst. of Theoretical Computer Science, ETH Z¨ urich, Universit¨ atstr. 6 - 8092 Z¨ urich, Switzerland article info Available online 13 July 2011 Keywords: Traveling Salesman Problem LIFO constraints Efficient algorithms Heuristics abstract In this paper we investigate theoretical properties of the Double Traveling Salesman Problem with Multiple Stacks. In particular, we provide polynomial time algorithms for different subproblems when the stack size limit is relaxed. Since these algorithms can represent building blocks for more complex methods, we also include them in a simple heuristic which we test experimentally. We finally analyze the impact of handling the stack size limit, and we propose repair procedures. The theoretical investi- gation highlights interesting structural properties of the problem, and our computational results show that the single components of the heuristic can be successfully incorporated in more complex algorithms or bounding techniques. & 2011 Elsevier Ltd. All rights reserved. 1. Introduction The optimization of routing and packing decisions plays a crucial role in logistics, since the final cost of goods is strongly affected by an efficient distribution. Both Vehicle Routing and Bin Packing problems have been studied extensively in the operations research literature: recent surveys include [17,27]; state-of-the- art techniques allow to solve many real life instances to prove optimality. Several practical applications, however, require the placement of items on the back of vehicles to be explicitly considered, so that routing and packing decisions have to be taken simultaneously [19]. For instance, in pickup and delivery problems origin– destination pairs are given instead of single customers, and the vehicles can deliver items to each destination only after visiting the corresponding origin. Among these, in the Traveling Salesman Problem with Pickup and Delivery and Last-In-First-Out con- straints (TSPPDL) a single vehicle is considered: each time an origin customer is visited its items are piled up on the back of the vehicle, and only the items on the top of the pile are available for delivery. Symmetric features have been considered, like First-In- First-Out behavior of the pile of items. Both exact [11] and heuristic [8] methods have been proposed for handling FIFO or LIFO constraints; state-of-the-art algorithms are able to approxi- mately solve problems with up to 750 origin–destination pairs in less than 1 h of CPU time. A more general setting is considered in the two-dimensional Loading Capacitated Vehicle Routing Problem (2L-CVRP). The back of each vehicle is modeled as a two-dimensional board, where customer items of different size and shape can be placed. The objective is to route a fleet of vehicles at minimum cost, in order to visit all the customers and ensuring that the items of customers visited by the same vehicle can be placed on the board without overlapping. After seminal exact [18] and Tabu Search approaches [16], Ant Colony [14] and Guided Tabu Search [29] methodologies have been exploited to heuristically solve the 2L-CVRP, allowing to obtain good solutions for instances with up to 76 customers in a few minutes. The Double Traveling Salesman Problem with Multiple Stacks (DTSPMS), introduced in [25], is one of the simplest examples of such integrated problems: a pickup city with N pickup customers and a delivery city with N delivery customers are given. Items of identical shape and size have to be collected from the pickup customers through a tour in the pickup city, and then delivered through a tour in the delivery city. During the pickup tour, the items have to be organized in stacks on the back of the vehicle; the delivery operations can start only from the top of the stacks. That is, in its simplicity the DTSPMS copes with a frequently arising issue: in the real world, more often than not unloading the last loaded items is much easier than accessing the previous ones. As similar routing–packing problems, the DTSPMS is NP-hard [15], as it includes the TSP as a special case [25]. Recently, there has been a growing interest in exact algorithms for the DTSPMS: branch-and-cut algorithms are introduced in [24,2], the authors in [22] try to iteratively generate good tours and combine them in an optimal way, while in [7] experiment on a branch-and-bound Contents lists available at ScienceDirect journal homepage: www.elsevier.com/locate/caor Computers & Operations Research 0305-0548/$ - see front matter & 2011 Elsevier Ltd. All rights reserved. doi:10.1016/j.cor.2011.06.008 Corresponding author. Fax: þ39 0373 898010. E-mail address: [email protected] (A. Ceselli). Computers & Operations Research 39 (2012) 1044–1053

Efficient algorithms for the double traveling salesman problem with multiple stacks

Embed Size (px)

Citation preview

Page 1: Efficient algorithms for the double traveling salesman problem with multiple stacks

Computers & Operations Research 39 (2012) 1044–1053

Contents lists available at ScienceDirect

Computers & Operations Research

0305-05

doi:10.1

� Corr

E-m

journal homepage: www.elsevier.com/locate/caor

Efficient algorithms for the double traveling salesman problem withmultiple stacks

Marco Casazza a, Alberto Ceselli a,�, Marc Nunkesser b

a D.T.I., Universit �a degli Studi di Milano, Via Bramante 65 - 26013 Crema (CR), Italyb Inst. of Theoretical Computer Science, ETH Zurich, Universitatstr. 6 - 8092 Zurich, Switzerland

a r t i c l e i n f o

Available online 13 July 2011

Keywords:

Traveling Salesman Problem

LIFO constraints

Efficient algorithms

Heuristics

48/$ - see front matter & 2011 Elsevier Ltd. A

016/j.cor.2011.06.008

esponding author. Fax: þ39 0373 898010.

ail address: [email protected] (A. Cesell

a b s t r a c t

In this paper we investigate theoretical properties of the Double Traveling Salesman Problem with

Multiple Stacks. In particular, we provide polynomial time algorithms for different subproblems when

the stack size limit is relaxed. Since these algorithms can represent building blocks for more complex

methods, we also include them in a simple heuristic which we test experimentally. We finally analyze

the impact of handling the stack size limit, and we propose repair procedures. The theoretical investi-

gation highlights interesting structural properties of the problem, and our computational results show

that the single components of the heuristic can be successfully incorporated in more complex

algorithms or bounding techniques.

& 2011 Elsevier Ltd. All rights reserved.

1. Introduction

The optimization of routing and packing decisions plays acrucial role in logistics, since the final cost of goods is stronglyaffected by an efficient distribution. Both Vehicle Routing and BinPacking problems have been studied extensively in the operationsresearch literature: recent surveys include [17,27]; state-of-the-art techniques allow to solve many real life instances to proveoptimality.

Several practical applications, however, require the placementof items on the back of vehicles to be explicitly considered, so thatrouting and packing decisions have to be taken simultaneously[19]. For instance, in pickup and delivery problems origin–destination pairs are given instead of single customers, and thevehicles can deliver items to each destination only after visitingthe corresponding origin. Among these, in the Traveling SalesmanProblem with Pickup and Delivery and Last-In-First-Out con-straints (TSPPDL) a single vehicle is considered: each time anorigin customer is visited its items are piled up on the back of thevehicle, and only the items on the top of the pile are available fordelivery. Symmetric features have been considered, like First-In-First-Out behavior of the pile of items. Both exact [11] andheuristic [8] methods have been proposed for handling FIFO orLIFO constraints; state-of-the-art algorithms are able to approxi-mately solve problems with up to 750 origin–destination pairs inless than 1 h of CPU time.

ll rights reserved.

i).

A more general setting is considered in the two-dimensionalLoading Capacitated Vehicle Routing Problem (2L-CVRP). The backof each vehicle is modeled as a two-dimensional board, wherecustomer items of different size and shape can be placed. Theobjective is to route a fleet of vehicles at minimum cost, in orderto visit all the customers and ensuring that the items of customersvisited by the same vehicle can be placed on the board withoutoverlapping. After seminal exact [18] and Tabu Search approaches[16], Ant Colony [14] and Guided Tabu Search [29] methodologieshave been exploited to heuristically solve the 2L-CVRP, allowingto obtain good solutions for instances with up to 76 customers ina few minutes.

The Double Traveling Salesman Problem with Multiple Stacks(DTSPMS), introduced in [25], is one of the simplest examples ofsuch integrated problems: a pickup city with N pickup customersand a delivery city with N delivery customers are given. Items ofidentical shape and size have to be collected from the pickupcustomers through a tour in the pickup city, and then deliveredthrough a tour in the delivery city. During the pickup tour, theitems have to be organized in stacks on the back of the vehicle;the delivery operations can start only from the top of the stacks.That is, in its simplicity the DTSPMS copes with a frequentlyarising issue: in the real world, more often than not unloading thelast loaded items is much easier than accessing the previous ones.

As similar routing–packing problems, the DTSPMS is NP-hard[15], as it includes the TSP as a special case [25]. Recently, therehas been a growing interest in exact algorithms for the DTSPMS:branch-and-cut algorithms are introduced in [24,2], the authorsin [22] try to iteratively generate good tours and combine them inan optimal way, while in [7] experiment on a branch-and-bound

Page 2: Efficient algorithms for the double traveling salesman problem with multiple stacks

M. Casazza et al. / Computers & Operations Research 39 (2012) 1044–1053 1045

algorithm separating the routing and packing phase. Neverthe-less, only small instances can be solved exactly by these methods,mainly due to the hardness of devising good lower bounds. On theother hand, various heuristics and meta-heuristic algorithms[23,13,12] allow to produce good solutions for real-size problems.The required computing efforts range from seconds to hours forsolving instances with up to 132 customers with a vehicle havingthree stacks.

The main aim of this paper is to investigate theoreticalproperties of the DTSPMS, providing polynomial time algorithmsfor different subproblems. We mainly focus on the relaxation ofthe problem in which stacks have no size limit, although some ofour results hold also when such a size limit is enforced.

In Section 2 we introduce a formal graph model, and in Section 3we present theoretical results. Since our algorithms can representbuilding blocks for more complex methods, we include them in asimple yet efficient heuristic, in order to assess also their practicalapplicability. The heuristic is described in Section 4; since in prac-tical applications the stacks are always limited in size, in Section 4.3we discuss how to modify our algorithms to handle these kindsof constraints. In Section 5 we perform an experimental analysison each component of the algorithm and we compare to otherheuristics. Finally, in Section 6 we summarize our results and givesome brief conclusions.

We remark that some of the results discussed in Section 3.1have been presented in preliminary forms [10,9], and indepen-dently obtained in [26].

Fig. 1. Solution of an instance with six customers and two stacks.

2. Formulation

The DTSPMS can be modeled as the following graph optimiza-tion problem. We are given a set of customers 1 . . .N and two(di-)graphs Gþ ðN þ ,Aþ Þ and G�ðN �,A�Þ with costs cþ and c�,respectively, on the arcs. The former is the pickup graph and thelatter is the delivery graph. Both sets N þ and N � consist of ver-tices nþi and n�i for each customer i, and two additional verticesnþ0 and n�0 which represent the depots. Each customer i demandsthe pickup of an item in vertex nþi and the delivery of the sameitem in vertex n�i .

Definition 2.1. We indicate as pickup tour any permutationsP ¼ ðsPð1Þ, . . . ,sPðjN þ jÞÞ of vertices of the pickup graph; in thesame way, we indicate as delivery tour any permutationsD ¼ ðsDð1Þ, . . . ,sDðjN �jÞÞ of vertices of the delivery graph.

Hence sðpÞ indicates the vertex in position p of the tour, ands�1ðiÞ indicates the position of vertex i in the tour.

Each tour starts from and ends at the depot. Each tour has acost, which is the cost of traveling from one vertex to the next,according to the order indicated by the permutation.

Definition 2.2. Given two customers i and j and a tour, we saythat i precedes j if s�1ðiÞos�1ðjÞ.

The vehicle has a given number S of stacks available fortransportation. A loading plan is a mapping ‘ from each customeri to a (stack, position) pair (s,p), representing the arrangement ofthe items in the stacks of the vehicle. In particular, ‘ðiÞ ¼ ðs,pÞ ifthe item of customer i occupies position p on stack s, with ðs,1Þrepresenting the bottom of stack s; we use notation i=2‘ to indicatethat the item of customer i is not included in the loading plan, andtherefore ‘ðiÞ is undefined. We also introduce notation ði,jÞA‘ toindicate that the item of customer j is on the top of the item ofcustomer i on the same stack of loading plan ‘.

For the ease of notation, in the remainder item i will refer tothe item of costumer i.

Definition 2.3. A loading plan is feasible with respect to a pickuptour (and vice versa) if, for any pair of customers i and j with‘ðiÞ ¼ ðs,pÞ and ‘ðjÞ ¼ ðt,qÞ, such that i precedes j in the pickup tour,either sat or poq. That is, if item i is picked up before item j, i

cannot be placed on the top of j in the same stack.

A similar definition holds for the delivery tour:

Definition 2.4. A loading plan is feasible with respect to a deliverytour (and vice versa) if, for any pair of customers i and j with‘ðiÞ ¼ ðs,pÞ and ‘ðjÞ ¼ ðt,qÞ, such that i precedes j in the deliverytour, either sat or p4q. That is, if item i is delivered before itemj, j cannot be placed on the top of i in the same stack.

Definition 2.5. If i precedes j in both the pickup and the deliverytour, that is s�1

P ðiÞos�1P ðjÞ and s�1

D ðiÞos�1D ðjÞ, we say that custo-

mers i and j are incompatible, and it must be ‘ðiÞ ¼ ðs,pÞ and‘ðjÞ ¼ ðt,qÞ with sat.

Intuitively, each stack represents a Last-In-First-Out structure.

Definition 2.6. A solution ðsP ,sD,‘Þ of the DTSPMS is composed bytwo ingredients: a pair of pickup and delivery tours sP and sD anda loading plan ‘; such a solution is feasible if the loading plan isfeasible with respect to both tours.

Therefore, we can formally define the DTSPMS as follows.

Definition 2.7. The DTSPMS consists in finding a feasible solutionðsP ,sD,‘Þ in which the sum of pickup and delivery tour costs isminimum.

Furthermore, in the literature it is usually imposed that thenumber of items in each stack cannot exceed a given limit M.

Example 2.1. In Fig. 1 we show an example of a feasible solutionfor an instance involving six customers and two stacks containingat most three items each. Customer locations are represented bysmall circles, and depots are indicated by small squares. Thepickup and delivery cities, respectively, are depicted on the leftand right sides of the figure. Customers are connected througharcs forming two Hamiltonian tours starting and ending at thedepot. The loading plan is represented in the center of the figure:each vertical pile of rectangles represents a stack; items ofcustomers 2, 5, and 1 are put in the first stack, while items 3, 6,and 4 are put in the second stack.

3. Properties

As stressed in the Introduction, we first ignore the constraintlimiting the number of items in each stack, and we defer thediscussion on how to handle it to Section 4.3. We show that,under this assumption, given one of the two ingredients of afeasible solution the remaining one can always be found inpolynomial time. This holds in particular for an optimal solution.

Page 3: Efficient algorithms for the double traveling salesman problem with multiple stacks

Fig. 3. Example of a conflict graph.

Fig. 4. Full and restricted loading plans, with corresponding encodings.

M. Casazza et al. / Computers & Operations Research 39 (2012) 1044–10531046

3.1. Building complete solutions

We begin by considering the following subproblem

Problem (1). Given a pickup tour and a delivery tour, find a feasible

loading plan using the minimum number of stacks.

In order to assess the complexity of Problem (1), let usconsider the following:

Definition 3.1. We define as the conflict graph C a graph havingone vertex for each customer, and one edge for each pair ofincompatible customers.

That is, only customers appearing in the same relative order inpickup and delivery tours are adjacent in the conflict graph.

Lemma 3.1. Problem (1) is equivalent to the problem of coloring

graph C with the minimum number of colors.

Proof. Different colors can represent different stacks; since noadjacent vertices can take the same color in a feasible coloring, noincompatible customers must be assigned to the same stack. Oncea feasible coloring of C is given, the order of the items inside eachstack in the corresponding loading plan can be chosen accordingto the order of the customers in one of the tours, constrained tothe fact that picked up items should be placed on the bottom ofthe stacks and delivery is only made from the top of thestacks. &

Now, assume without loss of generality that sP ¼ id, that is theidentity permutation of jN þ j elements having idðiÞ ¼ i for eachiAf1 . . . jN þ jg; this involves a simple renaming of the customers.

Example 3.1. In Fig. 2 an example of pickup and delivery tours,and the corresponding permutations, is given for the instance ofExample 2.1.

Finally, let us denote as ~sD the reverse of the deliverypermutation sD. We can prove the following claim, linking thestructure of ~sD to special properties of the conflict graph C.

Lemma 3.2. The problem of finding a minimum coloring of graph C

can be solved in polynomial time.

Proof. The conflict graph C has an edge between two customers i

and j if and only if io j and ~s�1D ðiÞ4 ~s�1

D ðjÞ. At the same time, thegraph having one edge for each pair of elements of ~sD which appearin reverse order with respect to identity permutation is the permuta-

tion graph of ~sD [6]. Since C is a permutation graph, which is a specialperfect graph, the coloring problem can be solved in polynomial timeby means of flow computations [4]. &

The conflict (permutation) graph of the solution for Example3.1 is represented in Fig. 3. The following results easily followfrom Lemmas 3.1 and 3.2.

Fig. 2. Representing tou

Proposition 3.3. Problem (1) can be solved in polynomial time.

A similar observation was independently made in [26]. Never-theless, by exploiting the permutation graph structure justdescribed, we get a more efficient algorithm: Problem (1) canbe solved in OðN � log NÞ time by a slight adaptation of thealgorithm presented in [5].

In a symmetric way, let us consider the following twosubproblems:

Problem (2). Given a loading plan, find a delivery tour that is

feasible with respect to the loading plan and has minimum cost.

Problem (3). Given a loading plan, find a pickup tour that is feasible

with respect to the loading plan and has minimum cost.

That is, given a loading plan, we aim at building the pair ofpickup and delivery tours of minimum total cost by consideringeach of them independently.

In the following we present a dynamic programming algo-rithm that solves this problem efficiently for a fixed number ofstacks. Once a loading plan is given, we define as restricted anyloading plan obtained by removing items from the top of thestacks.

Example 3.2. In Fig. 4 we show a full loading plan for a DTSPMSinstance and a set of corresponding restricted loading plans.Each restricted loading plan can be represented by a set of valuesðs1, . . . ,sSÞ, each indicating the number of items left on each stack.Such an encoding is reported in Fig. 4 on the top of eachloading plan.

rs as permutations.

Page 4: Efficient algorithms for the double traveling salesman problem with multiple stacks

Fig. 5. Structure of the dynamic programming algorithm.

M. Casazza et al. / Computers & Operations Research 39 (2012) 1044–1053 1047

We suppose to start from the depot with a full loading plan, and

to incrementally build delivery tours by choosing items on the top

of the stacks. Consider the instance in Fig. 4: the restricted loading

plan ð1,0,1Þ can only be obtained from ð2,0,1Þ by visiting 1, from

ð1,1,1Þ by visiting 3 or from ð1,0,2Þ by visiting 5. In the same way,

restricted loading plan ð2,0,1Þ can only be obtained from ð2,1,1Þ

by visiting 3 or from ð2,0,2Þ by visiting 5.

It is easy to find the cost of obtaining a restricted loading plan

from another, provided the last visited customer is given: as

depicted in Fig. 4, obtaining the restricted loading plan ð1,0,1Þ

from ð2,0,1Þ means either moving from customer 3 to customer

1 or from customer 5 to customer 1, depending on the last visited

customer yielding restricted loading plan ð2,0,1Þ.

Therefore, let us consider the space of statesðs1, . . . ,sS,pÞAZSþ1

þ , in which the tuple ðs1, . . . ,sSÞ encodes thenumber of items in each stack of a restricted loading plan andthe value p indicates the last stack from which an item has beenremoved for delivery. Let us indicate as f ðs1, . . . ,sS,pÞ the mini-mum cost of a partial path yielding such a configuration.

We can prove the following result:

Proposition 3.4. When the number of stacks is fixed, Problem (2)can be solved in polynomial time.

Proof. An optimal solution to Problem (2) can be found bycomputing all the values f ðs1, . . . ,sS,pÞ for each 1rprS and0rsprN. For doing this we proceed as follows.

First, when ðs1, . . . ,sSÞ is the full loading plan, for each 1rprS

f ðs1, . . . ,sp�1, . . . ,sS,pÞ ¼ c�n�0

,i,

where i is the customer whose item is on the top of stack p; this is

simply the cost for moving from the depot to the initial customer.

We observe that there are only S ways of obtaining a particular

restricted loading plan from another, that is by removing the top

item from one of the stacks (see Fig. 4); therefore each remaining

value f ðs1, . . . ,sS,pÞ can be obtained as

f ðs1, . . . ,sS,pÞ ¼ minq ¼ 1 €Sff ðs1, . . . ,spþ1, . . . ,sS,qÞþc�jq ,ig, ð1Þ

where i is the customer whose item is on the top of stack p, and jqis the customer whose item is on the top of stack q, that is the

customer having ‘ðjqÞ ¼ ðq,sqÞ.

Once all f ðs1, . . . ,sS,pÞ values are computed, the value of the

optimal solution can be obtained as

minq ¼ 1 €Sff ð0, . . .0,qÞþc�jq ,0g:

Since the restricted loading plan ð0, . . .0Þ represents an empty

vehicle, only the cost for coming back to the depot is missing for

obtaining a full solution.

The values f ðs1, . . . ,sS,pÞ can be computed using dynamic program-

ming as follows. We consider N stages in sequence: at each stage

t¼ 1 . . .N we compute the value of function f ðÞ for each state

ðs1, . . . ,sS,pÞ encoding a partial loading plan that contains exactly

N�t items. Therefore, in stage 1 the values f ðs1, . . . ,sp�1, . . . ,sS,pÞ are

initialized as described above; then, at each stage t41, each value

f ðs1, . . . ,sS,pÞ is computed from the set of values ff ðs1, . . . ,spþ

1, . . . ,sS,qÞ,q¼ 1 . . . Sg, that are all available from stage t�1. In this

way, in stage N we obtain the set of N final values

ff ð0, . . .0,qÞ,q¼ 1 . . . Sg.

The computation of expression (1) requires O(S) time, which is

constant when S is fixed, and therefore computing all the S � NS

values for f ðÞ requires OðNSÞ time. &

Example 3.3. Fig. 5 depicts the structure of states and thecomputation of stages in our dynamic programming algorithmfor a sample instance with two stacks and four customers.

In a similar way we can prove the following proposition.

Proposition 3.5. When the number of stacks is fixed, Problem (3)can be solved in polynomial time.

In fact, consider a loading plan in which the items in each stackare placed in reverse order: items on the bottom of each stack arethe last to be picked up. Problem (3) can be solved with the samedynamic programming approach as Problem (2), by simply con-sidering this reverse loading plan instead of the original one. Thecomputational time of these procedures is still exponential in thenumber of stacks.

As before, a similar result was reported in [10,9] and indepen-dently presented in [26].

3.2. Building partial solutions

Given two random tours, it might not be possible to find afeasible loading plan using at most S stacks. In this case weconsider the problem of computing partial solutions: these canstill be very useful for instance as starting points for repairingalgorithms or to simply evaluate how tightly constrained aninstance is.

First we introduce the following definition.

Definition 3.2. A partial loading plan is a loading plan in whichthe items of a subset of customers do not appear.

Then, we consider the following:

Problem (4). Given a pickup and a delivery tour, find a feasible

partial loading plan using at most S stacks, including the maximum

number of items.

In other words, we search for a Maximum S-Colorable InducedSubgraph (MSCIS) on the conflict graph C. The MSCIS problem isknown to be NP-hard even on chordal, and therefore perfectgraphs [28], unless S is fixed; instead, in the following we provethat by restricting to a different subset of perfect graphs, namelypermutation graphs, such a problem can be solved in polynomialtime.

Proposition 3.6. Problem (4) (i.e. the MSCIS problem on permuta-

tion graphs) can be solved in polynomial time.

The following proof gives also a polynomial time algorithm.

Proof. We model this problem as a minimum cost flow computa-tion on the lattice representation of graph C: ~sD is represented by

Page 5: Efficient algorithms for the double traveling salesman problem with multiple stacks

M. Casazza et al. / Computers & Operations Research 39 (2012) 1044–10531048

vertices on a two-dimensional lattice; each vertex i appearing inposition x in the permutation is placed in coordinates (x,i) of thelattice. The lattice representation of the reverse delivery permu-tation ~sD of Example 3.1 is reported in Fig. 6.

We build an auxiliary graph A by connecting each vertex in the

lattice representation to all vertices at its upper right. This corre-

sponds to connecting customers appearing in reverse order in the

pickup and delivery tours, whose items can therefore belong to

the same stack. We also include in A two dummy vertices, repre-

senting the starting and ending depot, and we insert arcs in A

connecting the starting depot to each vertex and connecting each

vertex to the ending depot.

We set the starting and ending depot to be, respectively, source

and sink of S units of flow. We assign capacity 1 and cost 0 to each

arc, capacity 1 and cost �1 to each customer vertex. The complete

graph A of permutation ~sD of Example 3.1 is reported in Fig. 7.

Observe that there is a one to one mapping from feasible partial

loading plans with K items to admissible flows of cost �K in the

auxiliary graph; that is, Problem (4) can be re-stated as the

problem of finding a minimum cost flow on A. Intuitively, the S

units of flow define sequences of customers included in the same

stack. Every time a vertex receives flow, the corresponding

customer is inserted in a stack, and a value of �1 is collected.

Therefore in an optimal solution the maximum number of

customers is included. &

In Fig. 8 a solution for Example 3.1 is depicted, including fiveout of six customers.

Fig. 6. Lattice representation of a permutation.

Fig. 7. Auxiliar

We recall that each flow problem involving capacities andcosts on nodes can be reformulated in order to involve capacitiesand costs on arcs only through the introduction of auxiliaryvertices, and solved in polynomial time with very efficientalgorithms [1].

4. Algorithms

We elaborated on the properties of the DTSPMS solutionspresented in Section 3 to obtain a heuristic algorithm for theDTSPMS with Unlimited Stacks (DTSPMUS). In the following wepresent this heuristic, we discuss alternative solution methodsand we describe how to handle capacity constraints to obtain fullDTSPMS solutions.

4.1. An alternating routing–loading heuristic

The algorithm works in five steps: (a) find initial pickup anddelivery tours, (b) solve Problem (4), creating a feasible partialloading plan including the maximum number of customers,(c) solve Problems (2) and (3) considering only customers in thepartial loading plan, creating optimal partial pickup and deliverytours, (d) create a candidate (possibly infeasible) solution for thenext iteration of the algorithm by including the remainingcustomers in the partial tours using a best insertion policy,(e) create a feasible DTSPMUS solution by including the remainingcustomers in the stacks using a best insertion policy, (f) repeatsteps (b)–(f) until a stopping criterion is met. As detailed below,the best insertion policy used in step (d) works on the pickup andthe delivery tours independently, producing a pair of possiblyincompatible tours, while the best insertion policy used in step(e) works by completing the loading plan, and finding compatible

y graph A.

Fig. 8. Representation of an optimal solution to Problem (4).

Page 6: Efficient algorithms for the double traveling salesman problem with multiple stacks

M. Casazza et al. / Computers & Operations Research 39 (2012) 1044–1053 1049

tours via dynamic programming. A formal description of thisAlternating Routing–Loading algorithm (ARL) is reported inPseudo-Code 1.

Pseudo-Code 1. ARL algorithm

input: fP0,D0,cþ ,c�goutput: fLk,Pk,Dkg

L0’|k’1repeat

Lk’getLoadingPlanðPk�1,Dk�1Þ

Pk’getTourðreverseðLkÞ,cþ Þ

Dk’getTourðLk,c�Þ

Pk’getTourNextIterationðPk,Lk,cþ Þ

Dk’getTourNextIterationðDk,Lk,c�Þ

Lk’fillLoadingPlanðPk,Dk,Lk,cþ ,c�Þ

P k’getTourðreverseðLkÞ,cþ Þ

Dk’getTourðLk,c�Þ

k’kþ1

until jLkjr jLk�1j

First we observe that the algorithm converges in at most N

steps, due to the following property:

Proposition 4.1. The number of customers who are inserted in the

partial loading plan found in step (b) is always non decreasing from

one iteration to the next.

In fact, customers whose items are included in a partialloading plan during iteration k appear in the tours according tothe order given by the partial loading plan; our insertion algo-rithm does not change that order; hence, during iteration kþ1 itis always possible to rebuild the partial loading plan found atiteration k. Therefore, we stop the algorithm whenever no addi-tional customer is inserted in the partial loading plan duringstep (c).

In the remainder we detail the behavior of each component ofthe algorithm.

Procedure getLoadingPlan(): At each iteration k receives asinput a pair of tours ðPk�1,Dk�1Þ and produces a partial loadingplan Lk; it solves Problem (4) by means of the flow computationdescribed in previous section.

Procedure getTour(): Receives as input the partial loadingplan Lk and produces an optimal partial delivery tour Dk, whichcontains only customers whose items are in Lk; this is donesolving Problem (2) via dynamic programming. The same proce-dure is used to build an optimal partial pickup tour Pk, by simplyreversing the order of items in each stack (procedure reverse()), asdiscussed in Section 3.

Procedure getTourNextIteration(): Given a partial tour anda compatible partial loading plan, produces a full tour. This isdone by including unassigned customers in the partial tour usingthe following best insertion policy: the elements of the set ofcustomers which are not in the tour are considered one by one.We iteratively find for each of them the position in the partialtour requiring the minimum increase in the overall length, selectthe customer producing the minimum increase and perform thecorresponding best insertion, producing a new partial tour, untilall elements are accommodated. A formal description is reportedin Pseudo-Code 2. The tour T is represented as a set of arcs, andthe loading plan L as a set of items. In a preliminary set ofexperiments, we tried to replace this Best Insertion policy with

random selection and Farthest Insertion, but Best Insertion gavebest results.

Pseudo-Code 2. Procedure getTourNextIteration()

input: fT ,L,cgoutput: fTg

while jLjaN dofor all k=2L do

ck’minði,jÞAT fcikþckj�cijg

end for

kn’argmink=2Lfckg

ðs,tÞ’argminði,jÞATfciknþckn j�cijg

T’TSfðs,knÞ,ðkn,tÞg\fðs,tÞg

L’L [ fkng

end while

Procedure fillLoadingPlan(): Given a partial loading plan Lk

and a pair of compatible partial tours ðPk,DkÞ produces a fullloading plan Lk. This is done as follows: the elements of the set ofcustomers who are not in the partial loading plan are consideredone by one in random order. For each such element k all pairs ofcustomers (l,m) having adjacent items in the partial loading planare considered. Customers l and m are in the tours, while k is not;therefore, we compute the position in the sequence between l andm in which the insertion of k yields the minimum overall increasein the length of the partial pickup and delivery tours. Among allpairs (l,m) we choose the one yielding minimum overall increase,and we insert the item of k in the loading plan between those of l

and m. In order to better estimate subsequent insertion costs,we also insert k in the tours. In a preliminary set of experimentswe tried to apply a Best Insertion or a Farthest Insertion policyinstead of selecting the customer to be inserted at each iterationin random order, but both yielded higher computing time withnegligible or no improvement on the average. A formal descrip-tion is reported in Pseudo-Code 3.

The pseudo-code of Procedure bestInsertion() is similar to thatreported in Pseudo-Code 2, and is therefore omitted.

The full loading plan is used to produce full tours Pk and Dk,composing with Lk a full solution which is always feasible.

Pseudo-Code 3. Procedure fillLoadingPlan()

input: fP,D,L,cþ ,c�goutput: fLg

for all k=2L dofor all ðl,mÞAL do

klm’minði,jÞAPjs�1PðlÞos�1

PðiÞ,s�1

PðjÞos�1

PðmÞfc

þ

ik þcþkj �cþij g

c�

klm’minði,jÞADjs�1DðmÞos�1

DðiÞ,s�1

DðjÞos�1

DðlÞfc

�ikþc�kj�c�ij g

end for

ðln,mnÞ’argminðl,mÞA Lfcþ

klmþ c�

klmg

L’LSfðln,kÞ,ðk,mnÞg\fðln,mnÞg

P’bestInsertionðP,ln,mn,kÞ

D’bestInsertionðD,mn,ln,kÞend for

4.2. Alternative methodologies

For the sake of comparison, we also considered the followingthree constructive heuristics, which are in nature similar to ARL.These will be used in Section 5 as a benchmark to evaluate theperformances of ARL.

SS-TSP algorithm. First, we exploited the following observa-tion: a feasible solution for the DTSPMUS can be obtained by

Page 7: Efficient algorithms for the double traveling salesman problem with multiple stacks

Table 1Initialization policies.

# Cust. Random Straight Reverse

/Best (%) Time (s) /Best (%) Time (s) /Best (%) Time (s)

33 14.26 0.76 3.02 0.04 0.20 0.05

66 14.15 4.86 2.19 0.19 0.12 0.28

132 11.17 35.57 2.05 1.63 0.01 2.03

M. Casazza et al. / Computers & Operations Research 39 (2012) 1044–10531050

allowing only a single stack to be used; an optimal single stacksolution can in turn be obtained by solving a TSP on a graphhaving cost cij ¼ cþij þc�ji on each arc, considering an optimal tourfor pickups and its reverse for deliveries. Once a single stack touris found, a feasible loading plan can be obtained by consideringeach customer in the order given by the tour and putting the itemof each customer in position i of the tour at the top of stackbði�1Þ=ðN=SÞcþ1. Such a heuristic is a natural benchmark for ouralgorithm, as it is typically used in the literature to obtain startingsolutions for local search methods [25,23,13].

MS-NN algorithm. Second we adapted the classical TSPNearest Neighbor heuristic to the Multiple Stack case as follows:(a) we start with an empty loading plan L, and a partial pickuppath P and delivery path D containing the depot only; (b) weidentify the nearest neighbor of the last customer in both P and D,and we consider that requiring the minimum connection cost;(c) if a pickup (resp. delivery) customer i who is not in the loadingplan is the overall nearest neighbor, it is inserted in the first stackin L, and added at the end of P (resp. D); otherwise, in order toavoid unsolved incompatibilities, we shift i to the first stack in L

containing only customers appearing before i in P and after i in D

or vice versa; if such a stack has index S, we discard i and repeatstep (b) considering the next nearest neighbor; (d) we repeatsteps (b) and (c) until both P and D are complete, or no customercan be inserted in L without using stack S; in the latter case, weplace all the remaining customers in stack S, and we build apartial path T including them with a standard Nearest Neighborpolicy; (e) we create a pickup tour by connecting P to T and T tothe depot, and a delivery tour by connecting D to the reverse of T,and the reverse of T to the depot; L represents a valid load-ing plan.

MS-FI algorithm. Third we experimented with a FarthestInsertion heuristic, adapted to the Multiple Stack case. Such aprocedure is similar to that reported in Pseudo-Code 3: (a) westart with partial pickup and delivery tours composed by thedepot only, creating a partial loading plan L which includes S

auto-loops on the depot, and considering a set I which includes allcustomers; (b) we compute the additional cost for inserting eachcustomer iA I in the best position of each tour still respecting thepartial loading plan; this is done by considering each pair ofsubsequent items in the loading plan, and performing a bestinsertion only in the portion of tours connecting them (c) weselect the customer i requiring the maximum insertion cost, andwe perform the best insertion respecting the partial loading plan,as described before; we update the loading plan and we remove i

from I; (d) we repeat steps (b) and (c) until I is empty. In a pre-liminary set of experiments we considered many insertion poli-cies, but Farthest Insertion worked best.

4.3. Handling capacity constraints

When a limit M is introduced on the number of items in thesame stack, some of the theoretical results presented in theprevious Sections are no longer valid. In particular, while thisconstraint has no effect on the complexity of Problems (2) and (3),Problem (1) becomes an M-bounded colorability problem, whichis NP-hard even in permutation graphs for fixed MZ6 [20]. AlsoProblem (4) cannot be solved by the flow computations describedin the previous sections when such a limit is enforced.

We nevertheless tried to adapt our procedures for handlingthis restriction. In particular, loading plan Lk given by procedurefillLoadingPlan() of our ARL algorithm might violate the stack sizelimit. When this happens, we complete a feasible solution asfollows. (a) We consider the set of items in each stack in the orderin which they appear in the pickup tour. (b) We consider the setof stacks in random order, and we scan the sequence of items in

each stack whose number of items exceeds the limit; wheneveran item is found which has no incompatible items in a stack withfree slots, such item is moved; we stop at the end of the sequence,or when the stack limit is not violated anymore. If all items canbe accommodated in this way, no modification to the tours isneeded. Otherwise, (c) we remove from each stack all items in thestack sequence whose position exceeds the limit. (d) We try toinsert the removed items in the stacks by using the best insertionpolicy described in Procedure fillLoadingPlan(), caring not toinsert additional items in full stacks.

We experimented with different policies to select a particularstack in step (b), but none of them showed significant improve-ments with respect to random order.

We also remark that this repair procedure can be carried out inthree different steps of the algorithm: (1) at each iteration, rightafter the generation of every partial tour and loading plan, (2) onlyonce, when convergence is reached, to repair the best solutionfound, and (3) only once, to repair the solution found after the lastiteration. Option (1) gave best results in our experiments.

5. Experimental results

We implemented the ARL heuristic algorithm in C, using theMCF library [21] to solve the flow subproblems. We run ourexperiments on a 1.83GHz Centrino notebook. We considered thetestbed proposed in [13,23]. It consists of three data sets of 20instances each, respectively, involving 33, 66, and 132 pickup–delivery pairs, in which three stacks are available, that is S¼3.

As stressed in Section 1, the main aim of this paper is to provide atheoretical investigation on the properties of the DTSPMS. Still, weperformed an experimental analysis using ARL, to highlight thecomputational behavior of each component of the algorithm and tocheck whether ARL is useful as a generator of seeds for more powerfuland complex local search metaheuristics as [25,13].

5.1. Initialization

We recall that our algorithm needs to be initialized with a pairðP0,D0Þ of tours. We compared three options for such an initi-alization. First, we simply tried to initialize our algorithm with arandom permutation of the pickup and delivery customers,repeating this operation for 50 starts (policy random). Second,we optimized independently the pickup and the delivery problemusing the chained Lin–Kernigan heuristic implemented in CON-CORDE [3], performing just one start (policy straight).

Third, since the instances considered in our data set aresymmetric, by optimizing independently pickup and deliverieseach tour P0 and D0 can be reversed obtaining a tour of the samelength.

Therefore, we tried to compute P0 and D0 using the chainedLin–Kernigan heuristic, and to start our algorithm four times, onefor each combination of direct and reverse pickup and deliverytours (policy reverse).

The average results of this experiment in each data set arereported in Table 1. The table consists of three rows, one for each

Page 8: Efficient algorithms for the double traveling salesman problem with multiple stacks

Table 3Behavior of the algorithm on each data set.

# Cust. Last iteration Best iteration

Iter Ex items Iter Ex items

33 2.6 10.0 1.5 11.0

66 3.6 28.7 2.1 31.1

M. Casazza et al. / Computers & Operations Research 39 (2012) 1044–1053 1051

data set, each reporting the number of pickup–delivery pairscontained in each instance. As reference we kept, for eachinstance, the value of the best solution among those found bythe three policies. Three blocks include the results for each ini-tialization policy in terms of both average gap between the valueof the solution found and the reference value (column /Best) andaverage computing time (column Time).

We first observe that the computation time does not growlinearly with the number of starts of the algorithm. In fact, mostof the computation time is spent in the allocation and initializa-tion of internal data structures, which is done once for all thestarts.

We note that policy random is outperformed by subsequentones both in terms of solution quality and computation time:although generating good initial tours does not give any guaran-tee on the quality of the final solution, we experimentallyobserved that this is actually the case.

Policy reverse is the best one, yielding improvements of thesolution value of up to 5% with an affordable increase incomputation time. Hence, it was kept as default in the followingexperiments.

5.2. Algorithm components

In a second experiment we evaluated the computationalbehavior of each component of the algorithm and its contributionto the quality of the final solution. Therefore, we considered asingle iteration of ARL; as described in Section 4 ARL relies on twomain ingredients: a Dynamic Programming algorithm to solveProblem (2) and (3) (DP) and a Flow Based algorithm to solveProblem (4) (FB).

First, we tried to solve Problems (2) and (3) in proceduregetTour() using the following Best Insertion heuristic (BI) insteadof applying our exact DP: (a) given a loading plan L, we start witha partial pickup tour T containing the depot only; (b) we evaluate,for each customer i having an item on the top of one of the stacksin L, the increase in the cost of T when i is inserted in the bestposition; (c) we choose the customers producing the minimumincrease in the cost of T, we remove it from L, and we insert it inthe best position of T; we iterate steps (b) and (c) until L is empty.We build a delivery tour in the same way by simply reversingeach stack.

Second, we tried to replace FB in procedure getLoadingPlan()by exploiting again the observation, discussed in Section 4.2, thatan optimal Single Stack TSP solution can always be used to build afeasible solution for the DTSPMUS. We refer to this procedure asSingle Stack approach (SS) in the remainder.

In order to exactly solve the TSP subproblems we used thebranch-and-cut algorithm implemented in CONCORDE [3]. Theaverage results of this experiment in each data set are reportedin Table 2. As before, the table consists of three rows, one for eachdata set, reporting in the first entry the number of pickup–delivery pairs contained in each instance; as reference we kept,for each instance, the value of the best solution found during theexperiment. Four blocks include in turn the results for a single

Table 2Algorithm components.

#

Cust.

FBþDP FBþBI SSþDP SSþBI

/Best

(%)

Time

(s)

/Best

(%)

Time

(s)

/Best

(%)

Time

(s)

/Best

(%)

Time

(s)

33 0.00 0.02 2.54 0.02 15.56 0.06 27.86 0.05

66 0.32 0.07 4.10 0.06 11.01 0.25 25.12 0.13

132 0.32 0.21 3.60 0.16 6.32 2.20 22.40 0.64

iteration of ARL (FBþDP), those obtained by replacing dynamicprogramming with best insertion (FBþBI), those obtained byreplacing flow with single stack computations (SSþDP) and thoseobtained by replacing both flow with single stack computationsand dynamic programming with best insertion (SSþBI); in eachblock we report both the average gap between the value of thesolution found and the reference value (column/Best) and theaverage computing time (column Time).

We remark that the FB approach produces only partial loadingplans which in turn, using DP, yield only partial tours, that have tobe completed heuristically; applying BI since the beginning couldyield, in principle, better tours. Nevertheless, this experimentallyhappens only in very few instances with N¼66 and 132, andelsewhere the FBþDP approach shows best results. At the sametime, replacing DP with BI yields significantly smaller computingtimes only on the data set having N¼132, but the solutionsobtained are on the average much worse; replacing FB with SSyields both worse solutions and larger computing times.

The FBþDP approach implemented in ARL is substantiallybetter at the same time than both FBþBI and SSþDP; we there-fore concluded that both DP and FB are actually useful as buildingblocks to obtain solutions of good quality in short computingtime.

5.3. Overall behavior

In a third set of experiments we tried to highlight the overallcomputational behavior of our algorithm. Besides the number ofpickup–delivery pairs of the instances in each data set, in Table 3we report two blocks of results, which refer, respectively, to thelast iteration of the algorithm, and to the iteration in which thebest solution is found. In both blocks we report the averagenumber of iterations performed (iter) and the number of itemsexcluded from the partial loading plan in that iteration (ex items)in each data set. Since the reverse initialization policy was used,the values in column iter of the first block are maximum and thevalues in column ex items of the first block are minimum amongthe four starts.

By looking at these results we observe that the algorithmalways performs few iterations before the stopping criterion ismet, and a large fraction of the items is not included in the finalpartial loading plan. Furthermore, the best solution is found evenearlier. This suggests to combine our procedure with suitablerestart methods. Many restart methods are naturally suggested bythe structure of the algorithm. For instance, Procedure getLoa-dingPlan() requires the solution of flow problems having multipleoptima; as observed in [9] different optimal solutions yield

132 4.6 73.1 2.3 77.6

Table 4Benefits of a restart technique.

# Cust. Improvement (%) Time (s)

33 1.63 0.46

66 1.92 2.62

132 1.81 19.13

Page 9: Efficient algorithms for the double traveling salesman problem with multiple stacks

M. Casazza et al. / Computers & Operations Research 39 (2012) 1044–10531052

different partial loading plans, and therefore a different behaviorof the algorithm. In Table 4 we report, for each set of instances,the average improvement we obtained by collecting alternativeoptima during the execution of the algorithm, and using them toperform 100 restarts of ARL. We also report the average CPU timeneeded to solve each instance. This simple technique allows toimprove the quality of the DTSPMUS solutions produced by a fewpercentage points; the computing time increases of a factor ofabout 0.1 for each restart. However, since our aim is to keep ARLas simple as possible, we did not experiment any further on moresophisticated restart strategies.

5.4. Comparison with benchmark algorithms

In a fourth set of experiments we compared our algorithmwith the three constructive heuristics SS-TSP, MS-NN and MS-FI

Table 5Comparison of algorithms on the data set involving 33 customers.

Inst. HVNS SS-TSP MS-NN MS-FI ARL

Result Result Time

(s)

Result Time

(s)

Result Time

(s)

Result Time

(s)

R00 1071 1682 0.04 1929 0.00 1309 0.01 1112 0.04

R01 1040 1579 0.03 1900 0.01 1279 0.01 1104 0.07

R02 1073 1564 0.04 1936 0.02 1292 0.01 1125 0.06

R03 1100 1741 0.15 2093 0.00 1495 0.01 1276 0.05

R04 1057 1631 0.03 1971 0.00 1290 0.01 1130 0.06

R05 1030 1438 0.03 1715 0.00 1184 0.01 1027 0.07

R06 1110 1644 0.02 1961 0.00 1418 0.01 1213 0.06

R07 1109 1697 0.04 2275 0.02 1343 0.01 1252 0.04

R08 1109 1643 0.05 1989 0.00 1304 0.01 1204 0.05

R09 1091 1557 0.03 2150 0.00 1328 0.01 1166 0.07

R10 1016 1575 0.02 1931 0.01 1242 0.01 1161 0.04

R11 1001 1429 0.04 1977 0.00 1201 0.01 1067 0.05

R12 1111 1674 0.07 1606 0.00 1257 0.01 1197 0.05

R13 1084 1613 0.05 1991 0.00 1438 0.01 1135 0.05

R14 1052 1565 0.03 2214 0.00 1310 0.01 1147 0.05

R15 1158 1784 0.04 2300 0.00 1341 0.01 1238 0.04

R16 1093 1647 0.03 2165 0.02 1301 0.01 1190 0.04

R17 1083 1620 0.03 1912 0.00 1180 0.01 1148 0.06

R18 1149 1673 0.02 2183 0.01 1242 0.01 1240 0.06

R19 1096 1633 0.02 2340 0.00 1347 0.01 1189 0.04

Table 6Comparison of algorithms on the data set involving 66 customers.

Inst. HVNS SS-TSP MS-NN MS-FI ARL

Result Result Time

(s)

Result Time

(s)

Result Time

(s)

Result Time

(s)

R00 1655 2537 0.07 3675 0.00 2045 0.06 1911 0.27

R01 1702 2607 0.1 3685 0.02 2054 0.06 2016 0.27

R02 1697 2514 0.07 3663 0.00 2148 0.06 1887 0.28

R03 1728 2681 0.09 3803 0.00 2087 0.06 1892 0.32

R04 1735 2584 0.08 3691 0.00 2030 0.06 1829 0.28

R05 1633 2429 0.07 3414 0.00 2004 0.06 1771 0.28

R06 1824 2636 0.14 3214 0.02 2112 0.06 1866 0.30

R07 1759 2584 0.08 4478 0.00 2223 0.07 1929 0.27

R08 1785 2531 0.1 3138 0.00 1908 0.07 1802 0.36

R09 1736 2423 0.05 4107 0.03 2115 0.06 1815 0.29

R10 1835 2769 0.11 4022 0.02 2165 0.06 2017 0.27

R11 1680 2492 0.1 3409 0.00 1986 0.06 1896 0.31

R12 1751 2630 0.15 3777 0.00 2108 0.06 1889 0.26

R13 1758 2614 0.07 4154 0.00 2089 0.06 1888 0.24

R14 1718 2684 0.08 3398 0.00 2285 0.06 1911 0.31

R15 1712 2574 0.08 3738 0.00 2203 0.07 1833 0.25

R16 1866 2723 0.1 4361 0.00 2204 0.08 1961 0.25

R17 1749 2696 0.09 3587 0.00 2134 0.06 1839 0.25

R18 1779 2715 0.09 3987 0.00 2122 0.08 1978 0.28

R19 1720 2687 0.79 3973 0.00 2184 0.06 1868 0.25

described in Section 4.2, which are in nature similar to ARL. Theaim of this experiment is to assess the usability of ARL asgenerator of good starting solutions for more complex methods.

In order to exactly solve the TSP subproblems we used thebranch-and-cut algorithm implemented in CONCORDE [3]. InTables 5, 6 and 7 we report the results of this test. Each tablehas four blocks, each corresponding to the algorithm indicated inthe leading row. Each block contains the values of the solutionobtained by the algorithm (column result) and the CPU timerequired to complete the computation (column Time). As areference, in the second column of the table we report also theresults obtained by a state-of-the-art metaheuristic, namely theoriginal implementation of the HVNS algorithm described in [13],after 10 s of computations. We remark that HVNS is designed tohandle stack size limits, and these limits are set to N/S in theexperiments discussed in [13]; nevertheless, its solution valuesconstitute valid upper bounds also for the unlimited stacksrelaxation. Average results are reported in Table 8, where theresult columns represent the average gap between the solutionvalue obtained by each algorithm and that found by ARL.

The MS-NN algorithm is very fast but gives poor results on allinstances. The MS-FI algorithm is a good alternative, outperform-ing SS-TSP and being fast and fairly accurate. Our algorithmalways produces the best solution among the four techniques,yielding a 12% average improvement with respect to the secondbest algorithm; this comes, however, at the expense of highercomputing times.

Table 7Comparison of algorithms on the data set involving 132 customers.

Inst. HVNS SS-TSP MS-NN MS-FI ARL

Result Result Time

(s)

Result Time

(s)

Result Time

(s)

Result Time

(s)

R00 2997 4094 0.27 7146 0.05 3427 0.43 3074 1.99

R01 3087 4228 0.2 7957 0.03 3455 0.46 3233 2.26

R02 3007 4256 0.15 7516 0.04 3671 0.54 3242 2.03

R03 3092 4380 6.24 7301 0.04 3678 0.43 3265 2.20

R04 2945 4165 0.72 7705 0.03 3484 0.43 3179 1.96

R05 3030 4202 0.51 7861 0.03 3611 0.45 3129 2.33

R06 2989 4082 0.15 6872 0.03 3370 0.46 3073 1.81

R07 3000 4104 0.16 7481 0.05 3615 0.43 3108 1.88

R08 3016 4209 0.5 7473 0.06 3607 0.51 3113 1.92

R09 2901 3999 0.21 6753 0.05 3414 0.42 2860 2.16

R10 3148 4268 0.33 7137 0.03 3709 0.45 3244 2.03

R11 2981 4094 0.16 6786 0.06 3648 0.51 3170 1.81

R12 3028 4129 0.15 6590 0.03 3591 0.43 3157 1.85

R13 3076 4215 0.16 6685 0.03 3481 0.43 3182 1.74

R14 2970 4192 0.17 7079 0.01 3465 0.48 3088 2.08

R15 3112 4205 0.34 6734 0.02 3411 0.44 3131 2.10

R16 2939 4068 0.26 7083 0.08 3388 0.42 3058 2.01

R17 2933 4082 0.28 7486 0.03 3496 0.44 3081 2.08

R18 3052 4168 1.28 7153 0.03 3532 0.44 3151 2.25

R19 3067 4209 0.16 7954 0.01 3519 0.45 3154 2.09

Table 8Comparison of algorithms.

#

Cust.

SS-TSP MS-NN MS-FI ARL

Result

(%)

Time

(s)

Result

(%)

Time

(s)

Result

(%)

Time

(s)

Result

(%)

Time

(s)

33 38.95 0.04 73.87 0.00 12.04 0.01 0.00 0.05

66 37.92 0.12 99.11 0.00 11.74 0.06 0.00 0.28

132 32.99 0.62 130.96 0.04 12.60 0.45 0.00 2.03

Page 10: Efficient algorithms for the double traveling salesman problem with multiple stacks

Table 9Impact of the stack size constraints.

# Cust. /NoLimit (%) Time (s)

33 2.80 0.05

66 1.98 0.28

132 2.26 2.12

M. Casazza et al. / Computers & Operations Research 39 (2012) 1044–1053 1053

5.5. Handling capacity constraints

Finally, we analyzed the effectiveness of the repair procedurediscussed in Section 4.3 in handling stack size limits.

In Table 9 we compare the solutions found on the originalinstances using the repair procedure, where the stack size is limitedto N/S, with those found on the unlimited stack size instances.

The table reports, for each data set, the average solution costincrease (column/NoLimit) and the CPU time spent by the wholealgorithm (column Time) when the repair procedure is activated.

The method of initially neglecting the stack size constraints, andintroducing them lately in a repair heuristic produces good results:the simple insertion policy is able to recover feasibility of the solu-tions with a negligible additional computing cost, and without subs-tantially increasing their value. In our experiments we also observedsuch an increase not to be related to the size of the instance.

6. Conclusions

In this paper we considered the structure of DTSPMS solutionsto be composed of two ingredients: tours and loading plans. Weproved that when stacks are unlimited, given only one of the twoingredients of a feasible solution, the whole solution can becomputed in polynomial time. We introduced polynomial algo-rithms to produce partial solutions when a full feasible onecannot be rebuilt.

We also devised an efficient heuristic which simply combinesthese algorithms, and we performed an experimental analysis onthis method and other adaptations of standard TSP heuristics. Ourcomputational results show that the single components of ourheuristic can successfully be incorporated as building blocks todevise or improve more complex algorithms or bounding techni-ques, and our simple procedure produces better seeds for localsearch procedures than generators used in the literature.

We finally considered how the introduction of stack size limitsimpact on our theoretical results, and provided effective repairprocedures to deal with this constraint.

Acknowledgments

We are grateful to Gregorio Tirado Dominguez for insightfuldiscussions on the topic of this paper, and for readily providinghis experimental results. We are also in debt with GiovanniRighini for his invaluable comments and suggestions. We finallywould like to thank two anonymous referees, whose remarkshelped us to improve the paper.

References

[1] Ahuja RK, Magnanti TL, Orlin JB. Network flows: theory, algorithms andapplications. Englewood Cliffs, NJ: Prentice-Hall; 1993.

[2] Alba M, Cordeau JF, Dell’Amico M, Iori M. A branch-and-cut algorithm for thedouble travelling salesman problem with multiple stacks. In: Contribution atAIRO 2010, Villa San Giovanni; 2010.

[3] Applegate D, Bixby R, Chvatal V, Cook W. Concorde documentation. /http://www.tsp.gatech.edu/concorde/index.htmlS; 2009 [Last access november

2009].[4] Bollobas B. Modern graph theory. In: Graduate texts in mathematics, vol. 184.

New York: Springer; 1998.[5] Brandstadt A. On improved time bounds for permutation graph problems. In:

Graph-theoretic concepts in computer science, Lecture notes in computer

science, vol. 653. Berlin/Heidelberg: Springer; 1992. p. 1–10.[6] Brandstadt A, Bang Le V, Spinrad JP. Graph classes: a survey. In: SIAM

Monographs on Discrete Mathematics and Applications; 1999.[7] Carrabs F, Cerulli R, Speranza MG. A branch and bound algorithm to solve the

double travelling salesman problem with multiple stacks. In: Contribution atAIRO 2009, Siena; 2009.

[8] Carrabs F, Cordeau J, Laporte G. Variable neighborhood search for the pickupand delivery traveling salesman problem with lifo loading. INFORMS Journalon Computing 2007;19(4):618–32.

[9] Casazza M. Algoritmi efficienti per il multiple stacks double traveling sales-man problem. Technical Report, D.T.I. – Universit�a degli Studi di Milano,

Degree Thesis; 2009.[10] Casazza M, Ceselli A, Nunkesser M. Efficient algorithms for the double TSP

with multiple stacks. In: Proceedings of CTW 2009, Paris; 2009.[11] Cordeau J, Dell’Amico M, Iori M. Branch-and-cut for the pickup and delivery

traveling salesman problem with FIFO loading. Computers and OperationsResearch 2010;37(5):970–80.

[12] Cote JF, Gendreau M, Potvin YJ. Large neighborhood search for the singlevehicle pickup and delivery problem with multiple loading stacks. TechnicalReport, CIRRELT-2009-47; 2009.

[13] Felipe A, Ortuno MT, Tirado G. The double traveling salesman problem withmultiple stacks: a variable neighborhood search approach. Computers and

Operations Research 2009;36(11):2983–93.[14] Fuellerer G, Doerner KF, Hartl RF, Iori M. Ant colony optimization for the two-

dimensional loading vehicle routing problem. Computers and OperationsResearch 2009;36(3):655–73.

[15] Garey MR, Johnson DS. Computers and intractability, a guide to the theory ofnp-completeness. New York: W.H. Freeman and Company; 1979.

[16] Gendreau M, Iori M, Laporte G, Martello S. A tabu search approach to vehiclerouting problems with two-dimensional loading constraints. Networks2008;51(1):4–18.

[17] Golden B, Raghavan S, Wasil E, editors. The vehicle routing problem.Springer; 2008.

[18] Iori M, Salazar Gonzalez JJ, Vigo D. An exact approach for the vehicle routingproblem with two dimensional loading constraints. Transportation Science

2007;41(2):253–64.[19] Iori M, Martello S. Routing problems with loading constraints. TOP 2010;18:

4–27.[20] Jansen K. The mutual exclusion scheduling problem for permutation and

comparability graphs. Information and Computation 2003;180(2):71–81.[21] Lobel A. Mcf documentation. /http://www.zib.de/Optimization/Software/

McfS; 2009 [Last access November 2009].[22] Lusby R, Larsen J, Ehrgott M, Ryan D. An exact method for the double TSP

with multiple stacks. Technical Report, Department of Management Engi-

neering, Technical University of Denmark and Department of EngineeringScience, The University of Auckland; 2009.

[23] Petersen HL. Heuristic solution approaches to the double TSP with multiplestacks. Technical Report, Informatics and Mathematical Modelling, TechnicalUniversity of Denmark, DTU; 2006.

[24] Petersen HL, Archetti C, Speranza MG. Exact solutions to the double travellingsalesman problem with multiple stacks. Technical Report, DTU Transport,

Technical University of Denmark and Department of Quantitative Methods,University of Brescia; 2008.

[25] Petersen HL, Madsen OBG. The double travelling salesman problem withmultiple stacks—formulation and heuristic solution approaches. European

Journal of Operational Research 2009;198(1):139–47.[26] Toulouse S, Wolfler Calvo R. On the complexity of the multiple stack TSP,

KSTSP. In: Theory and applications of models of computation, Lecture notes

in computer science, vol. 5532. Berlin/Heidelberg: Springer; 2009. p. 360–9.[27] Wascher G, Haußner H, Schumann H. An improved typology of cutting and

packing problems. European Journal of Operational Research 2007;183(3):1109–30.

[28] Yannakakis M, Gavril F. The maximum k-colorable subgraph problem forchordal graphs. Information Processing Letters 1987;24(2):133–7.

[29] Zachariadis EE, Tarantilis CD, Kiranoudis CT. A guided tabu search for thevehicle routing problem with two-dimensional loading constraints. EuropeanJournal of Operational Research 2009;195(3):729–43.