The Discrete Carnivorous Plant Algorithm with Similarity Elimination Applied to the Traveling Salesman Problem

: The traveling salesman problem (TSP) widely exists in real-life practical applications; it is a topic that is under investigation and presents unsolved challenges. The existing solutions still have some challenges in convergence speed, iteration time, and avoiding local optimization. In this work, a new method is introduced, called the discrete carnivorous plant algorithm (DCPA) with similarity elimination to tackle the TSP. In this approach, we use a combination of six steps: first, the algorithm redefines subtraction, multiplication, and addition operations, which aims to ensure that it can switch from continuous space to discrete space without losing information; second, a simple sorting grouping method is proposed to reduce the chance of being trapped in a local optimum; third, the similarity-eliminating operation is added, which helps to maintain population diversity; fourth, an adaptive attraction probability is proposed to balance exploration and the exploitation ability; fifth, an iterative local search (ILS) strategy is employed, which is beneficial to increase the searching precision; finally, to evaluate its performance, DCPA is compared with nine algorithms. The results demonstrate that DCPA is significantly better in terms of accuracy, average optimal solution error, and iteration time.


Introduction
Combinatorial optimization problems [1] explore extreme values in discrete areas, which commonly exists in numerous fields such as agriculture, industry, national defense, engineering, transportation, finance, energy, and communication. Many of these problems belong to NP-hard [2], in which the spatial scale, time scale, and complexity of the solution increase exponentially as the scale of the problem grows. Therefore, many current methods are not sufficient in solving this problem. The traveling salesman problem (TSP) is one of the most extensively studied combinatorial optimization problems in operation research. The TSP and its various variants are not only famous theoretical problems but also important practical application problems. It can be applied to various fields, including scheduling and drilling holes in printed circuit boards in manufacturing [3]; designing reasonable traffic roads to avoid traffic congestion [4]; planning the best transportation route to maximize the benefits to the company [5]; laying out the appropriate location for a router so that the information transmission efficiency is the strongest [6], and many other areas [7,8]. Usually, a minor improvement in solution quality or a reduction in execution time in these areas can save millions of dollars or significantly develop productivity, bringing enormous economic benefits to enterprises and society. In addition, the TSP is commonly adopted as a measurement tool of algorithms' performances. Therefore, the research of the TSP has high theoretical value and practical significance, and its solution method has attracted the attention of scholars in recent years.
The TSP has only simple loop constraints, so it is relatively simple. However, as a typical NP-hard problem, the calculation difficulty increases exponentially as the city number grows. The method for TSP can broadly divide into exact algorithms and heuristic algorithms. Exact algorithms, such as linear programming [9], dynamic programming [10], and branch and bound [11], find the optimal solution by traveling all solution spaces with exponential time complexity. Thus, the exact algorithms have been insufficient to satisfy the solution of a TSP with a large size. Heuristic algorithms, such as the nearest neighbor [12] and local search algorithms [13,14], can find the suboptimal solution or the optimal solution with a certain probability. However, they are prone to fall into local optimums. To solve such problems, some scholars have innovatively proposed an important branch of heuristic algorithms, called metaheuristic algorithms, which involve the ant colony algorithm (ACO) [15,16], particle swarm optimization (PSO) algorithm [17], genetic algorithm (GA) [18][19][20], differential evolution (DE) [21], sparrow search algorithm [22], artificial bee algorithm [23], etc. They solve large-scale instances by obtaining inspiration through the cognition of relevant behaviors, principles, and action mechanisms in biology, physics, chemistry, and other fields and designing and using heuristic rules to search the solution space. The metaheuristic algorithm is widely applied in optimization, as it can obtain a high-quality satisfactory solution in a reasonable time, which greatly enriches the algorithm system.
Most metaheuristics algorithms were created for continuous optimization problems and cannot be directly applied to solve TSPs with discrete properties [24]. To explore the performance of such algorithms in the TSP, many scholars have conducted research and proposed a variety of discrete methods. References [25,26] employed swap sequence and swap operator, reference [27] adopted swap, shift, and symmetry operators to alternate the update method of the algorithm, and references [28,29] introduced the Hamming distance and a local search algorithm to updating individuals. However, among the above three update methods, the first two methods lack heuristics and exhibit poor convergence speed. The last one lacks exploration ability and easily to falls into stagnation. References [30] and [31] applied the rank-order and rounding decoding methods, respectively. Although the above two methods are simple to implement, they are not heuristic and may have a negative effect on the solution quality of its randomicity. Researchers such as Kenneth Sörensen [32] think that in the field of optimization computing it is important not to propose new algorithms but to establish universal optimization-algorithmapplicable rules and strategies and research common problems in optimization problems and optimization algorithms. Therefore, it is necessary to design a new universal discrete method or improve existing methods to enhance the algorithms' performance when solving the TSP.
The carnivorous plant algorithm (CPA) is a new swarm intelligence optimization algorithm proposed by Meng et al. [33], and the algorithm has been verified to successfully solve high-dimensional continuous problems. To the best of our knowledge, CPA has not been adopted to solve discrete optimization problems. In addition, the grouping method of CPA easily results in an imbalance in search ability among subgroups, which has a negative influence on the search performance of the algorithm. The growth of carnivorous plants or the updates of prey depend on the attraction probability, and the attraction probability in CPA is a constant that cannot improve the balance between exploration and the exploitation ability. Therefore, CPA performs convergence prematurely and is easy to trap into a local optimum. For optimization problems, when the algorithm finds a region with an extreme value, individuals continue to approach this extreme point. As the iteration time grows, the number of identical or similar individuals in the population increases. If the two individuals selected for the update are highly similar or identical, the possibility of excellent offspring being generated is reduced, which affects the convergence speed. The limitations of the discrete method for TSPs and the promising results achieved by CPA in continuous problems have formed the main motivation for this paper.
To address the above problems, in this work a new type of individual generation method is designed, using redesigned subtraction, multiplication, and addition operators to satisfy the legitimacy of the TSP solution. The method combines set difference operation, optimal operation, three crossover operators, and symmetry transportation to maintain the exploration and exploitation abilities of the algorithm. Then, a simple sorting grouping method is proposed, which can promote the speed of grouping, reduces the rate of assimilation of the population, and heightens the exploitation ability. After that, an adaptive attraction probability is designed, which enables the prey to update the position in the early stage with a high probability and heightens the exploration ability. Carnivorous plants grow in the late stage with a high probability to strengthen the exploitation ability. In addition, to maintain population diversity and avoid the situation that affects the efficiency of the algorithm, the similarity-eliminating operation, comprising the same quantity of city sequences and route length, is designed. The former is applied to eliminate the individuals who participate in the update with high similarity, and the latter is applied to eliminate the same individuals in the population. Finally, the iteration local search algorithm (ILS) is introduced to jump out of the local optimum and find the global theoretical optimum.
The primary contributions of this work are: (1) A new method of carnivorous plant growth and prey updating for TSP is designed to ensure that the algorithm can switch from continuous space to discrete space without losing information. (2) A simple sorting grouping method is proposed to reduce the computational complexity of the algorithm. (3) An adaptive attraction probability is presented to balance the exploitation and exploration ability. (4) The similarity-eliminating operation is added to maintain population diversity and extend the search space. (5) ILS is adopted to improve search precision and reduce the probability of individual stagnation. (6) To verify the validity of the discrete carnivorous plant algorithm (DCPA), nine algorithms are conducted as comparison algorithms, and the results on 34 instances from TSPLIB show the superior performance of the proposed algorithm.
The remaining part of this work proceeds as follows: Section 2 gives a brief overview of the TSP and the CPA; Section 3 describes the formula of the TSP; Section 4 presents a discrete framework of the proposed DCPA; Section 5 is an account of the simulation experiment and data analysis; and Section 6 gives a conclusion.

