Paper Title (use style: paper title)

3 downloads 0 Views 164KB Size Report
1Assistant Professor, Sardar Vallabhbhai Patel Institute of Technology, Vasad, Gujarat. 1Doctoral Student, Research and Development Centre, Bharathiar ...
UNRAVELING TRAVELLING SALESMAN PROBLEM BY GENETIC ALGORITHM USING M-CROSSOVER OPERATOR 1

Devasenathipathi N. Mudaliar, 2Dr. Nilesh K. Modi

1

Assistant Professor, Sardar Vallabhbhai Patel Institute of Technology, Vasad, Gujarat Doctoral Student, Research and Development Centre, Bharathiar University, Coimbatore, Tamil Nadu 2 Professor and Head, S. V. Institute of Computer Studies, Kadi, Gujarat

1

Abstract—Travelling Salesman Problem (TSP) is a NP - Hard problem and one of the most studied problems related to many research areas. The main aim of this problem is to search the shortest (or cheapest) tour for a salesman to visit all cities exactly once and finally return to the starting city. Many real life problems which are a variant of TSP would be solved easily if the Travelling Salesman Problem could be solved that efficiently. Applications of Travelling Salesman Problem consists of Vehicle Routing, Job Sequencing, Computer Wiring, etc. Since brute force approach is an infeasible option, heuristics approach can be fairly relied upon to solve these kind of problems where heuristics approach utilizes much less computing power. Although solution from heuristics approach may not be the best solution, it surely provides much better solution. Genetic algorithm is one such heuristic search technique which is based upon genetic and natural selection. Genetic algorithm can perform this task by applying three operators viz. selection, crossover and mutation. In this paper, the authors propose a new crossover operator model (called m-crossover) of genetic algorithm to solve the travelling salesman problem. The proposed model is able to produce 18 different valid offspring chromosomes from any two valid parent chromosomes and select best two offspring chromosomes from the newly generated 18 chromosomes. We compared the efficiency of our crossover operator with existing crossover operators viz. Partially Mapped Crossover, Order Crossover, Cycle Crossover. Experimental results by applying our new crossover approach prove that it is faster at searching better solutions that the compared crossover operators. In addition to this, challenges and constraints of the proposed research work are also discussed. Keywords—Travelling Salesman Problem; Genetic Algorithm; Fitness Function; Crossover Operator; Multiple Offspring Crossover Operator.

I.

INTRODUCTION

The Travelling Salesman Problem (TSP) is an NPComplete problem where a salesman should visit all the cities in his given region one and only once and finally return to the starting city point, with the least possible coverage distance. One should find all the possible paths and its distance to get the least distance path. However, with this approach, the number of paths increases exponentially with the rise in the number of cities. Many real world problems like interview scheduling problem, school bus routing problem, printing press scheduling problem are a variant of Travelling Salesman Problem. Various different approaches like exact algorithms, tour construction,

tour improvement, etc. exist to solve the travelling salesman problem [8]. Exact algorithms approach consists of techniques like branch and bound technique, linear programming, etc. While Tour construction approaches consists of techniques like greedy heuristics, insertion heuristics, closest neighbour heuristics. Similarly, tour improvement heuristics consists of techniques like Tabu search, Simulated annealing, genetic algorithms, ant colony optimization, etc. All the above listed approaches and techniques have their own merits and demerits. However, the authors have chosen genetic algorithm of tour improvement approach to solve the travelling salesman problem. Genetic algorithm has the capability to solve this problem by quickly searching the search space (using selection, crossover and mutation operators) and providing a tour with a lesser cost quickly. First some finite number of random feasible solutions is generated (to create the initial population). All the chromosomes (or solutions) of the initial population are evaluated using a fitness function (in this case distance matrix). Best fixed number of chromosomes (also called as solutions) from the initial population are selected through selection operator using techniques like random selection, rank selection, tournament selection, roulette wheel selection, etc. The selected chromosomes (more fit chromosomes) are then allowed to crossover to produce better offspring chromosomes by exchanging the genetic materials among them. In order to solve travelling salesman problem various crossover techniques like partially mapped crossover, order crossover, cycle crossover are applied to the selected pairs of chromosomes to produce better offspring chromosomes. Finally mutation operators like displacement mutation, exchange mutation, etc. are applied to the produced offspring chromosomes in order to bring variation in the population and to allow the population to evolve. This cycle is iterated till a fixed number of times or till there is a significance improvement in the solution set. In this paper, the authors have tried to put forth a new crossover operator of genetic algorithm for solving the travelling salesman problem. The proposed crossover operator is able to reproduce 18 different offspring chromosomes from any two parent chromosomes (solutions). By applying this crossover operator, the genetic algorithm is quicker in searching better solutions to solve the travelling salesman problem. Literatures have been published where the crossover operator is able to produce more than two offspring chromosomes from parent chromosomes [1]. However, these literatures did not focus upon the crossover operator for solving the travelling salesman problem. It should be noted that

