Solving Traveling Salesman Problems Based on Artificial Cooperative Search Algorithm

The traveling salesman problem is a typical NP hard problem and a typical combinatorial optimization problem. Therefore, an improved artificial cooperative search algorithm is proposed to solve the traveling salesman problem. For the basic artificial collaborative search algorithm, firstly, the sigmoid function is used to construct the scale factor to enhance the global search ability of the algorithm; secondly, in the mutation stage, the DE/rand/1 mutation strategy of differential evolution algorithm is added to carry out secondary mutation to the current population, so as to improve the calculation accuracy of the algorithm and the diversity of the population. Then, in the later stage of the algorithm development, the quasi-reverse learning strategy is introduced to further improve the quality of the solution. Finally, several examples of traveling salesman problem library (TSPLIB) are solved using the improved artificial cooperative search algorithm and compared with the related algorithms. The results show that the proposed algorithm is better than the comparison algorithm in solving the travel salesman problem and has good robustness.


Introduction
Traveling salesman problem (TSP) is not only a basic circuit problem but also a typical NP hard problem and a typical combinatorial optimization problem. It is one of the most famous problems in the field of mathematics [1,2]. It was first proposed by Menger in 1959. After it was proposed, it has attracted great attention of scholars and managers in operations research, logistics science, applied mathematics, computer application, circle theory and network analysis, combinatorial mathematics, and other disciplines and has become a research hotspot in the field of operations research and combinatorial optimization [3]. In recent years, many scholars have studied the TSP [4][5][6][7][8][9], and more scholars have expanded the traveling salesman problem [10][11][12]. At present, the traveling salesman problem is widely used in various practical problems such as Internet environment, road traffic, and logistics transportation [13]. erefore, the research on TSP has important theoretical value and practical significance.
In the past 30 years, intelligent optimization algorithms have been favored by scholars because of their few parameters, simple structure, and easy implementation such as genetic algorithm (GA) [14][15][16][17], differential evolution algorithm (DE) [18], invasive weed optimization (IWO) [19], and particle swarm optimization (PSO) [20]. Artificial cooperative search algorithm was firstly proposed by Pinar Civicioglu in 2013 to solve numerical optimization problems [21]. e algorithm was proposed to simulate the interaction and cooperation process between two superorganisms with predator-prey relationship in the same natural habitat. In nature, the amount of food that can be found in an area is very sensitive to climate change. erefore, many species in nature will migrate to find and migrate to higher yield breeding areas. It includes the processes of predator selection, prey selection, mutation, and crossover [22][23][24][25]. Firstly, the predator population location is randomly generated, the predator location memory is set, and then the prey population location is randomly generated to reorder the prey location, where biological interactions occur during the variation phase. Finally, enter the crossover stage and update the biological interaction position through the active individuals in the predator population. Compared with other optimization algorithms, artificial cooperative search algorithm has the advantages of less control parameters and strong robustness and adopts different mutation and crossover strategies. At present, the algorithm has been used to solve scheduling problems, design problems, and other practical problems [26,27]. To some extent, these methods do solve some practical problems, but there are still some defects such as slow convergence speed and low accuracy. erefore, it is necessary to improve artificial cooperative search algorithm to improve the performance of the algorithm [28][29][30].
Aiming at the disadvantages of slow convergence speed, low accuracy, and easy to fall into local optimization of the basic artificial cooperative search algorithm (ACS), this paper proposes a reverse artificial cooperative search algorithm based on sigmoid function (SQACS), that is, after constructing the scale factor by the sigmoid function, the DE/rand/1 mutation strategy of differential evolution algorithm is added in the mutation stage, and the quasi-reverse learning strategy is introduced in the later development stage of the algorithm. In the numerical simulation, the SQACS is used to solve several examples in TSPLIB. e results show that the presented algorithm is feasible. e remainder of this paper is organized in the following manner. Section 2 describes the TSP model. In Section 3, the basic and improved ACS algorithms are introduced in detail. Solving TSP by the SQACS is described in Section 4. Section 5 covers simulations that have been conducted, while Section 6 presents our conclusion.

