A cluster- rst route-second approach for the Swap Body ... · PDF fileA cluster- rst...

17
A cluster-first route-second approach for the Swap Body Vehicle Routing Problem Juan Jos´ e Miranda-Bront *1,2 , Brian Curcio 1,2 , Isabel M´ endez-D´ ıaz 1 , Agust´ ın Montero § 1 , Federico Pousa 1,2 , and Paula Zabala k1,2 1 Departmento de Computaci´on, FCEyN, Universidad de Buenos Aires 2 Consejo Nacional de Investigaciones Cient´ ıficas y T´ ecnicas March 19, 2015 Abstract The Swap Body Vehicle Routing Problem (SB-VRP) is a generalization of the classical Vehicle Routing Problem (VRP) where a particular structure as well as several operational aspects for the trucks composing the fleet are considered. This research has been motivated by the VeRoLog Solver Challenge 2014, organized together by VeRoLog and PTV group, aiming to motivate the study of real-world logistic problems. A truck can carry either only one swap body or, in addition, an extra trailer with an extra swap body. For the latter, special depots, called swap locations, can be used to drop and pickup the swap bodies. These operations may affect the feasibility and the cost of a route, and therefore the overall operational cost. In this paper, we propose a cluster-first route-second heuristic for the SB- VRP. Computational experiments are conducted over the benchmark instances proposed for the competition, simulating a practical environment by considering limited resources and execution time. The results obtained are of very good quality, where our approach ended as runner-up in the final set of instances and performs similarly to the other algorithms in the remaining cases, showing its potential to be applied in practice. Keywords: Swap-Body VRP, Iterated Local Search, GRASP, Cluster-first route-second 1 Introduction The Vehicle Routing Problem (VRP) is one of the most important and studied problems in logistic and transportation literature. Many variants covering different aspects of real-world situations define problems with particular characteristics. Toth and Vigo [18] and Golden et al. [8] provide a very detailed and extensive survey including practical applications of the VRP as well as the proper algorithms to tackle them. * [email protected] [email protected] [email protected] § [email protected] [email protected] k [email protected] 1

Transcript of A cluster- rst route-second approach for the Swap Body ... · PDF fileA cluster- rst...

Page 1: A cluster- rst route-second approach for the Swap Body ... · PDF fileA cluster- rst route-second approach for ... The Swap Body Vehicle Routing Problem ... provide a very detailed

A cluster-first route-second approach for the Swap Body Vehicle

Routing Problem

Juan Jose Miranda-Bront∗1,2, Brian Curcio†1,2, Isabel Mendez-Dıaz‡1, AgustınMontero§1, Federico Pousa¶1,2, and Paula Zabala‖1,2

1Departmento de Computacion, FCEyN, Universidad de Buenos Aires2Consejo Nacional de Investigaciones Cientıficas y Tecnicas

March 19, 2015

Abstract

The Swap Body Vehicle Routing Problem (SB-VRP) is a generalization of the classicalVehicle Routing Problem (VRP) where a particular structure as well as several operationalaspects for the trucks composing the fleet are considered. This research has been motivatedby the VeRoLog Solver Challenge 2014, organized together by VeRoLog and PTV group,aiming to motivate the study of real-world logistic problems. A truck can carry either onlyone swap body or, in addition, an extra trailer with an extra swap body. For the latter,special depots, called swap locations, can be used to drop and pickup the swap bodies.These operations may affect the feasibility and the cost of a route, and therefore the overalloperational cost. In this paper, we propose a cluster-first route-second heuristic for the SB-VRP. Computational experiments are conducted over the benchmark instances proposed forthe competition, simulating a practical environment by considering limited resources andexecution time. The results obtained are of very good quality, where our approach ended asrunner-up in the final set of instances and performs similarly to the other algorithms in theremaining cases, showing its potential to be applied in practice.Keywords: Swap-Body VRP, Iterated Local Search, GRASP, Cluster-first route-second

1 Introduction

The Vehicle Routing Problem (VRP) is one of the most important and studied problems inlogistic and transportation literature. Many variants covering different aspects of real-worldsituations define problems with particular characteristics. Toth and Vigo [18] and Golden et al.[8] provide a very detailed and extensive survey including practical applications of the VRP aswell as the proper algorithms to tackle them.

[email protected][email protected][email protected]§[email protected][email protected][email protected]

1

Page 2: A cluster- rst route-second approach for the Swap Body ... · PDF fileA cluster- rst route-second approach for ... The Swap Body Vehicle Routing Problem ... provide a very detailed

The EURO Working Group on Vehicle Routing and Logistics (VeRoLog), in collaborationwith PTV Group, proposed the VeRoLog Solver Challenge 2014, aimed to develop and comparesolution approaches of participants from the academic and professional sector for a specificvariant of the VRP, called Swap Body VRP (SB-VRP). The SB-VRP is a generalization ofthe VRP that considers a homogeneous fleet which consists of trucks, semi-trailers and swapbodies, as well as special locations, called swap locations. The swap locations can be visitedwithin a route and perform some predetermined operations with the truck that may influencethe feasibility as well as the cost of the route (i.e., couple and decouple swap bodies). Given aset of customers, the SB-VRP involves finding a set of routes visiting all customers exactly onceand satisfying some operational constraints at minimum overall cost.

The SB-VRP is defined in Heid et al. [10]. We follow most of the notation introduced byHuber and Geiger [11] for the definition of the SB-VRP. The main distinctive feature of theSB-VRP with respect to other well known problems for the VRP literature is the characteristicof the fleet. An unlimited homogeneous fleet of vehicles consisting of trucks, semi-trailers andswap-bodies starts the operations at the depot v0. Two types of vehicles are allowed to start atthe depot, which are a single truck, carrying one swap body, or a train composed by a truck, asemi-trailer and two swap-bodies. Only swap bodies can be loaded, each of them with a capacityQ. Therefore a single truck has a capacity Q while a train has capacity 2Q. Transfers of swapbodies within a route are not allowed, and the vehicle must return to the depot with the sameswap bodies as departed originally.