traditional crossover operator techniques cannot be applied to the travelling salesman problem, since TSP requires ordering of cities (where each chromosome contains all the cities one and only once). The rest of the paper is organized as follows. The next section provides a glimpse of the literatures published in connection to the crossover operator of the genetic algorithm. Section three presents the methodology of the actual work done. Section four briefs on the results obtained from the experimental study and compares it with the results obtained using the existing crossover techniques. The next section (section five) concludes the research paper in addition to providing directions for future work in reference to the current research work undertaken. II.

BACKGROUND WORK

Many different approaches have been proposed by researchers across the world with respect to advancement and application of genetic algorithms. The parameters for genetic algorithm include selection technique, fitness function, crossover technique (including crossover rate) and mutation technique (mutation rate) [2]. A change in any one (or many) parameters discussed above will result in a different output, because the efficiency (or the accuracy) varies with respect to different techniques. The authors Yilmaz KAYA, Murat UYAR & Ramazan TEKIN in their research paper [5] proposed a new crossover operator called ring crossover operator for genetic algorithms. They compared the efficiency of their crossover operator with existing crossover operators. In addition to this, their proposed work was tested by test functions like sphere function, Axis Parallel Hyper-Ellipsoid function, Rotated Hyper-Ellipsoid function, Normalized Schwefel function, Generalized Rastrigin function and Rosenbrock’s Valley function. The crossover rate was set to 0.8 and mutation rate was set to 0.01 in their study. However, in this paper the authors did not include the crossover operator for solving problems like travelling salesman problem. Similarly the authors Zakir H. Ahmed in his research work [6] tried to solve the travelling salesman problem using Sequential Constructive crossover operator. The crossover operator generated an offspring from the two parent chromosomes by utilizing better edges based on their values which were present in the parents’ structure for maintaining the sequence of nodes in the parents. In addition to this, the author compared the performance of his proposed crossover operator with edge recombination crossover and Generalized N-point crossover which positively proved the author’s research work. The author used crossover, selection and mutation operators iteratively. He used sequential constructive crossover, survivor selection method and reciprocal exchange mutation in his research work. The authors Xunboi Shuai and Xiannguang Zhou designed the genetic algorithm based on inverse and dual combination operator [4]. Then this operator was combined with uniform crossover operator. The authors compared the result of proposed genetic algorithm with the results of standard genetic algorithm and reverse genetic algorithm. They used binary string encoding, tournament selection strategy with crossover rate = 0.45, mutation rate = 0.01 with a population size of 80.

The authors concluded that their proposed approach did not perform better than standard genetic algorithm with respect to searching for optimal value. However, it performed better than standard genetic algorithm in searching performance and distribution. In addition to this, their new genetic algorithm (RAGA)’s time was longer than the standard genetic algorithm. The authors Cui Zhihua and Zen Jianchan in their research paper [7] proposed a multi-parent dynamic nonlinear crossover operator for travelling salesman problem. They used the principle of dynamic parents selection to build their proposed crossover operator. They tested their approach on the TSPLIB data by using 2-exchange heuristic crossover. Their proposed crossover operator used local information more effectively compared to other crossover operators. They found their proposed experimental work to be much simpler and useful. The authors Darrell Whitley, Doug huins and Adele Howe in their research work [3] proposed a hybrid genetic algorithm which integrated the Generalized Partition Crossover for solving the Travelling Salesman Problem. The results of their experimental work proved that their propsed algorithm was quick at finding solutions for number of cities from 500 to 1817, with a population size of 10. They also found that soon after a few generations, edges of globally optimal solution were present in population in every run. In addition to this, the researchers found that the number of unique edges was half of the problem size while implementing their proposed algorithm. III.

METHODOLOGY

