You are on page 1of 5

International Journal of Computer Information Systems, Vol. 3, No.

2, 2012

Applying Gene Grouping Genetic Algorithm for Solving Travelling Salesman Problem
R.Sivaraj
Research Scholar and Assistant Professor (Sr.Gr) Department of CSE Velalar College of Engineering and Technology, Erode, India rsivarajcse@gmail.com

Dr.T.Ravichandran
Principal and Research Supervisor Hindusthan Institute of Technology, Coimbatore, India dr.t.ravichandran@gmail.com

R. Devi Priya
Assistant Professor, Department of IT Kongu Engineering College Erode, India scrpriya@gmail.com

Abstract: Evolutionary Algorithms like Genetic Algorithms have gained attraction for common use in various domains for some years. The convergence velocity in Genetic Algorithm is a major challenge confronting researchers and numerous researches are being carried out to introduce various techniques to address this issue. Gene Grouping Genetic Algorithm (GGGA) is a new variant of this kind which was proposed to achieve better performance in terms of reaching suboptimal solution with improved convergence velocity. In this paper, GGGA is implemented for Travelling Salesman Problem and the results confirm the superior performance of GGGA over Standard Genetic Algorithm. Keywords: Evolutionary algorithms, Genetic Algorithms, Convergence velocity, Travelling salesman problem.

I. INTRODUCTION Genetic Algorithm (GA) is an important area in Artificial Intelligence which derives the idea from Darwins theory about evolution [Goldberg, 1989]. GA is easy to understand and program and hence it is commonly used in many real-life applications. GA involves iterative execution of some important steps which can be adapted by the user for the specific problem. Flexibility is an advantage in GA where the user can have combination of any the operators present in the standard processes or new operators can be defined specific to the problem. A chromosome defines the solution for a problem. Many such solutions are created at random initially and are collectively called as population. The fitness function (Objective function) value is calculated for all the chromosomes (individuals) present in the population and the best chromosomes are selected for the successive crossover operation. Some of the traditional selection mechanisms used to select parent chromosomes for crossover are Roulette Wheel selection, Tournament Selection, Rank Selection, etc.

The better solutions are mated with each other to produce much better solutions for next generations in the process of crossover using any of the crossover operators like one-point crossover, two-point crossover etc. Mutation is a next step which is then done with very low probability by randomly changing some of the bits in order to introduce genetic diversity among the individuals. Thus the basic idea behind Genetic Algorithm is that the above genetic operators like crossover, mutation are applied to these chromosomes continuously in every generation to produce better individuals. If the new generation contains a solution that is near or equal to the desired solution, then the algorithm terminates and thus the problem has been solved. If not, the new generation will go through the same steps as their parents did. This will be continued until a new solution that is better than the previous one is reached and thus it gradually evolves to an ideal solution. The key factors that are to be considered while using Genetic Algorithm are encoding scheme, population size, appropriate fitness function, selection and crossover mechanisms, crossover and mutation probability and finally the number of generations the algorithm is allowed to run. The population size is chosen by the user and utmost care should be taken in determining it. Because if the population size is too small, the algorithm searches in the limited solution space and if it is too large, the algorithm spends unnecessarily too much time in finding the solution. The success of Genetic Algorithm depends on values determined from the fitness function for each chromosome which shows how close it actually is in reaching the solution of the problem. Usage of fitness function which is not appropriate for the problem does not influence the algorithm in reaching the final solution. Defining fitness function is thus a crucial part in designers point of view. All selection schemes try to find the best chromosomes for crossover, but they differ in

February Issue

Page 72 of 88

ISSN 2229 5208