Consider a complete digraph G = (V,A), where V is the set of vertices and A the set of arcs.Three different types of vertices are considered: vertex v0 represents the central depot, a set ofswap locations Vs = {sw1, . . . , swm}, where vehicles are allowed to perform certain actions, andset of customers Vc = {v1, . . . , vn}, where V = {v0}∪Vs ∪Vc. Each arc (i, j) ∈ E has associateda non-negative travel distance dij and a non-negative travel time tij . Customer vi ∈ Vc hasan associated demand qi ≥ 0, which must be served by exactly one vehicle and each customervi ∈ Vc has an associated parameter indicating whether it can be visited only by a truck or by atrain as well. The latter accounts for certain customers located in areas where, due to shuntingconstraints, vehicles carrying more than one swap body cannot access. The former are usuallycalled truck customers, while the latter are called train customers.

The swap locations can be optionally used by the vehicles - and they are the only placewhere is it allowed - to perform certain actions with the swap bodies carried by a train. Allswap locations allow the same actions to be performed, there is no limit on the number of timesa vehicle can visit a swap location and no synchronization is required if two or more vehiclesintend to use the same swap location. The valid actions allowed are four: park, pick-up, swap andexchange, where tpark, tpick, tswap and tex represent the time required for each action, respectively.These actions allow to modify temporarily the original setting of a train by deattaching, pickingup and swapping a swap body carried by a train. Figure 1 describes the behavior of each action.As a consequence, this allows a vehicle that started a route as a train to adapt its structure andvisit a truck customer. We name to these particular portions of a route a subtour.

Regarding operational constraints, the demand for each customer must be satisfied by exactlyone visit of a vehicle, taking into account train limitations for truck customers. Each route mustnot exceed the capacity of the vehicle. In this sense, it is important to remark that it is notallowed to transfer load from one swap body to another one within a route and that swap bodiescannot be exchanged among vehicles at swap locations. In addition, a route duration, including

2

Page 3: A cluster- rst route-second approach for the Swap Body ... · PDF fileA cluster- rst route-second approach for ... The Swap Body Vehicle Routing Problem ... provide a very detailed

(a) Park. (b) Pickup.

(c) Swap. (d) Exchange.

Figure 1: Swap actions.

the time spent at swap locations performing actions, must not exceed a fixed limit T .The structure of the objective function includes several parameters, which allow the company

to obtain a reasonable approximation of the real costs incurred during operations. There arefixed costs f t and f s for the use of a truck and a semi-trailer, respectively, and there are nocosts related to the use of swap bodies. Variable costs cttrd and cttrt are considered for thedistance traveled and the time spent, respectively, for a truck. In addition, for trains, a variablecost cssemi

d is considered for the total distance the semi-trailer is used. Note that, in general,actions at swap locations can be used to visit a truck customer within a train route but, also, toeventually reduce the cost of a route and of the overall solution by avoiding the costs incurredwhen carrying a semi-trailer.

The SB-VRP consists in finding a set of feasible routes, covering each vertex exactly once andsatisfying the operational constraints mentioned before, at minimum total cost. To illustrate thecharacteristics of the problem, we provide in Figure 2 a toy example with the basic structure ofa feasible solution for the SB-VRP. In this example we can observe a pure truck route, a trainroute, and a train route with two subtours. For the latter, next to each portion of the routeit is indicated which swap bodies are carried. For this particular solution, the first visit to theswap location is a park, the second one is a swap, and finally a pickup. Observe also that it isnot mandatory to visit all swap locations.

depotswap locationtruck cust.train cust.

truck routetrain route

Figure 2: Example of a feasible solution.

Finally, we make a practical remark on the information of the instances. As specified inthe problem definition in Heid et al. [10], both the distance and travel times are the result of acombination of the shortest path calculation including the distance and the driving times and

3

Page 4: A cluster- rst route-second approach for the Swap Body ... · PDF fileA cluster- rst route-second approach for ... The Swap Body Vehicle Routing Problem ... provide a very detailed

do not necessarily satisfy the triangle inequality. However, input files provide for each location(depot, customer, and swap location) the corresponding coordinates. We observe that theykeep a relation with both the distance and driving times. Our approach explicitly uses thisinformation at the beginning of the algorithm and, therefore, we assume this extra informationto be part of the instance.

Problems having a similar structure as the SB-VRP have been considered in the literature,which are reviewed in the next section. Regarding the SB-VRP, several algorithms have beenproposed within the context of the competition. To the best of our knowledge, the only publishedapproaches are the one by Huber and Geiger [11] and by Lum et al. [14]. Huber and Geiger[11] describe the heuristic developed for the competition and report the results obtained overthe test instances provided by the organizers. They consider an Iterated Local Search (ILS).An initial solution is constructed randomly, and then a sequence of intra and inter tour localsearch operators are applied. Whenever the current solution cannot be improved, it is perturbedby removing complete routes and reconstructing new ones. One distinctive decision is that, forconstructing a route, they consider having at most two subtours.

Lum et al. [14] follow a different approach. The SB-VRP instance is transformed into aclassical VRP, where an initial solution is obtained by developing a Simulated Annealing (SA)using a standard algorithm for the VRP provided in VRPH [9]. Then, since this solution may beof poor quality, a post-processing stage and a Variable Neighborhood Descent (VND) exploiting5 specifically designed local search operators are considered to obtain the final solution. Theresults are good in general, also evaluated on the instances provided up to the preselection stage,where 10 of the overall 27 teams classified for the final round.

The purpose of this paper is to contribute to the development of algorithms and approachesfor the SB-VRP by describing the details of our approach in the context of the competition,where real-world environment is simulated by providing a particular running environment andlimited computation time to solve real-world instances. We first point out some basic propertiesregarding the SB-VRP and then describe our approach, that ranked in the second position of thefinal round of the challenge. We also make an explicit comparison with the results obtained byHuber and Geiger [11] and Lum et al. [14], and analyze the results obtained to provide furtherdetails of the behavior of our approach.