The proposed crossover operator is based on two point crossover and can produce 18 different offsprings from the two parent chromosomes. The methodology for the same is explained with the help of an example where real coding is used for 9 cities. The cities are numbered from 1 to 9. A chromosome ‘192736458’ means a path from city number ‘1’ to city number ‘9’, then to city number ‘2’ and so on. Example demonstrating the proposed crossover operator: Suppose the two parent chromosomes are ‘P1’ and ‘P2’ with their paths given below respectively. Parent P1 = 1 2 3 4 5 6 7 8 9 Parent P2 = 9 1 2 8 7 4 5 6 3 Let, Cut Point 1 = after third gene (a different value can be set by the user) Cut Point 2 = after sixth gene (a different value can be set by the user provided cut point 1 is less than cut point 2) With this each parent string can be cut into three parts as follows: Parent P1 = [1 2 3] [4 5 6] [7 8 9] Parent P2 = [9 1 2] [8 7 4] [5 6 3] Step 1: The first part of second parent (i.e. [912]) is put before the first part of the first parent which results in 912 123 456 789 Step 2: The duplicate values (i.e. [912]) of parent2 P2 in parent1 P1 are deleted

912 123 456 789

7.

789 124 563

Now the final offspring chromosome string is 912 345 678

9.

124 789 563

We name the new offspring as offspring1 (= 912 345 678). To create one more offspring from the same set of parent chromosomes, we repeat the steps 1 and 2, but by putting the first part of parent 2 (i.e. [912]) before the second part of parent 1 we have 123 912 456 789 and deleting the entries of parent2 in parent1, we have 123 912 456 789 So the final offspring chromosome is 391 245 678. We name this newly produced chromosome as offspring2 (which is 391 245 678). The below diagram represents the parts of the one parent to be put before the part number of another parent and deleting the duplicate entries of later parent.

8. 127 894 563

It should be noted that in our actual experiment, every chromosome contained 10 genes whereas in the example above every chromosome contained 9 genes. The C programs were coded in such a way that every chromosomes contained different permutations of numbers from 1 to 10. Similar such 100 chromosomes were generated as the initial population. A simple fitness function was designed to produce fitness value on the basis of the chromosome provided as parameter value. However, instead of calculating the fitness value using the distance matrix (as in traditional traveling salesman problem), we used a different approach as in equation 1 for ease of use. y(x) =(x[0]/x[5]) + (x[1]/x[6]) + (x[2]/x[7]) + (x[3]/x[8]) + (x[4]/x[9]) (1) The higher the value of y(x), the fitter was considered the chromosome. Some sample values of ‘x’ vector (or array as in c-language) are given below: X[] = {10,8,7,5,6,1,4,9,2,3} X[] = {6,7,8,5,10,3,1,4,9,2} X[] = {6,5,8,10,9,1,2,7,3,4} X[] = {10,9,7,6,5,8,4,2,3,1} The fitness value of all the 18 offspring chromosomes were obtained through a fitness function, which is discussed later in this section. Then the two best chromosomes (with respect to fitness value) is selected from the newly generated 18 offspring chromosomes, while the rest 16 less fitter chromosomes are simply discarded and they are not sent for mutation. The below steps were followed to undertake the actual experimental work: 1. Initialize a random population of 100 chromosomes.

Figure 1. Representation of Permutation of Parts of Chromosomes of Two Parents for Crossover

Continuing the above procedure with respect to Figure. 1 we get 7 more different offspring chromosomes which are listed below: 1. 912 345 678

2. 391 245 678

3. 345 691 278

4. 874 123 569

5. 123 874 569

6. 123 568 749

7. 563 124 789

8. 125 634 789

9. 124 563 789 Next replacing chromosomes of Parent1 (P1) with Parent2 (P2) and vice versa and performing the above steps we have 9 more different offspring chromosomes resulting in a total 18 different offspring chromosomes from 2 parent chromosomes. The rest 9 offspring chromosomes are listed below: 1.

123 987 456

2. 912 387 456

3.

987 412 356

4. 456 912 873

5.

912 456 873

6. 912 874 563

2. Among the initialized population, select the best 50% (i.e. 50 chromosomes) of the better population (with respect to the fitness function) using Roulette wheel selection method. 3. Apply clonning to the selected population (i.e. duplicate the selected population). 4. Apply the proposed crossover operator and obtain 18 different offspring chromosomes from each pair of parent chromosomes. 5. Using the fitness function, select the best two offspring chromosomes for every pair of parent chromosomes. 6. Apply the mutation operator (displacement mutation) on these newly produced offspring chromosomes, which forms the new generation of population. 7. Iterate through steps 2 to 5 till satisfactory results are obtained or results have stopped improving with each each iteration. IV.

RESULTS

& DISCUSSIONS

We compared the efficiency of our proposed crossover operator with the performance of partially mapped crossover, order crossover and cycle crossover, keeping the selection and

mutation operator same for all the four programs. The selection was performed using Roulette Wheel selection technique and the mutation of chromosomes was done by displacement mutation. The crossover rate was set to 0.9, mutation rate was set to 0.01 and initial population was set to 50. The following functions were coded in c-language to accomplish the above tasks: 1.

