Abstract

The capacitated vehicle routing problem (CVRP) is an NP-hard problem with wide engineering and theoretical background. In this paper, a hybrid bat algorithm with path relinking (HBA-PR) is proposed to solve CVRP. The HBA-PR is constructed based on the framework of continuous bat algorithm; the greedy randomized adaptive search procedure (GRASP) and path relinking are effectively integrated into bat algorithm. Moreover, in order to further improve the performance, the random subsequences and single-point local search are operated with certain loudness (probability). In order to verify the validity of the method in this paper, and it's efficiency and with other existing methods, several classical CVRP instances from three classes of CVRP benchmarks are selected to tested. Experimental results and comparisons show that the HBA-PR is effective for CVRP.

1. Introduction

The vehicle routing problem (VRP) is a classical combinatorial optimization problem that was proposed in the late 1950s, and it is still a research hotspot in the field of Operations Research. The capacitated vehicle routing problem (CVRP) is introduced by Dantzig and Ramser in 1959 [1], which designs a set of customer demands that have to be served with a fleet of vehicles from a depot or central node, each vehicle has the uniform capacity, and each customer has a certain demand that must be satisfied at minimal cost. These costs usually represent distances, traveling times, number of vehicles employed, or a combination of these factors.

It is known that the CVRP is an NP-hard problem [2]. Various approaches have been presented to solve the CVRP during the last decades, such as linear programming [3], several metaheuristics [46], and many hybrid heuristics with variable neighborhood search or constructive heuristic methods [710]. The overview of methods presented in [6] shows that at least 29 different methods for the CVRP exist; all achieve more or less comparable performance. Although several methods can produce good solutions, the computational time is long when the scale of instances is large. Meanwhile, an abundance of methods for the CVRP is a population-based algorithm and the parameter setting of the algorithm, is pretty important; however, the parameter setting of many metaheuristics is not considered in the literature.

Bat algorithm (BA) is a fairly new metaheuristics proposed by Yang [11] in 2010, which inspired by the intelligent echolocation behavior of microbats when they forage. As we know, many new metaheuristics have been widely used and successfully applied to solve the CVRP notwithstanding BA has not yet been applied to solve the CVRP, and BA has been applied to solve other problems with great success. For example, Gandom et al. focus on solving constrained optimization tasks [12]. Yang and Gandom apply bat algorithm to solve many global engineering optimizations [13]. A classification mode is proposed by Mishra et al. using bat algorithm to update the weights of a functional link artificial neural network (FLANN) classifier [14]. Meanwhile, some researchers have improved bat algorithm and applied it to various optimization problems. Xie et al. proposed a DLBA bat algorithm based on differential operator and Lévy flights trajectory to solve function optimization and nonlinear equations [15]. Wang et al. proposed a new bat algorithm with mutation (BAM) to solve the uninhabited combat air vehicle (UCAV) path planning problem [16]. In this paper, we propose a hybrid bat algorithm (HBA-PR) to solve capacitated vehicle routing problem.

The rest of this paper is organized as follows. The problem description of CVRP and original bat algorithm are described in Section 2. The hybrid bat algorithm (HBA-PR) for CVRP is described detailedly in Section 3. The experimental results of the HBA-PR and comparisons with other previous algorithms are shown in Section 4. In the last section, we conclude this paper and point out some future work in Section 5.

2. Problem Descriptions and Bat Algorithm

2.1. Capacitated Vehicle Routing Problem

The CVRP is considered to be the classical version of the VRP, which designs a set of customer demands that have to be served with a fleet of vehicles from a depot or central node, each vehicle has the uniform capacity, and each customer has a certain demand. The objective makes the expended cost as minimal as possible. Let be a complete graph with a set of vertices , where the vertex represents the depot and the remaining ones represent the customers. Each edge has a nonnegative cost , and each customer has a demand . Let be the set of homogeneous vehicles with capacity . The CVRP consists in constructing a set of up to routes in such a way that (1) every route starts and ends at the depot; (2) all demands are accomplished; (3) the vehicle’s capacity is not exceeded; (4) a customer is visited by only a single vehicle; (5) the sum of costs is minimized. The mathematical formulas are defined as follows [10]: where denotes the number of vehicles; if vehicle is from to , otherwise ; the if vehicle is loading (active), otherwise .