The rest of the paper is organized as follows. In Section 2 we include a literature reviewof problems related to the SB-VRP and describe some observations and remarks regarding thecharacteristics of the problem. Then, in Section 3 we describe our metaheuristic approach.Finally, in Section 4 we present the computational results over the benchmark instances usedin the competition and in Section 5 we draw some conclusions and propose future researchdirections.

2 The SB-VRP

2.1 Literature review and relation with other problems

A similar problem to the SB-VRP is the Truck and Trailer Routing Problem (TTRP), which is,to the best of our knowledge, introduced by Semet and Taillard [16]. The TTRP shares someof the characteristics of the SB-VRP but, however, presents the following differences:

• it considers a limited fleet, and trucks and trailers may have different capacities (i.e.,

4

Page 5: A cluster- rst route-second approach for the Swap Body ... · PDF fileA cluster- rst route-second approach for ... The Swap Body Vehicle Routing Problem ... provide a very detailed

carrying swap bodies with different capacities);

• actions can be performed at train customers, i.e., there are no swap locations;

• the actions allowed are park, pickup, and shifting demands loads, indicating that thesemi-trailer is leaved at a feasible location and the truck travels alone;

• there is no time limit on the duration of a route.

In the last few years, the TTRP has caught some attention in the scientific community andseveral metaheuristic approaches for the problem are proposed in the related literature. Chao[2] proposes a tabu search method which is applied to 21 instances having between 50 and 200customers, with different configurations. Scheuerer [15] builds upon this paper and proposestwo new construction heuristics, which are evaluated in a similar framework as in Chao [2].The results obtained over the 21 benchmark instances showed the approach to be effective,obtaining better solutions in all cases. Lin et al. [12] consider a simulated annealing heuristicthat improved the best solution found by Scheuerer [15] in 17 of the 21 instances, and showingmixed results regarding the average results. These results are slightly improved in a follow-uppaper in Lin et al. [13]. Caramia and Guerriero [1] propose a two-stage Matheuristic, assigningcustomers to routes at first, and then optimizing each route locally. Villegas et al. [19] develop aGreedy Randomized Adaptative Search Procedure (GRASP) with a path-relinking strategy forthe problem, outperforming the previous approaches and reducing the variability in the results.Finally, Derigs et al. [3] propose a framework for the TTRP that can be adapted to manageother variants, i.e. time windows and the case without load transfer. They make an importantobservation regarding the instances, claiming that some of them as well as the definition of theproblem overlook several important aspects.

Gerdessen [7] considered the Vehicle Routing Problem with Trailers (VRPT), having a similarstructure as the TTRP and with applications in the distribution of dairy products in rural areas.In this problem there are no accessibility constraints but, however, the difference relies in theservice time required to serve a customer.

Regarding generalizations of the TTRP, Tan et al. [17] consider the TTVRP, a multi-objectiveoptimization problem where trucks can be used to pickup and deliver goods and are requiredto visit exchange points in order to select the correct trailer type. They propose an ILP formu-lation and the problem is tackled using an evolutionary algorithm. Computational results areshown for instances having at most 132 jobs (customers) considering two different objectives:route cost and the number of trucks used. Drexl [5] studies the VRP with Trailers and Tran-shipments (VRPTT), a very general problem which captures several synchronization aspectsregarding time, load and spatial constraints. A formal framework including the definition of aparticular network for such problems is discussed. Recently, Drexl [4] studies the GeneralizedTTRP(GTTRP), in which swap locations (called transhipment locations) are considered. Vehi-cles are also allowed to transfer their loads and trailers can be dropped and picked up by anothercompatible truck.

2.2 Properties and remarks for the SB-VRP

We begin by pointing out a few observations regarding the SB-VRP, mainly focused on limitsand characteristics imposed by the operational constraints, which are later incorporated in ouralgorithm.

5

Page 6: A cluster- rst route-second approach for the Swap Body ... · PDF fileA cluster- rst route-second approach for ... The Swap Body Vehicle Routing Problem ... provide a very detailed

The first observation concerns the use of swap locations, both in terms of the feasibility aswell as the cost of a solution. As mentioned in the previous section, a train that parks a swapbody could be useful to visit a truck customer or to reduce the cost of the solution. Consider thetwo routes in Figure 3, visiting the same set of locations. In Figure 3(a), the customers visitednext to the swap location are close, while in Figure 3(b) the same swap location is next to moreremote customers. The presence of a maximum travel time duration T for a route clearly limitsthe possibility of visiting a swap location to perform a sequence of activities. In addition, evenwhen the maximum duration of a route is not exceeded, obtaining a significant decrease in thecost of the route will depend on the relation between the values cttrd and cssemi

d . Assuming thatthe distance and travel time keeps a relation with respect to their relative location, the routeshown in Figure 3(b) is larger (both in time and distance) compared with the one in Figure 3(a).

(a) Swap location next to close cutomers (b) Swap location next to far cus-tomers

Figure 3: Examples of routes

This simple analysis shows that for some cases, limiting the use of a swap location couldrepresent a good alternative to reduce the size of certain neighborhoods, if the customers tobe visited immediately after/before it are close enough, without losing many feasible solutions.Indeed, as explained later, we consider for each customer only a restricted list containing apredefined subset of the (closest) swap locations.

We also analyze how capacities are handled in a train. Operational constraints establishthat transfers of load between swap bodies are not allowed, even when they belong to the sametrain. However, as stated in the definition, it is valid to load the quantity for one customer onthe two swap bodies -and it must be visited by the train- and the order of the swap bodies isnot relevant. We therefore consider the following result.

Remark 1. Let r =< v0, i1, . . . , ik, v0 > be a feasible sequence of vertices visited by a train.Define Γr ⊆ Vc the set of customers visited while carrying the two swap bodies and Γr

l ⊆ Vc thesubset of customers visited while carrying only swap body l, l = 1, 2. Then, r is feasible in termsof capacity iff ∑

v∈Γrl

qv ≤ Q, l = 1, 2 (1)

∑v∈Γr

qv +∑

v∈Γr1∪Γr

2

qv ≤ 2Q. (2)

