Research and Solution for the Shortest Routing Problem of Logistics Vehicle Based on Genetic Algorithm

Size: px
Start display at page:

Download "Research and Solution for the Shortest Routing Problem of Logistics Vehicle Based on Genetic Algorithm"

Transcription

1 doi: / Research and Solution for the Shortest Routing Problem of Logistics Vehicle Based on Genetic Algorithm Haifeng Hu, Xiaohui Wang* College of Information Technology, Pingdingshan University, Pingdingshan, Henan , China Abstract This paper has put emphasis on the study of genetic algorithm based on the introduction of vehicle routing problem and its algorithm, proposed the improved genetic algorithm based on double layer chromosome coding scheme and adaptive crossover probability, solved vehicle routing problem with capacity constraints with adoption of improved algorithm, realized with C++ language programming and verified the feasibility and effectiveness of this algorithm with examples. Keywords: Shortest Routing, Logistics Vehicle, Genetic Algorithm, C++ language 1. INTRODUCTION Distribution is a function derived from transportation in logistics system, is the product of market competition, is an important process of logistics system and is also the focus of our logistics development in the future. Distribution is the process of delivering goods to clients based on order. Distribution not only refers to delivering goods, but also includes picking, assignment, division, assembly and distribution etc. The logistics enterprises need to optimize the whole distribution process to attain the maximum profit (Liu et al., 2009). Preparing reasonable vehicle scheduling scheme and distribution route through deep research on logistics distribution can decrease the empty drive ratio of vehicle effectively, make the distribution route more reasonable, decrease transportation cost and improve the economic performance. The core of logistics distribution is distribution vehicle scheduling problem. Vehicle scheduling problem of logistics distribution refers to how to allocate vehicles, organize transportation, minimize empty drive distance and transportation cost under the condition of given transportation task. Logistics distribution cost can be decreased through optimizing vehicle scheduling program (Jain et al., 2009). Therefore, solving optimizing scheduling program with modern mathematical method and computer quickly is an important subject widely discussed by experts both at home and abroad. Vehicle routing problem (VRP) is an optimization of joint problems with the widest application in vehicle scheduling of logistics distribution (Liu, 2013); is the key problem in logistics distribution process and is a hot topic in the field of operations research and combinational optimization, which is in the central position of modern logistics (Anitha and Duraiswamy, 2012). Vehicle routing problem, simply speaking, is the proper selection of vehicle and route as well as reasonable preparation of transportation planning. It needs to make scientific distribution program to confirm reasonable vehicle distribution and vehicle route. Solving the vehicle routing problem reasonably can not only simplify distribution process, 125

2 decrease times of distribution, decrease the empty drive ratio of distribution vehicle and then decrease logistics cost and improve economic performance, but also speed up the reaction speed to customer demand, improve service quality and increase the satisfaction of clients to logistics. Therefore, the research on vehicle routing problem is of great significance. 2. GENERAL DESCRIPTION OF VEHICLE ROUTING PROBLEM The general description of this problem is: it is requested to design vehicle distribution route reasonably, make each vehicle departs from the distribution center and goes back to distribution center after accomplishing the distribution tasks of several demanding points by knowing the locations of distribution center, a series of clients demand points, the demand amount of clients, number and types of vehicles at distribution center and satisfying certain constraint conditions (Sotiropoulos et al., 2010). Certain targets (for example, the shortest driving route, the lowest distribution cost, the optimal logistics distribution and service level and the less number of distribution vehicles etc) have been reached through optimizing vehicle scheduling and under the premise of satisfying customer demands (Shorakaei, 2014). Figure 1 is the tour distribution map of routes for four vehicles, the box indicates center site, the arrow indicates route and the circle indicates customer demand point. Figure 1. Vehicle path graph Vehicle routing problem has been restricted by various conditions, such as (1) Restriction of vehicle capacity, the total customer demand served by each vehicle should not exceed the maximum load of vehicle; (2) Restriction of time window, each client must be served within certain time range; (3) Logistic enterprise may have several distribution centers to serve clients; (4) Clients may return some goods to distribution center; 126

