Literature DB >> 35463281

Solving Traveling Salesman Problems Based on Artificial Cooperative Search Algorithm.

Guangjun Liu1, Xiaoping Xu1, Feng Wang2, Yangli Tang1.   

Abstract

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.
Copyright © 2022 Guangjun Liu et al.

Entities:  

Mesh:

Year:  2022        PMID: 35463281      PMCID: PMC9019308          DOI: 10.1155/2022/1008617

Source DB:  PubMed          Journal:  Comput Intell Neurosci


1. 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-9], and more scholars have expanded the traveling salesman problem [10-12]. At present, the traveling salesman problem is widely used in various practical problems such as Internet environment, road traffic, and logistics transportation [13]. Therefore, 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-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]. The 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. Therefore, 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-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. Therefore, it is necessary to improve artificial cooperative search algorithm to improve the performance of the algorithm [28-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. The results show that the presented algorithm is feasible. The 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.

2. 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. That 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)=∑m(e) of C is the smallest. If d is used to represent the distance between city i and city j, d ≥ 0, i, j ∈ v, , then the mathematical model of TSP is as follows:where |S| represents the number of vertices in the set S. The 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.

3. Artificial Cooperative Search Algorithm

3.1. 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.

3.1.1. Population Initialization

ACS contains two superorganisms: α and β, in which α and β contain artificial sub-superorganisms 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. The initial values of the sub-superorganism 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, α and β are the components of the i-th sub-superorganism in the j-th dimension, up and low 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].

3.1.2. 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 r1 and r2 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.

3.1.3. 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. The artificial prey is selected by (9), and the selected prey is used to define the search direction of ACS in each iteration.where r1 and r2 are uniformly distributed random numbers in the [0, 1] interval and prey represents prey.

3.1.4. Mutation

Using the mutation process defined in equation (10), the biological interaction position between artificial predator and prey sub-superorganism is simulated. The 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, r1 and r2 are random numbers uniformly distributed on the [0,1] interval, and Γ is the gamma distribution with shape parameter 4 × rand and scale parameter 1.

3.1.5. Crossover

As defined in equation (11), the active individuals in the artificial predator sub-superorganism are determined by a binary integer matrix M. The 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. The 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 sub-superorganism. Then, 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. The crossover operator of ACS is given bywhere i ∈ 1,2, ⋯, N, j ∈ 1,2, ⋯, D. predator represents the component of the i-th predator in the j-th dimension, and M represents the component of the i-th active individual of the predator in the j-th dimension. r1, r2, r3, and r4 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

The 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. The specific operation is shown in (12) and (13).where i ∈ 1,2, ⋯, N, predator represents the i-th predator, and iter represents the current number of iterations.

3.2. 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 based on sigmoid function (SQACS) is proposed. The specific improvement scheme is as follows.

3.2.1. 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: The 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. Through 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 Gmax 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.
Figure 1

The curve of scale factor (R).

3.2.2. Quadratic Mutation Strategy

The 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. Therefore, 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. Thereby, the algorithm can avoid falling into the local optimum and improve the calculation accuracy. The quadratic mutation formula iswhere 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. The 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].

3.2.3. 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-35]. The detailed process is given below: Assuming that X=(x1, x2, ⋯, x) is a n-dimensional solution, x1, x2, ⋯, x ∈ R and x ∈ [l, u], i ∈ {1,2, ⋯, n}. Then, the reverse solution can be defined as On the basis of the reverse solution, the quasi-reverse solution 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.
Figure 2

Flowchart of SQACS.

4. 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=(x, x, ⋯, x) is defined as a sequence of traversing and accessing each city number in this paper. For example, one of the interaction positions X=[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)=1/Z 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. The 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.

5. 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 above-mentioned 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.
Table 1

Comparison of experimental results of eight algorithms.