Literature Review
Researchers have proposed various algorithms over the years to solve the TSP, which can be broadly grouped into permutated coded algorithms and real coded algorithms.
Among the permutated coded algorithms, the ACO and GA are suitable for solving discrete optimization problems, as their update method can directly generate legitimate offspring. Stodola et al. [34] proposed an adaptive ant colony optimization algorithm with nod clustering (AACO-NC). In AACO-NC, three techniques are adopted to enhance the algorithm's performance. First, the node clustering principle is adopted to decrease the optimization time; second, the adaptive pheromone evaporation coefficient based on the population's diversity is employed to extend the search space; and third, a new termination condition based on entropy is proposed to decrease the inaccuracy of the iteration number setting. Yong W et al. [35] presented a hybrid genetic algorithm with two local optimization algorithms. One is applied to the local Hamiltonian paths to enhance the solution quality, and another is applied to prevent falling into the local optimum. Q. M et al. [36] proposed a hybrid genetic algorithm with a splitting algorithm when solving the traveling salesman problem with a drone.
Several algorithms are only applicable for continuous optimization problems. It is necessary to modify the update method to maintain the discrete characteristics when solving TSPs. Wang et al. [37] improved a discrete symbiotic organism search with an excellent coefficient and self-escape strategy. The former helps to enhance the exploitation capability, and the latter helps to maintain population diversity. Eneko et al. [28] proposed a discrete water cycle algorithm where the Hamming distance is adopted to measure the difference between two individuals and the insert and 2-Opt operators are adopted as movement operators to avoid the local optimum. Kóczy et al. [38] presented a discrete version of the bacterial memetic evolutionary algorithm (DBMEA). In DBMEA, three nearest neighbor heuristic methods and a random creation method are employed to generate the initial population, two local search algorithms are introduced to improve the search precision, and a combined gene transfer operation maintains population diversity. Zhong et al. [39] developed a discrete pigeon-inspired optimization algorithm (DPIO). A new map and landmark operator with learning ability are employed in DPIO. The former helps to heighten the exploration ability, and the latter helps to enhance the exploitation ability. The metropolis acceptance criterion in the proposed algorithm helps to avoid stagnation. A discrete bat algorithm with Lévy flight (DBAL) was designed by Saji et al. [40], where a new updating method is proposed to solve TSP, and the crossover operator and three local search algorithms are employed to enhance the searching precision. A. Benyamin et al. [41] designed a discrete farmland fertility optimization algorithm (DFFA). In DFFA, the swap, inversion, and insertion operators are employed to expand the search space, the metropolis acceptance strategy is employed to prevent prematurely accepting a solution, and a crossover operator is adopted to maintain the features of the standard algorithm. G. H. Al-Gaphari et al. [42] proposed a crow-inspired algorithm with three new discrete methods to map the continuous variables into discrete variables, which are: the modular arithmetic and set theory, basic operators, and dissimilarity operation. Z. Zhang and J. Yang [43] developed a discrete cuckoo search algorithm with random work and a local adjustment operator for the TSP. The former is utilized to maintain population diversity, and the latter is adopted to promote the convergence rate.
Some algorithms need to introduce the mapping method to transform continuous variables into discrete variables. Samanlioglu et al. [44] improved a random-key genetic algorithm with the ranked-order value decoding for the TSP. Ezugwu et al. [45] adopted the rounding method and restructured symbiotic organism search by incorporating swap, insert, and inverse operators. Ali et al. [46] adopted the rank-order and best-matched decoding in a novel discrete differential evolution, where the k-means clustering-based repairing method is employed in the algorithm to improve the individuals' quality, and a combined mutation is introduced to maintain the population diversity. F. S. Gharehchopogh and B. Abdollahzadeh [47] employed random-key encoding in the Harris hawk optimization algorithm, where a mutation operator, the metropolis acceptance strategy, and a local search algorithm are adopted in the algorithm to maintain population diversity, prevent prematurely accepting a solution, and enhance the solution quality, respectively. Zhang et al. [30] applied the order-based arrangement to map continuous variables into discrete ones in the discrete sparrow search algorithm (DSSA). In the DSSA, Gaussian mutation and a swap operator are adopted to maintain population diversity, and the 2-Opt algorithm is adopted to enhance search precision.

