Abstract

Aiming at the problems of uneven distribution of initialized populations and unbalanced exploration and exploitation leading to slow convergence, low convergence accuracy, and easy to fall into local optimality of marine predators algorithm (MPA), a marine predators algorithm based on adaptive weight and chaos factor is proposed (ACMPA), the algorithm is applied to the traveling salesman problem (TSP), and the shortest path planning and research are carried out for the traveling salesman problem. Firstly, the improved adaptive weight strategy is used to balance the exploration and exploitation stage of the algorithm and improve the convergence accuracy of the algorithm. Secondly, the chaos factor is used to replace the random factor, and the ergodicity of the chaos factor is used to make it easier for predators to jump out of local optimization and enhance the optimization ability of the algorithm. Finally, 10 benchmark test functions, the CEC2015 test set, and the CEC2017 test set are used to evaluate the effectiveness of the ACMPA. The results show that, compared with the other four intelligent optimization algorithms, the improved ACMPA achieves better results in both mean and standard deviation, and the algorithm has a better effect on the shortest path problem.

1. Introduction

Travel salesman problem [1] is a typical combinatorial optimization problem, which can be simply described as finding an optimal closed path that can traverse all locations in the shortest time given the distance between some locations, and each location is visited only once. For the TSP problem, the emerging intelligent optimization algorithm has been well applied to this problem. The core of the intelligent optimization algorithm comes from the simulation of natural biological behavior, and the optimal solution is obtained by searching for the optimal value in global exploration and local exploitation [2, 3]. At the same time, more and more scholars have improved the algorithm and applied it to the traveling salesman problem [4, 5].

Metaheuristic algorithms proposed in recent years, such as Monarch Butterfly Optimization (MBO) [6], mainly simulate the migration and adaptation behavior of monarch butterflies. The position of each butterfly represents a feasible solution. The butterfly population is distributed in two continents, migrating and adapting to the environment. Zheng et al. proposed a slime mold algorithm (SMA) [7], which simulated the behavior and morphological changes of slime mold in the foraging process. Slime mold would determine the weight of each individual’s location according to the objective conditions of the current location and update the location through the weight index. Oliva et al. proposed the Moth Swarm Algorithm (MSA) [8], which simulates the behavior of moths flying toward the moon at night in nature, divides the moths into different types of moths, and carries out group cooperation, which balances the detection and mining capabilities of the algorithm to some extent. Alabool et al. proposed the Harris Hawks Optimization (HHO) [9], which simulates the behavior of Harris Hawks hunting rabbits and carries out unique cooperative foraging activities with other family members in the group.

The marine predators algorithm is a novel metainspired optimization algorithm proposed by Faramarzi et al. in 2020, which simulates the behavior of predators attacking prey through Brownian motion and Lévy motion, and the optimization process is divided into three stages [10]. Predator and prey will move in two different ways according to different speed ratios in these three stages. Although the MPA has made great achievements in optimization [11, 12], it still has the problems of slow convergence speed and easy to fall into local optimization. Mohamed Abd Elaziz et al. [13] proposed an enhanced marine predators algorithm, which introduces a differential evolution operator into the original marine predators algorithm, enhances the global exploration ability of the MPA, and improves the ability of the algorithm to jump out of the local optimal solution. Ma et al. [14] proposed an improved marine predators algorithm (MSIMPA), which uses a chaotic opposition learning strategy to generate a high-quality initial population and introduces an adaptive t-distribution mutation operator to update population to improve population quality and optimization accuracy. Oszust [15] proposed a new local escape operator (LEO-MPA), which uses new candidate solutions to replace part of the worst solutions to deal with premature convergence and significantly improve the optimization. Abdel-basset et al. [16] proposed an improved marine predators algorithm (IMPA). By introducing the ranking-based diversity reduction (RDR) strategy, the IMPA searched for the optimal individual position to replace the particles with poor effect many consecutive times so as to improve the convergence performance of the algorithm. But the convergence performance of the marine predators algorithm still needs to be improved. Chu et al. [17] proposed a whale optimization algorithm based on adaptive weight and simulated annealing, which adaptively adjusted the disturbance value according to the distance between the individual whale and the optimal one so as to balance the exploration and exploitation of the algorithm. Deng et al. [18] proposed a particle swarm optimization algorithm based on the neighborhood velocity imitation strategy, and the algorithm imitates the velocity of the optimal particle in the neighborhood, adaptively adjusts the convergence performance of the algorithm, and adopts the centroid mutation strategy to enhance the ability of the algorithm to jump out of the local extremum. Zhang et al. [19] proposed an improved whale optimization algorithm, which added an adaptive weight strategy in the later stage of local exploitation to improve the local search ability of the algorithm so as to improve the convergence accuracy of the algorithm. Although the adaptive weight strategy has been well applied in the optimization algorithm, it is seldom applied in the marine predators algorithm, and the convergence accuracy is low.