ExampleEvaluation criterionGADEIWOPSOACSIACS1IACS2SQACS
Oliver30Optimal value427.37423.11431.34428.01453.27452.12434.67420.00
Average value432.33435.94449.98437.83475.23468.21440.62421.31
Average time/s28.3628.2829.6727.2627.4127.8528.2626.17
Att48Optimal value33942.4733793.0633596.8133642.3434663.4134527.2333742.8433516.02
Average value40374.2834183.5833637.8633785.1235721.3935123.3134081.8233583.17
Average time/s49.3649.4250.2149.2350.2650.8551.9749.02
Eil51Optimal value473.56436.81471.36432.99484.05478.67442.43426.00
Average value481.52451.08482.90448.60496.55480.89449.76427.71
Average time/s55.5455.3558.3654.6557.2557.7858.0255.27
Eil76Optimal value568.47547.13562.20541.91572.93568.37543.00538.00
Average value584.01583.11578.37550.68586.33581.81552.45543.79
Average time/s85.4985.2886.2385.5486.2386.5487.1585.16
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: 6⟶5⟶30⟶23⟶22⟶16⟶17⟶12⟶13⟶4⟶3⟶9⟶11⟶7⟶8⟶25⟶26⟶29⟶28⟶27⟶24⟶15⟶14⟶10⟶21⟶20⟶ 19⟶18⟶2⟶1⟶6; 2⟶29⟶34⟶41⟶16⟶22⟶3⟶40⟶9⟶1⟶8⟶38⟶31⟶44⟶18⟶7⟶28⟶36⟶30⟶6⟶37⟶19⟶27⟶17⟶43⟶20⟶ 33⟶46⟶15⟶12⟶11⟶23⟶14⟶25⟶13⟶47⟶24⟶39⟶32⟶48⟶5⟶42⟶10⟶24⟶45⟶35⟶26⟶4⟶2; 40⟶19⟶42⟶44⟶37⟶15⟶45⟶33⟶39⟶10⟶30⟶34⟶50⟶9⟶49⟶38⟶11⟶5⟶46⟶51⟶27⟶32⟶1⟶22⟶2⟶16⟶21⟶29⟶20⟶35⟶36⟶3⟶28⟶31⟶26⟶8⟶48⟶6⟶23⟶7⟶43⟶24⟶14⟶25⟶18⟶47⟶12⟶17⟶4⟶13⟶41⟶40; 9⟶39⟶72⟶58⟶10⟶38⟶65⟶56⟶11⟶53⟶14⟶59⟶19⟶54⟶13⟶27⟶52⟶34⟶46⟶8⟶35⟶7⟶26⟶67⟶76⟶ 75⟶4⟶45⟶29⟶5⟶15⟶57⟶37⟶20⟶70⟶60⟶74⟶36⟶ 69⟶21⟶47⟶48⟶30⟶2⟶68⟶6⟶51⟶17⟶12⟶40⟶32⟶ 44⟶3⟶16⟶63⟶33⟶73⟶62⟶28⟶74⟶61⟶22⟶1⟶43⟶ 41⟶42⟶64⟶56⟶23⟶49⟶24⟶18⟶50⟶25⟶55⟶31⟶9.
Figure 3

The optimal path diagrams of four examples obtained by the SQACS. (a) Oliver30. (b) Att48. (c) Eil51. (d) Eil76.

In order to further verify the effectiveness of SQACS, the algorithms in [5-9] are further selected to compare the solution results of Oliver 30, Att48, Eil51, and Eil76 in TSP. The 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. This verifies the effectiveness of SQACS in solving TSP.
Table 2

Comparison of SQACS calculation results and literature.

TSP test setTSPLIB optimal solutionSQACS optimal solutionReference [5] optimal solutionReference [6] optimal solutionReference [7] optimal solutionReference [8] optimal solutionReference [9] optimal solution
Oliver30420.00420.00420.00420.00423.74423.74
Att4833503.0033516.0036441.0033522.00
Eil51426.00426.00479.00428.87428.00814.53426.00
Eil76538.00538.00544.37547.00538.00

6. Conclusion

In order to better solve the traveling salesman problem, this paper proposes a reverse artificial collaborative search algorithm based on sigmoid function. That 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.
  2 in total

1.  Stability of Solutions to Classes of Traveling Salesman Problems.

Authors:  Moritz Niendorf; Pierre T Kabamba; Anouck R Girard
Journal:  IEEE Trans Cybern       Date:  2015-04-20       Impact factor: 11.448

2.  Learning From a Complementary-Label Source Domain: Theory and Algorithms.

Authors:  Yiyang Zhang; Feng Liu; Zhen Fang; Bo Yuan; Guangquan Zhang; Jie Lu
Journal:  IEEE Trans Neural Netw Learn Syst       Date:  2021-06-17       Impact factor: 10.451

  2 in total

北京卡尤迪生物科技股份有限公司 © 2022-2023.