TSP Model
In general, TSP specifically refers to a traveling salesman who wants to visit n cities, starting from a city, must pass through all the cities only once, and then return to the departure city, requiring the traveling agent to travel the shortest total distance [13]. It is described in graph theory language as follows. In a weighted completely undirected graph, it is necessary to find a Hamilton cycle with the smallest weight.
at is, let G � (V, E), V � 1, 2, · · · , n { } represent the set of vertices and E represent the set of edges, and each edge e � (i, j) ∈ E has a non-negative weight m(e). Now it is necessary to find the Hamilton cycle C of G so that the total weight M(C) � E(C) m(e) of C is the smallest. If d ij is used to represent the distance between city i and city j, is on the optimal path 0, otherwise , then the mathematical model of TSP is as follows: i,j∈S where |S| represents the number of vertices in the set S. e first two constraints shown in (2) and (3) indicate that there is only one inbound and one outbound edge for each vertex, and the third constraint (4) indicates that no sub-loops will be generated.

Basic Artificial Cooperative Search
Algorithm. Basic artificial cooperative search (ACS) algorithm is a global search algorithm based on two populations, which is used to solve numerical optimization problems [21]. Generally, ACS includes the following population initialization, predator selection, prey selection, mutation, crossover, update selection, and so on.

Population Initialization.
ACS contains two superorganisms: α and β, in which α and β contain artificial subsuperorganisms equal to the population size (N). In the relevant sub-superorganisms, the number of individuals is equal to the dimension (D) of the problem. α and β ultrasound organisms are used to detect artificial predators and prey sub-superorganisms. e initial values of the subsuperorganism of α and β are defined by the following: where i � 1, 2, · · · , N, N is the population size, j � 1, 2, · · · , D, D is the dimension of the optimization problem, α i,j and β i,j are the components of the i-th subsuperorganism in the j-th dimension, up j and low j are the upper and lower limits of the j-th dimension search interval, respectively, and R(0, 1) is a random number uniformly distributed on [0, 1].

Predator Selection.
At this stage of ACS, the cooperative relationship between two artificial superorganisms is defined. In each iteration of ACS, according to the "if then else" rule, the artificial predator sub-superorganism is randomly defined from two artificial superorganisms (α and β), and the artificial predator is selected through (8). At this stage of ACS, in order to help explore the search space of the problem and promote the utilization of high-quality solutions, a memory process is developed. In order to provide this memory process, during coevolution, artificial predators will follow artificial prey for a period of time to explore more fertile eating areas.
where r 1 and r 2 are uniformly distributed random numbers on the [0, 1] interval, predator represents the predator, key represents the memory that tracks the origin of the predator in each iteration, and its memory is used to improve the performance of the algorithm.

Prey Selection.
Using the same rules as selecting artificial predators, artificial prey is selected through two artificial superorganisms (α and β). In ACS, the hierarchical sequence of artificial prey is replaced by random transformation function, which is used to simulate the behavior of superorganisms living in nature. e artificial prey is selected by (9), and the selected prey is used to define the search direction of ACS in each iteration.
where r 1 and r 2 are uniformly distributed random numbers in the [0, 1] interval and prey represents prey.

Mutation.
Using the mutation process defined in equation (10), the biological interaction position between artificial predator and prey sub-superorganism is simulated. e algorithm embeds a walk process (random walk function) in the mutation process to simulate the foraging behavior of natural superorganisms. In order to promote the exploration of the problem search space and the development of more effective solutions, the variation matrix is generated by using some experience obtained by the artificial predator sub-superorganism in the previous iteration.
where in order to control the scale factor of biological interaction speed, it is calculated from (13). iter is the current number of iterations, i ∈ 1, 2, · · · , N { }, a, b, c, rand, r 1 and r 2 are random numbers uniformly distributed on the [0,1] interval, and Γ is the gamma distribution with shape parameter 4 × rand and scale parameter 1. (11), the active individuals in the artificial predator sub-superorganism are determined by a binary integer matrix M. e initial value of M is a matrix whose elements in row N and column D are all 1. In ACS, those individuals who can only find new biological interaction sites and can participate in migration at any time are called active individuals. e degree of cooperation between individuals in the migration process is determined by the control parameter P, which limits the number of active individuals produced by each artificial subsuperorganism. en, the parameter controls the number of individuals involved in the crossover process, that is, it determines the probability of biological interaction in the crossover process. e crossover operator of ACS is given by

Crossover. As defined in equation
where i ∈ 1, 2, · · · , N, j ∈ 1, 2, · · · , D. predator i,j represents the component of the i-th predator in the j-th dimension, and M i,j represents the component of the i-th active individual of the predator in the j-th dimension. r 1 , r 2 , r 3 , and r 4 represent uniformly distributed random numbers in the [0, 1] interval, and P represents the probability of biological interaction. Different experiments with different P values in the [0.05, 0.15] interval show that ACS is not sensitive to the initial value of its control parameters.
3.1.6. Update Selection. e memory key set in the predator selection stage updates the α and β superorganisms, so as to better select predators and prey at the beginning of the next iteration, so as to strengthen the global search performance. e specific operation is shown in (12) and (13).
where i ∈ 1, 2, · · · , N, predator i represents the i-th predator, and iter represents the current number of iterations.

