1 Introduction

This paper addresses the capacitated vehicle routing problem with two-dimensional loading constraints, which is denoted as 2L-CVRP (Iori 2004; Iori 2005). The 2L-CVRP is a variant of one of the most frequently studied combinatorial optimization problems, the capacitated vehicle routing problem (CVRP) (Prins 2004; Tarantilis and Kiranoudis 2002; Tarantilis 2005; Mester and Bräysy 2007). The CVRP is the well-known variant of the vehicle routing problem (VRP) (Dantzig and Ramser 1959; Toth and Vigo 2002a).

The VRP is to find the minimum cost routes to be traveled by a fleet of vehicles. All of the vehicles must start and terminate at a central depot. Each customer must be visited once, by one vehicle only. The VRP is a well known integer programming problem which falls into the category of NP-hard problems. A large number of heuristics have been proposed to solve the problem. These algorithms are separated into two main categories—classical heuristics and metaheuristics. Tabu search strategy is the most widely used and efficient algorithm. Several variants of the standard Tabu search have been presented. In the last decade, many nature inspired metaheuristic algorithms have been proposed for the VRP, for instance, genetic algorithms and ant colony optimization. For more detailed descriptions of these algorithms, survey papers by Bodin et al. (1983); Fisher (1995); Gendreau et al. (1997); Laporte et al. (2000); Laporte and Semet (2002); Tarantilis (2005); Li et al. (2009); Laporte (2009) may be referred.

The simulated annealing algorithm is widely used for the VRP and its variants. Osman (1993) developed a hybrid simulated annealing and Tabu search algorithm for VRP. Chiang and Russell (1996) proposed simulated annealing metaheuristics for the vehicle routing problem with time windows. Breedam (1995) reported simulated annealing-based improvement methods to solve VRP. Moghaddam et al. (2006) presented a hybrid simulated annealing algorithm for capacitated vehicle routing problem with the independent route length. Lin et al. (2009) considered the application of a simulated annealing (SA) heuristic to the truck and trailer routing problem (TTRP) which is a variant of the VRP.

The CVRP is the well-known variant of the VRP where all vehicles are identical and have the same maximum loading capacity. A large number of heuristic and metaheuristic solution methods have been proposed for the problem. For more details, we refer to some extensive survey papers (Laporte and Semet 2002; Gendreau et al. 2002; Cordeau et al. 2002, 2005). For exact solution methods, the reader is referred to Toth and Vigo (2002b), Fukasawa et al. (2006) and Baldacci et al. (2008).

The 2L-CVRP combines the CVRP with a loading problem that is closely related to the well-known two-dimensional bin packing problem (2BPP). The 2BPP belongs to the category of combinatorial optimization problems, and is also a NP Hard problem. It finds the minimum number of identical rectangular bins to load a given set of rectangular items. For more algorithms or reviews on the bin packing problems, interested readers are referred to (Martello and Vigo 1998; Boschetti and Mingozzi 2003a, b; Pisinger and Sigurd 2007; Wei et al. 2009).

The 2L-CVRP was first solved by an exact algorithm which used the branch-and-cut technique (Iori et al. 2007). In the test dataset, their approach can deal with the instances with no more than 30 customers and 91 items in 1 day of CPU time. As for the larger scale problems, a metaheuristic approach was proposed by Gendreau et al. (2008). Precisely, the Tabu search was employed for routing aspects of the problem. Usually, the means of lower bounds, heuristics, local search and a truncated branch-and-bound were used to check the loading feasibility. 180 problem instances were tested in their work. The number of customers went up to 255 and the items up to 786. Recently, a new method, the guided Tabu search (Zachariadis et al. 2009), which combines the Tabu search with guided local search, was presented. For checking the feasibility of loading, a collection of packing heuristics was used. To accelerate the algorithm, two strategies that reduced the neighborhoods explored, and record of the loading feasibility information, were employed. A nature inspired metaheuristic algorithm, an effective heuristic based on ant colony optimization, has been proposed by Fuellerer et al. (2009). The costs of four different loading configurations were compared in this work.

The importance of the 2L-CVRP is mainly reflected in two aspects. Theoretically, composed of two NP-hard optimization problems (CVRP and 2BPP), it is also a high complexity NP-hard problem. For practical applications, this problem may exist at many companies. An efficient method to solve this problem can significantly reduce costs for the companies.