Random Initialization of Population

2.

Selection of fitter chromosomes

3.

Clonning of chromosomes

4.

Crossover function

5.

Selecting 2 best fit chromosomes from 18 newly produced chromosomes

6.

Mutation function

In all we coded four different C-programs for accomplishing our tasks (i.e. comparing the performance of all the four different crossover operators. The below table provides a detailed view of the performance comparison of all the four crossover operators. Table 1. represents the best fitness value obtained upto a given number of generations. It was observed (using the data in Table. 1) that our approach was quick in finding relatively better solutions. Within 20 generations, our proposed crossover operator was able to search for better (fitter) chromosomes, whose best fitness value was 17.27778, which was far better than the other crossover operators in that range. However, even after 50 generations our approach did not find that better solutions as that found by Partially Mapped Crossover whose best fitness value was 19.31667 whereas our approach searched solutions with fitness value of 18.5. In addition to this even after 50 generations the order crossover operator and the cycle crossover operator did not find that expected solutions, even though these operators receive the credit of understanding them easily compared to other crossover operators.

V.

In this paper, we have proposed a crossover operator for solving problems like the travelling salesman problem. We have also tried to compare the performance of our approach with the performance of other crossover operators viz. Partially mapped crossover, Order crossover, Cycle crossover. We have also found from the experimental work that our approach fared much better in quickly finding fitter solution, even though PMX (Partially Mapped Crossover) found more better solutions compared to our approach in the longer run. The rest two crossover operators viz. OCX (Order Crossover) and CCX (Cycle Crossover) were less efficient for our experimental work while they may be more efficient for other kinds of problems, since the solution space differs from problem to problem. We intend to apply our proposed crossover approach to other variants of Travelling Salesman Problem like the Student Group Formation Problem, which can be directly implemented in the industry for team formation among employees. REFERENCES [1]

[2] [3]

[4]

[5]

[6]

TABLE I. COMPARISON OF PERFORMANCE OF PROPOSED CROSSOVER OPERATOR WITH OTHER CROSSOVER OPERATOR WITH RESPECT TO BEST FITNESS VALUE OBTAINED No. of Generations

Best fitness value obtained by Proposed Crossover

Best fitness value obtained by Partially Mapped Crossover

Best fitness value obtained by Order Crossover

Best fitness value obtained by Cycle Crossover

14.3730 2 14.65

14.0

15.02222

14.3523 8 15.375

15.41667

40

15.6904 8 17.2777 8 18.3055 6 18.4381

16.96429

50

18.5

19.3166 7

15.8194 4 17.0083 3

10 20 30

16.6833 18.4381

15.8381

17.71429

CONCLUSION AND FUTURE DIRECTIONS

[7]

[8]

A. M. Sánchez, M. Lozano, C. García-Martínez, D. Molina, F. Herrera (2008), Real-parameter crossover operators with multiple descendents: An experimental study. Int. J. Intell. Syst., 23: 246–268. doi: 10.1002/int.20258 S. Sarmady, An Investigation on Genetic Algorithm Parameters, School of Computer Science, Universiti Sains Malaysia, 2007 Whitley, D., Hains, D., Howe, A.E.: A Hybrid Genetic Algorithm for the Traveling Salesman Problem Using Generalized Partition Crossover. ;In PPSN (1)(2010)566-575 Xunbo Shuai , Xiangguang Zhou, A Genetic Algorithm Based on Combination Operators, Procedia Environmental Sciences, Volume 11, Part A, pp. 346 – 350, 2011. Yilmaz Kaya, Murat Uyar, Ramazan Tekin, A Novel Crossover Operator for Genetic Algorithms: Ring Crossover, Computing Research Repository - CORR, vol. abs/1105.0, 2011 Zakir H. Ahmed, Genetic Algorithm for the Travelling Salesman Problem using Sequential Constructive Crossover Operator, International Journal of Biometrics & Bioinformatics, volume 3, issue 6 pp. 96 – 105, 2010. Zhihua Cui, Jianchao Zeng, Multi-parent dynamic nonlinear crossover operator for TSP, International Journal of Computer Science and Network Security, Volume 6, Issue 2A, February 2006. Rajesh Matai, Surya Singh and Murari Lal Mittal (2010). Traveling Salesman Problem: an Overview of Applications, Formulations, and Solution Approaches, Traveling Salesman Problem, Theory and Applications, Donald Davendra (Ed.), ISBN: 978-953-307-426-9.