2.2. Basic Bat Algorithm

The basic bat algorithm (BA) is a metaheuristic first introduced by Yang in 2010. In simulations of BA, under several under idealized rules, the updated rules of bat’s positions and velocities in a -dimensional search space are defined. The new solutions and velocities at generation are given by where is a random vector drawn from a uniform distribution and denotes frequency of each bat. Generally, the frequency . Here is the current global best location (solution) which is located after comparing all the solutions among all the bats.

After the position updating of bat, a random number is generated; if the random number is greater than the pulse emission rate , a new position will be generated around the current best solutions; it can be represented by where is a random number, while is the average loudness of all the bats at current generation .

Furthermore, the loudness and the pulse emission rate will be updated, and a solution will be accepted if a random number is less than loudness and . and are updated by where , are constants and is fitness function. The algorithm repeat until the termination criterion is reached.

3. Hybrid Bat Algorithm with Path Relinking for CVRP

3.1. Solution Representation in HBA-PR

Since standard BA is a continuous optimization algorithm, the standard continuous encoding scheme of BA cannot be used to solve CVRP directly. In order to apply BA to solve CVRP, the first step is to devise a suitable representation for the candidate solutions in designing a hybrid bat algorithm for a particular problem. Each individual is a sequence with integer number which is the order of visiting these customers; the 0 represents the depot. For example, if we have the following three routes:xy(6) the coded individual with integer is , and the bat individual is represented as .

3.2. Hybrid Bat Algorithm

Aimed at the capacitated vehicle routing problem, based on the idea of bat algorithm, a hybrid bat algorithm is proposed, which integrates greedy randomized adaptive search procedure (GRASP) heuristic and bat algorithm, and the path relinking as an intensification strategy to explore local trajectories connecting elite solutions obtained by the proposed algorithm. The hybrid bat algorithm with path relinking is named as HBA-PR.

GRASP [17, 18] is a heuristic already applied to many optimization problems successfully [1921]. GRASP consists of a two-phase iterative process: construction phase and local search phase. In the first phase, a greedy randomized solution is built. Due to this solution is not guaranteed to be locally optimal; a local search is performed in the second phase. The final result is simply the best solution found over all iterations.

The construction phase can be described as a process which stepwise adds one element at a time to a partial (incomplete) solution. According to a greedy function, all elements are sorted, and the Restricted Candidate List (RCL) is constructed based on the order, and then from the list randomly select a element. In the second phase, a local search is initialized from these points, this iterative process is repeated until a termination criterion is met, and the best solution found over all iterations is taken as the result.

RCL is created using a parameter to restrict the size of this list. Candidate is sorted according to their greedy function value . In a cardinality-based RCL, the latter is made up by the top-ranked elements. In a value-based construction, the RCL consists of the elements in the set , where , , and . Since the best value for is often difficult to determine, a random value is often assigned. The values for adopted in the constructive heuristics are set using reactive strategies, which usually leads to better performance than using fixed values [22].

In original bat algorithm, the bat individual randomly selects a certain range of frequency, its velocity is updated according to their selected frequency, and at last a new position is generated using its velocity and its own position. The idea is that the position of bat individual is updated by adjusting its frequency of sonic pulse. In this paper, the position updating of bat adopted GRASP to generate a new position, the frequency is used for restricting the size of CRL, frequency equivalent to parameter in GRASP, and the frequency is variable value. In basic bat algorithm, the loudness and the pulse emission rate are updated according as the iterations proceed. As the loudness usually decreases, while the rate of pulse emission increases, it indicates that the bats approximate their prey (optimum solution). The pulse emission rate is updated by where denotes the th generation and is the maximal generation. The rate is similar to Sigmoid function, and the frequency is determined according to the pulse emission rate , which is represented by where is a random number and 0.2 and 0.8 are experience parameters reference [18]. The frequency decreases gradually at firstly and then increases gradually, while the generation increases. Figure 1 is the changing curve of rate , Figure 2 is an example of frequency , and Algorithm 1 shows the pseudocode of greedy randomized construction with frequency .

  rand_Chosen_Vertex( );  // R is selected at random a vertex as initial solution