These two conditions can be easily translated into an straightforward algorithm that in O(|r|)can check the feasibility of a route in terms of the capacity constraints. Therefore, capacity canbe handled more generally in terms of feasibility and previous decisions regarding which swapbody serves to each customer do not restrict traditional operations when altering the structure,order and/or composition of a route.

6

Page 7: A cluster- rst route-second approach for the Swap Body ... · PDF fileA cluster- rst route-second approach for ... The Swap Body Vehicle Routing Problem ... provide a very detailed

Finally, we make an observation regarding the first operation at a swap location of a route.Based on the definition of each operation, it is reasonable (and indeed happens in all testinstances provided) that tpark ≤ tex, given that an exchange can be seen as a park followed bya swap. Under this scenario, the following result holds.

Remark 2. If tpark ≤ tex, then the first action at the first swap location visited by a route, ifany, should be a park.

The rationale behind this remark is very intuitive. The main difference between park andexchange operations is which swap body is selected for a simple subtour. Since we are consideringthe first action at the first swap location and customers allocated before in the route are visitedby the train with the two swap bodies, it is possible to simply invert the role of each swap bodyin the rest of the tour and use the result in Remark 1 to allocate the corresponding capacities.If tpark ≤ tex, the overall time for the route is reduced, without affecting the feasibility, and thecost of the route is improved as well.

3 Proposed approach

In this section we provide the details of the approach developed for the competition, includ-ing two basic greedy algorithms which are quite intuitive and were first considered as initialapproaches as well as to provide a baseline for our evaluation. It is important to remark thatsome of the decisions taken regarding the structure of the algorithm are driven by the contextimposed by the competition, where limited resources and time are available to solve real-worldinstances.

3.1 General comments

We now proceed to describe a few decisions made during the development of the solution methodfor the competition, which somehow affect the different parts of the approach. The first oneinvolves the feasibility check in terms of capacity. Following the result in Remark 1, we con-sider a straightforward algorithm to determine whether a particular operation (i.e., insertion,exchange, etc.) is feasible or not in terms of the total capacity. This allows us to avoid handlingexplicitly which swap bodies satisfy the demand of each customer, providing as well a moregeneral framework in this regard.

We also take into account the observation made in Section 2.2 regarding the proximity amongcustomers and swap locations. Therefore, we define for each customer vi ∈ Vc a restricted setof swap locations, Sl(vi), to capture this effect. Given a swap location swj ∈ Vs, the following(heuristic) weighted cost incurred when traveling arcs (swj , vi) and (vi, swj) using only a truckis

cviswj = cswjvi = α(cttrd × (dviswj + dvjswi)) + (1− α)(cttrt × (tviswj + tvjswi)) (3)

Then, we define Sl(vi) as the K closest swap locations to vi according to the weighted cost c.The motivation behind this definition is to capture swap locations which are likely to be feasibleand also incurring in a small cost when accessing to them. Indeed, we observed on preliminarycomputational experiments that considering these sets instead of all the swap locations reducessignificantly the computation times of certain routines, while obtaining reasonable results.

7

Page 8: A cluster- rst route-second approach for the Swap Body ... · PDF fileA cluster- rst route-second approach for ... The Swap Body Vehicle Routing Problem ... provide a very detailed

3.2 Constructive heuristics

These two greedy algorithms could represent a very first approach for the SB-VRP, and wereused for comparison purposes. In addition, a straightforward extension of the greedy approachpresented in Section 3.2.2 is used as the constructive step in a GRASP metaheuristic, as describedlater in the document.

3.2.1 Greedy naive

The first heuristic we consider is a simple heuristic which iteratively inserts unassigned verticesinto the partial solution following a greedy criterion, while in case no feasible insertion can bemade it forces the opening of a new route. This heuristic does not account for swap locations,but it is used to provide a baseline for comparison purposes. In Algorithm 1 we show the sketchof the greedy naive (GN) heuristic.

Algorithm 1 Greedy naive (GN) heuristic

Input: SB-VRP instance.Output: Feasible solution.

1. (Initialization) Let S = Vc the set of unassigned customers. Let R = ∅ be the set of routes representingthe (partial) solution.

2. (Evaluation) For each v ∈ S, compute the cost cirv incurred by inserting v in the position i of router ∈ R, if feasible. Consider also the cost c0sv incurred by opening a new single route to visit v if it isa truck customer, and the cost c0tv of a new complete route to visit v if it is a train customer.

3. (Insertion) Select the vertex v∗ producing the least cost insertion cirv∗ for position i in route r. If r isa new route, set R = R ∪ {r} (where r is a single route or a train, depending on the choice). Insertv∗ in position i of route r ∈ R. Set S = S \ {v∗}.

4. (Termination) If S 6= ∅, return to Step 2. Otherwise, return the solution and terminate the algorithm.

We remark the evaluation of two cases in Step 2, when opening a new route. Firstly, whenconsidering a truck customer the only alternative is to open a simple route since swap locationsare not considered. For a train customer, however, both types of routes can be considered. Dueto the greedy selection criterion based on the cost incurred, only single routes would be opened.Therefore, to reduce the final number of routes we decided to open single routes only whennecessary. On preliminary computational results, this particular distinction produced betterresults, incurring in overall smaller fixed and variable costs.

3.2.2 Greedy with swap locations

We now extend the idea described in the previous section to include actions and operations atthe swap locations. For this purpose, when attempting to insert a vertex into an existing route,we will also try to begin a subtour or, if already within a subtour, try to perform a swap action.In all cases, the feasibility of the solution in terms of capacity, duration and structure of theswap activities is guaranteed.

We first show in Algorithm 2 a sketch of the insertions attempted for an unassigned vertexinto a particular position within an existing route in the current solution. Recall the notation

8

Page 9: A cluster- rst route-second approach for the Swap Body ... · PDF fileA cluster- rst route-second approach for ... The Swap Body Vehicle Routing Problem ... provide a very detailed

introduced in the previous section, where S denotes the set of unassigned vertices and R the setof routes in the partial solution.

Algorithm 2 Vertex insertion evaluation