Standard Carnivorous Plant Algorithm
CPA is a metaheuristic algorithm that simulates the whole process of carnivorous plants' attraction, predation, and digestion. The algorithm is mainly composed of four stages: the grouping, growth, reproduction, and recombination phases.

Grouping Phase
Let the population size be n and rank the individuals according to the fitness value from small to large. The best (n1 individuals) are regarded as carnivorous plants, and the rest (n2 individuals) are regarded as prey (n1 can be arbitrarily determined, as long as n2 > n1, n2 + n1 = n is satisfied and n2 can be divisible by n1). The population is divided into n1 groups, and individuals in each subgroup are comprised of one carnivorous plant and n2/n1 prey. Table 1 presents the grouping process in the CPA at a population size of 12, where the population before ordering is X = (X1, X2, …, X n1+n2 ), after ordering is X ´= (X ' 1 , X ' 2 , …, X ' n+n ), and the fitness of individuals satisfies F (X ). The number of carnivorous plants (n1) is understood to be 3 in this example, so that the three best individuals in the population are regarded as carnivorous plants, and the remaining individuals are prey. In Table 1, prey X

Growth Phase
The attraction rate is adopted in the CPA. While the attraction probability γ (γ = 0.8) is greater than a random number between [0, 1], the individual executes the growth formula of carnivorous plants: where  indicates that two vectors are multiplied by elements at the same position, Xi indicates the carnivorous plants in the i-th subgroup, Piv indicates the v-th prey in the i-th subgroup, rand indicates a random vector with m-dimensional components and each component is uniformly distributed in the range [0, 1], m is the dimension number in the individual, and gr indicates the growth rate, which is equal to 2. While γ is less than the random number, the individual executes the update formula of grey: where  indicates that two vectors are multiplied by elements at the same position, Piu and Piv indicate the u-th and v-th prey in the i-th subgroup, respectively, rand indicates a random vector with m-dimensional components and each component is uniformly distributed in the range [0, 1], m is the dimension number in the individual, and f(P iu ) and f(P iv ) indicate the fitness values of the u-th and v-th prey, respectively.

Reproduction Phase
In the CPA, only the best individual can execute the reproduction operation. Its mathematical model is as follows: where  indicates that two vectors are multiplied by elements at the same position, X1 indicates the best individual, Xi and Xv indicate carnivorous plants in the i-th and v-th subgroup, respectively, the "rand" is a random vector with m-dimensional components and each component is uniformly distributed in the range [0, 1], m is the dimension number in the individual, f(Xv) and f(Xi) indicate the fitness values of the i-th and v-th carnivorous plants, respectively, and μ indicates the reproduction rate, which is equal to 1.8.

Recombination Phase
Recombination refers to merging the population before and after updating into a large population and calculating and ranking the fitness from small to large. n best individuals are selected from the large population.
The procedure of standard carnivorous plant algorithms is summarized in Algorithm 1, where n is the population size, n1 is the number of carnivorous plants, n2 is the number of prey, iter is the current iteration number, and Maxiter is the maximum iteration number. Algorithm 1. The standard CPA 1: Initialize the relevant parameters； 2: Generate n initial individuals in the population; 3: Calculate and sort the fitness value; 4: iter = 1; 5: While iter < Maxiter 6: iter = iter +1;

7:
Regard the n1 best individuals as carnivorous plants, the remaining n2 individuals as prey, and sort into subgroups as 8: shown in Table 1; Xnew and Pnew are updated with Equation (1) and Equation (3); 9: Xnew is updated with Equation (5); 10: Xnew, Pnew, X, and P are combined to form a new population; 11: The new population is sorted by its fitness, and n best individuals are selected; 12: End While 13: Output the best solution and its fitness value;

Problem Formulation
The TSP refers to a salesman starting from a city, passing through cities 1, 2, …, m to deliver goods, and eventually returning to the starting city. Since the distance from each city to other cities is different and the total path lengths corresponding to the sequences of different routes are different, it is necessary to design the sequence of cities and ensure that the final journey of the salesman is the shortest and each city is only visited once. If the city size is slight, the problem is easy to calculate, but with the city size expansion, it grows complex. The TSP can be also defined as an undirected weighted complete graph, G = (V, A), where V is the set of m vertices and A is the set of edges. For each edge, (i, j) ∈ A(i, j ∈ V). The modeling of the TSP can be expressed as: where f indicates the distance traveled by the salesman in the TSP, cij represents the distance between city i and city j, zij indicates the decision variable, and its formula is as follows: The calculation formula of cij is: where (hi, yi) and (hj, yj) indicate the coordinates of the i-th and j-th city, respectively.

The DCPA for TSP
A discrete carnivorous plant algorithm (DCPA) for the TSP is proposed in this section, where a novel individual-generated method and several improved components are introduced.

Individual-Generated Method
The method of generating initial solutions by the CPA is unsuitable for the TSP. Variables in the CPA are continuous, while the solutions in the TSP are discrete. For the TSP with m cities, each route is composed of m random integers without repetition, which are between [1, m]. Therefore, the encoding method of the DCPA employs permutation encoding.
It can be seen from the above description that the redefined subtraction operation employed the concept of the set difference operation, which can make the offspring have the inherent characteristics of the better individuals in the parents and make the subtraction have an inheritance.

Redefining the Multiplication Operation
r is a random number between [0, 2]. If r ≥ 1, U ' = U, and U is obtained by Section 4.1.1; otherwise, the calculation steps of U ' are: Step 1: Let U ' be a zero vector with an m-dimensional; Step 2: V ' = (l1, l2, …, lcc), which is a vector after deleting zero elements in U, where cc is the number of nonzero components in U. The distance between adjacent cities in V ' is marked as d, where d = (dl1, l2, dl2, l3, …, dlcc−1, lcc, dlcc, 1), and the vector D is calculated with Equation (10): where  indicates that two vectors are multiplied by elements at the same position, q is a random vector with a cc-dimensional and each component is uniformly distributed in the range [0, 2] when the offspring are generated by Equations (1) and (3), and each component is uniformly distributed in the range [0, 1.8] with a cc-dimensional when the offspring are generated by Equation (5).
Step 3: The smallest ⌊r * cc⌋ elements are selected in D (⌊ ⌋ represents round down), and their positions are taken as the index. Keep these components corresponding to the index in X ' and assign them to U ' according to the same position.
From the above description, it can be seen that the redefined multiplication operation enables the offspring to inherit the good characteristics of the parent. In Equation (10), a random vector and the distance between cities are introduced in D. The former can reduce the probability of falling into local optimum, and the latter can enhance the exploitation ability.

Redefining the Addition Operation
Crossover is an operation that generates new potential offspring by reconstructing parents, which helps to enhance the global search ability. The addition operation in the CPA is replaced by a crossover operation so that the offspring can not only satisfy the characteristics of the TSP but also retain the attraction of carnivorous plants to prey to improve the exploitation ability. If there is no zero vector in the parents who participate in the crossover, three crossover operators are applied to realize the addition operation; otherwise, the addition operation is realized by a symmetry transformation.
For the convenience of describing the addition operation, the Piv and U ' (Piv is randomly selected in the population, and U ' is obtained by multiplication) with eight cities are set as an example, and the distances between eight cities are shown in Table 2.