The purpose of the paper is to solve the 2L-CVRP efficiently. A simulated annealing metaheuristics is employed to solve the problem. As for the loading feasibility aspect, a new heuristic packing algorithm is used. When constructing the initial solution, a new, quicker method is introduced. In order to accelerate the algorithm, a Trie structure (Ferenc 2004; Zachariadis et al. 2009) is proposed to store the information of loading feasibility. The proposed methodology is tested on a 180 2L-CVRP benchmark data set introduced by Gendreau et al. (2008), and the results show that the proposed methodology is more efficient.

The rest of this paper is organized as follows. After the introduction, a clear detailed description of the problem is provided. In Sect. 3, the proposed algorithm is presented. Computational results are described in Sect. 4. Finally, conclusions are summarized.

2 Description of the problem

The 2L-CVRP is defined as follows. A completely undirected graph G is given. Let \( G = \{ V_{0} ,E\} \), in which \( V_{0} = V \cup \{ 0\} \) is a set of n + 1 vertices corresponding to the depot (vertices 0) and the customers (vertices \( 1,2, \ldots ,n \)) and E is the set of edges \( (i,j) \), \( (i,j \in V_{0} ) \). For each edge \( (i,j) \) \( \in E \), the associated traveling cost C ij is defined, which corresponds to the cost of transition from i to j. In the central depot, a set of K identical vehicles is available. Each vehicle has a weight capacity D and a rectangular loading surface of length L and width W. The loading surface is denoted as A = WL. Each customer i \( (i = 1,2, \ldots ,n) \) demands a set of m i rectangular items, denoted as IT i . Each item \( I_{ir} \in IT_{i} \) \( (r = 1,2, \ldots ,m_{i} ) \) has a specific length l ir and width w ir . In addition, we denote \( a_{i} = \sum\nolimits_{r = 1}^{{m_{i} }} {l_{ir} w_{ir} } \) as the total area of the items of customer i. The total weight of the items in the set IT i is equal to d i . The items have a fixed orientation. They must be loaded with their l-edges and w-edges parallel to the corresponding edges of the vehicle. Each set IT i must be loaded into a single vehicle. All customers must be served by using no more than K vehicles. In other words, each customer must be visited by one, and only one vehicle, once. Every vehicle starts from, and ends at, the central depot. The weight of the items loaded in a vehicle must not exceed the capacity of the vehicle D. All the items in a vehicle must be loaded in area A. Overlapping loading is not permitted. The 2L-CVRP is to find the minimum traveling cost of K vehicles.

The problem described in the previous paragraph is called the Unrestricted 2L-CVRP. There is another variant of the problem, called the Sequential 2L-CVRP. In the Sequential 2L-CVRP, an additional constraint is imposed. The additional constraint is as follows. When a vehicle is visiting customer i, all of the items in the set of IT i can be unloaded from the vehicle by means of forklift trucks parallel to the length dimension of the vehicle surface, without moving other items required by other customers. In this paper, we study both variants of the problem, the Unrestricted 2L-CVRP, and the Sequential 2L-CVRP.

3 The proposed algorithm

The proposed algorithm for the solution of the 2L-CVRP employs simulated annealing metaheuristics to explore the solution space, and to optimize the objective. Regarding loading constraints of the problem, the bundle of packing heuristics designed in Zachariadis et al. (2009) is used. We also add a new packing algorithm to the bundle. The efficiency of the added heuristic algorithm will be shown by experimental results. In Sect. 3.1, the packing heuristics bundle is introduced. In Sect. 3.2, the methodology for constructing the initial solution is proposed. In Sect. 3.3, the definition of three neighborhood structures is described. In Sect. 3.4, simulated annealing metaheuristics for the 2L-CVRP is developed. In Sect. 3.5, we discuss how to accelerate the algorithm.

3.1 The bundle of packing heuristics

Before altering the route-sequence of the customers, the loading feasibility must be checked. Six packing heuristics are employed. Five of them were used in Zachariadis et al. (2009). A brief review of them is given here; for detailed introduction, the reader is referred to Zachariadis et al. (2009). Then we focus on the newly added heuristic algorithm.