Improved Artificial Cooperative Search Algorithm.
Because ACS is not mature and perfect in theory and practice, aiming at its shortcomings such as slow convergence speed, low accuracy, and easy to fall into local optimization, a reverse artificial cooperative search algorithm Computational Intelligence and Neuroscience 3 based on sigmoid function (SQACS) is proposed. e specific improvement scheme is as follows.

Constructing Scale Factor R with Sigmoid Function.
In ACS, the scale factor R controlling the speed of biological interaction is randomly generated, which often makes the algorithm fall into local optimization, which is not conducive to the global search of the algorithm. In order to solve this problem, the following sigmoid function is introduced: e sigmoid function is continuous, derivable, bounded, and strictly monotonic, and it is a kind of excitation function [31]. In ACS, according to the mechanism of the biological interaction position, it is known that at the beginning of the algorithm, it needs to quickly approach the optimal position. When it reaches the optimal position, it is necessary to reduce the search speed of the algorithm.
rough the sigmoid function and constructing (15), the scale factor R that randomly controls the speed of biological interaction is transformed into a quantity that changes with the number of iterations and is mapped to the range of [0, 1], so that the scale factor R in [0, 1] gradually decreases in the range, so as to find the optimal solution more accurately. In this way, the scale factor R constructed using the sigmoid function is as in equation (15), and its curve is shown in Figure 1.
where G max is the maximum number of iterations, iter is the current number of iterations, and R(iter) is the scale factor at the iter-th iteration.

Quadratic Mutation Strategy.
e DE/rand/1 mutation strategy of the DE is added to the second mutation of the population generated in the mutation stage of the ACS [18]. Research has found that the Gaussian, random, linear, or chaotic changes of the parameters in the DE can effectively prevent premature convergence. erefore, after the DE/rand/1 mutation strategy of the DE is added to the ACS, a new mutation population is generated, and the next crossover behavior is performed. ereby, the algorithm can avoid falling into the local optimum and improve the calculation accuracy. e quadratic mutation formula is where i ∈ 1, 2, · · · , N, j ∈ 1, 2, · · · , D, iter is the current iteration number, random integers r1, r2, r3 ∈ N, and r1 ≠ r2 ≠ r3 ≠ i. e variation factor sf is a control parameter that scales any two of the three vectors and adds the scaled difference to the third vector. In order to avoid search stagnation, the variation factor sf usually takes a value in the range of [0.1, 1].

Quasi-Reverse Learning Strategy.
In the later development stage of the algorithm, a better biological interaction position should be found between the populations. Because the position is changing and this change is random, it often prevents it from searching for the optimal solution in a small local area. In order to overcome the above shortcomings, a pseudo-reverse learning strategy is introduced to generate pseudo-reverse populations to increase the diversity of the populations, so that organisms can conduct detailed search for interaction positions in neighboring communities to avoid skipping the optimal solution, and then greedy selection from the current population and quasi-reverse population can effectively find the optimal solution [32][33][34][35]. e detailed process is given below: (i) Assuming that X � (x 1 , x 2 , · · · , x n ) is a n-dimensional solution, x 1 , x 2 , · · · , x n ∈ R and x i ∈ [l i , u i ], i ∈ 1, 2, · · · , n { }. en, the reverse solution (ii) On the basis of the reverse solution, the quasi-reverse solution QOX � (x ⌣q 1 , x ⌣q 2 , · · · , x ⌣q n ) can be defined as In this way, the choice of the quasi-inverse solution and the current solution is To sum up, the flowchart of the proposed SQACS is shown in Figure 2.