Input: SB-VRP instance, an unassigned vertex v ∈ S, route r ∈ R, position i = (va, vb) ∈ rOutput: Cost of the best insertion of vertex v, if any.

1. Evaluate the cost of the following insertions, if feasible:

• insert v alone between va and vb;

• if r is a train route and i is within a subtour, let sw be the active swap location. Evaluateinserting the sequences < sw, v > and < v, sw >;

• if r is a train route and when traversing i the vehicle carries both swap bodies, evaluate insertinga single subtour composed by the sequence < sw, v, sw >, for sw ∈ Vs ∩ Sl(v).

2. If at least one of the previous attempts is feasible, return the cost of the best one.

In Algorithm 3 we show the details of a greedy heuristic that incorporates the use of swaplocations, which we name G-SL. The main idea behind the algorithm is similar to GN, exceptfor two minor differences. When attempting to insert a vertex into an existing route we callAlgorithm 2 to consider the use of swap locations. Secondly, contrary to GN, new routes areopened only when no feasible insertion in the actual routes is possible, despite eventually openinga new route could incur in a smaller cost. This is expected to increase the chances of using swaplocations in the solution.

Algorithm 3 Greedy with swap locations (G-SL) heuristic

Input: SB-VRP instance.Output: Feasible solution.

1. (Initialization) Let S = Vc be the set of unassigned customers. Let R = ∅ be the set of routesrepresenting the (partial) solution.

2. (Vertex insertion) For each unassigned vertex v ∈ S, route r ∈ R, and position i = (va, vb) evaluatethe insertions as described in Algorithm 2. If at least one feasible insertion can be done, select andperform the best one. Let v∗ be the vertex involved, update S = S \ {v∗} and go to Step 4.

3. (Route extension) If no feasible insertion has been found in the previous step, attempt an insertion ina new route. When considering a train route, attempt insertion using Algorithm 2 as in the previousstep. Select and perform the best insertion. Let v∗, r∗ be the selected vertex and the new route,respectively. Set S = S \{v∗} and R = R ∪ {r∗}.

4. (Termination) If S 6= ∅, return to Step 2. Otherwise, return the solution and terminate the algorithm.

3.3 Local search operators

In this section we provide some details regarding the local search operators considered, the wayin which they are adapted to the SB-VRP and which is the neighborhood we consider. Thepossible movements are the following:

1. Exchange: For every two customers vi, vj ∈ Vc allocated in different routes, exchange their

9

Page 10: A cluster- rst route-second approach for the Swap Body ... · PDF fileA cluster- rst route-second approach for ... The Swap Body Vehicle Routing Problem ... provide a very detailed

positions.

2. Relocate: For every customer vi ∈ Vc, remove it from its current position and attempt toinsert it in every other position of the current solution.

3. Restricted Or-Opt : Within a route, each sequence of consecutive customers having sizel = 1, 2, 3 is removed and several insertions are attempted in the remaining positions ofthe route. Let s be the sequence of customers, with vsi and vsf the beginning and the endof the sequence, respectively. Let also r∗ ∈ R be the route obtained by removing s and leti ∈ r∗ be an arc. Then, we attempt the following insertions at i:

• insert s and its reverse, noted rev(s),

• if i belongs to a subtour, with sw ∈ Vs the active swap location, test the sequences< sw, s >, < s, sw >, < sw, rev(s) > and < rev(s), sw >,

• if i belongs to a train sector of the route, for each sw ∈ Sl(vsi ) ∩ Sl(vsf ) attempt toinsert the complete subtours < sw, s, sw > and < sw, rev(s), sw > by performing apark.

4. Restricted 2-Opt : For the SB-VRP, a train route using one or more swap locations couldeasily fall into an infeasible solution. Since the 2-Opt operator needs to revert a subpathin the route, if a swap location is contained in such subpath it is necessary, at least, todefine how this is handled. Furthermore, truck customers visited within a subtour couldbe easily moved outside to a train section of the route, violating one of the operationalconstraints.

Therefore, we decided to apply the 2-Opt operator in an intra-route fashion, and withinsubpaths where the composition of the truck does not change. That is: whitin each subtourand on subpaths conformed by consecutive vertices visited by a train, if any. To clarify,in case no swap locations are present in a route, the operator behaves as in its standarddefinition. In addition, this adaptation allows to obtain a faster implementation since somevalidations can be omited.

5. Route downgrade: For each train route such that the total demand of all visited customersdoes not exceed Q, remove the swap locations (if any) and create a new simple truck routethat visits the customers in the same order and carrying only one swap body.

These operators are applied in the order they are presented, in a best improvement fashion,and our implementation moves from one operator to the next one when no improvement can befound. This sequence is applied iteratively until no better solution can be achieved by any ofthe operators.

We make a brief discussion regarding some of the operators presented below. Firstly, weremark that the Or-Opt we consider, although restricted to a route, includes the evaluation asa possible movement not only the reverse of a sequence but, in addition, the insertion within asubtour or even the possibility of starting a new one within a train route. The motivation forthis decision is to allow new subtours to be created, both aiming to visit truck-only customersand also to eventually reduce the overall cost of the tour. With respect to the downgrade route,we experimentally observed that this is a common situation after exploring the neighborhood.To facilitate the use of swap locations in a train route, we execute it only at the end of theprocess.

10

Page 11: A cluster- rst route-second approach for the Swap Body ... · PDF fileA cluster- rst route-second approach for ... The Swap Body Vehicle Routing Problem ... provide a very detailed

3.4 Shaking procedure

To escape from local optimum solutions, one of the alternatives considered is to apply a shakingprocedure to the solution and restart the search from the new generated solution. For thispurpose, given a feasible solution for the SB-VRP, each customer is removed from the solutionwith uniform probability p ∈ (0, 1). Let L be the list of removed customers. To reconstruct afeasible solution we shuffle L and its vertices are sequentially considered and inserted into therestricted solution in the position and route incurring in the smallest cost increment.

3.5 GRASP

