Recent Researches in Mathematical Methods in Electrical Engineering and Computer Science
Software Framework for Vehicle Routing Problem with Hybrid Metaheuristic Algorithms S.MASROM1, A.M. NASIR2 Malaysia Institute of Transport (MITRANS) Faculty of Computer and Mathematical Science Universiti Teknologi MARA, PERAK, MALAYSIA 1
[email protected] 2
[email protected] SITI.Z.Z.ABIDIN Faculty of Computer and Mathematical Science Universiti Teknologi MARA, MALAYSIA
[email protected]
A.S.A. RAHMAN Computer and Information Science Department Universiti Teknologi PETRONAS, MALAYSIA
[email protected]
Abstract: - The objective of vehicle routing problem (VRP) is to design a set of vehicle routes in which a fixed fleet of delivery vehicles from one or several depots to a number of customers have to be set with some constraints. To this date in the literature, many instances of VRP model have been introduced and applied for various types of scheduling problems. However, when implemented in a real life application, the VRP models proved to be very complex and time consuming, especially in the development phase. It is due to the fact that there are technical hurdles to overcome such as the steep learning curve, the diversity and complexity of the algorithms. This paper presents a generalize software framework for an effective development of VRP models. The software framework presented here is hybridized algorithm of two metaheuristics namely as Particle Swarm Optimization (PSO) and Genetic Algorithm (GA). The hybrid algorithm is used to optimize the best route for the vehicles that also incorporates a mechanism to trigger swarm condition for PSO algorithm. In order to test the functionality of the software framework, the applications of Pickup and Delivery Problem with Time Windows (PDPTW) and Vehicle Routing Problem with Time Windows (VRPTW) are developed based on the software framework. Experiments have been carried out by running the hybrid PSO with the VRPTW and PDPTW benchmark data set. The results indicate that the algorithm is able to produce significant improvement mostly to the PDPTW. Key-Words: - Software framework, Vehicle Routing Problem, Particle Swarm Optimization, Genetic Algorithm, Mutation, Hybridization.
Colony Optimization (ACO)[5], Particle Swarm Optimization (PSO)[6], Tabu search[7] and Simulated Annealing[8]. In the development of metaheuristic algorithms, there are some difficulties involved in the design and implementations. In order to shorten the development life cycle for metaheuristics based application, researchers may rely on open source software packages for metaheuristic algorithms. However, based on the literature, it is found that the available software packages are not originally designed for VRP based models. Modification and amendments are required to make the software packages relevant to the specific VRP models. Another difficult task is to design and implement
1 Introduction The vehicle routing problem (VRP) [1] is a popular and well-studied combinatorial optimization problem. It is an intensive research area because of its usefulness to the logistics and transportation industry. Real world instances of the VRP are more complicated which may involve a thousand of customer locations and many complicated constraints. The necessity for fast and good optimal solution has directed many researchers to look seriously into metaheuristic based technique. By using metaheuristic, remarkable results can be achieved [2-3]. Some examples of metaheuristic algorithms are Genetic Algorithm (GA)[4], Ant
ISBN: 978-1-61804-051-0
55
Recent Researches in Mathematical Methods in Electrical Engineering and Computer Science
significant improvements to the VRP optimal solutions. As for example, a combination of PSO with multiple phase neighborhood search and greedy randomized adaptive search (MPNS-GRASP) has been effectively solved VRP problem[14]. The purpose of this hybridization is for expanding the neighborhood strategy in PSO. In another work, PSO has also been hybridized with ACO for performance improvement [13]. This technique is proven to be effective when it is used in the implemention of VRP for grain logistic. A method that combines PSO with local search and simulated annealing is another technique for PSO hybridization. The computational experiments have showed that the proposed algorithm is feasible and effective for capacitated vehicle routing problem, especially for large scale problems [10].
appropriate solution representation for VRP with regard to the specific metaheuristics data structure. These processes also require in-depth understanding on the programming language, inner and working structure of the software packages. In addition, many of the available software packages were originally designed for only a single metaheuristic algorithm. In many cases of complex problem such as VRP, hybridization of metaheuristic is sometime necessary. Metaheuristic hybridization is an improvement algorithm process to the original metaheuristic algorithm. It is proven by various empirical experiments that metaheuristic hybridization techniques are very promising in providing fast and high optimal solutions [9-11]. With the limitation issues in software packages, this research is initiated with the focus on various aspects of the design and implementation for VRP models and its metaheuristics hybridization. The selected metaheuristic algorithms are PSO and GA. These two algorithms have been widely applied for various kinds of VRP problems [12-14]. The remaining content of this paper is organized as follows; Section 2 presents the related works on metaheuristics and available software packages for VRP. Section 3 describes the proposed software framework including its architecture and hybridization technique. Then, the computational results for two instances of VRP models are given in Section 4. Lastly, Section 5 concludes the paper with a short summary.
2.2 Software framework for metaheuristics and VRP The development of programming code for optimization problem like VRP and its metaheuristic algorithm from scratch has been considered as complex [22-23]. The process will have to go through huge works especially to those with no fundamental knowledge on computer programming concept and languages such as C, C++, C# and JAVA. Recently, several software packages have been developed with concern on reducing the development complexity and phase cycle. Researchers may use the freely available and widely used Concorde package[24]. It is an exact solver for the travelling salesman problem (TSP), the most related model to VRP. Another type for TSP is LinKernighan-Helsgaun(LKH) package developed by Hesgaun [25]. However, this software package is not supported by metaheuristic algorithms. Some of the available software packages with metaheuristic algorithms are METASIS [26], EasyLocal++ [27], ParadisEO [28] and HeuristicLab [29]. All of these software packages are not originally designed for VRP models. Moreover, many of them were developed for single meteheuristic implementation.
2 Related works To this date of literature, a lot of research works have been undertaken on solving VRP models by using metaheuristic algorithms. The implementation complexity in metaheuristic algorithms and its hybridization has directed researchers’ attention to use available software packages. However, the number of software framework for VRP application with metaheuristic algorithm is very limited.
2.1 Metaheuristics for VRP In recent years, the numbers of works that implementing VRP based application with metaheuristic algorithm is increasing. A variant of VRP problems have been successfully solved by using GA [11, 15-16] , ACO [9, 17-18] , Tabu search [15, 19-20] and also with PSO[12, 21]. Based on the literature, it can be seen that most of the metaheristics techniques on VRP were concentrated on metaheuristic hybridization rather than the single algorithm implementation [9-11]. The metaheuristic hybridizations have shown
ISBN: 978-1-61804-051-0
3 The Software Framework The software framework has been developed by using JAVA programming language. Generally, the architecture is composed of front and back end components. The front end provides user interface for application configurations while all the software engines are located at the back end. Fig. 1 illustrates the architecture of the software framework.
56
Recent Researches in Mathematical Methods in Electrical Engineering and Computer Science
Front module End Interface VRP configuration
according to the method introduced by Ai & Kachitvichyanukul [30]. Fig. 2 shows the solution representation.
Back End Problem engine
Hybrid engine Algorithm configuration
n = 8 customers
PSO
(1) 0.5
GA operator Database configuration
(3) 0.4
(4) 0.3
(5) 0.8
(6) 0.2
(7) 0.1
(8) 0.7
+ (5) 1.1
Database engine
(6) 1.6
(7) 1.4
(8) 1.0
m = 2 vehicles 2m = 4 dimensions
Vehicle
Fig. 2: Solution representation for each particle
Customer
In this method, every particle’s position in PSO is divided into (n+2m) dimension and each dimension is encoded as a real number. The first n dimensions represent the number of customers and the last 2m dimensions are related to the number of vehicle with its reference point in Cartesian map. A number of two dimensions are dedicated for each vehicle as a reference point. Developing a set of customer routes for vehicles is an important procedure in problem formulation engine. The procedure is different for every VRP model. The sum of total cost for all routes with a set of constraints will be passed over to the algorithm engine.
Fig. 1: Software architecture
3.1 Front end components The front end provides interfaces for experiment configurations including problem, algorithm and database setting. In the problem configuration, users can choose the predefined VRP models such as Pickup and Delivery VRP with Time Windows (PDPTW), VRP with time windows (VRPTW), VRP with split delivery and multiple depots VRP. The hybridization technique can be defined through algorithm configuration components. An important configuration is to select operators from the GA to be incorporated into the PSO algorithm. Other configurations consist of basic PSO parameters such as coefficient acceleration (c1 and c2), population size, particle dimension, iteration time, position range and velocity range. In order to be connected to a specific database of a particular VRP application, database interface is provided for files browsing purposes. The interface is also designed to facilitate data entry and manipulation of process on vehicles and customers information.
3.2.2 Hybrid engine Hybrid engine is the component for optimization process. It uses PSO as the master algorithm and GA as the subordinate algorithm. The GA provides several operators to be used by PSO including selection, crossover and mutation operators. Selection of operators can be done at the front end component.
In every population generation of PSO, each velocity of particle has to move towards the best fitness based on the information of previous experience which consists of previous velocity, personal best position of each particle, and global best position of the swarm. Afterward, the particle position will be adjusted according to the latest velocity. Before advancing to the next evaluation process, the condition of particle will be examined and determined. The idea behind this process is adapted from the PSO Triggered Mutation algorithm introduced by You & Ying [31]. A particle is considered healthy if it has
3.2 Back end components At the back end, three major components have been developed for the software framework. These components are problem formulation, hybrid algorithm and database engines. 3.2.1 Problem engine All the predefined classes for VRP models and its variant are located in the problem formulation engine. In this component, the general PSO solution representation for all VRP has been defined
ISBN: 978-1-61804-051-0
(2) 0.9
57
Recent Researches in Mathematical Methods in Electrical Engineering and Computer Science
from the software framework. The experiments run on a personal computer with Intel Pentium 1.20 GHz-3GBRAM and processing under Windows 7. A total of 20 runs for each case are conducted and an average result is obtained. The algorithm configuration is listed in Table 1. Table 1: Parameter setting
found a new personal best position at the current iteration. The number of particles with personal best improvement will be identified from the swarm population. When a certain percentage of particles in the swarm population are not healthy, the population condition can be considered as unhealthy and not strong. In this condition, the particles have fallen into local optima and stagnated.
Parameter Number of particle Number of iteration Inertia weight,w
Every time of iteration, the occurrence of unhealthy condition is counted. If the counted number is bigger than a certain number of iterations, the swarm is ready for mutation process. The purpose of mutation operation is to change slightly the value of particles’ positions so that it will increase the possibility of many potential solutions to be explored. A variety type of mutation operations have been proposed for PSO algorithm[32]. However, the operations are not really suitable and not specific for VRPTW solutions. In VRPTW solutions, the customer priority position is hardly dependent on the initialization position. So, mutating at random particle position will change the customer priority arrangement. It will cause to result inferiority to solutions. So, in the hybrid PSO (HPSO), the mutation is done on the vehicle location or reference point. The formula for mutation operation is (1) X idvi ( t ) = X idvi ( t ) + gaussian( p )
Xmin Xmax,Vmax Personal and global acceleration Healthy percentage Unhealthy occurrence mutation rate
4.1 Benchmark problem instance The Solomon’s [34] and Li &Lim [19] benchmark data set are used respectively for the VRPTW and PDPTW applications. Both Solomon and Li &Lim data is comprised of variety problem situations such as customer location, vehicles information, customers’ demand and corresponding time windows. However, in Li & Lim dataset, it is included with pickup and delivery data series. Table 2 lists the criteria for all data sets. The C1, C2, R1 and RC are all Solomon data sets while Li & Lim is represented with LC1, LC2, LR1 and LRC1. The short horizon is to represent less than 10 routes and long horizon used to describe more than 30 routes. All instances are tested on 100 number of customers.
The gaussion(p) function returns a random number drawn from a Gaussian distribution with a standard deviation of p. The value of p is 0.1 times the length of dynamic range of the particle dimension [33]. This is to ensure that the vehicle reference point for each vehicle is within the search vector.
Table 2: Solomon data set Data set
Distribution
Horizon
C1,LC1 C2,LC2 R1,LR1 RC1,LRC1
Clustered Clustered Random Random clustered
Short Long Short Short
3.2.3 Database engine The database engine is a database management system (DBMS) used to create, read, update and delete records. It is included with application programming interface (API) that allows user to interact with its underlying engine. In the software framework, MySQL has been used as database engine and the database is composed of vehicle, depot and customer records.
4.2 Performance metrics
4 Experiments and Results
4.3 Results
Vehicle capacity 200 700 200 200
The results are measured primarily on three performance metrics namely as number of vehicles (NV), best distance and computational time. These values are compared with the best known solutions from Solomon [34] and Li & Lim[19] .
Based on the results in Table 3, the HPSO algorithm used in the software framework is capable to produce shorter distance than the Solomon best distance. The improvements can be seen in all cases of VRPTW, extremely to the random (R)
Computational experiments have been conducted to evaluate the performance of the Hybrid PSO (HPSO) for solving two different kinds of VRPTW [34] and PDPTW [19] that have been generated
ISBN: 978-1-61804-051-0
Value 100 1000 Linear decreasing from 0.9 to 0.4 0 100 2 60% 3 0.2
58
Recent Researches in Mathematical Methods in Electrical Engineering and Computer Science
distribution (more than 60%). However, the HPSO algorithm could not reduce the number of vehicle used in all cases. The figures are similar with Solomon’s vehicle numbers.
5 Conclusions This paper presents a software framework that offers effective implementation of VRP instances by using hybrid PSO. The developments of VRPTW and PDPTW have demonstrated the capability of the software framework. From the empirical results, it can be revealed that the hybrid method from the software framework is proved to be more effective than the best known solutions of benchmark problems. In some of the PDPTW instances, the numbers of vehicles are smaller than other methods. This translates into cost reduction in the vehicle maintenance as well as drivers involvement.
Table 3: Computational results for VRPTW Prob.
NV
HPSO
C101 C102 C201 C202 R101 R102 RC 101 RC 102
10 10 3 3 20 18 15 14
820.1 820.2 553.6 574.3 1035.8 918.5 1518.5 1175.3
Best NV 10 10 3 3 20 18 15 14
Best known 827.3 827.3 589.1 589.1 1637.7 1466.6 1619.8 1457.4
Error (%) 0.15 0.18 0.2 0.21 0.25 0.28 0.27 0.32
Acknowledgements
Table 4 has showed that all problem instances of PDPTW have gained some improvement in the optimum solutions (distance) by using HPSO. Similar to VRPTW, an apparent achievement can be seen from the random distribution (R1) customers. But, the achievement is slightly lower than VRPTW instances with only about 50% improvement. On the contrary, most of the random and random clustered instances in PDPTW have a smaller number of vehicles when using HPSO.
The authors would like to thank Kementerian Pengajian Tinggi Malaysia and Universiti Teknologi MARA for their financial support to this project.
References: [1] G. B. Dantzig and J. H. Ramser, "The Truck Dispatching Problem," Management Science, vol. 6, pp. 80-91, 1959. [2] C.-H. Lin, et al., "Genetic Algorithm for Shortest Driving Time in Intelligent Transportation Systems," International Journal of Hybrid Information Technology, vol. 2, pp. 21-30, 2009. [3] P. R. Srivastava and T.-h. Kim, "Application of Genetic Algorithm in Software Testing," International Journal of Software Engineering and its Applications, vol. 3, pp. 87-96, 2009. [4] M. Affenzeller, et al., Genetic Algorithms and Genetic Programming - Modern Concepts and Practical Applications.: CRC Press, 2009. [5] M. Dorigo and T. Stutzle, Ant Colony Optimization: MIT Press Ltd., 2004. [6] M. Clerc, Particle Swarm Optimization: ISTE, 2006. [7] F. Glover and M. Laguna, Tabu Search. Boston.: Kluwer Academic, 1998. [8] P. J. M. V. Laarhoven and E. H. L. Aarts, Simulated Annealing: Theory and Applications (Mathematics and Its Applications): Kluwer Academic Publishers Group, 1988. [9] X. Zhang and L. Tang, "A new hybrid ant colony optimization algorithm for the vehicle routing problem," Pattern Recognition Letters, vol. 30, pp. 848-855, 2009. [10] A. L. Chen, et al., "Hybrid discrete particle swarm optimization algorithm for capacitated
Table 4: Computational results for PDPTW Prob.
NV
HPSO
LC101 LC102 LC201 LC202 LR101 LR102 LRC101 LRC102
9 9 3 3 18 16 14 12
820.3 820.6 552.7 574.1 950.7 764.3 1517.3 1172.8
Best NV 10 10 3 3 19 17 14 13
Best known 828.94 828.94 591.56 591.56 1650.78 1487.57 1708.80 1563.55
Error (%) 0.21 0.25 0.28 0.27 0.21 0.28 0.27 0.32
As shown in Table 5, the computational time for implementing HPSO in both VRPTW and PDPTW instances can be slightly longer than the original PSO. However, the average time taken for PDPRW instances is a little bit shorter than the VRPTW instances with 0.75 different. Table 5: Computational time (CT) in second Prob. C101 C102 C201 C202 R101 R101 RC 101 RC 102
VRPTW PSO HPSO 125 125 138 137 124 122 123 125
140 140 145 143 138 138 137 137
ISBN: 978-1-61804-051-0
Prob. LC101 LC102 LC201 LC202 LR101 LR102 LRC101 LRC102
PDPTW PSO 119 120 137 138 125 126 119 152
HPSO 136 138 140 140 139 140 140 139
59
Recent Researches in Mathematical Methods in Electrical Engineering and Computer Science
vehicle routing problem," Jounal of Zhejiang University Science A, vol. 7, pp. 607-614, 2006. [11] L. Guiyun, "Research on Open Vehicle Routing Problem with Time Windows based on Improved Genetic Algorithm," in International Conferences on Computational Intelligence and Software Engineering, 2009. , Wuhan, China, 2009, pp. 1-5. [12] T. J. Ai and V. Kachitvichyanukul, "Particle swarm optimization and two solution representations for solving the capacitated vehicle routing problem," Computers & Industrial Engineering, vol. 56, p. 380, 2009. [13] Y. Zhu, et al., "Hybrid Particle Swarm Algorithm for Grain Logistics Vehicle Routing Problem," in Third International Symposium on Intelligent Information Technology Application, Nanchang, China, 2009, p. 364367. [14] Y. Marinakis and M. Marinaki, "A hybrid genetic - Particle Swarm Optimization Algorithm for the vehicle routing problem," Expert System with Applications, vol. 37, pp. 1446-1455, 2010. [15] B. Ombuki-Berman and F. T.Hanshar, "Using Genetic Algorithms for Multi-depot Vehicle Routing," in Bio-Inspired Algorithm for the Vehicle Routing Problem, F. B. Pereira and J.Tavares, Eds., ed: Springer-Verlag Berlin Heidelberg, 2009, pp. 77-99. [16] H.C.W.Lau, et al., "Application of Genetic Algorithms to solve the Multidepot Vehicle Routing Problem," IEEE Transactions on Automation Science and Engineering, vol. 7, pp. 383-392, 2010. [17] Y. Gajpal and P. Abad, "An ant colony system (ACS) for vehicle routing problem with simultaneous delivry and pickup," Computers & Operations Research, vol. 36, pp. 3215-3223, 2009. [18] J. E.Bell and P. R.McMullen, "Ant colony optimization techniques for the vehicle routing problem," Advance Engineering Informatics, vol. 18, pp. 41-48, 2004. [19] H. Li and A. Lim, "A metaheuristic for the pickup and delivery problem with time windows," in Tools with Artificial Intelligence, Proceedings of the 13th International Conference on, 2001, pp. 160-167. [20] A.-S. Pepin, et al., "A comparison of five heuristics for the multiple depot vehicle scheduling problem," Journal of Scheduling, vol. 12, pp. 17-30, 209. [21] D. Ponce, "Bio-inspired metaheuristics for the vehicle routing problem," in The 9th WSEAS
ISBN: 978-1-61804-051-0
international conference on Applied computer science 2009, pp. 80-84. [22] S. Wagner, et al., "Benefits of Plugin-Based Heuristic Optimization Software Systems " in Computer Aided Systems Theory – EUROCAST 2007. vol. 4739, R. M.-D. ı. e. al., Ed., ed: Springer Berlin / Heidelberg, 2007, pp. 747-754. [23] Jos, et al., "Using metaheuristic algorithms remotely via ROS," in Proceedings of the 9th annual conference on Genetic and evolutionary computation, London, England, 2007. [24] D. A. Bixby, et al., The Traveling Salesman Problem: A Computational Study: Princeton University Press, 2006. [25] K.Helsgaun, "An effective implementation of the Lin-Kernighan traveling salesman heuristic," European Journal of Operational Research, vol. 126, pp. 106-130, 2000. [26] G. Ranjan, et al., "METASIS: A meta heuristic based logic optimizer," in Circuits and Systems, 2007. MWSCAS 2007. 50th Midwest Symposium on, 2007, pp. 1501-1504. [27] L. D. Gaspero and A. Schaerf, "EASYLOCAL++: an object-oriented framework for flexible design of local search algorithms," Software -Practice and Experience, vol. 00, pp. 1-34, 2003. [28] S. Cahon, et al., "ParadisEO : A framework for the reusable design of parallel and distributed metaheuristics," Journal of Heuristics - Special Issue on New Advances on Parallel Meta-Heuristics for Complex Problems, vol. 10, pp. 357-380, 2004. [29] S. Wagner and M. Affenzeller, "HeuristicLab: A Generic and Extensible Optimization Environment " in Adaptive and Natural Computing Algorithms, B. Ribeiro, et al., Eds., ed: Springer Vienna, 2005, pp. 538541. [30] T. J. Ai and V. Kachitvichyanukul, "A particle swarm optimization for the capacitated vehicle routing problem," International Jounal of Logistic and SCM Systme, vol. 2, pp. 50-55, 2007. [31] Z. You and T. Ying, "Particle swarm optimization with triggered mutation and its implementation based on GPU," in Proceedings of the 12th annual conference on Genetic and evolutionary computation, Portland, Oregon, USA, 2010. [32] P. S. Andrews, "An Investigation into Mutation Operators for Particle Swarm Optimization," in IEEE Congress on, Evolutionary Computation, 2006. CEC 2006., pp. 1044-1051.
60
Recent Researches in Mathematical Methods in Electrical Engineering and Computer Science
[33] N. Higashi and H. Iba, "Particle swarm optimization with Gaussian mutation," in Proceedings of the IEEE Swarm Intelligence Symposium, 2003. SIS '03., pp. 72-79. [34] M. Solomon, "Algorithms for the vehicle routing and scheduling problems with time window constraints," Operation Research, vol. 35, pp. 254-265, 1987.
ISBN: 978-1-61804-051-0
61