Parallel Ant Colony Optimization Algorithm For Vehicle Routing Problem

Size: px
Start display at page:

Download "Parallel Ant Colony Optimization Algorithm For Vehicle Routing Problem"

Transcription

1 International Conference on Software Engineering and Computer Science (ICSECS2013) Parallel Ant Colony Optimization Algorithm For Vehicle Routing Problem Ya Li, Dong Wang, Yuewu Yang, Yan Zhou, and Chen Wu dept. Computer School of Electrical&Information Engineering,Foshan University Foshan Guangdong, China Abstract this presents a parallel ant colony based on essage Passing Interface (PI) for vehicle routing problem (VRP). At beginning of, a subcolony is simulated in each processor which independently computes to ensure population diversity. In order to overcome shortcoming of ant colony that is easy to fall into local optimum, a method is designed to udge wear parallel get into premature stage. Once premature phenomenon turns up in whole colony, local search strategy is used to help search better. When iterative process is over, optimal of all ant colony computed is improved by neighborhood exchange strategy. Experimental results show that is effective and feasible especially for VRP of large scale cities. Keywords- parallel; ant colony ; premature stage I. INTRODUCTION Vehicle routing problem is an important segment of modern logistics, as economy continues to grow, distribution size of vehicle increases, efficiency of vehicle scheduling system is also need to rise, so research about vehicle routing problem has important oretical and practical significance[1]. VRP refers to in nown locations of distribution center and customers,design a path to get shortest distance or least transportation cost as much as possible to achieve maximum economic benefits of enterprise under premise of meeting customer demand and maximum load of vehicle[2]. VRP is a typical NP-hard; it is difficult to obtain a satisfactory global optimal. Currently, heuristic s become main s for VRP, y are: genetic, ant colony, particle swarm optimization, simulated annealing [3, 4]. Ant colony (ACA) is proposed by Italian scholars inspired by collective behavior of real ant colony [5]. In dealing with large and complex problem, serial ant colony optimization is slow, local convergence, while ant colony has a feature of parallelism, so parallel ant colony becomes an important area of research. Parallel computing has ability of process large scale data and can improve efficiency and speed operation. In parallel ant colony, information exchange patterns and cycles is an important factor, which will affect performance of [6]. This presents a parallel ant colony based on essage Passing Interface (PI), at beginning of ; a subcolony is simulated in each processor which independently computes to ensure population diversity. A method is designed to udge wear get local optimum. Once premature phenomenon turns up in whole colony, optimal computed by each sub-colony is gared and minimum value among m is selected. Both minimum value and pheromone matrix of sub-colony getting minimum value are broadcasted to whole ant colony,based on minimum value and pheromone matrix, iterative process of each sub-colony continues until some criterion for convergence is met. When iterative process is over, optimal is selected among sub-colony, which will be improved by neighborhood exchange strategy in order to get a better. II. THE ATHEATICS ODEL OF VEHICLE ROUTING PROBLE Suppose re are N cities, city numbered 0 is distribution center, No. 1 ~ N-1 of cities are customers waiting for delivery; Position of customer is (x, y ), demand of customer is demand ; There are cars, maximum carrying capacity of each car is axload, distance between city i and city is d,a cargo delivery missions is required to meet a minimum total traveling distance. Path maring function path = 1, vehicle through path(i,) in this cycle 0,orwise City maring function route = 1, vehicle service for city in this cycle 0,orwise The departure load of car is setload ; The load of car in path (i, ) is The total distance of all cars traveled: Y y load ; 1 In Equation 1,y is a total distance of car traveled: The authors - Published by Atlantis Press 107