In order to improve the convergence speed and jump out of the local optimal solution of the MPA, a marine predators algorithm based on adaptive weight and chaos factor strategy is proposed in this paper. Firstly, the adaptive weight is combined with the step length of the algorithm, which gives a larger weight to the step length in the early stage of optimization to improve the global search ability of the algorithm and gives smaller weight to the step length in the later stage of exploitation to achieve rapid convergence. Secondly, the ergodicity of the logistic chaos function is used to replace the random vector in the process of optimization to improve the ability to jump out of the local optimal solution. Thirdly, the simulation results of 10 benchmark test functions, the CEC2015 test set, and the CEC2017 test set show that the experimental results demonstrate the effectiveness of the ACMPA. Finally, the ACMPA is applied to the TSP problem, and the superiority of the ACMPA compared with the MPA is verified.

In this paper, we use chaotic mapping instead of random initialization so that the initial population distribution has the same probability at each location in each search region, the distribution is more uniform, which is conducive to the next iteration, and it is easier for the algorithm to find the global optimum. The introduction of the adaptive weight strategy makes it easier to find the global optimum in the exploration phase with larger step lengths and in the exploitation phase with smaller step lengths. By the above two methods, the convergence speed and convergence accuracy of the algorithm are improved.

In general, this paper proposes a marine predators algorithm based on adaptive weight and chaos factor. In Section 2, the marine predators algorithm (MPA) is introduced, in Section 3, the method to improve MPA is proposed, in Section 4, the results of the test function are introduced and analyzed, and finally, in Section 5, the work is summarized.

2. Marine Predators Algorithm

The marine predators algorithm is a new metaheuristic optimization algorithm, which simulates the behavior of predators preying on prey in nature and searches for the best proxy position through Brownian motion and Lévy motion [20]. The MPA optimization process is as follows:(1)Initialization phase:The MPA is similar to the majority heuristic optimization algorithm in the initialization stage. Its initial solution is distributed in the whole solution space by random strategy, and the specific expressions are as follows:where and are the maximum and the minimum bounds of variables and is a uniform random number between 0 and 1.(2)The optimization process of the original MPA is divided into three parts according to different speed ratios, and each part has different tasks to simulate the movement process of predators and prey in space, which is summarized as follows:Stage 1. When the number of iterations is in the first third of the maximum number of iterations (when the predator is faster than the prey), this stage belongs to the exploration stage. At this time, the best strategy of the predator is not to move. The specific expression is as follows:where is the current iteration number, is the maximum iteration number, is the moving step size, is the random vector generated by Brownian motion, is the elite matrix constructed by the top predator with the best fitness, is the prey matrix with the same dimension as the elite matrix, is the population number, is a constant, the recommended value is 0.5 [21], and is a random vector evenly distributed between [0,1].Stage 2. When the number of iterations is between one-third and two-thirds of the maximum number of iterations (when the speed of the predator is the same as that of the prey), this stage is a process of trying to change from the exploration stage to the exploitation stage. At this time, the population is divided into two parts, one for global exploration, the predator for exploration by Brownian motion, the other for local exploitation, and the prey for exploitation by Lévy motion.The first half of the population motion expression is as follows:The last half of the population motion expression is as follows:where is the random vector generated by Lévy motion, is the adaptive parameter controlling the predator step size, and the formula is as follows:Stage 3. When the number of iterations is in the last two-thirds of the maximum number of iterations (when the predator is slower than the prey), this stage is the exploitation stage, and the predator adopts the Lévy migration strategy. The specific expression is as follows:(3)In addition to the above stages, the actions of predators will also be affected by the environment, such as eddy current effect or fish gather device , and transferred to other hunting areas; that is, predators will have 80% of the time looking for prey, while 20% of their time will be transferred to other hunting areas to increase their ability to jump out of the local optimal solution, a strategy to avoid the premature convergence problem; specific expression is as follows:where is the probability of being affected in the optimization process. is a binary vector group containing 0 and 1. If the generated random vector is less than 0.2, the array is 0; if the random vector is greater than 0.2, the array is 1. and are random indexes of the prey matrix.

3. Improved Marine Predators Algorithms

Aiming at the problems of easy imbalance in exploitation and exploration and easy to fall into local optimization of marine predators algorithm, an improved algorithm of adaptive weight and chaos factor is proposed. The specific improvement method is as follows.