International Journal of Computer Information Systems, Vol. 3, No. 2, 2012 the way they select chromosomes and each one can be suitable for different types of problems. The crossover and mutation probability determines the number of chromosomes allowed for mating and random flipping respectively. The "Traveling Salesman Problem" (TSP) is a common NP hard problem that can be used to test the effectiveness of Genetic Algorithm. The traveling salesman problem is defined in simple term as: If there are n cities and cost to travel between each pair of them is given, the objective is to find the cheapest and shortest path that anyone can follow to reach destination city from the starting city provided all the cities involved in the problem are traveled exactly once. GA for TSP cannot be designed very easily. Many problems use just numerical values and hence it is easy to define the structure of chromosome and perform genetic operations. But TSP uses permutation encoding which uses ordering of cities for which genetic operations cannot be directly applied. Many researchers are putting in more effort in producing good approaches for solving TSP kinds of problems. In this paper we propose using a new algorithm called Gene Grouping Genetic Algorithm which tends to perform better for TSP when compared with existing algorithms. The proposed approach not only works for TSP but also for other similar problems like Scheduling, Problems which involves ordering etc. II. RELATED WORK In Moon et al (2002), the authors propose to use topological sorting which defines ordering of cities in a directed graph. In Zakir (2003), the sequential constructive crossover (SCX) operator constructs child chromosome using better edges based on their values present in the parents' structure. Hu and Di Paolo (2007) suggest mapping the represented solution of the pre-problem into the associated solution to the original problem. But designing preproblem is extremely problem specific and requires much expertise of the user. Buthainah and Ali (2008) suggest using specialized crossovers and mutation to improve the solution. Gohar Vahdati et al (2009) proposed a new method using heuristic crossover and mutation operations to generate and to reinforce optimal chromosomes. Fozia et al (2009) proposed a new representation scheme of chromosomes using binary matrix where new fittest criteria is used for finding the optimal solution for TSP. III. PROPOSED METHODOLOGY Grouping genetic algorithm (GGA) is an evolution of the GA in which the genetic operations are applied among a group of individuals (chromosomes) rather than considering all the individuals in standard procedure. Grouping Genetic Algorithm tends to perform better than Standard Genetic Algorithm in various kinds of problems such as line balancing, bin packing etc. Instead of grouping chromosomes based on fitness values of entire chromosomes, the proposed approach groups the genes in an effective manner to produce better results. The basic idea behind Gene Grouping Genetic Algorithm proposed by Sivaraj and Ravichandran (2011) is given below. Gene Grouping Genetic Algorithm Gene Grouping Genetic Algorithm (GGGA) is a relatively new algorithm which was introduced to effectively solve multi-objective combinatorial problems. It works on the simple principles and produces improved performance. In general, structure of the chromosome is fixed and the pool of chromosomes is allowed to pass through genetic operators like crossover and mutation. But in GGGA, length of the entire chromosome is divided into n subparts where each subpart of all the chromosomes in the entire population participates in crossover and mutation separately. Consider for example there are n chromosomes in the population; each chromosome is divided into groups as given below in figure 1.

Figure 1. Structure of chromosomes used in GGGA The encoding scheme chosen for the problem is Permutation encoding where genes in the chromosome represent the order in which one has to travel from the starting city. The idea here is that if there are n cities in the chosen problem, it has to be divided into x/n subgroups where x represents the number of genes included in each subgroup. Rather than searching from the starting city to the last city in each chromosome, the proposed approach effectively searches locally and combine the local best solutions to form a global final solution. All the cities in the problem are grouped like shown in figure 2 where each group will have collection of cities. Parent selection, genetic operators like crossover and mutation are applied and best ordering of the cities within each group are calculated independently as shown in figure 3 and

February Issue

Page 73 of 88

ISSN 2229 5208

International Journal of Computer Information Systems, Vol. 3, No. 2, 2012 finally the results from each group are combined to form a single solution as shown in figure 4. Thus it will reduce the overhead for the algorithm to apply genetic operators as a whole which takes more time to execute.
TABLE 1

Results of GGGA with varying number of groups

Figure 2. Chromosome with subgroups

Figure 3. Local best solutions

The above table shows superior performance of GGGA in almost all instances. Since it finds the local best solution and then integrates them to form the global best solution, it performs better. Even when the algorithm is allowed to run many times repeatedly, the results produced are consistent. For ft70 instance, the algorithm is repeated for 15 times and the solution obtained from each run is shown in the figure 5. This shows that even when the initial population is chosen at random, GGGA is successful in converging at consistent results in a reasonable amount of time.

Figure 4. Final global solution IV. IMPLEMENTATION AND RESULTS Standard Genetic Algorithm is implemented for solving Travelling Salesman Problem and its performance is compared with that of Gene Grouping Genetic Algorithm. TSPLIB instances are used for conducting the experiments. Too small number of groups will not have much impact and too large number of groups results in unnecessary process of splitting and combining. Hence a reasonable number of groups should be maintained in order to achieve optimal solution. For this to achieve, population size should be appropriately chosen. The number of genes within each group should also be chosen with utmost care. Table 1 shows the predictive accuracy of GGGA in finding the optimal solution with varying number of groups for TSPLIB instances.

Figure 5. Consistency of GGGA over 15 experiments for ft70