Given a route-sequence of customers \( C = (c_{1} ,c_{2} , \ldots ,c_{t} ),c_{1} ,c_{2} , \ldots ,c_{t} \in V \), customer c 1 will be visited first, then c 2, and c t the last. All corresponding sets of items \( IT_{{c_{i} }} ,(i = 1,2, \ldots ,t) \) must be loaded on the surface area of the vehicle A. In order to increase the probability of obtaining a feasible loading, two orderings \( (Ord_{Seq} ,Ord_{Un} ) \) of all items in sets \( IT_{{c_{i} }} ,(i = 1,2, \ldots ,t) \) will be generated and tested. The \( {\text{Ord}}_{Seq} \) ordering is produced by sorting the sets \( IT_{{c_{i} }} \) in the order of \( i = t,t - 1, \ldots ,2,1 \), and in each set \( IT_{{c_{i} }} \), sorting the items by decreasing surface area. The \( Ord_{Un} \) ordering is generated by simply sorting all items in sets \( IT_{{c_{i} }} ,(i = 1,2, \ldots ,t) \) by decreasing surface area.

For the first five heuristics, the items are selected for loading on the surface one by one, from the ordering. Available loading positions for the items are listed, in the list denoted as posList. In the beginning, posList = {(0, 0)}, only the bottom-left corner is the available loading position. After an item is loaded, its loading position is deleted from the posList, and a maximum of four new loading positions are generated and inserted into the posList. For instance, in Fig. 1, when item E is loaded, loading position (wc, la) is erased from the posList, while new loading positions (wc, la + le) (wc + we, la) (wd, la + le) and (wc + we, lb) are added to the posList.

Fig. 1
figure 1

Inserting an item into the loading surface

The position selected for an item must be feasible, which means when the item is loaded at the position, it should not lead to any overlaps (for both Unrestricted and Sequential problem versions), or sequence constraint violations (for the Sequential problem version). Each of the five heuristics has a different criterion to select a position, from available feasible positions, to load an item.

Heur1::

Bottom-Left Fill (W-axis) (Chazelle 1983) selects the one with the minimum W-axis coordinate, breaking ties by minimum L-axis coordinate.

Heur2::

Bottom-Left Fill (L-axis) (Chazelle 1983) gives priority to the one with the minimum L-axis coordinate, breaking ties by minimum W-axis coordinate.

Heur3::

Max Touching Perimeter heuristic (Lodi et al. 1999) selects the position where, if the item is loaded, it has the max total touching perimeter with the edges of the already loaded items, and the loading surface of the vehicle.

Heur4::

Max Touching Perimeter No Walls heuristic (Lodi et al. 1999) evaluates the total perimeter as the sum of the common edges of the item to be loaded, with edges of already loaded items, but not for edges common with the loading surface of the vehicle.

Heur5::

Min Area heuristic (Zachariadis et al. 2009) selects the one whose corresponding rectangular surface is the minimum.

Next, a novel heuristic Heur6 is introduced. In this heuristic, we check available positions from the lowest position to the highest position to place the remaining items. As shown in Fig. 2, the shaded area depicts areas where either items are already loaded, or area considered as wasted area. Let the horizontal line marked by the circle be the lowest available position. We try to place an item with the maximum fitness value in the area of S. The calculation of the fitness value is given in the following paragraphs. Let h 1 denote the height of the wall to the left of S, and h 2 denote the height of the wall to the right of S. In case h 1 ≥ h 2, the item will be placed at the left-bottom corner of S. For another case where h 1 < h 2, the item will be placed at the right-bottom corner of S. If all of the remaining items cannot be placed on the lowest position, the second lowest will be considered (see Fig. 3.). If there exists a remaining item whose height is larger than the height of S, the packing is considered unfeasible, and the heuristic algorithm is terminated.

Fig. 2
figure 2

The corner to place item

Fig. 3
figure 3

The second lowest position to

The question, then, is which kind of placement is better. It is obvious that a placement is good if it can decrease the number of corner positions. So the concept of fitness value is presented to evaluate whether a placement is good or not. If a placement can fit more corner positions, the corresponding rectangle for this placement is given a larger fitness value. We design the fitness value as follows.

  1. (1)

    In Fig. 4, item R is placed at the position marked by the circle. If the width of the item is equal to w, and its length is h 1, for case one, or h 2 for case two, the fitness value of R is 4.

    Fig. 4
    figure 4

    Fitness value = 4

  2. (2)

    In Fig. 5, if the width of item R is w, and its length is equal to h 2 for case one, or h 1 for case two, the fitness value of R is 3. Although Fig. 4 and Fig. 5 fit the same number of corners, we give the priority to Fig. 4. Because the items are always placed on the higher wall side, if a placement fit the higher wall, it is considered as a better placement.

    Fig. 5
    figure 5

    Fitness value = 3

  3. (3)

    In Fig. 6, if the width of item R is equal to w, and its length is equal to neither h 1 nor h 2, the fitness value of R is 2.

    Fig. 6
    figure 6

    Fitness value = 2

  4. (4)

    In Fig. 7, if the width of item R is not equal to w, and its length is equal to h 1 for case one, or h 2 for case two, the fitness value of R is 1.

    Fig. 7
    figure 7

    Fitness value = 1

  5. (5)

    In Fig. 8, if the width of item R is not equal to w, and the length of the item is not equal to h 1 for case one, or h 2 for case two, the fitness value of R is 0.

    Fig. 8
    figure 8

    Fitness value = 0