3.1. Adaptive Weight

The weight factor balances the important parameters of global exploration and local exploitation in the optimization algorithm [22]. In the early stage of the algorithm, the particles in the space are scattered and chaotic. When the weight is given a large value, it will enhance the global search ability of the algorithm and quickly find the optimal area in a large range. In the late stage of the algorithm, the particles in the space will be concentrated in a certain area. When the weight is given a small value, the local search ability of the algorithm can be improved, and the convergence speed can be accelerated [23]. Therefore, appropriate weight parameters can improve the optimization performance of the algorithm.

Inspired by literature [24, 25], a new adaptive weight strategy is proposed to replace the original step size formula, and a larger step size is given in the early stage of the algorithm, which is beneficial to increasing the search step size and realizing global search. In the later stage of the algorithm, the algorithm gradually converges, and individuals begin to conduct local search. At this time, a small step is given to reduce the search distance, which is beneficial to the local detailed search and improves the convergence accuracy of the algorithm. From formula (5), MPA step length formula, it can be seen that, in the early stage of the algorithm, the step distance is small, which is not conducive to the predator’s search for the whole world. It is in the process of trying to change from the exploration stage to the exploitation stage, and the sudden increase in step size is not conducive to the balance between exploration and exploitation; in the later stage of the algorithm, the algorithm is in a period of rapid convergence, but the step distance is reduced, which is not conducive to the convergence of the algorithm. Therefore, the improved step length formula iswhere and are the maximum and minimum values of inertia weight. When the inertia weight and , the algorithm can maintain good performance, make the step size curve conform to the previous step growth, increase the global search ability, and gradually reduce the step size spacing with the increase of the number of iterations to achieve rapid convergence.

3.2. Logistic Chaos Factor

Chaos mapping is an aperiodic function with ergodicity and randomness. Due to its unique advantages, it has been widely used as a global optimization processing mechanism [26]. Many scholars have applied chaos theory to intelligent optimization algorithms and achieved good results [27, 28]. (1) Replace some random parameters in the algorithm with sequences generated by the chaotic system. (2) The results of the chaotic system are applied to search space to improve the local search ability of the algorithm.

However, there are limitations of a single chaotic mapping, and speaking of multiple chaotic maps incorporated into the algorithm separately, randomly, in parallel, or selectively, the effect will be greatly improved [29]. In this paper, we combine four chaotic mappings in parallel instead of one chaotic mapping; compared with random numbers, chaos can form a nonrepetitive and uniform state within a certain range [30]. Random number R is in the early stage of the algorithm. If uneven particle distribution and overlap are explored in the early stage, the global nonconvergence of the algorithm will be affected, and the convergence accuracy of the algorithm will be affected. Therefore, mixed chaos is used to replace the random number R, and its expression is as follows:where , belongs to the chaos parameter, and . The experiment shows that when value is 4, value is 2.59, and value is 3.8.

3.3. ACMPA Steps

First, the initialization is performed by chaotic mapping to determine the position of each individual in the population. Second, when the number of iterations is less than 1/3 of the total number of iterations, the position is updated by replacing the R value in (2) with the R value in (9); when the number of iterations is greater than 1/3 of the total number of iterations and less than 2/3 of the total number of iterations, half of the populations are updated by (3) (bringing the result of (9) into (3)), and others are updated by (4) (bringing the result of (8) into 3); when the number of iterations is greater than 2/3 of the total number of iterations, it is updated by (6) (bringing the result of (8) into (6)). Finally, the number of iterations is judged to be satisfied; otherwise, the iterations are repeated. The relevant flowchart of the algorithm is shown in Figure 1.

4. Simulation Experiment and Result Analysis

4.1. Parameter Settings

In this paper, the population size of marine predators is set as 100, dimension , and the maximum iteration number is 1000. The simulation experiment environment is Windows 10 system, 16 G memory, and MATLAB R2019a. In this paper, four optimization algorithms, including the marine predators algorithm (MPA) [20], Moth-Flame Algorithm (MFO) [30], Chimp Optimization Algorithm (ChoA) [31], and Sine Cosine Algorithm (SCA) [32], are selected to compare the effectiveness of ACMPA. Parameter settings of various algorithms are shown in Table 1. To make the experimental results more authoritative, all hyperparameters in Table 1 are those presented in the original paper [20, 3133].

4.2. Complexity Analysis

