Modified artificial bee colony for the vehicle routing problems with time windows

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 slows-down 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 best-known results in the literature. Computational investigations show that the proposed algorithm is a good and promising approach for the VRPTW.

Observations on the swarm behaviour of natural self-organised systems has attracted researchers' attention in recent years and inspired the development of algorithms for solving real-life 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 self-organised 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 state-of-the-art 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 = 0 if there is no arc from nodei to node j 1 otherwise i � = j, i, j ∈ {0, 1, 2, . . . N }.
• 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 good-quality 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 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 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 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 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.

Solomon's benchmark for VRPTW
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 p-value is less than 0.05. Table 3 shows the comparison results between the Modified ABC algorithm and the best-known 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 best-known 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 best-known 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, x-axis represents the iterations and the y-axis represents the objective value. Figures 3 and 4 show the behaviour of the abandoned solutions on R1-01 and C1-03 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 NV number of vehicles  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 NV number of vehicles  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 state-of-the-art approaches, as represented by reducing the distance travelled, which is the main objective of the VRPTW.