; // The candidate set is initialized
While       do
    _Incremental_Costs( ); //  the incremental costs are evaluated
    ;
    ;
    ;  // is created
    _Element (RCL); // a vertex is randomly selected from
    _Min_Solution( , ); // the partial tour is updated by inserting the
    vertex
    ; // the candidate set is updated
end
return   

The local search phase uses the 2-Opt heuristic for exchanging. Algorithm 2 shows the local search procedure. The input parameter is an initial solution obtained by the Greedy_Randomized_Construction procedure. The current route need is divided into subroute according to the load, set the start, and end of suroute said to 0; for example, , subroute is , and .

;
_Sub-route( );
for each sub-route do
-opt ( ); // carry out the 2-opt operation
end
_Indiviaual ;
if ( ( )   then
  
end
return   

3.3. Hybrid Bat Algorithm with Path Relinking

Path relinking was originally proposed by Glover [23]; Laguna and Martí [24] were the first to use path relinking within a GRASP strategy. Path relinking generates new solutions by exploring trajectories connecting an initial solution to an elite guiding solution . The path relinking procedure consists in selecting moves that introduce attributes contained in the guiding solution to the initial solution until the initial solution is completely transformed in the guiding solution . Path relinking may also be viewed as a constrained local search strategy applied to the initial solution . Furthermore, there are several alternatives that have been considered, which involve tradeoffs between computation time and solution quality. These alternatives include periodical relinking, forward relinking, backward relinking, back and forward relinking, mixed relinking, randomized relinking, and truncated relinking [18].

One important issue in implementing a path relinking technique is the strategy to construct the elite set (ES). We adopted a fixed size elite set, and a solution is inserted into the ES as follows.

A solution is always inserted into ES if it is not full. Otherwise, the generated solution is inserted in ES only if its cost is better than the worst cost solution found in ES, and the worst cost solution is replaced by the solution . Algorithm 3 shows the pseudocode for the algorithm to construct and maintain the elite set ES.

ifcardinality( ) then  // is the population size
else
worst solution in
  if then
      
      
  end
end
return   

Algorithm 4 shows the pseudocode of path relinking procedure; an instance is , , according to process of Algorithm 4, the first different element is position 2 in ; after executing replace operation, the ; the second different element is position 3 in ; after executing replace operation, the ; the third different element is position 4 in ; after executing replace operation, the ; if the is better than the , and the only, then return .

; // initial solution
; //  guiding solution
;
( ); // find out the difference position between
for :  cardinality( ) do
_Position( ); // find the position of the element of   in which in
( ); // replace the   position of   with the  element of   in
( );  //replace the   position of   with the corresponding element of
  if       then
   ;
    ;
  end
end
return   

3.4. Subsequence and Single-Point Local Search

In this paper, the loudness of bat individual is relative to its own fitness , the better fitness, and the lower loudness. The loudness can be described by where constant 0.1 is used for avoiding the denominator is zero, and is the fitness of individual , and are the minimum and maximum fitness in current population, respectively. In HBA-PR, the loudness reflects the quality of individual. In this algorithm, there are two kinds of local search are embedded into HBA-PR to further improve the performance, random subsequence local search that and single-point local search. The random subsequence local search includes random subsequence inverse and random subsequence insert, and the single-point local search includes single-point insert and single-point swap.

For random subsequence insert, firstly, randomly selected an origin of subsequence, and then randomly selected a length of subsequence which is less than length of individual . Secondly, after determining the subsequence , randomly selected an insert point in remainder subsequence , ; the is inserted into location in insert point. An example is shown in Figure 2. For random subsequence inverse, firstly, randomly selected a subsequence with random length, and then the inverse operation is performed. An example is shown in Figure 3.

For single-point swap, choose two different positions from a permutation randomly and swap them. For single-point insert, choose two different positions from a permutation randomly, and the element in first position is insert into the back of second element. Similarly, two instances are shown in Figures 4 and 5.

In local search part, the random subsequence local search is performed before random single-point local search. The random subsequence insert and random subsequence inverse are preformed according to loudness . In other words, if a random number is greater than the loudness , the random subsequence insert is performed; otherwise, the random subsequence inverse is performed. Similarly, the random single-point insert and random single-point swap are performed with the loudness . If a random number is greater than the loudness , the insert operation is performed (Figure 6); otherwise, the swap operation is performed. Note that where local search is operated on the current optimal individual in elite set ES, local search is performed for each individual. Algorithms 5 and 6 show the pseudocode of subsequence and single-point local search.

for :  psdo
 if    then
    -sequence_Insert( ); // perform random sub-sequence insert operation
 else
    -sequence_Inverse( ); // perform random sub-sequence inverse operation
 end
end
return   

for :  ps do
  if then
     -point_Insert( );  //  perform random single-point insert operation
  else
     -point_Swap( ); // perform random ingle point swap operation
  end
end
return   

3.5. HBA-PR Framework for CVRP

We propose in this work, to incorporate greedy randomized adaptive search procedure, path-relinking strategies, subsequence, and single-point local search to the bat algorithm by defining distinct ways to solve capacitated vehicle routing problem. This iterative process is repeated until the termination criterion is met; Algorithm 7 shows the pseudocode of HBA-PR for CVRP.

(1) Initialize the ,  bat population and other parameters;
(2) Evaluate fitness for each individual;
(3) _Set( );
(4) while     do
(5)  Compute pulse emission rate by (7);
(6)  Determine frequency by (8);
(7)  for :  ps do
(8)     _Randomized_Construction( );
(9)     _Search_Phase ;
(10)  end
(11)  Evaluate fitness for each individual ;
(12)   _Set( );
(13)   _Best_Elite( ); // select the best individual in elite set
(14)  for :   do
(15)     _Relinking( ,   );
(16)  end
(17)  Evaluate fitness for each individual ;
(18)   _Set( );
(19)   _Loudness( ( )); //Compute loudness of each individual by (9);
(20)   _Best_Elite( );
(21)   -sequence_Local_Search   //carry out random sub-sequence local
   search
(22)  Evaluate fitness for each individual ;
(23)   _Set( );
(24)   _Best_Elite( );
(25)   -point_Local_Search   //carry out random single-point local search
(26)  Evaluate fitness for each individual ;
(27)   _Set( );
(28)  
(29) end
(30) Output result and plot

4. Numerical Simulation Results and Comparisons

To test the performance of the proposed HBA-PR which is extensively investigated by a large number of experimental studies computational simulations are carried out with some well-studied problems taken from the web http://www.branchandcut.org/, a reference site which contains detailed information regarding a large number of benchmark instances. In this paper, 12 instances from three classes of benchmarks are selected. The first class is Augerat et al. Set A instances, the second class is Augerat et al. Set P instances, and the third class is Augerat et al. Set E instances. So far, these problems have been widely used as benchmarks to certify the performance of algorithms by many researchers.

All computational experiments are conducted with MATLAB 2012a, and in our simulation, numerical experiments are run on a PC with AMD Athlon (tm) II X4 640 Processor 3.0 GHz and 2.0 GB memory. In the experiment, the termination criterion is set as maximum generation . Each instance independently run15 times for comparison.

4.1. Parameter Analysis

In the subsection, parameters of HBA-PR are determined by experiments, and the impact of each parameter is analyzed. In particular, the HBA-PR has few parameters; we only need to test population size () in HBA-PR. A small which may lead to insufficient population information is provided, and the diversity cannot be guaranteed. On the other side, a large one which indicates diversity is sufficient, but the computing time will increase and the precision of optimal solution may have lesser improvement. In order to evaluate the sensitivity of parameters , three benchmarks selected from different benchmark set are chosen to run 10 times. These benchmarks are A_n33_k5, E_n23_k3 and P_n19_k2, and the statistical result and convergence curves are shown in Figures 7, 8, 9, and 10.

The ordinate normalized fitness (log) in Figures 810 is logarithm of normalized fitness; the aim is to show the convergence curves clearly. The normalization formula of fitness is , where is the best-known solution, and is the initial fitness.

Figure 7 represents the relative error of test case A_n33_k5, E_n23_k3, and P_n19_k2 after 10 times independent running, which shows the sensitivity of parameter . From the three test cases, the parameter can be determined. For A_n33_k5 and P_n19_k2, the performance of HBA-PR is better when . For E_n23_k3, that is equal to 50 is best, but the performance is good as well, while . From Figures 810, the information provided by population is sufficient when is greater than 20; however, the convergence rate is better when among the three instances. Considering the tradeoff between the stability of algorithm and the rate of convergence, the parameter takes a compromise values, .

4.2. Comparisons of Simulation Results

In order to show the effective of HBA-PR, we carry out a simulation to compare HBA-PR with other state-of-art algorithms, that is, a parallel version of the classical Clarke and Wright Savings (CWS) heuristic and SR-GCWS (Simulation in Routing via the Generalized Clarke and Wright Savings heuristic) proposed by Juan et al. [9], CS-GRASP proposed by Zheng et al. [10]. Results of these simulations are summarized in Table 1, which contain the following information of each instance: vehicle capacity; tightness (demand/capacity); I_BKS is integral best-known solution (BKS) or “optimal” value according to the web http://www.branchandcut.org/; R_BSK is verifies real costs for the best-known solution according to [9]; CWS is the costs associated with the solution given by the parallel version of the CWS heuristic; SR-GCWS is the best solution obtained by SR-GCWS method; HBA-PR is our best solution, where “—” represents no records in the literature.

From the simulationresults obtained by testing HBA-PR, it demonstrates that using the proposed HBA-PR to solve the CVRP is effective, and the performance of HBA-PR is prominent. From Table 1, all instances achieved a good quality solution, and solutions of 6 instances are better than the best-known solution (“optimal” value). HBA-PR has matched 10 of the 12 best-known solutions except for P_n51_k10 and A_n39_k6, and the average deviation from the real costs best-known solution is 0.057%. HBA-PR outperforms CWS for the 12 instances. Comparing with CS-GRASP and HBA-PR, HBA-PR outperforms CS-GRASP in terms of A_n33_k5, A_n33_k6, and E_n23_k3; the other instances have same results. The SR-GCWS and HBA-PR have similar results, and the gap is very small.

Furthermore, Figure 11 shows the best solution found so far by using our methodology for the A_n37_k5.vrp file, where the depot (using 1 instead of 0) is at the center. Analogously, Figures 12 and 13 show the best solution found by HBA-PR for the E-n51-k5.vrp file and P_n51_k10.vrp file. The convergence curve for some test problems has been shown in Figure 14. From Figure 14, for instance, A_n37_k5, it converges to an optimal solution after 43 generation, and it expends about 170 generations, for instance, E-n51-k5 and P_n51_k10 when algorithm converges to an optimal solution, which demonstrate that the HBA-PR has a faster convergence rate.

In general, the proposed HBA-PR can produce good solutions when compared with existing heuristics for solving the CVRP, and the convergence rate of HBA-PR is faster. These results seem to indicate that the hybrid bat algorithm with path relinking is an alternative to solve the capacitated vehicle routing problem.

5. Conclusions

The capacitated vehicle routing problem is important in the fields of Operations Research, which is an NP-hard problem. Bat algorithm is a continuous metaheuristics; it cannot be used to solve the CVRP directly. In this paper, a hybrid bat algorithm with path relinking (HBA-PR) for solving the CVRP has been presented. This methodology, which does not require any particular fine tuning of parameters or configuration process, combines the classical greedy randomized adaptive search procedure (GRASP) with bat algorithm; the path relinking as an intensification strategy to explore local trajectories connecting elite solutions obtained by proposed algorithm; subsequence and single-point local search are effectively integrated into HBA-PR. Results show that our methodology is able to provide fine-quality solutions which can compete with the ones provided by some exact and heuristic approaches. Moreover, because of its simplicity and flexibility, we think that this methodology can easily be adapted to other variants of the vehicle routing problem and even to other combinatorial problems, for example, the vehicle routing problem with time window and traveling salesman problem, which is our further work.

Acknowledgments

This work is supported by National Science Foundation of China under Grant no. 61165015, Key Project of Guangxi Science Foundation under Grant no. 2012GXNSFDA053028, Key Project of Guangxi High School Science Foundation under Grant no. 20121ZD008, the Funded by Open Research Fund Program of Key Lab of Intelligent Perception and Image Understanding of Ministry of Education of China under Grant no. IPIU01201100, and the Innovation Project of Guangxi Graduate Education under Grant no. YCSZ2012063.