In optimization algorithms, complexity is often used to analyze the quality of algorithm operation time (time complexity) and space (space complexity). Among them, we usually use the time complexity to evaluate the efficiency of the algorithm and use the space complexity to evaluate the quality of the running space. Since the variables of the algorithm are not added or reduced in this paper, the space complexity has not changed, so it will not be discussed here. Big O is used to represent the time complexity of the improved algorithm, in which the added improved strategy only changes the detection step of the algorithm and hardly affects the time complexity of the algorithm; that is, O (ACMPA) = O (MPA). In this improvement, although the time complexity does not change, the accuracy of the optimal value is greatly improved compared with the original algorithm. By analysis, the complexity of the algorithm after improvement is , where is the cost of function evaluation.

4.3. Optimization Comparison of 10 Benchmark Test Functions

In order to better test the effectiveness of the improved marine predator algorithm ACMPA, 10 different test functions in the benchmark test function were selected to conduct experiments on the algorithm. Among the 10 test functions, are unimodal functions, and the peak value of this function has only one optimal value, which can be used to test the convergence speed of different algorithms. are multimodal functions, which have a large number of local optimal values. If the tested function can effectively achieve good convergence accuracy, it indicates that the algorithm has the ability to jump out of the local optimal solution. are multichannel low-dimensional functions with a small number of local minima, which can be used to test the comprehensive ability of the function. The details of each function are listed in Table 2.

In order to ensure the rationality of the algorithm, the ACMPA and other comparison algorithms were independently run 30 times, and their average value and standard deviation were recorded. The best results were marked in a deepened font. Table 2 shows the average and standard deviation of the five algorithms. Figure 1 shows the curve convergence of each algorithm under 10 test functions.

It can be seen from Table 3 that the improved ACMPA generally shows good results, ACMPA has been greatly improved on unimodal functions , and , and the highest solution accuracy reaches 1.17788e-82, which shows that, after adding adaptive weight and chaos factor, the algorithm step size gradually decreases with the increase of iteration times, and the particles in the space are distributed evenly, which balances the exploration and exploitation stages of the algorithm. For multimodal functions , and , the algorithm basically reaches the optimal value, which shows that the algorithm can jump out of the local optimal solution. For multichannel low-dimensional functions and , the improved algorithm and the original algorithm are both optimal in terms of average value, and ACMPA is better in standard deviation.

As shown in Figure 2, on unimodal functions , and , the convergence speed and convergence accuracy of the ACMPA are greatly improved compared with MPA, which indicates that the global search ability of the algorithm is improved in the global search space. For multimodal functions, , ACMPA, MPA, ChOA, and SCA have good convergence accuracy, but ACMPA is faster than other algorithms in convergence speed, which indicates that the algorithm has the ability to jump out of the local optimum after falling into the local optimum. For multichannel low-dimensional functions and , the convergence performance of ACMPA is also optimal. Generally speaking, ACMPA has a certain improvement in convergence speed and convergence accuracy.

In order to further test the effectiveness of the improved algorithm, the Wilcoxon signed-rank test is used to test the algorithm. The Wilcoxon signed-rank test is a nonparametric test method, which can analyze the statistical parameters of the optimized algorithm. In this experiment, the p-value index is used to judge whether there is a statistically significant difference between the two algorithms. When the p-value is less than 0.05, it indicates that there is a significant difference between the proposed algorithm and the comparison algorithm. Table 4 shows the comparison of experimental results between the ACMPA and other optimization algorithms.

Table 4 shows the simulation results of the Wilcoxon signed-rank test. It can be seen from the table that the significance level p values are all less than 0.05, which means that the ACMPA has significant advantages over other algorithms.

4.4. CEC2015 Test Set Experimental Comparison

In order to verify that the ACMPA has better optimization performance, this paper selects 15 test functions in the CEC2015 test set [33] to compare five optimization algorithms, among which test functions are unimodal functions, are multimodal functions, are hybrid functions, and are composition functions. The convergence speed and accuracy of the function and the overall performance of the algorithm are tested, respectively. In this experiment, the population size and the maximum iteration were set. The experimental results are best expressed in a deepened font. The results of the ACMPA and other algorithms are compared in Table 5.

From Table 5, it can be seen that the test functions and the improved algorithm ACMPA can achieve the best data in average and standard deviation compared with the other four algorithms, which effectively verifies that the MPA can improve the overall performance of the algorithm after adding adaptive weight and chaos factors. So far, the feasibility and effectiveness of the ACMPA have been proved.

4.5. CEC2017 Test Set Experimental Comparison