Partial heuristic crossover operator
When ||U ' || ≠ 0 and U ' involves zero elements, the offspring generated by the traditional crossover operator may not be a legal TSP route. To fix this problem, a partial heuristic crossover operator is proposed. Suppose Piv = (5 7 4 6 1 8 3 2) and U ' = (4 5 0 0 0 0 2 8), the main steps to generate offspring O are as follows: Step Step 2: The nonzero cities u1 and u2, which are nearest to 0, are found in O. Suppose u1 is randomly selected and the position of u1 in Piv is taken as the starting point, traverse clockwise and counterclockwise, respectively (the red color indicates clockwise, and the green color indicates counterclockwise), and two new individuals, a1 and a2, with first component, u1, are generated; Step 3: The cities v1 and v2, which are nearest to u1, are found in a 1 and a 2 ; Step 4: Determine whether cities v1 and v2 are included in U ' , and three situations may exist at this time: Case 1: If v1 and v2 are not included in U ' , the distances between u1 and v1, and u1 and v2 are compared, and the city with the shortest distance is selected to replace element 0 after u1 in O. Then, turn to Step 5.
Case 2: If only one of v1 and v2 is included in U ' , the included city is deleted in a1 and a2 and the nonexistent city is selected to replace the element 0 after u1 in O. Then, turn to Step 5.
Case 3: If both v1 and v2 are included in U ' , v1 and v2 are deleted in a1 and a2, and cities e1 and e2 adjacent to u1 are found in a1 and a2. Let v1 = e1 and v2 = e2. Then, Step 4 is repeated.
Step 5: If element 0 still exists in O, turn to Step 2; otherwise, output O.

Bidirectional heuristic crossover operator
For the TSP, if the distance between the t-th (t = 1, 2, …, m − 1) visited city and the (t + 1)-th visited city is the smallest, the chances of a short route will increase. The bidirectional heuristic crossover operator [48] can select the city with the shortest distance from the cities next to the t-th city in the parents as the (t + 1)-th visited city, which can enhance the search precision. Piv = (5, 7, 6, 1, 3, 2, 8, 4) and U ' = (7, 4, 6, 1, 8, 3, 2, 5) are randomly generated and set as an example. The main steps of this operator are: Step 1: Assuming that an integer 4 between [1,8] is randomly generated, traverse clockwise and counterclockwise in Piv and U ' with the starting city 4 (the red color represents clockwise, and the green color represents counterclockwise), respectively. Then, four new individuals a1, a2, a3, and a4 are generated; Step 2: The cities 5, 8, 6, and 7 adjacent to city 4 are found in a1, a2, a3, and a4, and calculate the distances between city 4 and cities 5, 8, 6, and 7. City 5, with the shortest distance, is selected as the second visited city of O; Step 3: City 4 is deleted in Piv and U ' . Step 2 is repeated with city 5 as the starting city to obtain b1, b2, b3, and b4. The cities 8, 2, and 6 adjacent to city 5 are found in b1, b2, b3, and b4, and calculate the distances between city 5 and cities 8, 2, and 6. City 8, with the shortest distance, is regarded as the third visited city of O; Step 4: The determined city in O is deleted in Piv and U ' , and Step 3 is repeated until the city size of O is 8;

Completely mapped crossover operator
Zahid [49] proposed a completely mapped crossover operator in 2020. Suppose Piv = (1 2 3 4 5 6 7 8) and U ' = ( 6 1 5 3 8 7 2 4) in this part The two individuals are set as an example, and 1 -8 represent different city numbers. In Piv, the index of cities 1 -8 is regarded as 1 -8. In U ' , the index of city 6 is 1, the index of city 1 is 2, and so on. The main steps of the completely mapped crossover operator are: Step Step 2 is executed.
Step 2: Compare two cities corresponding to the same index in Piv and U ' from the first component to the eighth component until the two cities are different so that W1 is equal to the city corresponding to the index in U ' .