3 (5) Clients can be served by different vehicles; (6) Number of clients, demand amount and route appear randomly; (7) Limitations exist in the sequence of service among clients etc. In research, some basic assumptions are usually made for constraint conditions, for example, accomplish distribution task with one distribution center and single type of vehicle; the distributed goods can be mixed; the location of each client and their distances to distribution center are already known; distribution center has enough goods for delivery and has enough transportation capacity (Panday and Bansal, 2015); each client is served by one vehicle and can only be served by one vehicle; the demand of each route can t exceed the maximum load of vehicle; all the vehicles depart from distribution center and go back to distribution center after accomplishing the task (Mcgehee, 2013; Mousavi et al., 2011; Skok et al., 2001) It may possibly need to consider about multiple distribution centers, multiple vehicles, time demand of customer service as well as the randomization of customer demand. For one specific problem, the above constraint conditions may be exist and may partially exist. 3. RESEARCH ON VEHICLE ROUTING PROBLEM BASED ON GENETIC ALGORITHM 3.1 CVRP mathematical model Because CVRP (Capacitated Vehicle Routing Problem, CVRP) that is the problem needs to consider about a lot of factors (such as number of distribution center, types of vehicle etc), make following basic assumptions for vehicle route problem for easy study: (1) There is only one distribution center; (2) There is only single type of vehicle (the loading is the same); (3) The location of distribution center and clients are known; (4) The demand of clients is known; (5) Each client is only visited by one vehicle; (6) The total demand of each route should not exceed the maximum load of vehicle; (7) All the vehicles depart from distributor center and go back to distribution center after accomplishing the tasks; 8) The total demand of client should not exceed the maximum load of vehicle. Optimization target is the shortest vehicle route of customer demand. 127

4 x y ijk ijk 1,i j 0, others 1,i 0, others (1) Number the distribution center as. for constructing the mathematical model easily. Number the clients as i(i=1,2,,n), in which the main constraint is vehicle capacity constraint and then the mathematical model of CVRP problem is as following: Target function: min Z n n m i0 j0 k1 c x ij ijk (2) Constraint conditions: n i1 g y q, k 1,2,, m i ik (3) n k1 y 1, i 1,2,, n ik (4) n ijk jk i0 x y, j 0,1,2,, n; k 1,2,, m (5) n xi jk yik, i 0,1,, n; k 1,2,m j0 (6) n m n m x x, k 0,1,, m 0jk j0k i0 k1 j0 k1 (7) 128

5 x 0or1, i, j 0,1,, n, k 1,2,, m ijk (8) y 0or1, i, j 0,1,, n, k 1,2,, m ik (9) In the model: Formula (2) is target function; Formula (3) is the vehicle capacity constraint, which is that the total client demand of each route should not exceed the maximum load of vehicle; Formula (4) indicates that each client is visited and can only be visited by one time; Formula (5) indicates that there is only one vehicle arriving at each client; Formula (6) indicates that there is only one vehicle departing from each client; Formula (7) indicates that all the vehicles departs from distribution center and then go back to distribution center in the end; Formula (8) and (9) are integer constraints. The optimization target of model is to minimize the vehicle route while satisfying the client demand. 3.2 Solve CVRP with basic genetic algorithm Because there is similarity in CVRP and TSP, it usually adopts chromosome representation method the same as solving TSP when solving CVRP, which is the single layer chromosome coding scheme based on route representation. Basic genetic algorithm adopts single layer chromosome coding scheme based on route representation to design chromosome structure, introduces penalty function to deal with vehicle capacity constraints and selects suitable genetic operator to make genetic operation. (1) Chromosome structure To improve the efficiency, adoptnatural number coding for CVRP and one route of CVRP can be coded into one chromosome with the length of n+m+1: (0,i11,i12, i1s,0,i21,i22, i2t,0,,0,im1,im2, imk,0), in which ijk indicates No.ijk task. This chromosome structure can be interpreted popularly as vehicle departing from distribution center 0, going back to distribution center 0 after passing tasks i11, i12,, i1s and forming into sub-route 1; and then departing from distribution center 0, going back to distribution center 0 after passing the unvisited tasks i21, i22,, i2t and forming into sub-route 2; repeating until all the n tasks are visited. 129