Solving TSP by SQACS
Taking the shortest path (i.e., equation (1)) as the objective function, the SQACS is used to solve the TSP. In order to better solve the TSP and realize the transformation between biological organism and TSP solution space, each biological interaction location X i � (x i1 , x i2 , · · · , x in ) is defined as a sequence of traversing and accessing each city number in this paper. For example, one of the interaction positions X i � [1,3,2,4,5,6] means that the TSP is that the traveler first visits the city with number 1, then successively visits the cities with numbers 3, 2, 4, 5 and 6, and finally returns to the departure city, that is, the city with number 1, and the corresponding objective function is equivalent to the path length of TSP. For the TSP, the shorter the individual's visit path is, the greater the fitness value is, so the fitness function f(x i ) � 1/Z x i is selected, where i � 1, 2, · · · , n, n is the number of cities to visit, and the lower and upper limits of variables are 1 and n, respectively. e specific steps of SQACS to solve TSP are as follows: Step 1. Population initialization: use the city number to encode the TSP path and randomly generate the arrangement order of n cities.
Step 2. Calculate the fitness value of each individual in the population.
Step 3. Randomly select the predator and prey population, and then randomly rearrange the position of prey population.
Step 4. Calculate the scale factor R of biological interaction velocity.
Step 5. Determination of active individuals M in predator population by binary integer mapping.
Step 6. Mutation: calculate the location X of biological interaction, i.e., the visit route of the traveler.
Step 7. Crossover: if the active individual mapping is greater than 0, update the path to the predator location; otherwise, keep the original location unchanged.
Step 8. Reselection of predator and prey populations.
Step 9. Judge whether the termination conditions are met. If so, stop the algorithm update and output the optimal position and optimal function value, that is, the shortest route and shortest path value of TSP. Otherwise, return to Step 2.

Numerical Simulation
In order to verify the performance of the proposed SQACS, SQACS is tested with GA [14], DE [18], IWO [19], PSO [20], ACS [21], IACS1 [27], and IACS2 [36] to solve four TSPs of different scales in TSPLIB standard database: Oliver 30, Att48, Eil51, and Eil76. In the simulation, in order to compare the results under the same conditions as much as possible, the maximum evaluation times of each algorithm is 2000 and the initial population size is 20. Other parameter settings of the algorithm involved are shown in the corresponding references.
After 30 times of solution by SQACS and the abovementioned algorithms, the optimal value, average value, and average calculation time of the results are shown in Table 1. By comparing the optimal value and average value of each algorithm to solve the TSP, it can be seen that SQACS can obtain the optimal results in the minimum value and average value, and the difference between the optimal value and average value is the smallest, indicating that SQACS has the strongest stability. From the comparison of index values of calculation time, SQACS performs better than other comparison algorithms on the four datasets. It can be seen that SQACS has good feasibility and robustness in solving TSP. Figure 3 shows the optimal path diagram of four groups of examples in solving TSP by SQACS. As can be seen from Figure 3, except the path intersection in Att48 dataset, the other three figures are a completely closed loop, and the paths do not cross, so the obtained paths are feasible. Also, the solutions of the optimal route obtained are as follows: Start Set the population size, the maximum number of iterations, and randomly initialize the α and β populations Select predators and prey according to Equations (8) and (9) Whether the termination conditions are met?
Calculate the scale factor R according to Equation (18) End Calculate the population fitness value, retain the optimal individual position and its fitness value Perform the mutation operation according to Equations (10) and (11) Perform the secondary mutation operation according to Equation (19) Perform crossover operation according to Equations (12), (13) and (14) Execute reverse learning strategy by Equations (20), (21) and (22) Update selection by Equations (15) and (16) Output the optimal individual position and its fitness value     Computational Intelligence and Neuroscience In order to further verify the effectiveness of SQACS, the algorithms in [5][6][7][8][9] are further selected to compare the solution results of Oliver 30, Att48, Eil51, and Eil76 in TSP.
e comparison results are shown in Table 2. By comparing the data in Table 2, it can be found that the solution results of SQACS on the other three datasets are better than those proposed in the literature, and the solution results all reach the optimal value in TSPLIB database. is verifies the effectiveness of SQACS in solving TSP.

Conclusion
In order to better solve the traveling salesman problem, this paper proposes a reverse artificial collaborative search algorithm based on sigmoid function. at is, the scale factor is constructed by sigmoid function to improve the global search ability of the algorithm. In the mutation stage, the DE/rand/1 mutation strategy of differential evolution algorithm is added to carry out secondary mutation on the current population, so that the algorithm can avoid falling into local optimization and improve the calculation accuracy. In the later development stage of the algorithm, the quasi-reverse learning strategy is introduced to find the optimal solution more effectively. Finally, the proposed algorithm is used to solve the traveling salesman problem, and the results show that the proposed algorithm in this paper is effective for solving the traveling salesman problem.

Data Availability
e data used and/or analyzed during the current study are available from the corresponding author on reasonable request.

Conflicts of Interest
e authors declare that they have no conflicts of interest. Computational Intelligence and Neuroscience 7