Another alternative considered to escape from a local optimum is to randomize the constructionphase, as proposed by the well known GRASP (see, e.g., Feo and Resende [6]). For each initialsolution, a local search procedure is executed in order to improve the solution. Therefore, weadapt and include into this scheme the procedures described before.

For the construction phase, we develop a straightforward adaptation of Algorithm 3, whereinstead of returning the best feasible insertion we construct a restricted candidate list havingthe best rclsize insertions. To decide which insertion is performed, we randomly select one ofthe elements in the list. We further add another random decision to the heuristic to decidewhich type of route to open. Unless all the remaining unassigned customers are required to bevisited by a train (i.e., Q < qv ≤ 2Q, for all unassigned v ∈ Vc), a single truck route is openwith uniform probability pr and a train route with probability 1− pr, pr ∈ (0, 1). We considergenerating a maximum of nitconst initial solutions.

Regarding the improvement phase, we consider an ILS combining the neighborhood definedin Section 3.3 and the shake procedure from Section 3.4. Starting from a feasible solution, weexplore the neighborhood until no improvement can be found, apply the shaking procedure andrepeat the process. The shaking procedure is applied always using the best solution obtainedfrom the last constructed solution until the limit of nitils consecutive iterations without improve-ments is reached. After reaching this limit, if possible, we start over again with the constructivephase. The sketch for the overall procedure is shown in Algorithm 4.

Algorithm 4 GRASP heuristic for the SB-VRP

Input: SB-VRP instance, nitconst, nitilsOutput: Feasible solution.

1. (Initialization) Set it = 0 and zbest =∞.

2. (Construction phase) If it ≥ nitconst, go to Step 5. Otherwise, construct a feasible solution using thegreedy randomized heuristic. Set xcur as the solution and zcur with its objective value. Define itils = 0and it = it+ 1.

3. (ILS) Explore the neighborhood defined in Section 3.3. Let x be the solution obtained and z itsobjective value. If z ≤ zbest, update xbest = x and zbest = z.

4. (Evaluation) If z ≤ zcur, then set zcur = z, xcur = x, itils = 0 and return to Step 3. If itils > nitils, goto Step 2. Otherwise, shake solution xcur, update zcur, set itils = itils + 1 and return to Step 3.

5. (Termination) Return solution xbest and zbest.

11

Page 12: A cluster- rst route-second approach for the Swap Body ... · PDF fileA cluster- rst route-second approach for ... The Swap Body Vehicle Routing Problem ... provide a very detailed

3.6 Cluster-first route-second and the overall approach

Finally, we point out the last decision concerning our strategy for the challenge, where theevaluation is performed considering large size instances with approximately 500 customers and150 swap locations. For this type of instance, the execution time of both the constructivealgorithms as well as the local search operators can be considerably increased. To tackle thisissue, for example, Lum et al. [14] restrict the set of neighbors of each vertex during the search.We adopted a similar strategy regarding the swap locations. However, for the remaining wedecided to follow a cluster-first route-second approach, which takes into account the upper limiton the running time for the program established by the organizers.

Given the complete instance, we divide the vertices (customers and swap locations) into atmost ncl clusters using k-means taking as input the coordinates of the vertices, for some valuencl set a priori. Once each cluster has been determined, they are treated independently for acertain amount of time and, at the end, the best solutions found for each cluster are will forma complete and feasible solution for the instance.

The procedure is as follows. Let Tmax be the time limit for running the algorithm and nclthe number of clusters. Since our program runs in a single thread and executes sequentially, weassign at most 2/3 of Tmax to optimize the clusters independently, where this time is distributedamong the cluster proportionally with respect to the number of customers. Each optimization iscarried out using the GRASP procedure described in Section 3.5. When each cluster has eitherfinished the procedure or reached the upper limit established, we dedicate the remaining 1/3of the time to optimize the merged solution by executing the ILS procedure described in theprevious section. When the overall time limit is reached, the best solution found during theprocess is reported.

Based on limited preliminary experiments, we established the following parameters for thealgorithm. Firstly, we observed that dividing the instance in at most 4 clusters provided goodresults. For the CFRS-GRASP, we set nitconst = 50 and nitils = 150. This configuration aims toprovide the following behavior: for small and medium instances, when exploring the search spacestarting from the best solution stops finding improvements, then we start over by recomputingan initial solution. However, for large instances, exploring the neighborhoods is time consumingand we prefer to restrict our attention to the ILS. Indeed, with the time limits imposed by thecompetition, this is the standard behavior of the GRASP procedure. For the weighted cost, weset α = 0.5. Within the greedy randomized, the probability of opening a single truck route isset to pr = 0.2, rclsize = 5, we consider the K = 10 closest customers and p = 0.35 as theprobability of removing a customer in the shaking procedure. For the rest of the paper, we nameCFRS-GRASP to the method described in this section.

4 Computational experiments

The method CFRS-GRASP described in the previous section has been implemented in C++,using g++ 4.8.2 and an Ubuntu Linux 14.04 LTS as operating system. The experiments arerun on a Lenovo Thinkpad T530 with an Intel Core i5-3320M CPU and 4Gb of RAM. Weremark that this configuration is slightly different from the one used in the competition (i.e.,the operating system used for the competition was Windows and 16Gb of RAM were available).Although it was possible to use 4 processors, our program runs in a single thread. The time limitTmax used both in the competition and as well in our experiments is 600 seconds. CFRS-GRASP

12

Page 13: A cluster- rst route-second approach for the Swap Body ... · PDF fileA cluster- rst route-second approach for ... The Swap Body Vehicle Routing Problem ... provide a very detailed

uses always all the time available, although in some cases, particularly in small instances, thebest solution is found early in the execution.

Regarding the instances, we consider the ones provided by the organizers during the compe-tition. Three different sets of instances were initially made public: a small set, having approxi-mately 50 customers and 20 swap locations; a medium instance, with nearly 200 customers and40 swap locations; and a large instance, having more than 500 customers and 100 swap loca-tions. All instances have three different versions: a normal version, where the type of customersis mixed; an all with trailer version, where all customers can be visited by a train; and an allwithout trailer, where vertices can only be visited by a single truck.