6 For example, chromosome indicates route: Sub-route 1: distribution center 0 client1 client 2 client3 distribution center 0 Sub-route 2: distribution center 0 client4 client 5 client6 distribution center 0 Sub-route 3: distribution center 0 client7 client 8 client9 distribution center 0 The internal sub-route of this chromosome structure is orderly, if clients exchange positions in sub-route 1, the value of target function will change; while if it is out of order among sub-routes, if sub-route 1 and sub-route 2 exchange positions, and then the value of target function will not change. m is the number of vehicles needed to accomplish the task. To arrange transportation route, firstly, it needs to make reasonable estimation for the number of vehicles for accomplishing the transportation task. Generally, the more constraints for the problem, the more difficult for organization path, the fewer tasks satisfying all constraints of one vehicle; in practical calculation process, it usually confirm the number of vehicle based on formula (10). i m g / q 1 (10) (2) Treatment for vehicle capacity constraint The structure of chromosome designed based on above method changes in crossover and mutation process; the chromosome produced after genetic operation may not meet the constraint of vehicle capacity; therefore, adopt the method of penalty function to deal with constraints and change vehicle capacity constraint into part of target function: n n m m n F x cij xijk Mmax gi yik q,0 i0 j0 k1 k1 i1 (11) m n Mmax gi yik q,0 k1 1 In which, i is the penalty value made when not satisfying the capacity constraint. To meet the capacity constraint strictly, there should be M, but considering about the inconvenience of computer processing, M can select one suitable positive. The value of corresponding target function not satisfying constraint capacity is big and adaptability is low, which will be eliminated in the genetic operation process. (3) Adaptability function Take the reciprocal of target function as adaptability function, that is f(x)=1/f(x), in which F(x) is target function. In this paper, target function indicates corresponding diving distance of individual, the shorter corresponding driving distance of individual, the higher adaptability, the longer corresponding driving distance of individual, the lower adaptability (Gierthmühlen et al, 2007). 130

7 (4) Selection of genetic operator Due to the features of chromosome coding, the chromosome crossover operation can t make simple crossover for the genes of two chromosomes directly based on traditional crossover method and it has to construct new crossover method. In addition, as the internal sub-route of chromosome is orderly while it is out of order among sub-routes, it is difficult to solve the good features of parents if adopts common crossover operator for solving TSP. For example, in chromosome A= , has become the subroute of the optimal route, while has not become the optimal sub-route. Make crossover for chromosome, if the selected crossover part includes gene segment 30, the offspring formed after crossover operation may lose the excellent gene of Therefore, one new crossover method-maximum preserved crossover has been proposed in this paper. 1If two genes at chromosome crossover points are both 0, and then make sequential crossover directly. First, preserve the selected gene segments and all genes 0, fill in to the corresponding location of offspring chromosome, and then delete this gene segment and gene 0 from corresponding paternal chromosome and fill the test genes into the blank location of offspring chromosome based on sequence. For example: 1 2 P : P : (12) First, copy gene segment and gene 0 between two crossover points into the corresponding position of offspring and attain: 1 2 O : O : (13) And then delete the genes4,5,6,7 appeared in sub-individual O1 from parental individual P2 and fill the rest genes 2,1,8,9,3 into O2 to attain: O 1 : (14) Attain another offspring similarly: O 2 : (15) 2 If the genes at chromosome crossover point are not O completely, and then turn the crossover point to left or right until both genes at left and right crossover points are 0 and finally make sequential crossover. Such as: 131

