Bees Algorithm for Vehicle Routing Problems with Time Windows
Total Page:16
File Type:pdf, Size:1020Kb
International Journal of Machine Learning and Computing, Vol. 8, No. 3, June 2018 Bees Algorithm for Vehicle Routing Problems with Time Windows Malek Alzaqebah, Sana Jawarneh, Hafiz Mohd Sarim, and Salwani Abdullah annealing, or population-based approaches such as ant colony Abstract—This paper presents the bees algorithm for vehicle optimization and genetic algorithms [3]. routing problems within time windows (VRPTW). The VRPTW Population-based approaches are classified into two aims to determine the optimal route for a number of vehicles categories, which are evolutionary algorithms and swarm when serving a set of customers within a predefined time interval (the time window). The objective in VRPTW is to intelligence algorithms [4]. This classification is based upon minimize overall transportation cost. Various heuristic and natural phenomena being modeled by the algorithms. metaheuristic approaches have been developed in literature to Evolutionary algorithms apply the theory of evolution to produce high-quality solutions for this problem because of its create new species [3]. By contrast, swarm intelligence (SI) high complication rate and extensive implementation in real-life algorithms rely on metaheuristics that mimic collective applications. This research investigates the use of bee algorithms behavior of problem-solving processes in self-organized (BA) for VRPTW and identifying the strengths and weaknesses. systems [5]. The interactions between agents in social Index Terms—Foraging behaviour, bees algorithm, vehicle colonies with their environment leads to the collective routing problem with time windows. intelligence [6]. SI features have inspired some researchers to develop algorithms for VRPTW, including the ant colony optimization algorithms [7], bee colony optimization (BCO) I. INTRODUCTION algorithms [8] and the artificial bee colony (ABC) algorithms Vehicle routing problems (VRP) have an important role in [9], [10], to name a few examples. the domains of transportation, delivery, and logistics. Hence, With regards to swarm intelligence, researchers are numerous research works have been undertaken to study VRP concerned with developing algorithms that model the since 1959 [1]. The work presented by Dantzig and Ramser in behavior of honeybees. Honeybee algorithms are categorised 1959 proposed the problem as a generalized Travelling based on the behavior of bees [11]: queen, marriage, and Salesman Problem (TSP). Later, a huge number of studies foraging bee. Examples of foraging behavior algorithms can have been conducted on number of VRP divisions (e.g. VRP be found in ABC [12], bees algorithm (BA) [13], and bee with Time Windows (VRPTW), VRP with Pick-Up and colony optimization (BCO) [14], [15]. In this paper, Bees Delivery (VRPPD), Multiple Depot VRP (MDVRP), algorithm (BA) is investigated for VRPTW and some MDVRP with Time Windows (MD-VRPTW), and strengths and weaknesses are identified. Capacitated VRP (CVRP)). The remainder of the paper is organized as follows: in the VRPTW is an NP-hard problem, which is concerned with next section VRPTW is described and its formulation with determining the best routing of a set of limited capacity some relevant-literature review is provided. In the third vehicles between a central depot and a number of scattered section, the proposed algorithm is presented. The fourth customers, where customers must be visited within predefined section provides an extensive computational study comparing time duration (the time window). the results of BA and with the best-known approaches. Finally, Several approaches have been developed for VRPTW. the paper is concluded and some future research directions are Solomon [2] first introduced heuristics to solve this problem. listed. In recent years, metaheuristics has become increasingly popular. Metaheuristics can be classified either as single-based approaches such as tabu search and simulated II. THE VEHICLE ROUTING PROBLEMS WITH TIME WINDOWS This study focuses on the VRPTW in order to understand its complexity and maximize its advantages in real life. In recent years, the VRPTW has gained considerable research attention in network optimization [16]. Ellabib et al. [17] defined the VRPTW as a generalisation Manuscript received March 15, 2018; revised May 2, 2018. of the VRP. The VRPTW often appears in many real M. Alzaqebah is with the Department of Mathematics, Faculty of Science, Imam Abdulrahman Bin Faisal University, Dammam, Saudi Arabia (e-mail: applications. VRPTW can be also used to achieve the [email protected]). following objectives: optimize the number of vehicles that S. Jawarneh is the Department of Computer Science, Community College must serve a set of customers, to determine the customers that Dammam, Imam Abdulrahman Bin Faisal University, Dammam, Saudi Arabia (e-mail: [email protected]). each vehicle should serve, and to determine the order of cost H. M. Sarim and S. Abdullah are with Data Mining and Optimisation that should be minimised as much as possible. The VRPTW is Research Group, Centre for Artificial Intelligence Technology, Universiti subject to capacity of the vehicle and service time constraints. Kebangsaan Malaysia, Selangor, Malaysia (e-mail: [email protected], [email protected]). The problem contains vehicle tasks that minimise task cost. doi: 10.18178/ijmlc.2018.8.3.693 236 International Journal of Machine Learning and Computing, Vol. 8, No. 3, June 2018 According to the definition above, the VRPTW processes a [13]. The general pseudo-code for the BA is shown in Fig. 1. specific number of requests to be visited by a certain number of vehicles. All customers are supposed to require a limited Initialization: quantity of demands. Furthermore, each route must start and NumOfIte : maximum number of iteration; populationsize : #of solutions in the population; finish at depot, and each customer must be visited only once. ne: #of elite solutions; The main formulation of the VRPTW was proposed in nre: list of recruited bees assigned to elite solutions; 1987 by Solomon [2]. The standard benchmark of Solomon’s nb: #of best solutions; nrb: list of recruited bees assigned to best solutions; datasets contains 56 instances, and every instance has 100 stlim: stagnation iteration limit for abandonment solutions; customers. In the network, each vehicle represents one route. The vehicle starts routing from the departure point and arrives Initialise the population; Compute the initial value of the fitness, f(Sol); iteration ← 0; at specific destinations (customers), then returns to the best solution, Solbest ← Sol; departure point. In considering Solomon’s benchmark, each Improvement: route has its own cost cij and the traveling time tij. Each do while (iteration < NumOfIte) vehicle spends one-time slot (time unit) to travel one distance Rank all solutions in the population based on fitness value. nbSet = the top nb solutions of population; unit, so the speed of the vehicle is assumed to be constant. neSet = the top ne solutions of nbSet; The time window boundaries are defined by the earliest and for (i=1 : nrb) latest arrival times (the time interval); in which the vehicle for (j=1 : nb) Sol* ← neSetj; must arrive at the customer’s place before the latest arrival A random neighbourhood method is applied on Sol* ; time. The vehicle should wait in cases where it arrives before Update the population; the earliest arrival time. The service time of the customer must end for be taking into account, which represents the time that is spent end for for (j=1 : nre) to load or unload demands. The demands’ size is considered for (h=1 : nrb) unique for all customers. Route time (time window) is the Sol** ← neSetj; time taken by vehicles to visit all customers in the same route. random neighbourhood method is applied on Sol** ; end for Equation 1 represents the main function for VRPTW [2]: end for Solbest ← the best solution found so far; N N N random neighbourhood method is applied on the rest of (nb–ne) Minimise xc (1) ijkij solutions; i0j 0k 1 Update the population; iteration++; end do where, Fig. 1. Pseudo-code for the BA. 0 if there is no arc from node i to node j x i j,i, j {01 , , N} ijk 1 otherwise As can be observed by Fig. 1, the algorithm begins with N number of customers randomly initializing the population, where the number of scout bees is equal to the number of solutions in the K number of vehicles population. The scout bees randomly search for the food sources (solutions). Once they find the food sources, they cij cost on arc between two customers i to j. return to the hive and start recruiting other bees to exploit those food sources. Next, all solutions in the population are III. BEES ALGORITHM (BA) evaluated and ranked based on a fitness function. A number of nb highest ranked solutions are selected for a local search. BA was firstly proposed by Pham et al. [13] and algorithm Then, the scout bees recruit the foragers to search on the has been applied in various optimization fields [18]-[22]. neighbourhood of the selected solutions, as follows: BA consists of two groups of bees i.e., scout bees and Every scout bee returned from each nb (the best solutions) foragers. The scout bees are involved in searching for food will recruit the nest (the top nb solutions from the sources (solutions) and recruiting foragers to continue population) foragers for a local exploration. searching in the discovered food sources. The scout bees search for food sources randomly in the search space The scout bees that visited the first ne elite solutions (Exploration). During the search, they collect useful among the best nb solutions will recruit nre foragers and information and return back to the hive to share the apply a random neighbourhood structure. information with other bees in the hive. and the scouts then The scout bees that visited the rest (nb–ne) solutions will recruit other bees as foragers to continue searching in recruit nrb < nre foragers and apply a random previously discovered food sources (Exploitation).