In order to further verify the effectiveness of the ACMPA, the CEC2017 test set [34] is selected to compare the ACMPA and four algorithms such as MPA, MFO, ChoA, and SCA. The CEC2017 test set has a total of 30 test functions, among which are unimodal functions, to test the convergence speed and accuracy of the algorithm. The function has been ruled out due to instability [35]. multimodal functions test whether the function can effectively jump out of the local optimal solution. are hybrid functions, and are composite functions to test the overall performance of the function.

Set dimension , the population number , and the maximum number of iterations . The average value and standard deviation of each algorithm were recorded independently 30 times, and the optimal value was marked with a deepened font. The results of the ACMPA and other comparison algorithms are shown in Table 6.

It can be seen from Table 6 that the ACMPA significantly improves the average and standard deviation of 29 test functions. On a few functions , and , the average value of the improved function ACMPA fails to reach the optimal value, but in other test functions, the average value is better than other comparison algorithms. It shows that the convergence speed and convergence precision of the marine predators algorithm are improved by adding adaptive weight and chaos factor, which verifies the effectiveness of the improved algorithm.

4.6. Runtime Overhead

The runtime overhead of each algorithm is shown in the table (the algorithm is calculated within the CEC2017 function library, the number of populations is 30, and the number of iterations is 100). From the data in Table 7, we can conclude that the difference in running time between the improved algorithm and the previous algorithm is not significant. But from the analysis above, we can conclude that the effect of the improved algorithm increases significantly.

5. ACMPA Based on Traveling Salesman Problem

5.1. Traveling Salesman Problem Description

The TSP problem, also known as the salesman problem, is mainly described as a salesman going to sell products in several cities. The salesman starts from a certain city and requires to pass through each city, and each city can only be visited so that the total path is the shortest. Set the city node set as and the distance between cities as , and the objective function of the shortest path is

5.2. Traveling Salesman Algorithm Test

The number of cities is set as 40, and the maximum iteration is 5000. In this experiment, the ACMPA and MPA are compared and analyzed. Table 8 shows the optimal access path length of 40 cities and the path length calculated by the two algorithms. Figures 3(a) and 3(b) show the shortest path length results of the two algorithms, respectively. For the TSP problem, we conducted 30 experiments and took the mean and variance to compare the degree of superiority of the results, and the results are shown in Table 8. From Table 8, we can get the following conclusions. The improved MPA has a better way to handle this problem.

It can be seen from Table 8 and Figure 3 that the path simulation of 40 city coordinates and the path optimization using the ACMPA are closer to the optimal solution, which has a great improvement in the path optimization compared with the MPA. In general, the ACMPA is effective in solving the traveling salesman problem.

6. Conclusion

Aiming at the problems of the MPA, like unbalanced exploration and exploitation, vulnerability to local extreme points, and so on, this paper proposes a marine predators algorithm based on adaptive weight and chaos factor.

Firstly, the adaptive weight is set as a dynamic step, and a large step length is given in the early stage of the algorithm to carry out an effective global search, which improves the convergence speed of the algorithm. At the same time, with the increase of the number of iterations, the step length is gradually reduced, which is more conducive to local careful search in the later stage and maintains the balance between algorithm exploration and exploitation. Secondly, logistic chaos mapping is used to replace random numbers; due to the ergodicity and randomness of the chaotic system, the scattered particles in space can effectively avoid repeated folding and improve the ability of the algorithm to fall into the local optimal solution. Applying the ACMPA to the TSP problem effectively improves the optimization accuracy of the original algorithm in practical applications. Finally, the application algorithm is compared and tested, which proves the effectiveness of the ACMPA. In the future research, the improved marine predators algorithm will be applied to large-scale engineering practice to further exploit the advantages of the optimization algorithm.

Data Availability

The data used to support the findings of the study are available from the corresponding author upon request.

Conflicts of Interest

The authors declare that there are no conflicts of interest regarding the publication of this paper.

Authors’ Contributions

Shujun Liang contributed to conceptualization, methodology, investigation, original draft preparation, and review and editing of the paper. Youmei Pan contributed to investigation and writing the original draft. Huanlong Zhang contributed to methodology and editing and review of the paper. Jie Zhang contributed to conceptualization and methodology. Fengxian Wang contributed to conceptualization, methodology, and investigation. Zhiwu Chen contributed to review and editing of the paper.

Acknowledgments

This work was supported by the National Natural Science Foundation of China (61873246, 62072416, 62006213, 6167241, and 61702462), the Program for Science & Technology Innovation Talents in Universities of Henan Province (21HASTIT028), the Natural Science Foundation of Henan (202300410495), and the Zhongyuan Science and Technology Innovation Leadership Program (214200510026).