8 1 2 P : P : (16) Move the crossover point in double individuals P2 by one step and change into 1 2 P : P : (17) The offspring produced after maximum preservation crossover operation is: O O 1 2 : : (18) 4. EXAMPLE VERIFICATION AND RESULTS ANALYSIS C++ language has been adopted in this paper to realize improved genetic algorithm in this paper and example verification has been made for above algorithm on computer with CPU frequency of 1.73GHz and inventory of 512MB. 4.1 Example verification To test the performance of improved genetic algorithm, test if it can offer better results for large-scale vehicle routing problem. The improved genetic algorithm in this paper has calculated VRP benchmark test example E-n51-k5. In the example, the number after n indicates the size of problem and its value equals to total number of clients +1 (including distribution center); the number after k indicates the number of vehicles requested by optimal solution. Verify with E-n51-k5V testing problem proposed by Christofides and Eilon. This testing problem has one distribution center and 50 customer demand points, the coordinates and customer demand of distribution center and each client are as shown in table 1 and the vehicle capacity is 160. It needs to arrange the distribution route of vehicles reasonably to minimize the distribution route. 132

9 Table 1 Distribution center and a task point coordinates and customers need to quantity custom er points coordinat es Dema nd custom er points coordinat es Dema nd custom er points coordinat es Dema nd 0 (31,41) 0 17 (28,26) 5 34 (62,22) 29 1 (38,56) 5 18 (18,36) (63,69) 18 2 (20,23) 8 19 (16,42) 6 36 (35,32) 9 3 (41,54) (57,12) (45,46) 16 4 (22,29) 9 21 (62,14) 8 38 (52,41) 8 5 (41,54) (63,25) 9 39 (12,69) 28 6 (18,12) (8,16) (22,29) 19 7 (23,36) (9,41) (32,56) 28 8 (52,62) (7,29) (5,18) 12 9 (53,41) 8 26 (17,28) 8 43 (23,54) (24,12) 6 27 (22,47) 9 44 (26,45) (42,15) (36,41) (22,39) (31,36) (22,10) 9 46 (29,36) (5,26) 5 30 (10,25) (8,54) 5 14 (5,42) 2 31 (15,19) (9,25) 6 15 (12,45) (22,25) (18,26) 8 16 (45,23) (31,16) 3 50 (27,45) Results analysis Operate this example on computer randomly with improved genetic algorithm for 8 times and the attained optimal results are as following: The attained shortest route is and the corresponding 5 routes are: Vehicle 1: Vehicle 2: Vehicle 3: Vehicle 4: Vehicle 5: The results after 8 times of random operation are as shown in table 2. It can be seen from table 2 that the average value of the optimal results based on improved genetic algorithm after 8 operations is , the maximum value of optimal solution after 8 operations is and the minimum value is ; there is small difference between optimal results within 6% and the results are relatively stable. Its reaction time is 5s and the convergence speed is fast. Use this algorithm to solve and the results are satisfactory. 133

10 Table 2 Operation results number optimal value Table 3 E-n51-k5 VRP test the algorithm to solve the optimal value problem Algorithm Optimal value Save method Two stage method Simulated annealing Particle swarm optimization The basic genetic algorithm Improved genetic algorithm The adoption of adaptive crossover probability and 2-opt mutation operator has improved the searching ability of algorithm, improved the convergence rate of improved genetic algorithm greatly and made up the shortage of basic genetic algorithm which is easily to be trapped in local optimal. Under the large-scale situation, the solution result of this improved genetic algorithm is better and the success rate of searching is higher. Literature (Potvin et al., 1996) adopts saving algorithm and two-phase method; literature (Reed, 1996)adopts simulated annealing algorithm; literature (Contardo and Martinelli, 2014) adopts particle swarm algorithm; literature (Ezzatneshan, 2010)basic genetic algorithm solves E-n51-k5 VRP testing problems respectively and the optimal values comparison of five heuristic algorithm is as shown in table 3. The data in table 3 has shown that the algorithm proposed in this paper can attain better optimal value. The optimal solution solved by improved genetic algorithm designed in this paper is 11.5% higher than the optimal solution attained by saving algorithm, 4.2% higher than the results attained by two-phase method and is improved obviously than the results attained by simulated annealing algorithm and particle swarm algorithm; compared with basic genetic algorithm, the solution of improved algorithm is better, which explains that the algorithm performance proposed in this paper is more superior and is an effective optimization method. When solving large-scale VRP problem, it can shorten the distribution distance. The improved algorithm is with good global searching performance, can search for better feasible solution and improve the convergence speed of genetic algorithm at the same time. This algorithm is easy and convenient for operation and is a practical and feasible optimization method for solving the vehicle routing problem of logistics distribution. 134