A first preselection round took place at the middle of the competition, where the best 10teams classified for the final round. For this preselection, instances medium normal and largenormal where considered, as well as a new large instance with its two corresponding variantsregarding the type of customers considered, giving a total of five instances. The final round wassimilar, where two new large instances and their corresponding variants were considered, givinga total of 6 instances. We refer the reader to Huber and Geiger [11] for more details regardingthe instances up to the preselection.

In Table 1 we show the computational results obtained for the instances used up to thepreselection. The first column indicates the name of the instance, and Best-Presel reports thebest solution known after the preselection has been performed. We then report the results forGN and G-SL where in both cases we applied to the resulting solution one local search stepexploring the neighborhood described in the previous section. The next three columns show theaverage and best results obtained by Huber and Geiger [11] and the best result reported by Lumet al. [14]. Finally, the average and best results over 10 runs for CFRS-GRASP are reported inthe last two columns.

The first observation regarding the three heuristics from the competition available is that inthe three cases the results are comparable, obtaining improvements within the 6-7% within thebest solution obtained during the preselection phase. The best results in this sense are obtainedby Huber and Geiger [11], which in several cases reached that value and, furthermore, were ableto improve in the experiments performed afterwards. For this set of instances, CFRS-GRASPis in the middle between Huber and Geiger [11] and Lum et al. [14], standing within 0.5 and 3%both on average and best solution of the results reported in Huber and Geiger [11]. With respectto CFRS-GRASP, the ILS procedure and the cluster stage produced the best improvements inthe overall approach. The latter, in particular, allows a better usage of the available time.Although not mentioned explicitly, the clustering phase is able to improve nearly 3-4% withrespect to previous solutions.

Next, we focus on the results obtained by GN and G-SL, and relate them with the structureof the SB-VRP. We first remark that, although both approaches are heuristic and contain a fewarbitrary design decision, they are however useful to obtain a deeper insight on the structure ofthe problem in general and the instances in particular. At a first glance, it seems reasonable toexpect that by incorporating swap locations in the solution, as G-SL does, it would be beneficial.However, from Table 1 we can observe that the results of G-SL compared with GN are somehowmixed, and that GN obtained better solutions in 8 of the 12 instances. This behavior is consistentwith our experience during the development of the heuristic, where for this set of instances thesolutions tend to avoid using swap locations. Similar observations are reported in Lum et al.[14].

13

Page 14: A cluster- rst route-second approach for the Swap Body ... · PDF fileA cluster- rst route-second approach for ... The Swap Body Vehicle Routing Problem ... provide a very detailed

Inst

an

ceB

est-

Pre

sel

GN

G-S

LH

ub

eran

dG

eige

r[1

1]L

um

etal

.[1

4]C

FR

S-G

RA

SP

Avg.

Bes

tA

vg.

Bes

t

smal

ln

orm

al

-58

90.0

467

26.5

448

05.3

248

04.9

749

59.0

048

18.1

547

97.5

5sm

all

all

wit

htr

aile

r-

5386

.37

5646

.86

4730

.92

4730

.92

4873

.05

4730

.63

4730

.63

smal

lal

lw

ith

ou

ttr

ail

er-

6510

.88

6085

.46

4860

.06

4839

.64

5356

.36

4913

.09

4855

.62

med

ium

nor

mal

779

6.68

9667

.97

9591

.56

7818

.87

7755

.43

8297

.25

8040

.17

7952

.30

med

ium

all

wit

htr

ail

er-

9009

.27

9180

.53

7885

.75

7817

.83

8335

.57

7957

.60

7847

.30

med

ium

all

wit

hou

ttr

ail

er-

1033

8.30

9883

.55

8119

.43

8045

.47

8628

.37

8263

.76

8221

.32

larg

en

orm

al

205

35.7

024

238.

6024

342.

2020

764.

0520

524.

5422

051.

4021

050.

2920

889.

20la

rge

all

wit

htr

aile

r-

2300

1.70

2364

4.30

2048

2.65

2021

5.26

2131

7.00

2093

2.23

2077

8.30

larg

eal

lw

ith

ou

ttr

aile

r-

2593

5.00

2528

3.60

2145

7.48

2125

5.51

2241

9.40

2178

2.45

2168

3.60

pre

sele

ctio

nn

orm

al256

47.0

030

208.

9032

399.

2025

617.

7725

425.

8526

712.

4026

291.

6526

146.

00p

rese

lect

ion

all

wit

htr

ail

er251

38.4

029

024.

4030

731.

1025

331.

6625

072.

3626

658.

1026

013.

0925

915.

10p

rese

lect

ion

all

wit

hou

ttr

ail

er261

49.9

030

567.

2031

063.

5026

166.

9925

835.

8526

712.

4026

762.

8026

524.

50

Tab

le1:

Res

ult

sob

tain

edon

the

test

inst

ance

sp

rovid

edin

itia

lly

and

the

ones

use

dfo

rth

ep

rese

lect

ion

.

14

Page 15: A cluster- rst route-second approach for the Swap Body ... · PDF fileA cluster- rst route-second approach for ... The Swap Body Vehicle Routing Problem ... provide a very detailed

Instance GN G-SL CFRS-GRASPAvg. Best

final normal 43366.50 41990.50 37613.59 37087.00final normal all with trailer 37529.60 41896.80 36762.59 36037.90final normal all without trailer 46093.50 44607.50 39860.18 39339.70final random 151125.00 150372.00 137677.00 137213.00final random all with trailer 139537.00 149361.00 132537.10 132094.00final random all without trailer 215155.00 164757.00 155542.00 154237.00

Table 2: Results obtained on the instances used in the final round.

We now present the results obtained by CFRS-GRASP in the final set of instances. Thekey for the table is the same as before, with the exception that neither Huber and Geiger [11]or Lum et al. [14] report the results for this instances. Indeed, we only count with our resultsfor this set of instances and the result provided by the organizers, where our approach rankedin the second position. Similarly to the previous table, the relation between the best solutionfound by CFRS-GRASP and the average over the ten runs keeps the same relation.