If there are more than two items having the same maximum fitness value, we give priority to the one having the maximum length.

As mentioned before, there are two different orderings, Ord Un and Ord Seq . When ordering Ord Un is put into Heur6, Heur6 selects the best fitting item from all of the item sets \( IT_{{c_{i} }} ,(i = 1,2, \ldots ,t) \). While for ordering Ord Seq , the items are loaded by the order of the item sets. Heur6 selects the best fitting item from item set \( IT_{{c_{t} }} \) first, and load it. When all items in set \( IT_{{c_{t} }} \) are loaded, it turns to item set \( IT_{{c_{t - 1} }} \), and so on, until all items are loaded.

All of the first five heuristics load the items one by one, according to the orderings. The sixth heuristic packing algorithm selects the best fitting item from the remaining items, so it may increase the probability of obtaining a feasible loading.

The given route sequence is checked by the six heuristics in the order presented (Heur1 comes first, while Heur6 will be the last). The two orderings, Ord Un and Ord Seq , are put into the packing heuristics for each version of the problem, i.e., the Unrestricted 2L-CVRP and the Sequential 2L-CVRP. If all packing heuristics fail to produce a feasible loading with these two orderings, the route examined is considered to be violative of loading constraints of the problem.

3.2 Constructing the initial solution

At first, all of the n customers are sorted in decreasing value of \( a_{i} (i = 1,2, \ldots ,n) \), and the sequence is recorded in \( OrdCustomer_{i} (i = 1,2, \ldots ,n) \). The unoccupied loading surface of each vehicle is calculated and denoted as \( freeArea_{i} (i = 1,2, \ldots ,K) \). Customers are selected successively, to be inserted into the routes one by one, according to the ordering \( OrdCustomer \). The feasibility of inserting a customer c into every position of every route is checked. If a customer c can be inserted into a set of feasible routes, its items are assigned to be loaded by the vehicle with the minimum \( freeArea \), and inserted into the corresponding route at the position that leads to the minimum cost increase. If it comes up against a customer \( OrdCustomer_{t} \) who cannot be inserted into any of the K routes, it is exchanged with \( OrdCustomer_{j} \) (j is selected randomly from 1 to t−1). Then the construction is tried again with the new ordering \( OrdCustomer \).

Feasible initial solutions for all Unrestricted and Sequential 2L-CVRP problem instances can be constructed by this method very quickly.

3.3 Three neighborhood structures

To move from the current to the subsequent solution, we use three types of moves. Each of them defines a neighbourhood structure NS i (i = 1,2,3). These three structures are also used by Zachariadis et al. (2009). A neighbourhood structure is selected randomly out of the three in the same probability, and the subsequent solution is a stochastically feasible solution among the neighbourhood solutions of this type.

NS 1 :

customer relocation (Waters 1987): in this type, a customer is relocated to another position of the current solution.

NS 2 :

route exchange (Waters 1987): in this type, a pair of customers exchange their positions in the current solution.

NS 3 :

route interchanging (Croes 1958; Lin 1965): in this type, a pair of customers is selected. If they are in the same route, positions of customers between them including themselves are reversed. In the other case, when they are in different routes, the part of the first route, before the selected customer, is connected to the part of the second route, after the other selected customer, including itself, and vice versa.

3.4 The simulated annealing metaheuristics for the 2L-CVRP

Simulated annealing (SA) is an algorithmic approach for solving combinatorial optimization problems (Kirkpatrick et al. 1983; Cerny 1985). Simulated annealing randomizes the local search procedure, and, in some instances, allows for solution changes that worsen the solution. This constitutes an attempt to reduce the probability of becoming trapped in a locally suboptimal solution. The probability of accepting a worsened solution is determined by a control parameter (T), called temperature. At the beginning of the algorithm, T is assigned an initial value T 0. The deterministic cooling schedule is designed according to the following formula:

$$ T_{k} = 0.9T_{k - 1} $$

