International Journal of Engineering & Computer Science IJECS-IJENS Vol:3 No:0 Modified Ant Colony Optimization for Solving Traveling Salesman Problem Abstract-- This paper presents a new algorithm for solving the Traveling Salesman Problem (NP- hard problem) using pheromone of ant colony depends on the pheromone and path between cites. TSP is a problem in theoretical computer science which is very hard to solve a number of real-world problems can be formalized as TSP problems, and ants of the colony are able to generate successively shorter feasible tours by using information accumulated in the form of a pheromone trail deposited on the edges of the TSP and improves ACO by taking under consideration the overall path of cities in candidate list. Sometimes choosing minimum distance isn't a guaranty that s a best path. The experimental results on large set of samples indicate that the new approach is better than the original one for finding optimal solutions of the (TSP) in less time as compared to results achieved by applying basic idea of ACO algorithm. Keywords Modified Ant Colony System, Traveling Sales man Problem I. INTRODUCTION The traveling salesman problem (TSP) is the problem of finding a shortest closed tour which visits all the cities in a given set. In this article we will restrict attention to TSPs in which cities are on a plane and a path (edge) exists between each pair of cities (i.e., the TSP graph is completely connected) []. Real ants are capable of finding the shortest path from a food source to the nest without using visual cues []. They are deposit pheromones according to the quality of the path they find [2], this allow capable of adapting to changes in the environment, for example finding a new shortest path once the old one is no longer feasible due to a new obstacle consider[]. Since ants prefer to follow trails with larger amounts of pheromone, eventually all the ants converge to the shorter path around the obstacle as shown in figure [3]. Fig.. Illustrating the behavior of real ant movements. In particular, several ant species are capable of selecting the shortest pathway, among a set of alternative pathways, from their nest to a food source. Ants deploy a chemical trail (or pheromone trail) as they walk; this trail attracts other ants to take the path that has the most pheromone. This reinforcement process results in the selection of the shortest path: the rest ants coming back to the nest are those that took Kanar Shukr Mohammed Software Engineering Dep. Salahddien University Erbil Iraq kanarshukr@yahoo.com kanarshukr@eng-usalah.org the shortest path twice (to go from the nest to the source and to return to the nest), so that more pheromone is present on the shortest path than on longer paths immediately after these ants have returned [4]. This paper produces an approach for solving traveling salesman problem (TSP) by making modification on ACO depends on pheromone on edges between unvisited cities and maximum path between them. The salesman starts at some city and then visits the best city according to the current city until all cities visited and the salesman returns the start city. Find the nearest neighbor tours have the advantage that refers to find shortest path as some times nearest city doesn't refers to the shortest path, thus such tours can serve as good starting at each iteration for subsequently performed improvement method and it's reasonable to put some effort in designing heuristics that are based on neighbor tours principle. II. ANT COLONY OPTIMIZATION The meta heuristic Ant Colony Optimization (ACO) is an optimization algorithm successfully used to solve many NP hard optimization problems. ACO algorithms are a very interesting approach to find minimum cost paths in graphs. The artificial ants have been successfully used to solve the (conventional) Traveling Salesman Problem (TSP) [], as well as have been successfully applied to diverse combinatorial optimization problems quadratic assignment [6], [7], vehicle routing [8], [9], [], telecommunication networks [], graph coloring [2], constraint satisfaction [3], Hamiltonian graphs [4], and scheduling [], [6], [7]. In this section we briefly describe Ant Colony System (ACS), an ACO algorithm introduced by Dorigo and Gambardella (997a, 997b). The algorithms based on the fact that ants are always able to find the shortest path between the nest and the food sources, using information of the pheromones previously lay on the ground by other ants in the colony []. This phenomena considered as (positive feedback) process which could be treated as knowledge sharing through collaborative efforts, based on previous knowledge, ants progressively construct their tours []. Let us consider a symmetric TSP with n cities. Let m be the total number of ants, assumed constant over time. For an ant located on city i, the transition from city i to city j depend on []: () Whether or not city j has already been visited. Each ant has a tabu list that contains all the cities that the ant has already visited. Let Jk(i) be the set of cities that remain to be visited by ant k when ant k is currently on city i.
International Journal of Engineering & Computer Science IJECS-IJENS Vol:3 No:0 2 (2) The distance dij between i and j. dij = dji for a symmetric TSP. (3) The amount of "artificial pheromone" on the edge connecting i to j, denoted by (Ti; j). An ant located in node i will randomly choose to move to node j with the probability Pi,j computed as shown in equation () [9]: (3) The distance dij between i and j. dij = dji for a symmetric TSP. (4) Let J p(i) be the set of paths from city j to start city for each j in J k(i). () The amount of "artificial pheromone" on the edge connecting i to j, denoted by T (i,j). An ant located in node i the probability of i to city j (Pi,j) computed as follows: Where: α is a parameter to control the influence of Ti,j β is a parameter to control the influence of Ni,j j is a node reachable from node i that was not visited yet Following equation (), the ant makes the best possible move (as indicated by the learned pheromone trails and the heuristic information, i.e. the ant is exploiting the learned knowledge) with probability q0, while it performs a biased exploration of the arcs with probability ( q0) [9]. Better solutions need to be marked with more pheromone. So whenever an ant k determines a new tour V k of cost L k the ant will increase pheromone strength on each edge of the tour with a value that is inversely proportional to the cost of the tour by equation (2) [9]. { Ti,j k = When an ant travels along a given path, this traveling takes an amount of time that is proportional with the travel distance (assuming the ants move with constant speed). As pheromone is volatile, if a real ant travels more, pheromone will have more time to evaporate, thus favoring better solutions to be discovered in the future. We conclude that adding pheromone evaporation to our model can be useful, especially for solving a complex problem like TSP. When an ant completes a tour it will retrace its steps marking the edges on the way with pheromone. Therefore they will often choose the edge with the highest pheromone, while the exploration of less probable edges is low. This behavior can be compensated by decreasing the pheromone on edges chosen by ants using a local pheromone evaporation process. This has the effect of making them less desirable, increasing the exploration of the edges that have not been picked yet [9]. III. PROPOSED APPROACH The approach is based upon the ACO algorithm for solving TSP and modification of the ACO to find optimal solution (minimum shortest path) of n cities with m ants. The objectives are: i) an ant starts at any city should visit all cities one time and returns to the start city. ii)an ant at city i the transition from i to city j depend on: () City j not visited yet. (2) Let J k(i) be the set of cities that remain to be visited by ant k when ant k is currently on city i. Where: α is a parameter to control the influence of Ti,j β is a parameter to control the influence of Ni,j j is a node reachable from node i that was not visited yet The Template of the proposed approach (ModifiedACO) is shown below: Procedure ModifiedACO algorithm for TSP Set parameters, initialize pheromone trails Loop Each ant is positioned on a staring node Loop Construct Solutions Apply Local Search Local Pheromone Update Until all ants have built a complete solution Until End_Condition End ModifiedACO for TSP Consider m= ants, n= cities as shown in the following figure 2: 3 4 Fig. 2. Graph with n cities Distance between cities shown in the matrix distance: distance={{0,,2,6,2}, {,0,6,,}, {2,6,0,2,}, {6,,2,0,2}, {2,,,2,0}}; Ant is at c chooses city i depends on equation (3,): P2=0.46, P3=0.23, P4=0.08, P=0.23 Depends on the above probabilities the ant choose city 2 that after finishing all the cities the tour will be 3. With the modified approach Ant is at c chooses city i depends on the following equation: The initial tour for each unvisited city is :{V2=3, V3=26, V4=36, V=26}, 2
Path International Journal of Engineering & Computer Science IJECS-IJENS Vol:3 No:0 3 P2=0., P3=, P4=0.02, P= Depends on the above probabilities the ant chooses city 3 that after finishing all the cities the tour will be 26. The above consideration is the basic of the modified method of the approach for achieved optimal solution. And results show that the modified approach gives small or optimal path with little different time. IV. EVALUATION AND RESULTS To illustrate the effectiveness and performance of an implementation of the approach described in this section, Consider samples of TSP as shown in "Table ", results shown that the approach modification gave good solution with less time completion as compared to ACO. The average of enhancement equals to %0.43. No.ofcities Path(ACO) TABLE I of Traveling Salesman Problem Path(Modified) Differencebetween them Timeinms(ACO) Timeinms(Modified) 3 2 76 2 3 26 9 76 3 7 0 28 22 3 4 68 33 260 48 2 60.9 29.3 3.6 280 0 6 7 7 40 300 72 7 43 82 6 349 94 8 23 2 40 9 9 23 409 332 77 43 0 The evaluation results also show that the modification of the ACO has effect on the required time that is too less as compare with achieved minimum path of original ACO. 2 77 03 74 4 63 "Figure 3" and "Figure 4" show the comparative curves of (ACO results and modified ACO) and time difference between them respectively. Minimum Path Curve for Approach 80 40 00 460 4 380 340 300 260 2 0 40 0 60 6 7 8 9 2 3 4 6 7 9 2 22 23 24 2 26 ACO Solution Modified Method Solution Fig. 3. comparative curves of minimum path between ACO algorithm and modified ACO algorithm
Path International Journal of Engineering & Computer Science IJECS-IJENS Vol:3 No:0 4 Time Curve for Approach 30 490 40 4 370 330 290 2 70 30 90 0 6 7 8 9 2 3 4 6 7 9 2 22 23 24 2 26 ACO Solution Modified Method Solution Fig. 4. comparative curves of time difference between ACO algorithm and modified ACO algorithm V. CONCLUSION The study of TSP still has a long way to go before can really claim to understand the nature of getting optimal solution. In this study, after designed, implemented and the results obtained from proposed algorithm, the following points can be concluded:. Evaluation shows the difference in the required time is as much as less compares with optimal solutions that achieved by modified approach. 2. The key to the application of ModifiedACO to a new problem is to identify an appropriate representation for the problem (to be represented as a graph searched by many artificial ants), and an appropriate heuristic that defines the distance between any two nodes of the graph. Then the probabilistic interaction among the artificial ants mediated by the pheromone trail deposited on the graph edges will generate good, and often optimal, problem solutions. 3. The Modified ACO algorithm can be used in dynamic applications (adapts to changes such as new distances, etc) 4. Research is experimental rather than theoretical.. ModifiedACO shows great performance with the illstructured problems like network routing. VI. FUTURE WORK ACO can be analyzed for future enhancement such that using another search algorithm to find the ACO parameters that can relate its variable to the ACO parameters to produce better solution by improving the effectiveness and reducing the limitation. REFERENCES [] Marco Dorigo and Luca Maria Gambardella, "Ant colonies for the traveling salesman problem", TR/IRIDIA/,Université Libre de Bruxelles Belgium, 996-3. [2] Nicolas Durand and Jean-Marc Alliot, "Ant Colony Optimization for Air Traffic Conflict Resolution", Eighth USA/Europe Air Traffic Management Research and Development, July, 09. [3] V.Selvi and and Dr.R.Umarani, "Comparative Analysis of Ant Colony and Particle Swarm Optimization Techniques", International Journal of Computer Applications (097 8887),Volume No.4, New York, NY 00, USA, August. [4] Hozefa M. Botee and Eric Bonabeau, " Evolving Ant Colony Optimization", Adv. Complex Systems, 49 9, HERMES, 998. [] Carlos A. Silva and Thomas A. Runkler, "Ant Colony Optimization for dynamic Traveling Salesman Problems", Siemens AG, Corporate Technology, Information and Communications, CT IC 4, 8730, 29-266, Munich Germany. [6] V. Maniezzo and A. Colorni, The ant system applied to the quadratic assignment problem, IEEE Trans. Knowledge and Data Engineering, vol., no., pp. 769 778, 999. [7] T. Stuetzle and M. Dorigo, ACO algorithms for the quadratic assignment problem, in New Ideas in Optimization, D. Corne, M. Dorigo, and F. Glover, Eds: McGraw-Hill, 999. [8] B. Bullnheimer, R. F. Hartl, and C. Strauss, Applying the ant system to the vehicle routing problem, in Meta-Heuristics: Advances and Trends in Local Search Paradigms for Optimization, S. Voss, S. Martello, I. H. Osman, and C. Roucairol, Eds: Kluwer, 999, pp. 28 296.
International Journal of Engineering & Computer Science IJECS-IJENS Vol:3 No:0 [9] Bullnheimer B, Hartl RF, Strauss C,"An improved ant system algorithm for the vehicle routing problem, Ann. Oper. Res., vol. 89, pp. 39 328, 999. [] L. M. Gambardella, E. Taillard, and G. Agazzi, MACS-VRPTW a multiple ant colony system for vehicle routing problems with time windows, in New Ideas in Optimization, D. Corne, M. Dorigo, and F. Glover, Eds: McGraw-Hill, 999, pp. 63 76. [] G. Di Caro and M. Dorigo, Ant colonies for adaptive routing in packetswitched communication networks, in Proc. th Int. Conf. Parallel Problem Solving From Nature (PPSN V), Amsterdam, The Netherlands, September 998, pp. 673 682. [2] D. Costa and A. Hertz, Ants can color graphs, J. Oper. Res. Soc., vol. 48, pp. 29 30, 997. [3] L. Schoofs and B. Naudts, Ant colonies are good at solving constraint satisfaction problems, in Proc. 00 Congress on Evolutionary Computation, San Diego, CA, July 00, pp. 90 9. [4] I. A. Wagner and A. M. Bruckstein, Hamiltonian(t) an ant inspired heuristic for recognizing Hamiltonian graphs, in Proc. 999 Congress on Evolutionary Computation, Washington, D.C., July 999, pp. 46 469. [] A. Bauer, B. Bullnheimer, R. F. Hartl, and C. Strauss, Minimizing total tardiness on a single machine using ant colony optimization, Central Eur. J. Oper. Res., vol. 8, no. 2, pp. 2 4, 00. [6] A. Colorni, M. Dorigo, V. Maniezzo, and M. Trubian, Ant system for job-shop scheduling, Belgian J. Oper. Res., Statist. Comp. Sci. (JORBEL), vol. 34, no., pp. 39 3, 994. [7] M. den Besteb, T. Stützle, and M. Dorigo, Ant colony optimization for the total weighted tardiness problem, in Proc. 6th Int. Conf. Parallel Problem Solving From Nature (PPSN VI), Berlin, 00, pp. 6 6. [] Raed Abu Zaitar andhussein Hiyassat, "OPTIMIZING THE ANT COLONY OPTIMIZATION USING STANDARD GENETIC ALGORITHM", artificial intelligence and applications, 23 rd IASED international multi-conference, Innesbruck, Austria, February 4-6, 0. [9] Sorin Ilie and Costin B adic a, "Effectiveness of Solving Traveling Salesman Problem Using Ant Colony Optimization on Distributed Multi-Agent Middleware", Proceedings of the International Multiconference on Computer Science and Information Technology pp. 97 3, ISBN 978-83-608-22-4, ISSN 96-7094, Romania,.