W1 = (6)
Step 3: The index k1 with city 6 is found in Piv, and the city corresponding to k1 in U ' is 7. The k2 with city 7 is found in Piv, and the city corresponding to k2 in U ' is 2. Then, W2 is: Step 4: The index k3 with the city g2 is found in Piv, and the city corresponding to k3 in U ' is 1. The index k4 with city 6 is found in Piv, and the city corresponding to k4 in U ' is 7. Then, W1 and W2 are: Step 5: If the first city in Piv appears in W2, turn to Step 6; otherwise, Step 4 is repeated. 6 1 2 7) W2 = (2 7 6 1) Step 6: Let O1 = Piv and O2= U ' . The cities where O1 is equal to W1 and O2 is equal to W2 are replaced by *. * indicates that the city is unknown. O1 and O2 are: 6 1 5 3 8 2 7 4) Step 7: * in O1 and O2 are replaced by cities in W1 and W2 in sequence, respectively. O1 = (2 7 3 4 5 6 1 8) O2 = ( 6 1 5 3 8 2 7 4) Step 8: The individual with better fitness values in O1 and O2 are selected as newly generated offspring O.
Among the three crossover operators, the partial heuristic crossover operator applies to the case where element 0 is included in the parent; otherwise, the bidirectional heuristic crossover and the completely mapped crossover operator are selected. The former considers the distances between cities, which exhibits fast convergence speed, but easily falls into local optimums. The latter exhibits strong exploration ability and slow convergence speed. To better balance the search ability, the completely mapped crossover operator in the early iteration and the bidirectional heuristic crossover operator in the late iteration are employed with high probability. Thus, an adaptive parameter ρ is designed with Equation (11): where T is the current running time and Tmax is the maximum running time. When ||U ' || ≠ 0, the selection methods of the three crossover operators are: if element 0 is not included in U ' in the growth phase and if the random number k ≤ ρ (k∈[0,1]), the completely mapped crossover operator is selected; otherwise, the bidirectional heuristic crossover operator is selected. If element 0 is included in U ' , the partial heuristic crossover operator is selected. In the reproduction phase, if element 0 is not included in U ' , the bidirectional heuristic crossover operator is selected; otherwise, the partial heuristic crossover operator is selected.

Symmetry transformation
A zero vector may be generated after the subtraction and multiplication operations, that is, ||U ' || = 0. Three crossover operators do not apply to the case where a zero vector is included in parent individuals. To realize the addition operation, a symmetry transformation is employed to Piv. The specific steps of the symmetry transformation are as follows: Step 1: Four unequal random integers, N1, N2, N3, and N4, are randomly generated between [1, m] and sorted from small to large, where m is the city size; Step 2: The cities between N1 and N2, and N3 and N4 are flipped in Piv; Step 3: The city sequences between N1 and N2, and N3 and N4 are swapped in Piv to generate the offspring O.
The completely mapped crossover operator exhibits inheritance but does not exhibit a heuristic. Compared with the other two crossover operators, it has a strong global search ability. Partial heuristic crossover operators have some heuristics and inheritance. Compared with the other two crossover operators, the global search ability and local search ability are relatively balanced. The bidirectional heuristic crossover operator exhibits heuristic and strong local search abilities compared with the other two crossover operators. In addition, symmetry transformation can maintain population diversity. Therefore, the addition operation takes into account global and local search capabilities, which is beneficial for improving the performance of the algorithm.

Simple Sorting Grouping
The CPA divides the population into n1 subgroups, each group is composed of one carnivorous plant and n2/ n1 prey, and the details are shown in Table 1. It can be found that: (1) the implementation is complex; (2) the quality of subgroups decreases with the ranking of carnivorous plants, which leads to the imbalance in search ability among the different subgroups; and (3) the quality of individuals and search abilities in the first subgroup is significantly better than that in the other subgroups. After the offspring individuals are grouped, the individuals with the information of the first subgroup may become the local optimum of the other subgroups, which increases the assimilation of individuals and the probability of falling into the local optimum.
Pointing at the above problems, a simple sorting grouping method is proposed, which sorts the individuals according to the fitness value and divides them into two groups for updating with randomly selected individuals. The specific operations are as follows: Step 1: The individuals are sorted from small to large for the fitness value with the population size n; Step 2: The population is divided into two groups. The first group is carnivorous plants with the first n1 individuals, and the second group is prey with the remaining n2 individuals (n1 can be arbitrarily determined as long as n2 > n1, n2 + n1 = n is satisfied and n2 can be divisible by n1).
Step 3: In the update method of the growth phase and reproduction phase, the carnivorous plants are randomly selected from the first group, and the prey are randomly selected from the second group.
Simple sorting grouping divides the population into two groups according to the fitness value of the individual, which is easier and faster to group. Carnivorous plants and prey are randomly selected from the two groups to update in the simple sorting grouping, which can reduce the probability of becoming stuck in a local optimum and improve the exploration ability.

Adaptive Attraction Probability
The growth of carnivorous plants or the update of prey in the CPA depends on the attraction probability, γ. The update of prey can enhance the exploration ability, and the growth of carnivorous plants can enhance the exploitation ability. However, γ in the CPA is a constant 0.8, which does not improve the balance between the exploration and exploitation ability. Therefore, an adaptive attraction probability is designed with Equation (12): where T1 is the current running time and Tmax is the maximum running time.
When γ is greater than the random number,  ( ∈ [0, 1]), the carnivorous plant grows; otherwise, the prey updates its position. It can be seen from Equation (12) that γ is small in the early stage of iteration, and the prey has a high probability of updating, which exhibits a strong exploration ability. With the increase in time, the probability of the carnivorous plant growing increases, which exhibits a strong exploitation ability.

Iteration Local Search Algorithm
The idea of ILS [50] is to perturb the local optimal solution obtained by the local search algorithm. Then, the local search algorithm is conducted on the perturbed individual. Three parts are mainly included in ILS: a local search algorithm, a perturbation method, and an acceptance criterion. In ILS, the local search algorithm is first applied to the population. Then, the optimal individual is selected, and the double-bridge perturbation is executed to obtain an intermediate solution. Finally, the intermediate solution is searched locally, and the newly generated solution is used to replace the optimal solution if its fitness value is better than the optimal solution. The details of ILS are shown below.