The simulated annealing algorithm attempts to transform the current solution S cur into one of its neighbors S new . This process can be modeled as a Markov chain. For each temperature value, we get one Markov chain. The length of each Markov chain, denoted as Len, is a parameter of the algorithm that needs tuning. In Len iterations, if the cost of the new solution is less than the current solution, the new solution is accepted unconditionally. If the cost of the new solution is higher than the current solution, the probability to accept the new solution is P.

$$ P = \exp \left( {{\frac{{\cos t(S_{cur} ) - \cos t(S_{new} )}}{T}}} \right) $$

If a solution remains unchanged for 2*Len iterations, the algorithm is terminated.

3.5 Accelerating the algorithm

In order to accelerate the algorithm, a Trie is employed to record the loading feasibility of routes already examined. This strategy helps avoid unnecessary calls to the packing heuristic bundle. To ascertain if a given route violates the loading constraints of the problem, first, it is checked whether it is in the Trie tree. If it is in the tree, the feasibility of the route is given by the tree. If not, the heuristic bundle is executed and the result is inserted into the Trie tree. For a large scale instance, the physical memory required for storing the loading information may exceed the available memory. So before inserting a route into the Trie tree, the percent of memory in use is queried. If it exceeds a threshold, the tree is destructed, and rebuilt.

4 Computational results

We have implemented the algorithm in C++ and run it on a 2.4 GHz Core Duo notebook with 2,048 MB RAM under Windows XP. In order to verify the performance of the proposed algorithm, the proposed algorithm was tested by 360 2LCVRP (180 for the Unrestricted and 180 for the Sequential version of the problem) benchmark problem instances from the literature (Iori 2004; Iori et al. 2007; Gendreau et al. 2008; Zachariadis et al. 2009). The datasets are available at http://www.or.deis.unibo.it/research.html.

These instances were derived from 36 classical CVRP instances, whose description can be found in Toth and Vigo (2002a). The customer demands, which are a set of two-dimensional, weighted and rectangular items, are expressed into the instances. Each of the 36 instances has five classes of item sets. In Class 1, each customer is assigned one item with unit width and length. In Classes 2–5, the number of items, demanded by customer i, m i is generated by a uniform distribution on a certain interval (see Table 1, column 2). Each item is classified into one of the three shape categories, with equal probability. The three categories are vertical (the relative lengths are greater than the relative widths), homogeneous (the relative lengths and widths are generated in the same intervals), and horizontal (the relative lengths are smaller than the relative widths). The dimensions (width and length) of an item are uniformly distributed into the ranges determined by this item’s shape category (see Table 1, columns 3–8). The values L = 40 and W = 20 were chosen for the dimensions of the loading area. The numbers of customers and items, in the instances for Classes 2–5, are shown in Table 2. For details of the datasets, the reader is referred to Gendreau et al. (2008) and Zachariadis et al. (2009).

Table 1 The characteristics of items of classes 2–5 instances
Table 2 The characteristics of Classes 2–5 instances

There are only two parameters, the initial value T 0 , and the length of each Markov chain Len, in the proposed algorithmic framework. The values of them were determined through an extensive calibration procedure. In order to cover cases with diverse customer set sizes and item characteristics, 30 problems (instances 6, 12, 24, 30, 36, Classes 1–5) were tested by the proposed algorithm with different parameters values. The experiment results are summarized in Table 3. In the table, the results are the average of 30 problems. There is no obvious correlation between the two parameters. So we valued each of them separately. After extensively calibration tests, known from Table 3, the appropriate value for T 0 is set as 10, and 20,000 for Len.

Table 3 Calibration experiment results for the parameters

We compare our proposed algorithm with Tabu search (TS) algorithm (Gendreau et al. 2008), guided Tabu search (GTS) algorithm (Zachariadis et al. 2009), and ant colony optimization (ACO) algorithm (Fuellerer et al. 2009). The TS was coded in C and tested on a Pentium IV 1.7 GHz. The GTS was coded in Visual C#, executed on a Pentium IV 2.4 GHz with 1 GB of RAM under Windows XP. The ACO was coded using ANSI C++ and performed on a Pentium IV 3.2 GHz.

The results are shown in Tables 4, 5, 6, 7. In these tables, the SA is the proposed algorithm, s is the average value of the solution obtained, %gap is the percent improvement over the corresponding algorithm solution value, and tot is the total time required for processing the algorithm (in seconds).

Table 4 Computational results on the pure CVRP instances of Class 1
Table 5 Computational results for the Unrestricted 2L-CVRP (Classes 2–5)
Table 6 Computational results for the Sequential 2L-CVRP (Classes 2–5)
Table 7 Computational results of SA and ACO (Classes 1–5)

