Genetic algorithms are evolutionary techniques used for optimization purposes according to survival of the fittest idea. These methods do not ensure optimal solutions; however, they give good approximation usually in time. The genetic algorithms are useful for NPhard problems, especially the traveling salesman problem. The genetic algorithm depends on selection criteria, crossover, and mutation operators. To tackle the traveling salesman problem using genetic algorithms, there are various representations such as binary, path, adjacency, ordinal, and matrix representations. In this article, we propose a new crossover operator for traveling salesman problem to minimize the total distance. This approach has been linked with path representation, which is the most natural way to represent a legal tour. Computational results are also reported with some traditional path representation methods like partially mapped and order crossovers along with new cycle crossover operator for some benchmark TSPLIB instances and found improvements.
Genetic algorithms (GAs) are derivativefree stochastic approach based on biological evolutionary processes proposed by Holland [
The traveling salesman problem (TSP) is one of the most famous benchmarks, significant, historic, and very hard combinatorial optimization problem. TSP was documented by Euler in 1759, whose interest was in solving the knight’s tour problem [
Over the last three decades, TSP received considerable attention and various approaches are proposed to solve the problem, such as branch and bound [
Create an initial population of P chromosomes.
Evaluate the fitness of each chromosome.
Choose P/2 parents from the current population via proportional selection.
Randomly select two parents to create offspring using crossover operator.
Apply mutation operators for minor changes in the results.
Repeat Steps 4 and 5 until all parents are selected and mated.
Replace old population of chromosomes with new one.
Evaluate the fitness of each chromosome in the new population.
Terminate if the number of generations meets some upper bound; otherwise go to Step 3.
The selection criteria, crossover, and mutation are major operators, but crossover plays a vital role in GAs. A lot of crossover operators have been proposed in literature and all have their significant importance. In this article, we also proposed a new crossover operator for TSP which is moved within two selected parents as previous cycle crossover operator. In Section
In literature, there are many representations to solve the TSP using the GAs. Among these binary, path, adjacency, ordinal, and matrix representations are important. The further types of these representations are given in Table
Summary of crossover operators for TSP.
Representation  Crossover operators  Proposed year 

Binary  Classical + repair operator  1991 


Path  Partially mapped crossover  1985 
Order crossover  1985  
Cycle crossover  1987  
Heuristic crossover  1987  
Order based crossover  1991  
Position based crossover  1991  


Adjacency  Alternative edge crossover  1985 
Heuristic crossover 1  1985  
Heuristic crossover 2  1989  
Heuristic crossover 3  1987  


Ordinal  Classical operators  1985 


Matrix  Intersection crossover  1987 
Union crossover  1987 
The most natural way to present a legal tour is probably by using path representation. For example, a tour
Since the TSPs in combinatorial with the path representation and the classical crossover operators such as onepoint, twopoint, and uniform crossovers are not suitable, we choose only partially mapped, order, and cycle crossover operators from path representation which are mostly used in literature and also we can compare our proposed crossover operator with these operators.
The partially mapped crossover (PMX) was proposed by Goldberg and Lingle [
Then we can fill further bits (from the original parents), for those which have no conflict as follows:
Hence, the first
The order crossover (OX) was proposed by Davis [
The cycle crossover (CX) operator was first proposed by Oliver et al. [
We are going to propose a new crossover operator which works similarly as CX, so we suggest it as CX2. At the same time it generates both offspring from parents using cycle(s) till last bit. We differentiate CX2 in the following steps.
Choose two parents for mating.
Select 1st bit from second parent as a 1st bit of first offspring.
The selected bit from Step 2 would be found in first parent and pick the exact same position bit which is in second parent and that bit would be found again in the first parent and, finally, the exact same position bit which is in second parent will be selected for 1st bit of second offspring.
The selected bit from Step 3 would be found in first parent and pick the exact same position bit which is in second parent as the next bit for first offspring. (Note: for the first offspring, we choose bits only with one move and two moves for second offspring’s bits.)
Repeat Steps 3 and 4 till 1st bit of first parent will not come in second offspring (complete a cycle) and process may be terminated.
If some bits are left, then the same bits in first parent and in second offspring till now and vice versa are left out from both parents. For remaining bits repeat Steps 2, 3, and 4 to complete the process.
According to the previous steps, we derive two cases for CX2. First case of CX2 will be terminated within Step 5 and second will take all six steps. We provide detailed examples of both cases in next subsections.
Consider the two selected parents as mentioned in Step 1:
Consider the two selected parents as mentioned in Step 1:
Hence the scheme is over with efficient work.
To apply this crossover operator, we made a MATLAB code for genetic algorithms and have given pseudocode in Algorithm
For each
For each
Distance
For each
For each 1 ≤ generation ≤
For each
Sum1
For each
Length
For each
St1
St2
Where (Length(
While (
Ind1
Val1
St1
Ind2
Val2
St2
For each
Sum1
For each
Sum2
We use genetic algorithm in MATLAB software to compare the proposed crossover operator with some traditional path representation crossover operators. Our first experiment has 7 cities and we impose the transition distance between cities in Table
Transition distance between cities.
City  1  2  3  4  5  6  7 

1  0  34  36  37  31  33  35 
2  —  0  29  23  22  25  24 
3  —  —  0  17  12  18  17 
4  —  —  —  0  32  30  29 
5  —  —  —  —  0  26  24 
6  —  —  —  —  —  0  19 
7  —  —  —  —  —  —  0 
Table
Comparison of three crossover operators (30 runs).
Crossover  Optimum  Average value  Best value  Worst value 

PMX  17/30  159.7  159  165 
OX  14/30  160.3  159  163 
CX2  24/30  159.2  159  162 
We perform the proposed crossover operator CX2 along two traditional crossover operators PMX and OX on twelve benchmark instances which are taken from the TSPLIB [
Comparison results among three crossover operators.
Instance 

Optimum value  Results  PMX  OX  CX2 

Best  2962  3005  2995  
gr21  21  2707  Worst  3322  3693  3576 
Average  3127  3208  3145  


Best  1056  1051  1099  
fri26  26  937  Worst  1294  1323  1278 
Average  1133  1158  1128  


Best  1708  1804  1811  
ftv33  34  1286  Worst  2399  2366  2322 
Average  2012  2098  2083  


Best  2345  2371  2252  
ftv38  39  1530  Worst  2726  2913  2718 
Average  2578  2617  2560  


Best  1298  1222  0699  
dantzig42  42  699  Worst  1606  1562  0920 
Average  1425  1301  0802  


Best  13445  13826  10987  
ft53  53  6905  Worst  16947  16279  13055 
Average  14949  14724  12243 
Generation = 500.
Comparison results among three crossover operators.
Instance 

Optimum value  Results  PMX  OX  CX2 

Best  090231  097122  092450  
kro124p  100  36230  Worst  118386  122497  121513 
Average  100335  103457  101229  


Best  13346  15202  6421  
ftv170  171  2755  Worst  19314  19708  8416 
Average  16775  17569  7019  


Best  4123  3998  4212  
rbg323  323  1326  Worst  5147  5385  5342 
Average  4434  4602  4654  


Best  5380  5630  5404  
rbg358  358  1163  Worst  5915  5948  6004 
Average  5532  5830  5622  


Best  6231  6196  6257  
rbg403  403  2465  Worst  6653  6629  6671 
Average  6536  6386  6455  


Best  6754  6932  6854  
rbg443  443  2720  Worst  7209  7351  7388 
Average  6905  7121  6981 
Generation = 1000.
In Table
In Table
Finally, the overall results summarize that the proposed approach CX2 performs better on some aspects similar to existing PMX and OX crossover operators.
Various crossover operators have been presented for TSP with different applications by using GAs. The PMX and OX along with proposed crossover operator CX2 are mainly focused in this article. At first, we apply these three operators on a manual experiment and found that CX2 performs better than PMX and OX crossovers. Also, for a global performance, we take twelve benchmark instances from the TSPLIB (traveling salesman problem library). We apply all three crossover operators on these benchmark problems. We observe that the proposed operator works over 20, 70, and 100 percent for ft53, dantzig42, and ftv170 problems, respectively, compared to the other two operators. We see that, for large number of instances, the proposed operator CX2 is performing much better than PMX and OX operators. We suggest that CX2 may be a good candidate to get accurate results or may be a fast convergent. Moreover, researchers will be more confident to use it for comparisons.
The authors declare that there are no conflicts of interest regarding the publication of this paper.
The authors extend their appreciation to the Deanship of Scientific Research at King Saud University for funding this work through Research Group no. RG1437027.