Local search algorithm
The local search process is to search the neighborhood of the current solution to find a better solution and update the solution until it cannot be improved. The 2-Opt algorithm [51] is an efficient method for the TSP, which can quickly eliminate the intersection edges in each path and enhance search precision. Its main idea is that for each route the two nonadjacent edges are exchanged in turn to obtain the set of paths, and the reservation can improve the exchange of paths.
An example with X1 = (3, 2, 1, 6, 5, 4, 7, 10, 9,11,8) is provided in Figure 1a, and the initial path after the double-bridge perturbation is provided in Figure 1b. The pseudo-code of ILS is summarized in Algorithm 2. In Algorithm 2, XX indicates the individual in the population.

Algorithm 2. ILS 1:
Execute the 2-Opt algorithm on XX and calculate the fitness of the population after the 2-Opt algorithm; 2: Find the best individual and record as Xi; 3: Execute the double-bridge perturbation and 2-Opt algorithm on Xi and regard the individual after the two operations as X * ; 4: If f(X * ) < f(X) 5: Replace X with X * ; 6: End

Similarity-Eliminating Operation
For a multi-extremum optimization problem, the individuals in the population continue to move to extreme points and finally gather near these points as the iteration time grows. Therefore, the number of similar and identical individuals increases as the iteration time grows, which leads to poor population diversity and the possibility of excellent individuals being generated being reduced.
To avoid the above phenomenon, the similarity-eliminating operation is added to DCPA with two suboperations: suboperation 1 is based on the same quantity of city sequences, and suboperation 2 is based on the route length.
1. The similarity-eliminating operation based on the same quantity of city sequences: The solution of the TSP is a sequence of m nonrepeating integers, and m is the city size. The same city sequence in different individuals will increase as the iterations increase. If the quantity of the same city sequence in different individuals is greater than n 0.8 , these individuals are regarded as similar. X1 = (1 2 3 4 5 6 7 8 9) and X2 = (7 9 1 2 3 4 8  5 6) are randomly generated and taken as an example to illustrate the similarityeliminating operation based on the same quantity of city sequences. Each component in X1 and X2 represent a city number. X1 and X2 are depicted in Figure 2. Step 1: From Figure 2, it can be found that the same quantity of the city sequences of X1 and X2 is 6, which are (1, 2), (2, 3), (3,4), (5,6), (6,7), and (9,1).
Step 2: X1 and X2 are regarded as similar individuals for the same quantity of city sequence 6 > 9 0.8 , where 9 is the city size.
Step 3: The individual X1 with the shortest route length is preserved, and X2 is removed. Then, X2 is randomly generated to maintain the same population size. 2. The similarity-eliminating operation based on the route length: Individuals with the same route length in the population are considered identical. The steps of the similarity-eliminating operation based on the route length are as follows: Step 1: Calculate and find individuals with the same route length in the population; Step 2: One of the same individuals is kept and the rest are removed; Step 3: The removed individuals are replaced with randomly generated individuals to maintain the same population size.
An example of population size n = 10 and city size m = 6 is given in Table 3, where I is the initial population, f is the route length of individuals, I1 is the population after removing the identical individuals, Y is the randomly generated individuals, and I ' is the population after the similarity-eliminating operation based on the route length. The bold in f means individuals with the same route length. According to the description, identical individuals must be similar individuals, but the converse is not true. For example, 1 2 3 4 and 4 1 2 3 are identical and similar individuals; 1 2 3 4 5 6 7 8 9 and 7 9 1 2 3 4 8 5 6 are similar individuals, but not identical individuals. Suboperation 1 performs the similarity-eliminating operation on the individuals who execute the update method. Therefore, identical individuals may exist in the recombined phase. To maintain population diversity and reduce the possibility of trapping into a local optimum, suboperation 2 is added after the recombination phase.

The Framework of DCPA
The framework of the DCPA is shown in Figure 3. It can be observed that the performance of the DCPA is mainly concerned with the update method of offspring, the grouping method, the local search strategy, and the similarity-eliminating operation. A new generation method that redefines subtraction, multiplication, and addition operations is designed in the DCPA. The method not only satisfies the legitimacy of the TSP but also enhances the search precision. In addition, a simple sorting grouping method is proposed, which can promote the grouping speed and exploration ability compared with the method in the CPA. At the same time, an adaptive attraction probability is proposed to better balance the search ability, which can fix the defect that γ is a constant. Then, ILS is introduced to heighten the exploitation ability and reduce the probability of solution stagnation. Finally, the similarity-eliminating operation composed of two suboperations is added, which can not only identify the identical individuals but also the individuals with high similarity in the update operation so that the DCPA can maintain the population diversity during the iteration. Therefore, the DCPA can better balance the exploration and exploitation abilities.
The pseudo-code of the DCPA is summarized in Algorithm 3, where n is the population size, T is the iteration time of the proposed algorithm, and Tmax is the maximum iteration time. Randomly generate n initial individuals, record the population as A, and calculate its fitness; 3: Divide individuals into subgroups according to Section 4.2; 4: While T < Tmax,

5:
Perform the eliminate operation based on the same city sequence on the involved individuals and the offspring generated in the growth 6: phase by Equation (1) and Equation (4) with the redesigned subtraction, multiplication, and addition operators; Perform the eliminate operation based on the same city sequence on the involved individuals and the offspring generated by Equation (5)  7: with the redesigned subtraction, multiplication, and addition operators and record the population as B; Perform Algorithm 2 on B and record the population as C; 8: A, B, and C combine to form a new population, recorded as I; 9: Perform the eliminate operation based on route length on I, which is discussed in Section 4.5; 10: Select n best chromosomes according to the objective function from I; 11: Record the running time and update runtime; 12: End While 13: Output the best solution and the optimal value;

Experimental Results and Discussions
The algorithms involved in this work were developed in Matlab R2019b. To ensure the fairness of the experiment, all experiments were performed on the same computer. The computer used Windows 10 and operated at 3.09 GHz with 32GB of RAM. Several comparisons were conducted for evaluating the performance of the proposed algorithm in various instances from TSPLIB as follows: 1) self-comparison, where the algorithm was compared with other versions of the DCPA to evaluate the significance of improvements, 2) DCPA without a local search algorithm was compared with the other algorithms The similarity-eliminating operation based on the same quantity of city sequences without local search, and finally, 3) a DCPA comparison with other algorithms with local search.