2 y N 1 N 1 i0 0 path d The demand of distribution Center : demand 0 = 0 The distance between city i and : d Constraints: axload 2 ( xi x ) ( yi y N 1 demand route ) 2 1 1,2, Ensure that each car's actual loading must not exceed its maximum load. path 1 i 1 i 0,1, N-1, 0,1, N-1 Ensure that each path is only serviced once by a vehicle. route 1 1 1,2, N-1 Ensure that all customers are only serviced once by a vehicle [7]. III. PI PROFILE PI is composed of a group of library functions, tass between parallel programs communicate through se functions. These functions include elementary functions (used to construct environment and related issues), basic point messaging functions and collective messaging functions. The first function called in PI program must be PI_ Init (), this function can be called only once to initialize PI programming environment. After all function called, code must be over in PI_Finalize (), it maes program exit PI programming environment. After PI_ Init () called, its default communicator property is set to PI_CO _WORLD, this attribute includes all tass, used to determine number of tass and each tas s id. PI_Comm _size ( ) is used to get number of tass which need PI_CO _WORLD as parameter[8]. IV. THE PRINCIPLE AND IPLEENTATION OF PARALLEL ANT COLONY ALGORITH BASED ON PI The mainly includes following improvements: construct policy according whole colony to determine wher going into premature stage; Once going into this stage, pheromones of each sub-colony is redistributed in accordance with pre-determined strategy to help escape from local optima to improve search speed; Finally, neighborhood exchange strategy is used on optimal to furr improve search accuracy. A. Premature Judgment Policy In traditional serial ant colony, through positive feedbac of information, amount of information on better path is gradually increased. With increase in number of iterations, amount of information on better path is significantly higher than or paths. But this usually can not obtain optimal, but better existing near optimal. At this time, goes into premature stage. For parallel ant colony, re is same problem. The presented by this simulates a subcolony in each processor. At early stages of, each processor independently calculates. Therefore, time of each sub-colony going into premature stage is various. In order to measure time of whole parallel going into premature, a constant N is set. After each subcolony finish N time s iteration, premature udgment policy starts. Because ant colony is an evolving process, it usually goes into premature stage in late of iterations, constant N is usually between maximum number of iterations Ncax and Ncax divided by 2. Since change of optimal of each sub-colony is unchanged or smaller, so computing average of each sub-colony s optimal in same iteration can reflect entire state of parallel s. If average of optimal in continuous Nbestax time s iterations remains unchanged (Nbestax is predefined value), it means parallel s going into premature stage. So after each sub-colony finishes iterations for N times, premature udgment policy starts. In next iterations, optimal of each sub-colony is gared and average of m is calculated. If averages of optimal s in continuous Nbestax time s iterations remain unchanged, local search strategy is started, else iteration continues. A integer random is randomly generated between N + i* Nbestax +1 and Ncax, here, i is an integer that represents times of starting premature udgment policy. The initial value of i is 0, after each premature udgment policy is started, i is incremented. When number of iteration is random, premature udgment policy starts. Repeat process until local search strategy starts or cycle is end directly into local search strategy. 108