11 5. CONCLUSION This paper has elaborated the basic idea, operation steps and improvement methods of genetic algorithm in details, analyzed CVRP problem, established mathematical model and introduced the principle and steps of basic genetic algorithm of solving CVRP on this basis and proposed improved genetic algorithm based on double layer chromosome coding scheme and adaptive crossover probability for the shortage of genetic algorithm. Example verification has been made with adoption of C++ programming and VRP standard testing data and the results have proven the feasibility and effectiveness of this algorithm. 6. REFERENCES Anitha E.B., Duraiswamy K. (2012). A heuristic moving vehicle location prediction technique via optimal paths selection with aid of genetic algorithm and feed forward back propagation neural network, Journal of Computer Science, 8(12), Contardo C., Martinelli R. (2014). A new exact algorithm for the multi-depot vehicle routing problem under capacity and route length constraints, Discrete Optimization, 12(1), Ezzatneshan A. (2010). A algorithm for the Vehicle Problem, International Journal of Advanced Robotic Systems, 7(2), Gierthmühlen J., Rempe T., Wolff S. (2007). Optimal offline path planning of a fixed wing unmanned aerial vehicle (UAV) using an evolutionary algorithm, Evolutionary Computation, CEC IEEE Congress on Gholamjafari A. (2015). A Genetic Algorithm approach to best scenarios selection for performance evaluation of vehicle active safety systems, Dissertations & Theses Gradworks. Hashimoto H., Yagiura M., Ibaraki T. (2008). An iterated local search algorithm for the time-dependent vehicle routing problem with time windows, Discrete Optimization, 5(2), Jain M., Desai C., Kharma N. (2009). Optimal powertrain component sizing of a fuel cell plug-in hybrid electric vehicle using multi-objective genetic algorithm, Conference of the IEEE Industrial Electronics Society. IEEE, Liu C.Y. (2013). An Improved Adaptive Genetic Algorithm for the Multi-depot Vehicle Routing Problem with Time Window, Journal of Networks, 8(5). Liu S., Huang W., Ma H. (2009). An effective genetic algorithm for the fleet size and mix vehicle routing problems, Transportation Research Part E Logistics & Transportation Review, 45(3), Mcgehee J.L. (2013). Optimal control of a mild hybrid electric vehicle using weight functions and genetic algorithms, Dissertations & Theses Gradworks. Mousavi M., Hoque S., Rahnamayan S. (2011). Optimal design of an air-cooling system for a Li-Ion battery pack in Electric Vehicles with a genetic algorithm, IEEE Congress on Evolutionary Computation, Panday A., Bansal H.O. (2015). Optimal fuel control of series-parallel input split hybrid electric vehicle using genetic algorithm based control strategy, iceee Park N., Okano H., Imai H. (2000). A Path-Exchange-Type Local Search Algorithm for Vehicle Routing and Its Efficient Search Strategy, Journal of the Operations Research Society of Japan, 43(1), Potvin J.Y., Duhamel C., Guertin F. (1996). A genetic algorithm for vehicle routing with backhauling, Applied Intelligence, 6(4), Reed M., Yiannakou A., Evering R. (2014). An ant colony algorithm for the multicompartment vehicle routing problem. Applied Soft Computing, 15(2), Shorakaei H., Vahdani M., Gholami B.I.A. (2014). Optimal cooperative path planning of unmanned aerial vehicles by a parallel genetic algorithm, Robotica, 34(4),

12 Skok M., Skrlec D., Krajcar S. (2001). The Genetic Algorithm Scheduling of Vehicles from Multiple Depots to a Number of Delivery Points, Arficial Intelligence, 349. Sotiropoulos P., Aspragathos N., Andritsos F. (2010). Determination of the Optimum Docking Position for an Unmanned Underwater Vehicle using a Genetic Algorithm, Lecture Notes in Engineerin g & Computer Science, 2186(1). 136