Experiment Termination Conditions
Due to the different complexities of the algorithms participating in the comparison, the traditional method of setting the maximum number of iterations as the termination condition could not fairly measure the performance. Thus, the maximum iteration time with different city sizes was set as the termination condition in this work, which is shown in Table 4. In addition, if the length of the current optimal route was less than or equal to the best known optimum before the maximum iteration time, the iteration was ended. Each experiment was performed with 20 independent runs, and the best solution of each dataset for each run was recorded.

Comparisons and Analysis
To evaluate the performance of the proposed algorithm, the minimum (Best), maximum (Worst), average (Avg), standard deviation (SD), and deviation percentage of the Avg (PDA) values were adopted as a measurement. The Friedman test [53,54] and Holm's procedure [55] were employed to verify the significant differences among the participating algorithms.

Validation of the Improved Component
Several versions of the proposed algorithm, starting from the CPA with swap sequence and with ILS to the final version of the DCPA, which incorporates a new individual-generated method, similarity-eliminating operation, simple sorting group method, adaptive attraction rate, and local search algorithm, are described in Table 5. For the seven algorithms in Table 5, the population size was n = 100, the quantity of the carnivorous plant was 25, and the quantity of the prey was 75. For each algorithm, each instance was run 20 times independently, and the maximum running time is summarized in Table 4. Three algorithms, Version 1-Version 3, were adopted to illustrate the effectiveness of our proposed individual generation method, and the results are shown in Table 6. The description of the participating algorithms is shown in Table 5. Note: the best is set in bold.
It can be observed from Table 6 that the PDA of Version 3 was less than 3.35% on 11 instances and more than 3.35% on 5 instances, such as rat99, eil101, bier127, ch130, and d198. However, the PDA of the other two methods was more than 3.35% on 16 instances, and compared with the other two methods, our method could obtain better solutions on 15 instances, except on bay29. In addition, the mean values of Version 3 were superior to the other two methods on 15 instances, except on d198. The above analyses verified that our individual-generated method is suitable for the TSP, and it can direct the produced discrete solutions towards optimality compared with the other two methods.

Self-comparisons
Several self-comparisons between different versions of the DCPA, to illustrate the effect of each improvement component (simple sorting group, similarity-eliminating operation, and adaptive attraction probability) on the overall performance of the proposed DCPA, were conducted, and the results are summarized in Table 7. The description of the participating algorithms is shown in Table 5.
Compared with Version 3 in Table 7, it can be noticed that the PDA obtained by Version 4 only lost in pr107 and improved in 21 instances. The PDA obtained by Version 5 won in 22 instances compared with Version 4. For Version 6, it lost in 6 instances compared to Version 5 with regard to PDA and performed better in 16 instances. The analyses above indicates that adding the new components can increase the performance of the proposed algorithm.
The mean rank and final rank of the Friedman rank test are depicted in Figure 4, where the mean rank gradually decreased and the final rank gradually increased among Version 3, Version 4, Version 5, and Version 6, which verified that each added component enhanced the algorithm's performance. Note: the best is set in bold. The Friedman statistic, χ 2 , with the significance level of 0.05 is summarized in Table  8, where χ 2 is 59.62. The critical value of χ 2 0.05 [3] is 7.82 with s − 1 = 3 degrees of freedom. Thus, the null hypothesis is rejected at α = 0.05. Holm's procedure was used to further verify the significant impact of a single component on the algorithm performance. The results of all pairwise comparisons are summarized in Table 9, where v is the rank value corresponding to the unadjusted pvalue, sorted from small to large. As presented in Table 9, it is noted that the statistical test does not show a significant difference between Version 6 and Version 5 for the adjusted p-value and unadjusted pvalue, which are more than 0.05 at a 95% confidence level, and this is because the adaptive attraction rate focuses on enhancing the exploration rather than the exploitation ability of the algorithm. However, compared to Version 5, Version 6 enhanced the mean PDA, which verified that the adaptive attraction rate plays a positive role in the algorithm's performance. The rest of the adjusted p-values are all lower than 0.05, which confirms that the similarity-eliminating operation and the simple sorting group can significantly enhance the algorithm's performance. The analyses above confirmed the efficiency of the introduced components in improving the performance of the proposed algorithm.

Validation of the Proposed Algorithm
1. Compared with the algorithms without the local search algorithm: In this paper, three algorithms without local search were compared with DCPA without iterated local search (Version 6), which include DJAYA [27], the agglomerative greedy brain storm optimization algorithm (AGBSO3) [56], and DSMO [25]. The parameters of the participating algorithms are summarized in Table 10, and the comparison results on 10 instances from TSPLIB are shown in Table 11. Table 10. Parameter settings of the participating algorithms.

