 Research
 Open Access
 Published:
Modified artificial bee colony for the vehicle routing problems with time windows
SpringerPlus volume 5, Article number: 1298 (2016)
Abstract
The natural behaviour of the honeybee has attracted the attention of researchers in recent years and several algorithms have been developed that mimic swarm behaviour to solve optimisation problems. This paper introduces an artificial bee colony (ABC) algorithm for the vehicle routing problem with time windows (VRPTW). A Modified ABC algorithm is proposed to improve the solution quality of the original ABC. The high exploration ability of the ABC slowsdown its convergence speed, which may due to the mechanism used by scout bees in replacing abandoned (unimproved) solutions with new ones. In the Modified ABC a list of abandoned solutions is used by the scout bees to memorise the abandoned solutions, then the scout bees select a solution from the list based on roulette wheel selection and replace by a new solution with random routs selected from the best solution. The performance of the Modified ABC is evaluated on Solomon benchmark datasets and compared with the original ABC. The computational results demonstrate that the Modified ABC outperforms the original ABC also produce good solutions when compared with the bestknown results in the literature. Computational investigations show that the proposed algorithm is a good and promising approach for the VRPTW.
Background
Many real transportation logistics and distribution problems can be expressed as a vehicle routing problem, where the objective is to plan a route with minimum cost while serving a set of customers with known demands. Each customer is allocated to only one route and the total demand of any route must not exceed the vehicle capacity.
The vehicle routing problem with time windows (VRPTW) is a wellknown optimisation problem and it has received a lot of consideration in the literature. The VRPTW involves determining a set of routes starting and ending at a depot, wherein the demand of a set of geographically scattered customers is satisfied. Each route is traversed by a vehicle with a permanent and limited capacity, and each customer needs to be visited only once. The total demand (load) delivered in each route should not exceed the vehicle’s capacity. Time windows are imposed for the customer destinations, meaning that the vehicle is only permitted to arrive at/depart from a customer destination within a specific time window. The solution to the VRPTW consists of the set of routes that has the least total travelled distance (Desrochers et al. 1988a, b). Surveys papers in VRPTW can be founded in Kumar and Panneerselvam (2012), Bräysy and Gendreau (2005a, b), Ioannou et al. (2001), Toth and Vigo (2001), Toth and Vigo (2014) and Solomon and Desrosiers (1988).
Observations on the swarm behaviour of natural selforganised systems has attracted researchers’ attention in recent years and inspired the development of algorithms for solving reallife problems; these algorithms are known as swarm intelligence. Examples of swarm intelligence that have been applied to the VRPTW are bee colony optimisation (Jawarneh and Abdullah 2015), ant colony optimisation (Gambardella et al. 1999; Yu et al. 2009) and particle swarm optimisation (Amini et al. 2010). A swarm intelligence algorithm simulates the behaviour of the selforganised system. In particular, the behaviour of real honeybees has motivated researchers to develop metaheuristics that model such behaviour in order to find better solutions for optimisation problems. Honeybee algorithms are classified into three different types based on behaviour (Baykasoglu et al. 2007): foraging, marriage and queen bee. The algorithms that are based on the foraging behaviour of honeybees to solve optimisation problems are the artificial bee colony (ABC), bee algorithm (BA) and bee colony optimisation (BCO). The bees in these three algorithms have different behaviour models. In this paper, the focus is on the ABC algorithm.
The ABC algorithm was proposed Karaboga (2005) for solving numerical optimisation problems. A further updated version of the ABC algorithm was later proposed by Karaboga and Basturk (2008) for solving constraint optimisation problems, Szeto et al. (2011) introduced an artificial bee colony heuristic for solving the capacitated vehicle routing problem (CVRP) and they show that the enhanced ABC algorithm outperforms the original one, and can produce good solutions when compared with other heuristics. The ABC algorithm works based on local communication between three groups of bees (scouts, employed and onlookers) and between each other about their environment, which contributes to the collective intelligence of the bee colony (Karaboga 2005).
In this paper, a new approach is proposed to improve the convergence speed of the ABC algorithm by introducing a method of finding abandoned solutions and replacing them with new solution that has a random routs selected from the best solution found so far. Experimental results show that the proposed Modified ABC algorithm improves the results. Overall comparison indicates that our Modified ABC algorithm is able to obtain the best results in comparison to stateoftheart approaches, as represented by reducing the distance travelled, which is the main objective of the VRPTW.
This paper starts with representation of the VRPTW and its formulation. Next, introduction of the ABC algorithm and the modified ABC algorithm are presented. At last, the experimental results are presented and analysed.
Vehicle routing problems with time windows (VRPTW)
The VRPTW consists of a set of identical vehicles, a depot node, a limited number of distributed customers, and a net connecting all the customers to the depot. Solomon (1987) proposes the formulation of the VRPTW, Solomon’s benchmark has 56 instances with 100 customers must be served by a predefined number of vehicles. Each arc in the network shows a connection between two nodes and identifies the direction of travel. Every vehicle starts from the depot, arrives at some customer destinations, and then returns to the depot. Every vehicle illustrates one route in the network. In Solomon’s benchmark, the cost c _{ ij } and the travel time t _{ ij } are linked with every arc in the network; the vehicle spends one unit of time to travel one unit of distance (Euclidean distance).
Every vehicle has the same capacity and each customer must be visited one time only by one of the vehicles and has an identified demand, and the total capacity of all the demands must be equal or less than the maximum capacity of the vehicle on the route being travelled, and no vehicles should be overloaded. The time window constraints are indicated by a predefined time interval, i.e., the earliest arrival time and latest arrival time, where the vehicle must arrive at the customer before the latest arrival time and if it arrives before the earliest arrival time, the vehicle must wait. The service time for each customer for the time taken to load/unload is also measured, which is considered to be unique regardless of the demands’ size. Vehicles are considered to visit their route within route time, which is named as the time window.
The main function in the problem is illustrated in Eq. 1:
where