3 B. Local Search Strategy Before goes into premature stage, subcolony in each processor tae use of advantages of parallel s, each processor on each sub-colony calculate independently to maintain diversity of s. Once whole colony goes into premature stage, subcolony in each processor requires exchange of information between m in order to help to enhance local search ability, get rid of local optimal, open up new paths to get a better near optimum. Specific strategy is that when whole colony into premature stage, optimum s calculated by each sub-colony are gared and minimum value is selected. The minimum value and pheromone of sub-colony get minimum value are broadcasted to each sub-colony. On basis of se, each sub-colony continues to iterate following steps of ant colony until it reaches predetermined times. Finally optimal s calculated by each sub-colony are re-collected, minimum value is selected to furr optimize. Since each sub-colony continues iteration based on optimal whole colony calculating, convergence speed of will be greatly accelerated. In addition, each subant modify its pheromone according sub-colony get minimum value, which can guarantee in subsequent iterations of, search is near optimal s, advantages of parallel s is used to help get rid of local optimal, and improve search accuracy. C. Neighborhood Exchange Strategy When Ant colony calculates state transition probability, an important factor is involved: 1 ( t) d heuristic function, is desired heuristic factor, reflecting degree heuristic information is valued during movement of ants. The greater value is, similarer is to greedy rule [9]. Therefore ant colony has shortcoming of randomness which is also shortcoming of greedy rule. When structures a, it does not care "" is how to compose and will only concern " components." In or words, " components" that greedy rule get are generally all components of optimal. But greedy rule can not combine " components" into optimal s. The greedy rule can only combine " components" randomly, but optimal is generally unique. In actual calculation process, constitute of shortest path can often be obtained, but not shortest path. For example, in Fig. 1, Fig. 2, vertex is composition of (cities); connection is combination mode (vehicle routing route). Figure 1 is oretical optimum ; Fig. 2 is one set of approximate s s find. It is not difficult to find components of two s are same, except that combination mode, and as long as two sides exchanged in Fig. 2, optimal can get. This approach is neighborhood exchange: use more rational edges replace original edges [10]. Figure 1. oretical optimum Figure 2. approximate To eliminate cross of path, proposed uses neighborhood exchange strategy for furr optimization optimum and rearranged optimal path. The adustment procedure for optimum route of each vehicle is as follows: The cities that vehicle traveled are sorted by abscissa x, If abscissa x of two cities are same, two cities are sorted by longitudinal distance to distribution center. After sorted, minimum distance is adusted (if better appears); Then cities that vehicle traveled are sorted by ordinate y, If ordinate y of two cities are same, two cities are sorted by lateral distance to distribution center.after sorted, minimum distance is adusted (if better appears). D. Specific Algorithm Steps Step 1:No. 0 process reads size N of city, each city s point coordinates (x,y ), demand of each city (demand ) and vehicle s maximum load(axload). The distance between cities are calculated according to formula (3). All 109

4 information will be broadcasted to or processes. Step 2: Parameter initialization. Ncax, Nbestax and N are set in each sub-colony. The or parameters ant colony involved are set for best configuration values. Step 3: The sub-ant colony calculates in accordance with max-min ant colony. Step 4: When number of iterations of each subcolony have reached N times (achieved by synchronization of PI_Barrier), is udged wher to go into premature stage according to premature udgment policy. If goes into premature stage, step 5 is executed, if not, iteration continues until goes into premature stage or end of iteration. If end of iteration, step 6 is executed. Step 5: The local search is started near optimal according to local search strategy. Step 6: The optimal s that sub-ant colony obtained are collected, one of minimal is selected, and minimal are furr optimized according to neighborhood exchange strategy. V. SIULATION AND ANALYSIS The experimental environment is: 4 computers(pentium (R) 4 2.8GHz CPU, 512 RA);100 switch; Windows XP operating system, PICH2 libraries, icrosoft VC programming software are installed on each computer. In order to verify and compare effect of, this selects two typical examples from internationally VRP problem libraries (Solomon s instances) as test cases. The parameters of involved in two cases: 1, 3, 0.8, Q 60,Ncax = 10000, Nbestax = 5, N = A. edium-scale Test This selects TSPLIB, eil51 VRP problem, namely 51 cities vehicle routing problem, as medium-scale test case. The runs in two hosts is compared with standard of ant colony of stand-alone version, parameters of standard of ant colony are same with. Figure 3 shows optimal s of two s obtained by 10 experiments. The solid lines represent optimal of standard of ant colony of stand-alone version, dashdotted line represent optimal of of this. Figure 3. Values of optimal in 10 experiments for eil51 VRP problem Table 1 gives number of vehicles, average, optimal, worst and average time of computation ( average time of end last process) that two s obtained in 10 experiments. TABLE I. standard of ant colony vehicle number ANALYSIS OF EXPERIENTAL RESULTS FOR EIL51 VRP PROBLE average optimal worst average time of computation (/s) B. Large-Scale Test This also selects TSPLIB, eil101 VRP problem, namely 101 cities vehicle routing problem, as large-scale test case. The s in two hosts and four hosts are compared with standard of ant colony of stand-alone version. Figure 4 shows optimal s of three conditions obtained by 10 experiments. The solid lines represent optimal of standard of ant colony of stand-alone version, dotted line represents optimal of in two hosts, dash-dotted line represents in four hosts. 110