As can be seen in Tables 4, 5, 6, 7. Table 4 reports the results obtained on the pure CVRP instances. The solution values achieved by the SA and GTS are almost the same, on average. They are better than that achieved by the TS. But for the more difficult problems in Classes 2–5, the proposed algorithm beats the TS and GTS. As shown in Tables 5 and 6, for the Unrestricted 2L-CVRP, the SA achieved on average 3.19% improvement over the TS, 1.38% over the GTS, and in all of the instances, except Instance 6, SA achieved a better solution than the GTS. While for the Sequential 2L-CVRP, the improvement was 3.57% over TS, and 2% over GTS on average, and also only in one instance (Instance 8), the solution of the proposed algorithm was defeated by the GTS. As demonstrated in Tables 4, 5, 6, 7 all of the instances can be solved by SA within 1.5 h. So the executing time is acceptable.

The GTS produced solutions with higher average quality compared to those obtained by TS. So we focused on the comparison between the proposed algorithm SA and GTS. Figure 9 shows the percent improvement of SA over GTS. The x-axes displays instances 1–36, and the y-axes denotes the improvement. As known from the figure, for the larger scale instance, the performance of the SA is the better. For the more complex, the more constraints problem, from the CVRP, to the Unrestricted 2L-CVRP, and then the Sequential 2L-CVRP, the SA is more efficient.

Fig. 9
figure 9

The percent improvement of SA over GTS

The performance of the proposed algorithm SA with respect to ACO is shown in Table 7, where the runtime limit of ACO is 3,600 s. ACO performs better than SA for the Unrestricted 2L-CVRP on average, while SA performs better than ACO for the Sequential 2L-CVRP on average. In particular, for the Unrestricted 2L-CVRP and the Sequential 2L-CVRP, the average running time of SA (Core Duo notebook, 2.4 GHz) on Classes 1–5 is 298.5 and 463.1 s, respectively, while that of ACO (Pentium IV, 3.2 GHz) is 902.0 and 1067.7, so SA computes faster than ACO. In addition, for the sequential instances with the number of customers more than 100, SA consistently outperforms ACO.

In order to demonstrate the efficiency of the proposed packing algorithm Heur6, we design tests for the problems, using the heuristics bundle that includes Heur6, for comparing it with the bundle that does not include Heur6. The results are shown in Table 8, where s, tot and %gap are as before. The results are improved by 1.17% for the Unrestricted 2L-CVRP and 1.35% for the Sequential 2L-CVRP on average. It can be noted that adding packing algorithm Heur6 in SA is not necessary to increase the computational time. It can be explained as follows: In the SA metaheuristics, there are a number of iterations. In each iteration, packing heuristics Heur1, Heur2, …, and Heur6 (as Heur1 comes first, while Heur6 will be the last) will be involved. Moreover, Heur6 is able to increase the number of feasible solutions in the neighbourhoods of current solution in each iteration of SA. Hence, in each iteration, with the feasible solutions obtained by Heur6 in previous iteration, a better solution may be obtained. Finally, the total number of iterations of SA may be reduced. That is why the total executing time may be decreased by using packing heuristics Heur1 to Heur6. After adding the packing algorithm Heur6, for each Unrestricted 2L-CVRP instance, the average time required by SA decreases from 410.0 s to 347.9 s, while for the Sequential 2L-CVRP instance, it increases from 543.1 s to 553.6 s. So adding the proposed packing algorithm Heur6 improved the performance of SA algorithm without taking much more total computational time for processing the whole algorithm.

Table 8 Computational results of two packing heuristics (Class 2–5)

The results obtained by the proposed algorithm for all tests are reported in Tables 9 and 10 of the Appendix.

Table 9 Results obtained for the Unrestricted 2L-CVRP
Table 10 Results obtained for the Sequential 2L-CVRP

5 Conclusions

In this paper we have examined two versions of the 2L-CVRP, the Unrestricted 2L-CVRP and the Sequential 2L-CVRP. To the best of our knowledge, it is the first time for the simulated annealing metaheuristics to be used in this problem. From the computational results, it is shown that SA achieves good results. A new packing heuristic algorithm is introduced, whose efficiency is showed by the experiment results. For constructing the initial solution, a stochastic algorithm is employed. The future work is to further improve the performance of this algorithm, especially for Class 1, and extend it to solve the capacitated vehicle routing problem with three-dimensional loading constraints.