Particle Swarm Optimization with Partial Search To Solve TSP M. A. H. Akhand, Shahina Akter, S. Sazzadur Rahman and M. M. Hafizur Rahman
Introduction to PSO Particle Swarm Optimization (PSO) is a population based optimization technique on metaphor of social behavior of flocks of birds and/or schools of fishes. PSO includes elements of exploration and exploitation (or local and global search) and found effective for function optimization. PSO recently studied to solve combinatorial problems such as Traveling Salesman Problem (TSP).
Position Change in PSO In PSO, each Particle changes position in every iteration calculating velocity based on own previous best position and best particle’s position. Velocity Vid(t)= ω*Vid (t-1)+η1*rand()* ( Pid − Xid )+η2*rand()* ( Pig − Xid ) New position Xid (t)= Xid(t-1) + Vid Where, ω = the inertia factor Xid = position of the particle Pid = best solution of particle (local best) Pig = global best solution of all the particles. η1*rand() and η2*rand() are weight determining the influence of Pid and Pig
Position Change in PSO Xi(t+1) Vi Vi(t+1) Pig Pid Xi Xi = current position of the particle Vi = velocity of the particle Pid = best solution of particle (local best) Pig = global best solution of all the particles.
PSO simulation(Initial state)
After 5 Generation
After 10 Generation
After 15 Generation
After 30 Generation
After 50 Generation
After 100 Generation
After 500 Generation
PSO for TSP PSO found effective for function optimization and recently studied to solve combinatorial problems such as Traveling Salesman Problem (TSP). Every particle in PSO is considered as a complete tour for solving TSP. The velocity is termed as Swap Sequence (SS) of several Swap Operators (SOs). A SS may define as SS= (SO1, SO2, SO3... SOn) . A SO indicates two positions in the tour that might be swap. PSO representation for TSP, : Xi (t) = Xi (t-1) +Vi (t) Vi (t) = Vi (t-1) α( Pid (t-1) − Xi (t-1) ) β (Pig (t-1) − Xi (t-1) ) The operator means to merge two SSs into a new SS. All swap operators of a SS are applied maintaining order on a particle and gives a new tour.
Swap Operator in Detail Suppose a tour of five cities is S= (l, 2, 3, 5, 4). For Swap Operator SO (1, 2), the new tour S’ is: S'= S + SO (1, 2) = (1, 5, 3, 2, 4) + (1, 2) = (5, 1, 3, 2, 4) Here meaning of ‘+’ is to conceive swap operator and change the position of cities in the solution indicated in the operator. A Swap Sequence (SS) is set of SOs. SS= (SO1, SO2, SO3,... SOn). If S2 =S1+SS 12 = S1 + (SO1, SO2, SO3,... Son) then SS 12= S2 -S1 = (SO1, SO2, SO3,... SOn) N.B.: Different SSs may produce same new solution acting on a solution.
New Tour applying SS based Velocity 5 4 3 1 8 6 2 9 7 10 5 4 3 1 8 6 2 9 7 10 Vi (t) = (4,9),(1,7),(2,7),(3,9). Vi (t) = (4,9),(1,7),(2,7),(3,9). Vi (t) = (4,9),(1,7),(2,7),(3,9). Vi (t) = (4,9),(1,7),(2,7),(3,9). Vi (t) = (4,9),(1,7),(2,7),(3,9). ∫(x) 51.36 3 7 6 9 2 4 10 5 8 1 3 7 6 8 2 4 10 5 9 1 10 7 6 8 2 4 3 5 9 1 10 3 6 8 2 4 7 5 9 1 ∫(x) 44.46 10 3 9 8 2 4 7 5 6 1 10 3 9 8 2 4 7 5 6 1 ∫(x) 44.46 All the SOs of the velocity SS are applied to get new tour. Implementation of every SO gives a new tour and partial implementation of velocity SS may give better tour
Motivation to PSO with Partial Search 5 4 3 1 8 6 2 9 7 10 5 4 3 1 8 6 2 9 7 10 5 4 3 1 8 6 2 9 7 10 5 4 3 1 8 6 2 9 7 10 5 4 3 1 8 6 2 9 7 10 Vi (t) = (4,9),(1,7),(2,7),(3,9). Vi (t) = (4,9),(1,7),(2,7),(3,9). Vi (t) = (4,9),(1,7),(2,7),(3,9). Vi (t) = (4,9),(1,7),(2,7),(3,9). Vi (t) = (4,9),(1,7),(2,7),(3,9). ∫(x) 51.36 3 7 6 9 2 4 10 5 8 1 ∫(x) 54.46 3 7 6 8 2 4 10 5 9 1 ∫(x) 43.85 10 7 6 8 2 4 3 5 9 1 ∫(x) 43.85 10 7 6 8 2 4 3 5 9 1 ∫(x) 47.23 10 3 6 8 2 4 7 5 9 1 10 3 9 8 2 4 7 5 6 1 ∫(x) 44.46 Partial implementation velocity SS give better tour. In PSOPS evaluation is made after applying every SO of velocity SS and final is partial SS which give best tour.
Equations for PSOPS Xi (t) = Xi (t-1) +Vi (t) Vi (t) = Vi (t-1) α( Pid (t-1) − Xi (t-1) ) β (Pig (t-1) − Xi (t-1) ) Suppose Vi(t)= SO1, SO2,……SOn then X1i(t) = Xi(t-1)+SO1 ; X2i(t) = X1i(t) +SO2= Xi(t-1)+SO1 + SO2 Xni(t) = Xn-1i(t) +SOn Xi(t) = Xji(t) where Xji(t) belongs minimum Tour Cost among X1i(t), X2i(t) .. Xji(t) .. Xni(t). Velocity Considered Vi(t) = Xi(t) - Xi(t-1) (9)
Proposed PSO with Partial Search (PSOPS) algorithm Initialize particles with random tours. Calculate fitness of each particle and copy as Pid; identify Pig in the population. For each particle Calculate tentative velocity V’i(t) using Eq. 7. Calculate new solution (i.e., tour) Xi(t) using Eq. 8. Calculate final velocity Vi(t) using Eq. 9. Update Pid with current new solution (i.e., tour) if new one is better than exiting Pig Update Pig if there is a new best solution, which is superior to Pig. If stopping criteria reach then take Pig as a solution; otherwise go to Step 2. PSO with Partial Search (PSOPS) algorithm for TSP.
Experimental Results on Benchmark Problems Tour cost comparison among GA, PSO and PSOPS for benchmark TSP problems. Problem GA PSO PSOPS burma14 32.49 33.02 30.95 eil51 860.71 870.23 768.18 berlin52 17547.22 15786.42 14099.36 eil76 1624.30 1591.04 1263.52 kroA100 116722.26 118089.89 84224.50 kroA200 211219.60 274825.01 206281.56 For a method, the results are the average of five independent runs with population size 100 and number of generation 500. PSOPS is shown to achieve better results than other methods for any problem.
Analysis: Tour Cost Vs Generation for Burma14 problem PSOPS converge rapidly with respect to PSO and GA
Analysis: Req. Time vs Generation for Burma14 problem PSO and PSOPS require similar time that is less than GA
Conclusion A Partial Search option is explained and investigated for PSO for solving TSP. In proposed PSO with Partial Search (PSOPS) tentative velocity is calculated and tour cost is measured after applying every Swap Operator (SO) of the tentative velocity Swap Sequence (SS). Final velocity is part of SS that gives best tour. The PSOPS algorithm produces optimal solution within a minimal time than standard PSO and Genetic Algorithm in solving benchmark TSPs.
Thank You All