We can observe, however, a different trend in this table when comparing the heuristics GNand G-SL. In this case, G-SL obtains better results in 4 out of the 6 instances, and it producesworse results in the all with trailer instances. In addition, for the last instance, a remarkableimprovement of nearly 40% is observed between both solutions. This results are consistent withthe structure observed in these instances. Compared with large instances used in the previoustable, we noted that the maximum route duration has been increased considerably, and alsothat demands for customers represent a tight constraint in general. In particular, the differenceobtained in the instance final random all without trailer is due to the fact that, in general, atmost two customers can be allocated into a single swap body. Therefore, since all customersare truck customers, GN generates a large number of truck routes. On the other hand, G-SLattempts to use train routes trying to take advantage of the use of swap locations. As a result,a smaller number of routes is generated, where each of them visits nearly twice the number ofcustomers with respect to the solution generated by GN.

Overall, these findings lead us to believe that the SB-VRP presents a complicated struc-ture, and that further developments from the theoretical side as well as from a computationalstandpint are required to get a deeper insight on the problem.

5 Conclusions

In this paper we study the Swap-Body Vehicle Routing Problem and consider a cluster-firstroute-second with a GRASP metaheuristic to solve it. This problem is relatively new in theVRP literature and, although it presents some similarities with other VRP variants, its particularstructure and the results obtained by our algorithm as well as other approaches developedsimultaneously showed that it deserves further attention. Taking into account the time limitfor the execution, our approach starts by splitting the instance into smaller instances, optimizethem during a certain amount of time, and then merge this solution and use the remainingtime to obtain a better final solution. This approach showed to be quite effective in practice,

15

Page 16: A cluster- rst route-second approach for the Swap Body ... · PDF fileA cluster- rst route-second approach for ... The Swap Body Vehicle Routing Problem ... provide a very detailed

obtaining comparable results in the instances provided and ranking in the second position onthe final set of instances. We also provide an explicit comparison of the approaches appearingin the literature, aiming to contribute to future developments for the problem.

As future research, based on our experience while working on the problem, we believe thatmore attention should be devoted to study the structure of the problem, in particular regardingthe convenience (or not) of using the swap locations. In addition, taking into account the otherapproaches, it would be interesting to investigate the use of Integer Linear Programming bothto explore large neighborhoods of a solution as well as to evaluate where is the limit for solvinginstances to optimality.

Acknowledgments

This research is partially supported by grants PICT-2010-0304, PICT-2011-0817, PICT-2013-2460 and UBACyT 20020100100666.

References

[1] M. Caramia and F. Guerriero. A heuristic approach for the truck and trailer routingproblem. Journal of the Operational Research Society, 61(7):1168–1180, 2010.

[2] I.-m. Chao. A tabu search method for the truck and trailer routing problem. Computers& Operations Research, 29:33–51, 2002.

[3] U. Derigs, M. Pullmann, and U. Vogel. Truck and trailer routing problems, heuristics andcomputational experience. Computers & Operations Research, 40(2):536–546, 2013.

[4] M. Drexl. Branch-and-Price and Heuristic Column Generation for the Generalized Truck-and-Trailer Routing Problem. 2011.

[5] M. Drexl. Applications of the vehicle routing problem with trailers and transshipments.European Journal of Operational Research, 227(2):275 – 283, 2013.

[6] T. A. Feo and M. G. Resende. Greedy randomized adaptive search procedures. Journal ofglobal optimization, 6(2):109–133, 1995.

[7] J. C. Gerdessen. Vehicle routing problem with trailers. European Journal of OperationalResearch, 93(1):135–147, 1996.

[8] B. L. Golden, S. Raghavan, and E. A. Wasil. The Vehicle Routing Problem: Latest Advancesand New Challenges: latest advances and new challenges, volume 43. Springer Science &Business Media, 2008.

[9] C. Groer. VRPH. http://projects.coin-or.org/VRPH.

[10] W. Heid, G. Hasle, and D. Vigo. Verolog solver challenge 2014 vsc2014 problem description.In VeRoLog (EUROWorking Group on Vehicle Routing and Logistics Optimization) andPTV Group, pages 1–6, 2014.

16

Page 17: A cluster- rst route-second approach for the Swap Body ... · PDF fileA cluster- rst route-second approach for ... The Swap Body Vehicle Routing Problem ... provide a very detailed

[11] S. Huber and M. Geiger. Swap Body Vehicle Routing Problem: A Heuristic SolutionApproach. Computational Logistics, pages 16–30, 2014.

[12] S.-W. Lin, V. F. Yu, and S.-Y. Chou. Solving the truck and trailer routing problem basedon a simulated annealing heuristic. Computers & Operations Research, 36(5):1683–1692,2009.

[13] S.-W. Lin, V. F. Yu, and S.-Y. Chou. A note on the truck and trailer routing problem.Expert Systems with Applications, 37(1):899–903, 2010.

[14] O. Lum, P. Chen, X. Wang, B. Golden, and E. Wasil. A Heuristic Approach for the Swap-Body Vehicle Routing Problem. In 14th INFORMS Computing Society Conference, pages172–187, 2015.

[15] S. Scheuerer. A tabu search heuristic for the truck and trailer routing problem. Computers& Operations Research, 33(4):894–909, 2006.

[16] F. Semet. A two-phase algorithm for the partial accessibility constrained vehicle routingproblem. Annals of Operations Research, 61(1):45–65, 1995.

[17] K. Tan, Y. Chew, and L. Lee. A hybrid multi-objective evolutionary algorithm for solvingtruck and trailer vehicle routing problems. European Journal of Operational Research,172(3):855–885, 2006.

[18] P. Toth and D. Vigo, editors. The Vehicle Routing Problem. Society for Industrial andApplied Mathematics, Philadelphia, PA, USA, 2001.

[19] J. G. Villegas, C. Prins, C. Prodhon, A. L. Medaglia, and N. Velasco. A GRASP with evo-lutionary path relinking for the truck and trailer routing problem. Computers & OperationsResearch, 38(9):1319–1334, 2011.

17