Algorithm
Year  According to the results in Table 11, it can be observed that Version 6 achieved a smaller PDA (%) for 8 instances out of 10 instances. For Version 6, the PDA (%) was no more than 2.45% for all 10 instances. However, there were only six instances of DSMO, nine instances of AGBSO3, and one instance of DJAYA that were no more than 2.45%. The experimental results illustrate that Version 6 has a strong optimization capability and is stable to compute a satisfactory solution in each experiment. Thus, our proposed method without the local search algorithm is robust and effective in solving the TSP compared with the other three algorithms without the local search algorithm.
The mean rank and final rank of the Friedman rank test are depicted in Figure 5, where the mean rank and final rank of Version 6 are better than the other three algorithms.  Table  12, where χ 2 is 23.3. The critical value of χ 2 0.05 [3] is 7.82 with s -1 = 3 degrees of freedom. Thus, the null hypothesis is rejected at α = 0.05. Holm's procedure was used to find the concrete pairwise comparisons that produced significant differences among the four participating algorithms. The results of Holm's procedure are summarized in Table 13. As shown in Table 13, the unadjusted p-values and adjusted p-values are all lower than 0.05, which illustrates that there are significant differences between Version 6 and DJAYA, Version 6 and DSMO, and Version 6 and AGBSO3. From the analysis in Figure 5 and Tables 12 and 13, it can be confirmed that Version 6 performed significantly better than DJAYA, DSMO, and AGBSO3. 2. Compared with the algorithms with the local search algorithm: For demonstrating the competitiveness of DCPA, 27 instances with cities from 29 up to 1577 were selected and compared with six algorithms in the literature, namely, DSSA [30], DSFLA [57], DBAL [40], D-GWO [29], ABC [26], and PACO-3Opt [58]. The parameters of the participating algorithms are shown in Table 14. Among them, the DSSA, DSFLA, and D-GWO use the 2-Opt local search algorithm, the ABC and PACO-3Opt use the 3-Opt local search algorithm, and the DBAL uses 2-Opt, 2.5-Opt, and 3-Opt local search algorithms. The comparison results in Table 15 show that our proposed method outperformed the most competitive methods in solving TSPs, as it can obtain better Best values and MPDA (%) among the seven participating algorithms. The DCPA could obtain 15 theoretical optimal solutions of 27 instances, and 4 of the remaining 12 instances were close to the optimal solutions (as their percentage deviation of the best found solution to the theoretical optimal solution was no more than 0.26%). In general, the seven algorithms are effective for TSP, but the performances of the comparison algorithms were challenged by the increasing problem scales. In some relatively large instances, such as d657, u724, pr1002, rl1323, and fl1577, the percentage deviation of the best found solution to the theoretical optimal solution of our proposed algorithm was no more than 2.31%. However, the values of the comparison algorithm were all more than 2.37%. In addition, the MPDA (%) achieved by the DCPA were 0.69, 1.32, 0.83, 2.39, 2.18, and 0.9, which were superior to DSSA, DSFLA, DBAL, DGWO, ABC, and PACO-3Opt, respectively. Note: the best is set in bold, the MPDB means the mean percentage deviation of the best found solution to the best known solution, and the MPDA (%) means the mean of PDA.
Then, the Friedman rank test was used to order the participating algorithms based on their performance in solving TSPs. The order of the seven algorithms is shown in Figure 6.  Table  16, where χ 2 is 105.32. The critical value of χ 2 0.05 [6] is 12.59 with s−1 = 6 degrees of freedom. Thus, the null hypothesis is rejected at α = 0.05. Lastly, Holm's procedure was used to find the concrete pairwise comparisons that produced significant differences among the seven participating algorithms. The results of Holm's procedure are summarized in Table 17. The results obtained from Holm's procedure show that the DCPA did not show a significant difference from the DSSA for the adjusted p-value and unadjusted p-value, which are more than 0.05 at a 95% confidence level. However, compared to the DSSA, the DCPA significantly enhanced the MPDA and MPDB, which verified the algorithm's superior performance. The statistical test shows that the DCPA was significantly different from the other five comparison algorithms, with all p-values less than 0.05 at a 95% confidence level. The analyses above demonstrate the outstanding performance of the DCPA.

Comparison of convergence speed
For demonstrating the convergence performance of the DCPA, the convergence analysis of the participating algorithms was analyzed with average computation time and convergence curves. The average computation times of 16 instances in 20 runs are summarized in Table 18, and the graphical representation of the convergence analysis is depicted in Figure 7. The Tavg in Table 18 denotes the average time of 16 instances. The xaxis in Figure 7 is taken as the running time, and the y-axis is taken as the length of the route.
The analyses above show that the DCPA can achieve a higher quality than the comparison algorithms, and the results in Table 18 confirmed that the DCPA also performs faster in computational time than the others, as the DCPA won on 11 of 16 instances. The Tavg of the DCPA was the shortest among the seven algorithms, which means that the proposed algorithm can exhibit superior quality solutions in a much faster computational time than the other participating algorithms.

Conclusions and Future Work
This work proposes a new discrete carnivorous plant algorithm with similarity elimination for the TSP, which considers intelligence and heuristics in both the intensification and diversification stages and finally increases the overall performance of the algorithm. The DCPA presents a new individual generation method that redefines the addition, subtraction, and multiplication operators. The newly generated individual can not only satisfy the discrete properties of the TSP but also maintains the good characteristics of the better individual in the parents, which helps to enhance the search precision. After that, a simple sorting grouping method is proposed, which randomly selects carnivorous plants and prey for updating, and reduces the computational complexity and the assimilation speed. Then, an adaptive variable attraction probability is proposed, and the high probability of prey updating enhances the exploration capability in the early stage of iteration. At the late stage, a high probability of carnivorous plant The value of function growth enhances the exploitation capability. Finally, the similarity-eliminating operation based on the same quantity of city sequences and route length is added to the DCPA, which effectively reduces the number of similar and identical individuals, helps to maintain population diversity, and reduces the probability of stagnation.
To verify the effectiveness of the improvements in the DCPA, two sets of experiments were designed. The first experiment compared the new generation method with the two generation methods in the literature. Then, the self-comparison of different versions of the DCPA was carried out in the second experiment. From the results, the following conclusions can be drawn: (1) the new generation method can solve the TSP effectively; and (2) simple sorting grouping, adaptive attraction probability, and the similarityeliminating operation play positive roles in the enhancement of the algorithm's performance.
To assess the performance of the proposed algorithm, the algorithm was compared with nine algorithms. The parametric and nonparametric statistical tests proved that the proposed algorithm has superior performance in solution quality. In addition, the convergence curves show that the DCPA converges more quickly than the other comparison algorithms. The above analyses demonstrate that the DCPA is an effective and competitive choice to solve the TSP.
The DCPA was only verified on the instances of the TSP and the parameters were determined with trial and error. It is not suitable for other optimization problems with discrete domains. In future work, the proposed DCPA will be tested for more complex discrete problems, such as multi-objective traveling salesman problems and multitraveling salesman problems. In addition, the optimal parameter combination, the research work on the running time, the accuracy of the algorithm, and the applied research can be carried out.