5 In terms of time, time-consuming are slightly more than standard of ant colony of stand-alone version, but this extra time is only used to exchange optimal and pheromone of sub-ant colony after entering premature stage, so extra time is not a lot. For large scale cities, with increase in number of hosts, time-consuming of are not increased significantly, this is because larger size of city, smaller proportion of se extra time in whole computer time. Therefore, For large scale cities, when more host involved in compute, can get better result in a short period of time. Figure 4. Values of optimal in 10 experiments for eil101 VRP problem Table 2 gives number of vehicles, average, optimal, worst and average time of computation ( average time of end of last process) that three conditions obtained in 10 experiments. TABLE II. standard of ant colony (2 host) (4 host) ANALYSIS OF EXPERIENTAL RESULTS FOR EIL101 VRP PROBLE vehicle number average optimal worst average time of computation (/s) C. Analysis Of Experimental Results From Figure 3, Figure 4, Table 1 and Table 2, it can be seen, both for medium scale or large scale cities, optimal s obtained by are significantly better than standard of ant colony of stand-alone version. Especially to large scale cities, more number of hosts running, better optimal obtained. This is due to more detailed local search near optimal after going into premature stage, higher quality of optimal. VI. CONCLUSIONS This presents an improved parallel ant colony for vehicle routing problem. The improved can effectively avoid problem of local optimal, get higher quality ; especially for problem of larger scale cities, when more hosts involved in compute, can get better results in a short period of time. Experimental results show that is effective and feasible. ACKNOWLEDGENT This is supported by Guangdong Province scientific and technological proect (2012B ) and Guangdong Province outstanding and innovative young personnel training proect (2012LY_0132). REFERENCES [1] JIANG Qi-wei,CHEN Zhi-ya, On Dynamic Programming ethod in Shortest Route of Logistics Delivery, Systems Engineering, vol. 25,Jan. 2007, pp [2] Wu Jianun,Liu Jun, IXED ANTS ALGORITH OF ROUTING PROBLE FOR LOGISTICS DISTRIBUTGION, China Civil Engineering Journal, vol. 37,Aug. 2004, pp [3] WU Jie-ming, Vehicle Routing Optimization Problem of Logistics Distribution, Computer Simulation, vol. 28,Jul. 2011, pp [4] CHEN Yin,XU Hong-mei, Application of Hybrid Algorithm in Vehicle Routing Problem, Computer Simulation, vol. 29,ay. 2012, pp.356. [5] Colorni A, Dorigo and aniezzo V, An investigation of some properties of an ant, Proc. of Nature Conference ( PPSN 92), Brussels, Belgium: Elsevier Publishing,1992,pp [6] ELLABIB I,CALAAI P andbasir O, Exchange strategies for multiple ant colony system, Information Sciences, vol. 177,ay. 2012, pp [7] LI Ya,WANG Dong, Ant colony optimization based on chaotic disturbance and neighborhood exchange for vehicle routing problem, Journal of Computer Applications, vol. 32,Feb. 2012, pp.444. [8] Liu Dong,Chang Jing,Wei Wen-hong and Zhao Jie, Research and Implementation of Parallel Ant Colony Optimization Algorithm Based on PI, Journal of Guangdong University of Technology, vol. 25,Jan. 2008, pp.39. [9] Duan Hai-bin, ant colony s:ory and applications, Being: Science Press,2005. [10] arco Dorigo, Thomas Stützle, Ant Colony Optimization, Being: Science Press,