\(x_{ijk} = \left\{ {\begin{array}{*{20}c} 0 & {{\text{if there is no arc from node}} {\text{i to node j}}} \\ 1 & {\text{otherwise }} \\ \end{array} i \ne j, i, j \in \{ 0,1,2, \ldots N\} } \right.\).

N number of customers (0 denotes the central depot)

K number of vehicles

c _{ ij } cost incurred on arc from customer i to customer j.
The following constraints represent the time windows without violating any time window constraints, where for each vehicle, the earliest possible time of returning to the depot cannot exceed the latest possible return time.
Artificial bee colony algorithm (ABC)
The ABC algorithm simulates the foraging behaviour of real honeybees. Several researchers have studied its application to optimisation problems in recent years. A survey paper on algorithms based on honeybee behaviour (ABC, bee colony algorithm, bee swarm optimisation, bees algorithm, and honeybee mating optimisation) by Karaboga et al. (2014) reported that 54 % of recent publications are related to the ABC algorithm.
In the ABC algorithm, there are three groups of agents (employed bees, onlooker bees and scout bees) that work collaboratively in solving problems. The groups of agents communicate and cooperate to find a food source (solution) with goodquality nectar (cost or fitness value for a problem). Each group of agents is responsible for one process. The scout bees are responsible for finding the positions of new food sources. At the beginning of the search, the food source positions are determined randomly. The employed bees are responsible for exploring the search space and visit the neighbourhood of the food source positions collecting all the information about the visited positions (including the distance, direction and profitability) in order to share this information with the onlooker bees. The onlooker bees are responsible for selecting promising food sources based on the information given by the employed bees.
In the ABC algorithm, a food source represents a possible solution, and the amount of nectar in the food source corresponds to the quality (the cost or the fitness value) of the solution. The number of employed bees is equal to the number of solutions in the population.
As shown in Fig. 1, the ABC algorithm starts by initialising the population with respect to the number of employed bees. Employed bees explore new solutions based on their memories and old solutions are replaced by new explored solutions only if the new solutions have an equal or better fitness value.
Communication between the employed and onlooker bees happens when the employed bees present promising solutions to the onlooker bees in the hive. Cooperation happens when the onlooker bees explore the solutions presented by the employed bees. If the solution cannot be improved in a predefined number of iterations (defined as a parameter called limit), the employed bee becomes a scout bee in order to explore a new solution. At this point, the newly discovered solution is memorised and the old solution is abandoned. The ABC algorithm has exploration and exploitation capabilities, where scout bees are able to globally explore the search space and employed and onlooker bees are able to locally explore the search space.
Modified ABC algorithm
The basic ABC algorithm described above still lacks the ability to execute strong exploration throughout the scout bee phase. The main weakness of the basic ABC algorithm is that scout bees promote high exploration capability because a new solution is created randomly when the old solution cannot be improved. Randomly created solutions may affect the search process to search the area blindly making it difficult to find the promising areas.
This causes the search to slow the convergence speed (Weng and Bin Asmuni 2013). Therefore, in this paper we propose an improved version of the ABC algorithm, where a list of abandoned solutions is defined (abnd_lst: extendable abandoned list) so that the scout bees can memorise the solutions that exceed the maximum number of trials (limit).
The scout bees select a solution from the abandoned list based on a roulette wheel selection. Then each scout bee creates a new solution by selecting a random route from the best solution found so far, and replace it with a random route in the new generated solution (Fig. 2, line 39), while keeping the solution feasible (Fig. 2, line 40), and all the neighbourhood structures are performed on each new created solution in order to slightly improve the new generated solutions. The pseudo code for the Modified ABC algorithm is presented in Fig. 2.
Neighbourhood structures
To explain the neighbourhood structures, let’s consider that a, b, c and d are customers in the same route visited in sequence {a → b → c → d}. The neighbourhood structures presented as follows:
 NBS1:

One shift in the same route, where b is moved to a position after all the other customers’ positions; the new sequence is {a → c → d → b}
 NBS2:

Two shifts in the same route, where both a and b are moved to a position after c and d; the new sequence is {c → d → a → b}
 NBS3:

One swap in the same route, where a and c are exchanged; the new sequence is {c → b → a → d}
 NBS4:

Two swaps in the same route, where a and b are exchanged with c and d, the new sequence is {c → d → a → b}
Solomon’s benchmark for VRPTW
Solomon in 1987 proposes 6 datasets for the VRPTW, which have been used by a number of heuristics. In this paper, these benchmark datasets are used to test the performance of the Modified ABC algorithm. The instances vary in terms of the number of vehicles used to serve the customers, travelling time of the vehicles, vehicle capacity, customer locations and service time (for unloading/loading). In other words, each customer has their own time window, demand (amount of properties), location, earliest arrival time and latest arrival time, and service time.
All instances in the benchmark datasets have 100 customers; the travelling time among customers is equivalent to the same Euclidean distance. The 56 instances are splitted into six groups based on the arrangement of the customers’ locations and time windows. These groups are C1, C2, R1, R2, RC1, and RC2. In group C the customers are clustered, while in group R the customers are distributed remotely. Group RC mixes the customers distribution in the instances R and C.
Results
The experiment results are based on 31 independent runs. Our proposed algorithms were implemented in Java programming language on Intel^{®} Core™ i3 processors. The execution times were between 20 and 700 s based on the size of the tested dataset.
Table 1 shows the final parameter settings, which were experimentally chosen from a total of 10 runs to obtain the average results.
Table 2 shows the comparison of the results of the ABC and Modified ABC algorithms for VRPTW.
To compare the performance of the algorithms a single objective is used, the distance is considered as the main objective. The comparison in Table 2 shows that the Modified ABC algorithm outperforms the ABC algorithm in all the tested datasets; the new method for scout bees further enhances the quality of the solutions. A statistical test is executed to examine if there is any significant difference between the ABC and the Modified ABC algorithms with the significance interval 95 % (α = 0.05). The p value shows that there are significant differences in 38 datasets, which means that 67 % of the results are significant. Note that the italic font means that the pvalue is less than 0.05.
Table 3 shows the comparison results between the Modified ABC algorithm and the bestknown results in the literature. Note that the best results (distances) are presented in bold and the last column shows the deference percentage between the Modified ABC and the best known results, where the minus sign indicate that the modified ABC obtain better results.
The Modified ABC algorithm produces best results (lowest distance) for 8 datasets out of 56 datasets, which means that 14 % of the results obtained a lower distance than the bestknown results achieved by several approaches proposed over the years. It also achieved equal or better results when compared to the best individually published results with respect to minimising the total travelled distance for the VRPTW. Moreover, the Modified ABC algorithm provides competitive results for 20 datasets with same number of vehicles as compared to the bestknown results.
The effect of the proposed modification on ABC algorithm can be clearly observed in Figs. 3a, b and 4a, b. The lines represent the abandoned solutions, xaxis represents the iterations and the yaxis represents the objective value.
Figures 3 and 4 show the behaviour of the abandoned solutions on R101 and C103 datasets, respectively. It can be clearly seen in Fig. 3 that ABC algorithm offers large moves (the quality rose sharply) throughout the solution’s improvement process. This represents that the abandoned solution is replaced by a new solution where the objective value becomes high (as explained in modified ABC algorithm section), in which it looks like the search starts from the beginning, where the quality of the solution is almost similar to the earlier solution’s quality at the initial stage. Thus, it is hard for the ABC algorithm to further improve the solution again. Furthermore, at the end of the improvement process, these large moves are not accepted.
On the other hand, Fig. 4 shows the behaviour of the Modified ABC, where the figure demonstrates that when the abandoned solutions are replaced with new solution (the solution with random routes selected from the best solution). It can be seen that the quality of the solution goes slightly up (small moves), so the algorithm can easily improve the solution.
Figure 5 shows the behaviour of one solution extracted from the above figures for ABC and Modified ABC algorithms, in order to show the behaviour in details.
As shown in Fig. 5a the solution (Sol 1) becomes abandoned roughly at iterations (150, 300, 470, 550, 610, 770, 800, 970 and 990) and replaced by randomly generated solutions. The quality for the randomly generated solution is roughly 3100 (at iteration 150) which is most likely equal to the quality of the initial solution (before the ABC algorithm is performed). This shows that, due to the poor quality of the randomly generated solution to replace the abandoned solution, thus it is hard to be further improved by the ABC algorithm. However, in the Modified ABC, Fig. 5b the solution becomes abandoned roughly at iterations (250, 350, 750, 780, 950, and 980), and replaced by a new solution where the routes of the solution are selected from the best solution. From the figure, we can see that the quality of the replaced solution is roughly 1900 (at iteration 250) which is better compared to the quality of the initial solution (roughly 3000) before the replacement takes place. Thus, it helps the algorithm to easily improve the quality of the solution at every time the abandoned solutions are replaced.
Conclusion
The Modified ABC algorithm proposed in this paper for the VRPTW appears to excel in the quality of its solution as well as in computational time. Experimental results show that the Modified ABC algorithm improves the results when using a memory by scout bees, where they can memorise the abandoned solutions and select one of these solution to be replaced by a new generated solution rather than replacing all the abandoned solutions by randomly generated solutions as in the original ABC algorithm. Overall comparison indicates that our Modified ABC algorithm is able to obtain the best results in comparison to stateoftheart approaches, as represented by reducing the distance travelled, which is the main objective of the VRPTW.
References
Amini S, Javanshir H, TavakkoliMoghaddam R (2010) A PSO approach for solving VRPTW with real case study. Int J Res Rev Appl Sci 4(3):118–126
Baykasoglu A, Ozbakir L, Tapkan P (2007) Artificial bee colony algorithm and its application to generalized assignment problem. In: Swarm intelligence focus on ant and particle swarm optimization. ITech Education and Publishing, Vienna, pp 113–144
Bent R, Van Hentenryck P (2004) A twostage hybrid local search for the vehicle routing problem with time windows. Transp Sci 38(4):515–530
Berger J, Barkaoui M (2004) A parallel hybrid genetic algorithm for the vehicle routing problem with time windows. Comput Oper Res 31(12):2037–2053
Bräysy O, Gendreau M (2005a) Vehicle routing problem with time windows, part I: route construction and local search algorithms. Transp Sci 39(1):104–118
Bräysy O, Gendreau M (2005b) Vehicle routing problem with time windows, part II: metaheuristics. Transp Sci 39(1):119–139
Chiang WC, Russell RA (1997) A reactive tabu search metaheuristic for the vehicle routing problem with time windows. INFORMS J Comput 9(4):417–430
Cook W, Rich JL (1999) A parallel cuttingplane algorithm for the vehicle routing problem with time windows. Computational and Applied Mathematics Department, Rice University, Houston, TX, Technical Report
Cordeau JF, Laporte G, Mercier A (2001) A unified tabu search heuristic for vehicle routing problems with time windows. J Oper Res Soc 52(8):928–936
Cordone R, Calvo RW (2001) A heuristic for the vehicle routing problem with time windows. J Heuristics 7(2):107–129
De Backer B, Furnon V, Shaw P, Kilby P, Prosser P (2000) Solving vehicle routing problems using constraint programming and metaheuristics. J Heuristics 6(4):501–523
Desrochers M, Lenstra JK, Savelsbergh MWP, Sourris F (1988) Vehicle routing with time windows: optimization and approximation. Vehicle routing: method and studies. Studies in management science and systemsvolume 16. Publication of: Dalctraf
Desrochers M, Lenstra JK, Savelsbergh MW, Soumis F (1988b) Vehicle routing with time windows: optimization and approximation. Veh Rout Methods Stud 16:65–84
Desrochers M, Desrosiers J, Solomon M (1992) A new optimization algorithm for the vehicle routing problem with time windows. Oper Res 40(2):342–354
Gambardella LM, Taillard ED, Agazzi G (1999) MACSVRPTW: a multiple ant colony system for vehicle routing problems with time windows. New Ideas in Optimization. McGraw Hill, London, UK, pp 63–76
Homberger J, Gehring H (1999) Two evolutionary metaheuristics for the vehicle routing problem with time windows. INFOR 37(3):297
Ibaraki T, Kubo M, Masuda T, Uno T, Yagiura M (2001) Effective local search algorithms for the vehicle routing problem with general time window constraints. In: Proceedings of MIC, vol 2001, pp 293–297
Ioannou G, Kritikos M, Prastacos G (2001) A greedy lookahead heuristic for the vehicle routing problem with time windows. J Oper Res Soc 52(5):523–537
Jawarneh S, Abdullah S (2015) Sequential insertion heuristic with adaptive bee colony optimisation algorithm for vehicle routing problem with time windows. PLoS One 10(7):e0130224
Kallehauge B, Jesper K, Larsen J (2001) Lagrangean duality applied on vehicle routing with time windows. Informatics and Mathematical Modelling (IMM), Technical University of Denmark
Karaboga D (2005) An idea based on honey bee swarm for numerical optimization, vol 200. Technical Reporttr06, Erciyes University, Engineering Faculty, Computer Engineering Department
Karaboga D, Basturk B (2008) On the performance of artificial bee colony (ABC) algorithm. Appl Soft Comput 8(1):687–697
Karaboga D, Gorkemli B, Ozturk C, Karaboga N (2014) A comprehensive survey: artificial bee colony (ABC) algorithm and applications. Artif Intell Rev 42(1):21–57
Kohl N, Desrosiers J, Madsen OBG, Solomon MM, Soumis F (1999) 2 Path cuts for the vehicle routing problem with time windows. Transp Sci 33(1):101–116
Kumar SN, Panneerselvam R (2012) A survey on the vehicle routing problem and its variants. Intell Inf Manag 4(3):66
Lau HC, Lim YF, Liu Q (2001) Diversification of neighborhood via constraintbased local search and its application to VRPTW. In: Proceedings of the CPAIOR 2001 workshop
Lau HC, Sim M, Teo KM (2003) Vehicle routing problem with time windows and a limited number of vehicles. Eur J Oper Res 148(3):559–569
Li H, Lim A (2002, March) Local search with annealinglike restarts to solve the vehicle routing problem with time windows. In: Proceedings of the 2002 ACM symposium on applied computing, ACM, pp 560–565
Mester D, Bräysy O, Dullaert W (2007) A multiparametric evolution strategies algorithm for vehicle routing problems. Expert Syst Appl 32(2):508–517
Potvin JY, Bengio S (1996) The vehicle routing problem with time windows part II: genetic search. INFORMS J Comput 8(2):165–172
Rochat Y, Taillard ÉD (1995) Probabilistic diversification and intensification in local search for vehicle routing. J Heuristics 1(1):147–167
Rousseau LM, Gendreau M, Pesant G (2002) Using constraintbased operators to solve the vehicle routing problem with time windows. J Heuristics 8(1):43–58
Shaw P (1998) Using constraint programming and local search methods to solve vehicle routing problems. In: Principles and Practice of Constraint Programming—CP98, pp. 417–431. Springer, Berlin
Solomon MM (1987) Algorithms for the vehicle routing and scheduling problems with time window constraints. Oper Res 35(2):254–265
Solomon MM, Desrosiers J (1988) Survey papertime window constrained routing and scheduling problems. Transp Sci 22(1):1–13
Szeto WY, Wu Y, Ho SC (2011) An artificial bee colony algorithm for the capacitated vehicle routing problem. Eur J Oper Res 215(1):126–135
Tavares J, Machado P, Pereira FB, Costa E (2003, March) On the influence of GVR in vehicle routing. In Proceedings of the 2003 ACM symposium on Applied computing, ACM, pp 753–758
Thangiah SR, Osman IH, Sun T (1994) Hybrid genetic algorithm, simulated annealing and tabu search methods for vehicle routing problems with time windows. Computer Science Department, Slippery Rock University, Technical Report SRU CpScTR9427, 69
Toth P, Vigo D (2001, January) An overview of vehicle routing problems. In: The vehicle routing problem, pp 1–26. Society for Industrial and Applied Mathematics
Toth P, Vigo D (eds) (2014) Vehicle routing: problems, methods, and applications, vol 18. SIAM, University of Bologna, Italy
Weng FC, Bin Asmuni H (2013) An automated approach based on bee swarm in tackling university examination timetabling problem. Int J Electr Comput Sci 13(02):8–23
Woch M, Łebkowski P (2009) Sequential simulated annealing for the vehicle routing problem with time windows. Decis Mak Manuf Serv 3(12):87–100
Yu B, Yang ZZ, Yao B (2009) An improved ant colony optimization for vehicle routing problem. Eur J Oper Res 196(1):171–176
Authors’ contributions
MA carried out the study of the algorithm with its improvement, SJ and SA carried out the study of VRPTW and its formulations, MA and SJ have contributed in Data analysis. SA contributed in the revision of this manuscript. All authors read and approved the final manuscript.
Acknowledgements
This work was supported by the Ministry of Higher Education, Malaysia (FRGS/1/2015/ICT02/UKM/01/2), and the Universiti Kebangsaan Malaysia (DIP201215 and GPK008253).
Competing interests
The authors declare that they have no competing interests.
Author information
Authors and Affiliations
Corresponding author
Rights and permissions
Open Access This article is distributed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits unrestricted use, distribution, and reproduction in any medium, provided you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made.
About this article
Cite this article
Alzaqebah, M., Abdullah, S. & Jawarneh, S. Modified artificial bee colony for the vehicle routing problems with time windows. SpringerPlus 5, 1298 (2016). https://doi.org/10.1186/s4006401629408
Received:
Accepted:
Published:
DOI: https://doi.org/10.1186/s4006401629408
Keywords
 Foraging behaviour
 Artificial bee colony
 Vehicle routing problem with time windows