The same experiments are conducted in p43 instance and the results are shown in figure 6. It also confirms the consistency of GGGA in finding the optimal solution. Rather than using random initial random population, Genetic Algorithm will tend to produce better results if prior knowledge is incorporated in initializing the population. Hence in all our experiments, GGGA is implemented with case based initialization where some prior knowledge about the

February Issue

Page 74 of 88

ISSN 2229 5208

International Journal of Computer Information Systems, Vol. 3, No. 2, 2012 similar kinds of problems is used in selecting the individuals of the population.
Accuracy %

100

90

80

70
35 44 ft 7 0 rA 10 0 Kr o1 24 p ft v 17 0 D1 98
Pop Size-40 Pop Size-50

ft v

ft v

br

Figure 6. Consistency of GGGA over 15 experiments for p43

Figure 9. Accuracy % of GGGA for TSPLIB instances for 4 groups V.CONCLUSION Travelling Salesman Problem is a typical problem that can be used to demonstrate the performance of Genetic Algorithm. The main advent of GGGA is that the local solutions are combined to form global solution which is simple and efficient. The experiments are conducted with different number of groups in various TSPLIB instances and the results demonstrate the superior performance of GGGA. GGGA results in better performance if some prior knowledge is incorporated even though it also tends to produce better solutions with random initialization. The results produced in different runs are also consistent without much deviation. REFERENCES

Population Size is also a major factor in determining the success of the algorithm. Hence the population size is varied and the results are studied. We conducted the experiments by dividing the chromosome length into 2, 3 and 4 groups and the results are shown in figures 7, 8 and 9 respectively. In this case also, the superior performance of GGGA is noted.
100

Accuracy %

90

80

70

TSPLIB instance

Pop Size-40 Pop Size-50

Figure 7. Accuracy % of GGGA for TSPLIB instances for 2 groups


100

90

80

70

TSPLIB instance

Pop Size-40 Pop Size-50

Figure 8. Accuracy % of GGGA for TSPLIB instances for 3 groups

[1] Gohar Vahdati, Mahdieh Poostchi, M. B. Naghibi S and Mehdi Yaghoubi. A New Approach to Solve Traveling Salesman Problem Using Genetic Algorithm Based on Heuristic Crossover and Mutation Operator, International Conference of Soft Computing and Pattern Recognition, 2009. [2] Hu, X. B., andDi Paolo, E. (2007). Ahybrid genetic algorithm for the travelling salesman problem. In Nature Inspired Cooperative Strategies for Optimization (NICSO 2007), pp. 357367. Berlin: Springer. [3] Chiung Moon, Jongsoo Kim, Gyunghyun Choi, Yoonho Seo. An efficient genetic algorithm for the traveling salesman problem with precedence constraints. European Journal of Operational Research 140 606617, 2002. [4] Zakir H. Ahmed .Genetic Algorithm for the Traveling Salesman Problem using Sequential Constructive Crossover Operator. International Journal of Biometrics & Bioinformatics (IJBB) Volume (3): Issue (6), 2003. [5] TSPLIB, http://www.iwr.uni - heidelberg.de/iwr/comopt/ Software/TSPLIB95. [6] Hanif Khan Fozia, Nasiruddin Khan, Syed Inayatullah and Shaikh Tajuddin Nizami. Solving TSP problem by using genetic algorithm, International Journal of Basic & Applied Sciences IJBAS Vol: 9 No: 10, 2009

ft7 0 Ko rA 10 0 Kr o1 24 p

p4 3 ftv 17 0

br 17

ftv 35

ftv 44

Accuracy %

ft7 0 Ko rA 10 0 Kr o1 24 p

p4 3 ftv 17 0

br 17

ftv 35

ftv 44

February Issue

19 8

19 8

Page 75 of 88

Ko

TSPLIB Instance

p4 3

17

ISSN 2229 5208

International Journal of Computer Information Systems, Vol. 3, No. 2, 2012 [7] [8]
R. Sivaraj and T. Ravichandran, An Efficient Grouping Genetic Algorithm, International Journal of Computer Applications, Vol 21, No: 7 (8), 2011 Buthainah Fahran Al-Dulaimi and Hamza A. Ali. Enhanced Traveling Salesman Problem Solving by Genetic Algorithm Technique (TSPGA). World Academy of Science, Engineering and Technology 38, 2008 Goldberg, D.E, Genetic Algorithms: in Search, Optimization & Machine Learning, Addison Wesley, A. 1989.

[9]

February Issue

Page 76 of 88

ISSN 2229 5208

You might also like