Multi-modal travel salesman problem optimization method
Through the 'preprocessing-global convergence-local optimization' method, the problem of providing multi-modal solutions in travel business problems is solved, and rapid convergence and diversity enhancement is achieved, adapting to practical application needs and providing multiple high-quality preparations Choose a plan.
Patent Information
- Application Number
- CN202411117728.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-15
- Publication Date
- 2024-12-20
AI Technical Summary
The existing traveler problem (TSP) focuses on finding the optimal solution, failing to effectively provide multiple high-quality alternatives, making it difficult to deal with emergencies such as traffic congestion or bad weather in practical applications, and the computational complexity High, it is difficult to quickly find multimodal solutions.
Using the staged optimization method of 'preprocessing-global convergence-local optimization', it provides multimodal solutions and avoids resource waste through key edge set recognition, individual generation strategies, environment selection and local search of jump operators, and enhances the algorithm. flexibility and diversity.
While finding the optimal value, multiple multimodal solutions are provided, which reduces waste of computing resources, improves the convergence speed and diversity of the algorithm, adapts to different user needs, and enhances the flexibility and efficiency of decision-making.
Smart Images

Figure CN119168178A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of path planning, and in particular to an optimization method for a multi-modal traveling salesman problem. Background Art
[0002] TSP (Traveling Salesman Problem) is a classic combinatorial optimization problem, first proposed by mathematicians Haskell Haskell and Thomas Kirkman in the 19th century. Its basic concept is: given a set of cities and the distances (or costs) between them, find a path that visits each city exactly once and eventually returns to the starting point, minimizing the total length of the path. TSP is a classic problem in combinatorial optimization theory, involving multiple mathematical and computer science fields such as graph theory, algorithm design, and computational complexity theory. It represents an important category of NP-hard problems, requiring a lot of computation to find the optimal solution even at a relatively small problem scale, which means that as the number of cities increases, the computational complexity of finding the optimal solution increases exponentially. In recent years, heuristic algorithms have performed well in solving TSP, such as greedy algorithms, genetic algorithms, simulated annealing algorithms, ant colony algorithms, and particle swarm algorithms, which simulate the behavior of biological or physical systems to find the optimal path to the solution. These algorithms show their respective advantages in different scenarios and problem scales.
[0003] With the improvement of computing power and the progress of algorithm research, the application scenarios of TSP are becoming more and more extensive and complex. It is mainly reflected in the fields of path planning and resource optimization. For example, in logistics management, it is often necessary to plan the optimal path for deliverymen or transport vehicles to minimize time or cost. TSP can help optimize daily delivery routes to maximize delivery efficiency and reduce mileage and transportation costs. In chip design, TSP is used to optimize the connection paths on circuit boards to minimize the delay and energy consumption of signal transmission. By finding the optimal path, the performance and reliability of the circuit can be improved. In drone applications, TSP can help plan the flight path of drones to minimize energy consumption or complete tasks at multiple target points. This optimization is particularly important for the application of drones in agriculture, exploration, and rescue. By improving resource utilization efficiency and the scientific nature of decision-making, TSP research has brought significant value and results to various fields in real life.
[0004] Most TSP-related problems and TSP variants focus on finding an optimal solution without considering the fact that there may be multiple high-quality solutions. However, in real life, it is necessary to provide decision makers with a variety of optimal alternatives so that they can quickly adopt another solution in an emergency, such as traffic congestion caused by urban road projects or flight cancellations due to bad weather. Due to different route options, traffic load can also be balanced. Therefore, this demand has given rise to the study of the multimodal traveling salesman problem. The study of the multimodal traveling salesman problem is not only of great significance in theory, but also has a profound impact on optimizing efficiency, reducing costs, and providing more flexible and efficient solutions in practical applications. Summary of the invention
[0005] The present invention conducts an in-depth study on the multimodality of traditional TSP, and based on the multimodal traveling salesman problem, provides a phased optimization method of "preprocessing-global convergence-local optimization", which can provide multiple multimodal solutions while finding the optimal value to meet the preferences and needs of different users.
[0006] The technical solution adopted by the present invention is:
[0007] The optimization method for the multimodal traveling salesman problem includes the following steps:
[0008] Step 1, preliminary optimization of the solution;
[0009] Step 2: Based on the key edge set obtained in step 1, two individual generation strategies are used to quickly converge the solution globally, and the environment selection strategy is used to delete or retain the multimodal solution;
[0010] Step 3, adaptively generate clusters based on the target space distance, and arrange the inter-class multimodal solutions according to the number of clusters; generate individuals based on the archive and inter-class multimodal arrangement, and perform local optimization on the individuals based on the local search strategy of the jump operator.
[0011] Further, in step 1, specifically:
[0012] Step 1.1, initialize the population according to the problem scale, the population size is NP, and calculate the fitness value of the individuals in the population;
[0013] Step 1.2, perform a crossover operation on the initial population to generate offspring and calculate the fitness value;
[0014] Step 1.3, merge the parent generation and the offspring generation for environmental selection;
[0015] Step 1.4, loop iterates until the stopping condition is reached.
[0016] Further, in step 1.2, the crossover operation includes the following steps:
[0017] Step 1.2.1, initialize the population according to the problem scale,
[0018] Step 1.2.2, randomly select two parents:
[0019] P1=3 5 6 7 8 9 2 1 4
[0020] P2=4 7 3 1 2 5 6 8 9
[0021] Step 1.2.3, randomly generate two intersection points to divide the individual into three segments, and leave the middle part in the offspring:
[0022] P1=3 5 6|7 8 9 2|1 4
[0023] P2=4 7 3|1 2 5 6|8 9
[0024] O1=***|1 2 5 6|**
[0025] O2=***|7 8 9 2|**
[0026] Step 1.2.4, leave the middle part of the intersection and place it in the third segment:
[0027] P1=1 4|3 5 6|7 8 9 2
[0028] P2=8 9|4 7 3|1 2 5 6
[0029] Step 1.2.5, delete the middle part of parent 1 from parent 2 to get 4-3-1-5-6, delete the middle part of parent 2 from parent 1 to get 4-3-7-8-9, and add them to get the offspring:
[0030] O1=7 8 9|1 2 5 6|4 3
[0031] O2=1 5 6|7 8 9 2|4 3
[0032] Further, in step 2, specifically:
[0033] Step 2.1, the population preprocessed in step 1 is arranged according to its fitness value, and two individual generation strategies are adopted in combination with the key edge set and the greedy strategy. At the same time, the population is still crossover-operated, and individuals generate multiple offspring;
[0034] Step 2.2, merge the offspring, remove redundant individuals to avoid wasting computing resources, and calculate the fitness value of the offspring;
[0035] Step 2.3, merge the parent and child generations for environmental selection, and use the environmental selection mechanism to delete and retain the multimodal solutions;
[0036] Step 2.4, Step 2 loop uses two stop conditions:
[0037] (1) If the optimal value of the entire population is not updated after several iterations, the loop of step 2 will end;
[0038] (2) The maximum number of evaluations in step 2 is reached.
[0039] Furthermore, in step 2.1, the overview of the key edges and key edge sets is specifically:
[0040] Key edge: In different path schemes of better individuals in the population (including multimodal solutions), the connection order of some cities is the same, that is, the same gene fragments exist in the individuals;
[0041] Key edge set: Multiple different key edges can be identified in all multimodal solutions with different target values or in multimodal solutions with the same target value. The set of all key edges is called a key edge set. If the key edge set can be successfully identified, the search space can be appropriately reduced, achieving a certain degree of dimensionality reduction.
[0042] Further, in step 2.1, the two individual generation strategies include the following steps:
[0043] Step 2.1.1, sort the entire population according to the fitness value, identify the key edge sets in all the top 4 individuals (including multimodal solutions) and mark the number of occurrences of the key edges. The more times the key edges appear, the more important they are.
[0044] Step 2.1.2, the first individual generation strategy: the critical edge dimension is fixed to one-fourth of the total city dimension. After identifying and marking the number of critical edges according to step 2.1.1, individuals are generated based on the importance of the number. Each occurrence of a critical edge generates an individual. One-fourth of an individual is the critical edge dimension. The identification of critical edges is meaningful only when there are at least three edges. Three edges require four city vertices to be determined. Therefore, if the critical edge dimension is calculated to be less than 4, the critical edge dimension is set to 4, and the rest will be randomly inserted into the remaining sites, and it is ensured that the individual gene chromosome sites are not repeated, that is, the individual is a valid solution;
[0045] Step 2.1.3, the core of the second individual generation strategy lies in the combination of greedy strategy and number of times. In step 2, the initial key edge dimension is one-fifth of the total city dimension, and the key edge dimension is updated as the iteration proceeds. The specific operation is to increase the key edge dimension by 2 every 50 generations until the key edge dimension is two-thirds of the total city dimension and stop updating.
[0046] After identifying and marking the number of key edges according to step 2.1.1, for the two key edges without repeated genes, two individuals are generated by combining them. The specific steps are as follows:
[0047] (1) The first individual: put the key edge 1 at the front, randomly generate a site at the position where there is no gene site and put it into another key edge 2, and the remaining sites will be supplemented according to the greedy strategy;
[0048] (2) The second individual: reverse the two key edges, put the reversed key edge 2 at the front, randomly generate a site to put the reversed key edge 2, and fill the remaining site according to the greedy strategy;
[0049] For the remaining identified key edges that cannot be combined, two individuals are still generated. The specific steps are:
[0050] (1) The first individual: put the key edge at the front, and the empty sites will be filled according to the greedy strategy;
[0051] (2) The second individual: reverse the key edge and put it at the front, and fill the remaining positions according to the greedy strategy;
[0052] Step 2.1.4, the above two individual generation strategies are aimed at the top 4 individuals in the entire population, so they have a stronger convergence speed, and crossover operations are still required for the entire population.
[0053] Further, in step 2.2, the redundant individuals are:
[0054] In the above step 2.1, the two individual generation strategies and the crossover operation generate three parts of offspring. The two individual generation strategies do not control the number of offspring generated. Therefore, after the offspring are merged, duplicate individuals, loop individuals, and reverse individuals may appear. They are defined as redundant individuals and deduplication operations are performed before calculating the fitness value to avoid waste of resources.
[0055] Among them, the loop individual, that is, in the TSP problem, the calculation of the target value is a loop distance calculation. For example, individuals 1-2-3-4-5-6 and 5-6-1-2-3-4 are the same individual in actual situations; reverse order individuals, such as individuals 1-2-3-4-5-6 and 6-5-4-3-2-1, are still the same individual without considering the order. However, in actual situations, if the customer has requirements for the order of cities, it can also be used as a multimodal solution. In this paper, it is removed as a redundant individual.
[0056] Further, in step 2.3, the environment selection includes the following steps:
[0057] Step 2.3.1, sort the entire population according to the fitness value. Since the population size is not controlled, 1.4*NP individuals are first reserved for environmental selection;
[0058] Step 2.3.2, the individuals under the same target value, i.e., multimodal de-clustering, directly retain all individuals with a ranking of 1, and the remaining individuals will be allocated according to the population size NP;
[0059] Step 2.3.3: Individuals with 1 or 2 multimodal solutions under the same target value are directly retained. Individuals with more than 2 multimodal solutions will be retained according to the following formula:
[0060]
[0061] Among them, CN is the current number of clusters and NP is the population size.
[0062] In step 2.3.4, based on the number of retained solutions calculated above, the multimodal solutions are retained and deleted according to the similarity of the individuals, and the one with the worst similarity is retained, and the rest with good similarity are retained.
[0063] To measure the similarity between solutions, we use the number of common edges N1 between solutions and the number of vertices visited in the same order N2. For two solutions x1 = (x 11 ,x 12 ,…,x 1n ,x 11 ) and x2=(x 21 ,x 22 ,…,x 2n ,x 21 ), N1 and N2 are calculated by the following formula:
[0064] N1=|Φ(x1)∩Φ(x2)|
[0065] Among them, Φ(x1) and Φ(x2) are the edges of the solutions x1 and x2 respectively;
[0066]
[0067] Among them, if x 1i =x 2i , then k i =1, otherwise k i =0;
[0068] The similarity of individuals can be understood as the distance between solutions in the decision space. The similarity between solutions is calculated by the following formula:
[0069]
[0070] Among them, the value of S(x1,x2) is between 0 and 1. The larger the values of N1 and N2, the smaller the value of S(x1,x2), which means that the two solutions are more similar. When S(x1,x2) = 0, the solutions are the same.
[0071] Further, in step 2.4, the maximum number of evaluations and the number of stagnation generations for the stopping condition are specifically set as:
[0072] For problems MSTSP1-MSTSP12, the maximum number of evaluations is set to 60000, the maximum number of evaluations for step 1 is set to 3000, and the maximum number of evaluations for step 2 is set to 20000. Since step 3 generates a maximum of 1500 offspring in one cycle, the stopping condition for step 3 is set to 58000;
[0073] For problems MSTSP13-MSTSP25, the maximum number of evaluations is set to 1200000, and the maximum number of evaluations for step 1 is set to 15000. The minimum dimension of problems MSTSP13-MSTSP25 is 22, and the maximum dimension is 66. The difficulty of low-dimensional problems lies in their diversity, and the difficulty of high-dimensional problems lies in their convergence and diversity. In order to make rational use of computing resources, when the city dimension is greater than 22 and less than 45, the maximum number of evaluations for step 2 is set to 200000, and the number of stagnation generations is set to 80; when the city dimension is greater than or equal to 45 and less than 60, the maximum number of evaluations for step 2 is set to 300000, and the number of stagnation generations is set to 100; when the city dimension is greater than or equal to 60, the maximum number of evaluations for step 2 is set to 400000, and the number of stagnation generations is set to 150. Since step 3 generates a maximum of 1500 offspring in one cycle, the stopping condition for step 3 is set to 1198000.
[0074] For the setting of stop conditions, users can set them according to actual conditions and computing resources.
[0075] Further, in step 3, specifically:
[0076] Step 3.1, create an archive, and save all individuals after the environment selection in step 2 above into the archive;
[0077] Step 3.2, select the best individual in the archive, and adaptively generate clusters using the target space distance of the best individual;
[0078] Step 3.3, according to the number of clusters in the above step, the inter-class multimodal solution is fully arranged, and the invalid arrangements of inter-cluster loops and reverse order are removed to obtain all possible valid arrangements;
[0079] Step 3.4, use the average value to find the cluster center, and find the loop distance between cluster centers based on the above effective arrangement, and arrange the order between classes according to the importance. To ensure the effectiveness of each arrangement cycle and the computing resources of important order within a certain computing resource, a maximum of three arrangements will be retained, and users can change them according to actual conditions and computing resources;
[0080] Step 3.5, generate individuals based on archives and inter-class multimodal arrangements, and enter a loop iterative optimization process;
[0081] Step 3.6, in problems MSTSP1-MSTSP12, step 3 evolution identifies the key edge set from the top 3 individuals in the population. In problems MSTSP13-MSTSP25, step 3 evolution identifies the key edge set from the top 8 individuals in the population in the early stage, and identifies the key edge set from the top 3 individuals in the late stage. The identification operation of the key edge is the same as step 2 above, and the key edge dimension is a random integer;
[0082] Step 3.7: In the later stage of evolution, the entire population tends to be stable, so the similarity between individuals is extremely high, and the similarity of the identified key edge sets is also extremely high. Redundant key edges are removed before using them;
[0083] Step 3.8: With iterative evolution, the population converges to a higher degree, and an individual may have multiple key edges, resulting in a huge number of offspring individuals. Therefore, an upper limit of the generated individuals is set, and the search resources for each individual are allocated proportionally. Then, a local search strategy based on a jump operator is performed on the individuals with identified key edges, and redundant individuals are removed and the environment is selected for the generated individuals;
[0084] Step 3.9, perform a crossover operation and two local mutation operations that do not protect the key edge set on the individuals obtained above, merge the parent and child individuals to remove duplicates and perform environmental selection, and save them into the archive;
[0085] In step 3.10, the populations obtained from each inter-species arrangement are placed in an archive, and environmental selection is performed on all individuals in the archive and output.
[0086] For problems MSTSP1-MSTSP12, the highest dimension is 15, and the above steps 3.2 to 3.5 will not be performed in this low-dimensional problem.
[0087] Further, in step 3.2, the specific steps of adaptively generating clusters based on target space distance are as follows:
[0088] Step 3.2.1, select the best individual in the archive, calculate the distance between each city to form a 1-row n-column matrix, and calculate the individual target value, and use the following formula to calculate the average distance between cities:
[0089] mean=sum / n
[0090] Among them, sum is the individual target value, and n is the city dimension;
[0091] Step 3.2.2, identify the number of elements greater than the mean from the 1-row and n-column matrix elements, which is the number of clusters. The clusters can be obtained by matching individuals with the matrix.
[0092] Furthermore, in step 3.5, the specific steps of generating individuals based on archive and inter-class multimodal arrangement are as follows:
[0093] Step 3.5.1, cluster the individuals in the archive segment by segment according to the above clustering method, and mark each cluster in order;
[0094] Step 3.5.2: Follow all the permutations in step 3.4 and cycle through the local search. There are three ways to generate individuals based on archives and inter-class multimodal permutations:
[0095] (1) The individuals are organized in order;
[0096] (2) First, put the gene fragments of the first cluster in, and calculate the distances between the last gene of the first gene fragment and the first and last genes of the second cluster. If the distance to the first gene of the second cluster is shorter, put it directly into the second cluster. Otherwise, if the distance to the last gene of the second cluster is shorter, reverse the gene fragment of the second cluster and then fill it into the individual. The gene fragments of the remaining clusters are put in sequentially in the same way.
[0097] (3) Using the loop principle, the gene fragment of the first cluster is placed at the end of the blank individual, and the distance between the first site of the effective fragment of the filled individual and the first and last sites of the gene fragment of the last cluster are calculated respectively, and the shortest segment is connected in the above manner.
[0098] According to the above method, one individual in the archive will generate 3 offspring, which will be merged and deduplicated before environmental selection.
[0099] Furthermore, in step 3.6, the specific settings for randomly selecting the key edge dimensions are as follows:
[0100] (1) For problems MSTSP1-MSTSP12, the identification of key edges is meaningful only when there are at least three edges. Three edges require four city vertices to be determined. Therefore, the minimum range of key edge dimensions is 4. The random selection range of key edge dimensions is:
[0101] CES len ∈(4,n-5)
[0102] Where n is the city dimension.
[0103] (2) For problems MSTSP13-MSTSP25, the lowest dimension is 28 and the highest dimension is 66. For problems with a city dimension greater than 45, the initial critical edge dimension will be set to one-third of the problem size, and for the remaining problems it will be set to one-quarter. The lower limit of the random selection range of the critical edge dimension will increase linearly with iterative evolution, that is, it will increase by 4 every 80 generations, and the upper limit will be set to n-5.
[0104] Furthermore, in step 3.8, the local search strategy based on the jump operator is:
[0105] For each individual, the key edge set is identified and the number of times the key edges appear is marked. The local search of the individual will protect the gene fragment where the key edge is located, that is, this part of the gene fragment will be directly inherited to the offspring. The adjacent gene fragment is randomly selected, and the gene sites on the fragment are randomly mutated and replaced. Since the individual has become stable at this time, the dimensions of the gene fragment randomly mutated cannot be too many, and the remaining sites are also directly inherited to the offspring.
[0106] The above-mentioned random selection of gene fragments for chromosome mutation will be performed multiple times according to the number of times the marked key edges appear. An individual may have multiple key edges, resulting in a huge number of offspring individuals. Therefore, an upper limit on the number of individuals generated is set, and the search resources for each individual are allocated proportionally.
[0107] Furthermore, in step 3.9, with the iterative evolution, the population converges to a high degree, and individuals based on the key edge set may fall into the local optimum. In order to jump out of the local optimum, two local mutation operations are performed on the individuals without protecting the key edge set:
[0108] (1) Local mutation operation: The local mutation operation uses the same principle as step 3.8, except that the local mutation here no longer protects the key edge. That is, when the adjacent gene fragments containing the key edge are randomly selected, they are still mutated and replaced, and the remaining gene fragments are directly inherited to the offspring;
[0109] (2) Local reversal mutation operation: Still without protecting the critical edges, two chromosomes are randomly selected on the individual and the fragment between the two chromosomes is reversed.
[0110] For the above two changes, the dimension of randomly selected gene fragments is set within 10, and changes in too large a range are meaningless.
[0111] The present invention uses two indicators when calculating the indicators. The specific information of the evaluation indicators is as follows:
[0112]
[0113] Among them, F βIt reflects the quality of the solution, that is, the convergence P reflects the accuracy, where TP is the number of optimal solutions among the solutions obtained by the algorithm, FP is the number of non-optimal solutions among the solutions obtained by the algorithm, and FN is the number of optimal solutions missed by the algorithm.
[0114] The beneficial effects of the present invention are:
[0115] 1. The present invention proposes an optimization method for the multimodal traveling salesman problem from the three stages of "preprocessing-global convergence-local optimization"; in the global convergence stage, it is believed that the more times the key edges appear, the more important they are. Based on this, two individual generation strategies are provided to reduce the search space of the entire population, so that the entire population can converge quickly; at the same time, the concept of redundant individuals is proposed to avoid unnecessary waste of resources in the search process. Finally, a new environment selection strategy is provided for the retention and deletion of multimodal solutions. In order to jump out of the local optimum, some non-elite individuals are retained, and diversity is enhanced to a certain extent without losing convergence.
[0116] 2. The present invention utilizes the best individuals obtained in the above-mentioned global convergence stage to perform adaptive generation of clustering operations based on target space distances, obtains the number of clusters by individual clustering, arranges the number of clusters, obtains the loop distance of the cluster center, and arranges the order between classes according to their importance. In order to ensure important multimodal solutions for inter-class arrangements within effective resources, the most promising inter-class arrangements are retained. At the same time, an individual generation strategy based on archives and inter-class multimodal arrangements is adopted to reorganize the inter-class arrangements of individuals in the archives.
[0117] 3. The present invention performs local optimization on the entire population based on the above-mentioned individual generation. In this stage, more multimodal solutions can be found; the key edges of the best individual in the entire population are identified and the number of times is marked. It is still believed that the more times the key edges appear, the more important they are. Subsequently, redundant key edges are removed, and a local search strategy based on a jump operator is proposed. This strategy searches for multimodal solutions on a large scale on the basis of protecting key edges to generate a large number of offspring. The offspring are deduplicated and cross-mutated after environmental selection. In order to prevent the population from entering the local optimum, two local mutation operations that do not protect key edges are used.
[0118] 4. Due to the complexity of high-dimensional problems, the present invention can provide more multimodal solutions compared to other algorithms, providing decision makers with more flexible options. BRIEF DESCRIPTION OF THE DRAWINGS
[0119] Figure 1 This is the overall flow chart of the algorithm;
[0120] Figure 2 It is a schematic diagram of cross operation;
[0121] Figure 3Schematic diagram for identifying key edges;
[0122] Figure 4a Generate schematic diagrams for individuals based on the number of critical edges;
[0123] Figure 4b Generate schematic diagrams for agents based on greedy strategies;
[0124] Figure 5 To adaptively generate clustering diagrams based on target spatial distance;
[0125] Figure 6 Schematic diagram of strategies for individual generation based on archive and inter-class multimodal alignment;
[0126] Figure 7 Schematic diagram of the local search strategy based on the jump operator;
[0127] Figure 8a Schematic diagram of local mutation strategy;
[0128] Figure 8b Schematic diagram of the local reversal mutation strategy;
[0129] Fig. 9 For MSTSP1-MSTSP12 problems F β The average value change diagram of
[0130] Fig.10 For MSTSP13-MSTSP25 Problem F β The average value change graph. DETAILED DESCRIPTION
[0131] The present invention will be further described below in conjunction with the accompanying drawings and examples.
[0132] The following is the multi-solution traveling salesman (MSTSP) benchmark test set used in the present invention, which includes 25 test problems. According to the design method, MSTSPs are divided into three categories: simple MSTSPs, geometric MSTSPs and composite MSTSPs. The specific information of the test problems is shown in Table 1 Benchmark test set.
[0133] Table 1 Benchmark test sets
[0134]
[0135]
[0136] Due to the different scales of problems, the total number of evaluations set is different. Table 2 shows the total number of evaluations for the 25 test problems.
[0137] Table 2 Total evaluation times
[0138]
[0139] Based on the above problem example, we will select instance geometry1_10 for detailed explanation, and use instance composite3_22 to explain the operations from step 3.2 to step 3.5.
[0140] The present invention is an optimization method for a multimodal traveling salesman problem, comprising the following steps:
[0141] Step 1: Perform preliminary optimization on the solution to prepare for step 2 to obtain the key edge set; the specific steps are:
[0142] Step 1.1, initialize the population according to the problem scale, the population size is NP, and calculate the fitness value of the individuals in the population;
[0143] Step 1.2, perform a crossover operation on the initial population to generate offspring and calculate the fitness value;
[0144] The crossover operation consists of the following steps:
[0145] Step 1.2.1, initialize the population according to the problem scale,
[0146] Step 1.2.2, randomly select two parents:
[0147] P1=3 5 6 7 8 9 2 1 4
[0148] P2=4 7 3 1 2 5 6 8 9
[0149] Step 1.2.3, randomly generate two intersection points to divide the individual into three segments, and leave the middle part in the offspring:
[0150] P1=3 5 6|7 8 9 2|1 4
[0151] P2=4 7 3|1 2 5 6|8 9
[0152] O1=***|1 2 5 6|**
[0153] O2=***|7 8 9 2|**
[0154] Step 1.2.4, leave the middle part of the intersection and place it in the third segment:
[0155] P1=1 4|3 5 6|7 8 9 2
[0156] P2=8 9|4 7 3|1 2 5 6
[0157] Step 1.2.5, delete the middle part of parent 1 from parent 2 to get 4-3-1-5-6, delete the middle part of parent 2 from parent 1 to get 4-3-7-8-9, and add them to get the offspring:
[0158] O1=7 8 9|1 2 5 6|4 3
[0159] O2=1 5 6|7 8 9 2|4 3
[0160] Step 1.3, merge the parent generation and the offspring generation for environmental selection;
[0161] Step 1.4, loop iterates until the stopping condition is reached.
[0162] like Figure 1 As shown in Figure 1, an initial population of NPs is randomly generated in the search space, and the population is initialized by evaluating the fitness value and then enters the first stage for preprocessing. Since the total number of evaluations is different for different problem scales, the maximum number of evaluations set in step 1 is also different. Table 3 shows the maximum number of evaluations set in step 1.
[0163] Table 3 The highest number of evaluations in step 1
[0164]
[0165] Initialize the population according to the instance geometry1_10. The population size of the present invention is set to 150. After calculating the fitness value, enter step 1. The preprocessing operation of step 1 is mainly to prepare for the next stage to accurately identify and mark key edges. Among them, the crossover operation is as follows Figure 2 As shown, for problem geometry1_10, the total number of evaluations is 60,000, the stopping condition of step 1 will be set to 3,000, and the newly generated offspring will be merged with the parent generation to remove duplicates and then enter step 2 after environment selection.
[0166] Step 2: Based on the key edge set obtained in step 1, two individual generation strategies are used to quickly converge the solution globally, and the environment selection strategy is used to delete or retain the multimodal solution. The specific steps include:
[0167] Step 2.1: The population preprocessed in step 1 is arranged according to its fitness value, and two individual generation strategies are adopted in combination with the key edge set and the greedy strategy. At the same time, the population still performs crossover operations, and individuals generate multiple offspring; the key edge is that in different path schemes of the better individuals in the population (including multimodal solutions), the connection order of a certain part of the cities is the same, that is, the same gene fragment exists in the individual. Multiple different key edges can be identified in all multimodal solutions with different target values or multimodal solutions under the same target value. The set of all key edges is called the key edge set. If these gene fragments can be successfully identified, the search space can be appropriately reduced, and a certain degree of dimensionality reduction can be achieved.
[0168] Step 2.1 The specific steps are:
[0169] Step 2.1.1, sort the entire population according to the fitness value, identify the key edge sets in all the top 4 individuals (including multimodal solutions) and mark the number of occurrences of the key edges. The more times the key edges appear, the more important they are.
[0170] Step 2.1.2, the first individual generation strategy: the critical edge dimension is fixed to one-fourth of the total city dimension. After identifying and marking the number of critical edges according to step 2.1.1, individuals are generated based on the importance of the number. Each occurrence of a critical edge generates an individual. One-fourth of an individual is the critical edge dimension. The identification of critical edges is meaningful only when there are at least three edges. Three edges require four city vertices to be determined. Therefore, if the critical edge dimension is calculated to be less than 4, the critical edge dimension is set to 4, and the rest will be randomly inserted into the remaining sites, and it is ensured that the individual gene chromosome sites are not repeated, that is, the individual is a valid solution;
[0171] Step 2.1.3, the core of the second individual generation strategy lies in the combination of greedy strategy and number of times. In step 2, the initial key edge dimension is one-fifth of the total city dimension, and the key edge dimension is updated as the iteration proceeds. The specific operation is to increase the key edge dimension by 2 every 50 generations until the key edge dimension is two-thirds of the total city dimension and stop updating.
[0172] After identifying and marking the number of key edges according to step 2.1.1, for the two key edges without repeated genes, two individuals are generated by combining them. The specific steps are as follows:
[0173] (1) The first individual: put the key edge 1 at the front, randomly generate a site at the position where there is no gene site and put it into another key edge 2, and the remaining sites will be supplemented according to the greedy strategy;
[0174] (2) The second individual: reverse the two key edges, put the reversed key edge 2 at the front, randomly generate a site to put the reversed key edge 2, and fill the remaining site according to the greedy strategy;
[0175] For the remaining identified key edges that cannot be combined, two individuals are still generated. The specific steps are:
[0176] (1) The first individual: put the key edge at the front, and the empty sites will be filled according to the greedy strategy;
[0177] (2) The second individual: reverse the key edge and put it at the front, and fill the remaining positions according to the greedy strategy;
[0178] Step 2.1.4, the above two individual generation strategies are aimed at the top 4 individuals in the entire population, so they have a stronger convergence speed, and the crossover operation is still required for the entire population;
[0179] Step 2.2, merge the offspring, remove redundant individuals to avoid wasting computing resources, and calculate the fitness value of the offspring; in the above step 2.1, the two individual generation strategies and crossover operation generate three parts of offspring, and the two individual generation strategies do not control the number of offspring generated. Therefore, after the offspring are merged, duplicate individuals, loop individuals, and reverse individuals may appear, which are defined as redundant individuals. Deduplication operations are performed before calculating the fitness value to avoid wasting resources. Among them, the loop individual means that in the TSP solution problem, the calculation of the target value is a loop distance calculation, such as individual 1-2-3-4-5-6 and individual 5-6-1-2-3-4, which are the same individual in actual situations; reverse individuals, such as individual 1-2-3-4-5-6 and individual 6-5-4-3-2-1, are still the same individual without considering the order, but in actual situations, if customers have requirements for the order of cities, it can also be used as a multimodal solution. In this paper, it is removed as a redundant individual.
[0180] Step 2.3: merge the parent and child generations for environment selection, and use a new environment selection mechanism to delete and retain the multimodal solution; the specific steps are:
[0181] Step 2.3.1, sort the entire population according to the fitness value. Since the population size is not controlled, 1.4*NP individuals are first reserved for environmental selection;
[0182] Step 2.3.2, the individuals under the same target value, i.e., multimodal de-clustering, directly retain all individuals with a ranking of 1, and the remaining individuals will be allocated according to the population size NP;
[0183] Step 2.3.3: Individuals with 1 or 2 multimodal solutions under the same target value are directly retained. Individuals with more than 2 multimodal solutions will be retained according to the following formula:
[0184]
[0185] Among them, CN is the current number of clusters and NP is the population size.
[0186] In step 2.3.4, based on the number of retained solutions calculated above, the multimodal solutions are retained and deleted according to the similarity of the individuals, and the one with the worst similarity is retained, and the rest with good similarity are retained.
[0187] To measure the similarity between solutions, we use the number of common edges N1 between solutions and the number of vertices visited in the same order N2. For two solutions x1 = (x 11 ,x 12 ,…,x 1m ,x 11 ) and x2=(x 21 ,x 22 ,…,x 2n ,x 21 ), N1 and N2 are calculated by the following formula:
[0188] N1=|Φ(x1)∩Φ(x2)|
[0189] Among them, Φ(x1) and Φ(x2) are the edges of the solutions x1 and x2 respectively;
[0190]
[0191] Among them, if x 1i =x 2i , then k i =1, otherwise k i =0;
[0192] The similarity of individuals can be understood as the distance between solutions in the decision space. The similarity between solutions is calculated by the following formula:
[0193]
[0194] Among them, the value of S(x1,x2) is between 0 and 1. The larger the values of N1 and N2, the smaller the value of S(x1,x2), which means that the two solutions are more similar. When S(x1,x2) = 0, the solutions are the same.
[0195] Step 2.4, Step 2 loop uses two stop conditions:
[0196] (1) If the optimal value of the entire population is not updated after several iterations, the loop of step 2 will end;
[0197] (2) The maximum number of evaluations in step 2 is reached.
[0198] The maximum number of evaluations and the number of stagnation generations for the stopping condition are specifically set as:
[0199] For problems MSTSP1-MSTSP12, the maximum number of evaluations is set to 60000, the maximum number of evaluations for step 1 is set to 3000, and the maximum number of evaluations for step 2 is set to 20000. Since step 3 generates a maximum of 1500 offspring in one cycle, the stopping condition for step 3 is set to 58000;
[0200] For problems MSTSP13-MSTSP25, the maximum number of evaluations is set to 1200000, and the maximum number of evaluations for step 1 is set to 15000. The minimum dimension of problems MSTSP13-MSTSP25 is 22, and the maximum dimension is 66. The difficulty of low-dimensional problems lies in their diversity, and the difficulty of high-dimensional problems lies in their convergence and diversity. In order to make rational use of computing resources, when the city dimension is greater than 22 and less than 45, the maximum number of evaluations for step 2 is set to 200000, and the number of stagnation generations is set to 80; when the city dimension is greater than or equal to 45 and less than 60, the maximum number of evaluations for step 2 is set to 300000, and the number of stagnation generations is set to 100; when the city dimension is greater than or equal to 60, the maximum number of evaluations for step 2 is set to 400000, and the number of stagnation generations is set to 150. Since step 3 generates a maximum of 1500 offspring in one cycle, the stopping condition for step 3 is set to 1198000.
[0201] For the setting of stop conditions, users can set them according to actual conditions and computing resources.
[0202] Step 2 only identifies the key edge sets for the top 4 individuals. Since it contains multimodal solutions, the top 4 individuals are greater than or equal to 4. Assuming that there are 10 individuals ranked in the top 4, since one quarter of the problem size is less than 4, the key edge dimension is set to 4. Identify the key edges that appear in each individual (marked by different colors) as follows Figure 3 As shown. For the first strategy based on the number of critical edges, Figure 4a , for each occurrence of a key edge, an individual is generated based on the key edge, and the remaining blank chromosome sites are randomly inserted while ensuring the validity of the solution, that is, ensuring that each sorting only appears once to form a Hamiltonian circuit. The core of the second individual generation strategy lies in the combination of the greedy strategy and the number of times. Figure 4b In step 2, the initial key edge dimension is one-fifth of the total city dimension. As above, due to the low dimension of the instance problem, the key edge dimension is set to 4. The key edge dimension is updated as the iteration proceeds. The specific operation is to increase the key edge dimension by 2 every 50 generations until the key edge dimension is two-thirds of the total city dimension and then stop updating the key edge dimension. The two individual generation strategies promote each other to speed up the individual search.
[0203] The entire population will be cross-operated at each iteration, so step 2 will generate three parts of offspring. Since the above two individual generation strategies only target the optimality of the entire population and do not control the number of individual generation, it is very easy to cause the entire population to fall into a local optimum. Therefore, two methods are used in step 2 to avoid falling into a local optimum:
[0204] (1) Repeat step 2 to generate individual strategies and operate them independently twice to perform global search;
[0205] (2) Once the optimal value has not been updated after gen iterations, the loop of step 2 will end.
[0206] Due to the different problem scales, the settings of gen are different, and the maximum number of evaluations in step 2 is also different. For different problems, users can change the settings according to actual conditions. The present invention is set according to the total number of evaluations as shown in Table 4:
[0207] Table 4 The highest number of evaluations in step 2
[0208]
[0209] After merging the above three parts of offspring and removing redundant individuals, the fitness value is calculated, the parent generation and offspring are merged for environmental selection, and an empty archive is created to store all the individuals after the environmental selection. The present invention uses a new environmental selection mechanism to delete and retain multimodal solutions. The pseudo code of the environmental selection mechanism is introduced below:
[0210]
[0211]
[0212] Step 3: Adaptively generate clusters based on the target space distance, and arrange the inter-class multimodal solutions according to the number of clusters; generate individuals based on the archive and inter-class multimodal arrangement, and perform local optimization on individuals based on the local search strategy of the jump operator; the specific steps are:
[0213] Step 3.1, create an archive and save all individuals after the environment selection in step 2 into the archive;
[0214] Clustering is not required for the 10-dimensional low-dimensional problem type, so steps 3.2 to 3.5 in Step 3 will be specifically described using the 22-dimensional problem composite3_22.
[0215] Step 3.2, select the best individual in the archive, and use the target space distance of the best individual to adaptively generate clusters; the specific steps are as follows:
[0216] Step 3.2.1, select the best individual in the archive, calculate the distance between each city to form a 1-row n-column matrix, and calculate the individual target value, and use the following formula to calculate the average distance between cities:
[0217] mean=sum / n
[0218] Among them, sum is the individual target value, and n is the city dimension;
[0219] Step 3.2.2, identify the number of elements greater than the mean from the 1-row and n-column matrix elements, which is the number of clusters. The clusters can be obtained by matching individuals with the matrix.
[0220] Step 3.3, according to the number of clusters in the above step, the inter-class multimodal solution is fully arranged, and the invalid arrangements of inter-cluster loops and reverse order are removed to obtain all possible valid arrangements;
[0221] Identify the number of best individuals greater than mean, that is, the number of clusters, and perform segmented clustering according to the individuals corresponding to the identified sites. This not only accurately determines the clusters, but also simply sorts the gene fragments in the clusters, which reduces the search resources in the later stage of evolution to a certain extent. The above operations are as follows Figure 5 As shown. Based on the above clustering, the number of clusters is determined. The number of clusters in problem composite3_22 is 4. Changing the clusters and the order of clusters may also lead to multimodal solutions. Therefore, the multimodal solutions of the classes and inter-class arrangements are arranged according to the number of clusters. When the number of clusters is 4, there are 24 possible full arrangement results. In the characteristics of the TSP problem, repeated solutions such as loops and reverse order are included. There are also repeated arrangements between classes. After removing the repeated arrangements, there are three arrangements left.
[0222] Step 3.4, use the average value to find the cluster center, and find the loop distance between cluster centers based on the above effective arrangement, and arrange the order between classes according to the importance. To ensure the effectiveness of each arrangement cycle and the computing resources of important order within a certain computing resource, a maximum of three arrangements will be retained, and users can change them according to actual conditions and computing resources;
[0223] All individuals in the archive are clustered in the above manner. After each clustering is completed, there will be three strategies for generating individuals based on the archive and inter-class multimodal arrangement. Step 3.5 generates individuals based on the archive and inter-class multimodal arrangement, and enters the loop iterative optimization. The specific steps are as follows: Figure 6 As shown:
[0224] Step 3.5.1, cluster the individuals in the archive segment by segment according to the above clustering method, and mark each cluster in order;
[0225] Step 3.5.2: Follow all the permutations in step 3.4 and cycle through the local search. There are three ways to generate individuals based on archives and inter-class multimodal permutations:
[0226] (1) The individuals are organized in order;
[0227] (2) First put the gene fragment of the first cluster in, and calculate the distance between the last gene of the first gene fragment and the first and last gene of the second cluster respectively. If the distance to the first gene of the second cluster is shorter, put it directly into the second cluster. Otherwise, if the distance to the last gene of the second cluster is shorter, reverse the entire gene fragment of the second cluster and then fill it into the individual. The gene fragments of the remaining clusters are put in in sequence in the same way. Since this arrangement operation cannot take into account the order problem between the last cluster and the first cluster, a third individual generation method is provided.
[0228] (3) Using the loop principle, the gene fragment of the first cluster is placed at the end of the blank individual, and the distance between the first site of the effective fragment of the filled individual and the first and last sites of the gene fragment of the last cluster are calculated respectively, and the shortest segment is connected in the above manner.
[0229] According to the above method, one individual in the archive will generate 3 offspring, which will be merged and deduplicated before environmental selection.
[0230] The offspring after environmental selection are searched locally. In the early stage of evolution in step 3, the key edges of all the top 4 individuals in the entire population are identified. The key edges can be repeatedly identified on an individual, so an individual can identify multiple key edges. Since the entire population is in the local search of step 3, the key edges searched are highly similar, so the key edges with high similarity are stored together and their occurrence times are calculated. One of the key edges is selected as a representative and the total number is given. In order to protect the key edges in the individual, a local search strategy based on the jump operator is designed. Figure 7 As shown. For the key edge (blue) identified by individual P, the offspring will be guaranteed to inherit the key edge in the local search. "1" in off_1 is selected for retention and "0" is mutation. The chromosomes corresponding to the key edge will all be retained, and the remaining chromosomes (green) will randomly generate "1" or "0", but the chromosomes generating "0" are guaranteed to be adjacent and the length of the generated fragment cannot be too long. Here, off_1 is generated multiple times according to the number of occurrences of the key edge mark. The generated off_1 corresponds to individual P to obtain off_2, and the chromosome fragment off_3 corresponding to "0" is proposed. The chromosome order is randomly disrupted according to the length of off_3, and off_3 is reordered and put into off_2 to obtain the offspring off.
[0231] Since off_1 is generated multiple times according to the number of occurrences of the key edge marker, and the individual will not only recognize this one key edge, an individual can generate multiple offspring. The upper limit of individual generation is set, and the search resources are allocated to each individual in proportion. The individuals generated in this part are selected by the environment.
[0232] Step 3.6, in problems MSTSP1-MSTSP12, step 3 evolution identifies the key edge set from the top 3 individuals in the population. In problems MSTSP13-MSTSP25, step 3 evolution identifies the key edge set from the top 8 individuals in the population in the early stage, and identifies the key edge set from the top 3 individuals in the late stage. The identification operation of the key edge is the same as step 2 above, and the key edge dimension is a random integer;
[0233] The specific settings for randomly selecting key edge dimensions are as follows:
[0234] (1) For problems MSTSP1-MSTSP12, the identification of key edges is meaningful only when there are at least three edges. Three edges require four city vertices to be determined. Therefore, the minimum range of key edge dimensions is 4. The random selection range of key edge dimensions is:
[0235] CES len ∈(4,n-5)
[0236] Where n is the city dimension.
[0237] (2) For problems MSTSP13-MSTSP25, the lowest dimension is 28 and the highest dimension is 66. For problems with a city dimension greater than 45, the initial critical edge dimension will be set to one-third of the problem size, and for the remaining problems it will be set to one-quarter. The lower limit of the random selection range of the critical edge dimension will increase linearly with iterative evolution, that is, it will increase by 4 every 80 generations, and the upper limit will be set to n-5.
[0238] Step 3.7: In the later stage of evolution, the entire population tends to be stable, so the similarity between individuals is extremely high, and the similarity of the identified key edge sets is also extremely high. Redundant key edges are removed before using them;
[0239] Step 3.8: With iterative evolution, the population converges to a higher degree, and an individual may have multiple key edges, resulting in a huge number of offspring individuals. Therefore, an upper limit of the generated individuals is set, and the search resources for each individual are allocated proportionally. Then, a local search strategy based on a jump operator is performed on the individuals with identified key edges, and redundant individuals are removed and the environment is selected for the generated individuals;
[0240] The local search strategy based on the jump operator is to identify the key edges for each individual and mark the number of times the key edges appear. The local search of the individual will protect the gene fragment where the key edges are located, that is, this part of the gene fragment will be directly inherited to the offspring, randomly select adjacent gene fragments, and randomly mutate the gene sites on the fragment. Since the individual has become stable at this time, the dimensions of the gene fragments randomly mutated cannot be too many, and the remaining sites are also directly inherited to the offspring.
[0241] The above-mentioned random selection of gene fragments for chromosome mutation will be performed multiple times according to the number of times the marked key edges appear. An individual may have multiple key edges, resulting in a huge number of offspring individuals. Therefore, an upper limit on the number of individuals generated is set, and the search resources for each individual are allocated proportionally.
[0242] Step 3.9, perform crossover operation and two local mutation operations without protecting the key edge set on the individuals obtained above, merge the parent and child individuals to remove duplicates and perform environmental selection, and save them into the archive; with iterative evolution, the population converges to a high degree, and individuals based on key edges may fall into local optimality. In order to jump out of the local optimality, two local mutation operations are performed on the individuals without protecting the key edges:
[0243] (1) Local mutation operation: The local mutation operation uses the same principle as step 3.8, except that the local mutation here no longer protects the key edge. That is, when the adjacent gene fragments containing the key edge are randomly selected, they are still mutated and replaced, and the remaining gene fragments are directly inherited to the offspring;
[0244] (2) Local reversal mutation operation: Still without protecting the critical edges, two chromosomes are randomly selected on the individual and the fragment between the two chromosomes is reversed.
[0245] For the above two changes, the dimension of randomly selected gene fragments is set within 10, and changes in too large a range are meaningless.
[0246] The core idea of the local mutation strategy is the same as the local search based on the jump operator mentioned above. The difference is that in step mut_1, no key edges are protected. Figure 8a Local reversal mutation strategies such as Figure 8b , randomly select two chromosome sites and reverse the gene fragments therein. It is worth noting that the distance between the two randomly selected chromosome sites cannot be too long, which is set to 5 in the geometry1_10 problem.
[0247] The present invention uses two indicators when calculating the indicators. The specific information of the evaluation indicators is as follows:
[0248]
[0249] Among them, F βIt reflects the quality of the solution, that is, the convergence P reflects the accuracy, where TP is the number of optimal solutions among the solutions obtained by the algorithm, FP is the number of non-optimal solutions among the solutions obtained by the algorithm, and FN is the number of optimal solutions missed by the algorithm.
[0250] In the present invention, when calculating the index, β is set 2 =0.3. Usually, if β 2 = 1, P and R are considered equally important. However, for test instances with a large number of optimal solutions, obtaining the most representative optimal solution is more important than exhaustively finding all optimal solutions. 2 The value of is set to 0.3 to amplify the effect of accuracy on the evaluation of the obtained solution.
[0251] In step 3.10, the populations obtained from each inter-species arrangement are placed in an archive, and environmental selection is performed on all individuals in the archive and output.
[0252] For problems MSTSP1-MSTSP12, the highest dimension is 15, and the above steps 3.2 to 3.5 will not be performed in this low-dimensional problem.
[0253] There are two key points in solving the multimodal traveling salesman problem: 1. How to quickly converge to the optimum within limited computing resources and obtain as many multimodal solutions as possible. 2. How to prevent the algorithm from falling into the local optimal area during the algorithm convergence process. In order to solve the multimodal traveling salesman problem, the present invention provides a new optimization method for the multimodal traveling salesman problem, the core of which is divided into three stages: "preprocessing-global convergence-local optimization".
[0254] In response to the first key point of the problem, a theory is proposed that the more times a key edge appears in a good individual, the more important it is. Based on this theory and combined with the greedy strategy, two individual generation strategies are provided in the global convergence stage. The two strategies complement each other to achieve rapid global convergence of the population. In order to obtain more multimodal solutions, the present invention provides a method for adaptively generating clusters based on target space distances, and obtains possible class and inter-class arrangements based on the number of clusters, and then generates individuals based on archives and inter-class multimodal arrangements, thereby increasing the number of multimodal solutions obtained. In the local optimization stage, a local search strategy based on a jump operator is provided to protect the key edges to the greatest extent to achieve problem dimensionality reduction search, thereby increasing the number of multimodal solutions.
[0255] In order to prevent the algorithm from falling into the local optimum, a strategy for selecting environments to delete or retain multimodal solutions is provided to prevent the algorithm from falling into the local optimum. In this strategy, a certain number of non-elite individuals with low similarity are retained. At the same time, two local mutation strategies that do not protect key edges are provided in the local optimization stage to prevent the algorithm from falling into the local optimum area.
[0256] Combined with the above strategies, the present invention can ensure rapid convergence to the optimum within limited computing resources in the multimodal traveling salesman problem, prevent falling into the local optimum, and also obtain as many multimodal solutions as possible.
[0257] Among the 25 test problems, five optimization algorithms were used to solve the problem: the genetic algorithm MTGA for the multimodal traveling salesman problem, the niche-based ant colony system NACS, the neighborhood-based genetic algorithm NGA, the niche memetic algorithm NMA for the multi-solution traveling salesman problem, and the niche regression adaptive memetic algorithm NRAMA for multimodal optimization of the Euclidean traveling salesman problem. The population size of each algorithm was set to 150, and the maximum number of evaluations was set to 60,000 in problems MSTSP1-MSTSP12, and the maximum number of evaluations was set to 1,200,000 in problems MSTSP13-MSTSP25. In order to avoid the randomness of the algorithm results, each algorithm was independently run 50 times on the 25 problems. The quality of the solution was evaluated using the comprehensive evaluation method F. β The two indicators of R and response accuracy are used to evaluate the results obtained by different algorithms for solving this problem.
[0258] Table 5 Index F of different algorithms in 50 experiments β The average
[0259]
[0260]
[0261] Table 6 Average values of index R of different algorithms in 50 experiments
[0262]
[0263]
[0264] Table 5 reflects the convergence of the algorithm, and Table 6 reflects the accuracy of the algorithm. From the data results, we can see that MTGA has better convergence and higher accuracy in 25 problems. In the statistics of 50 experimental results, MTGA's performance in the three problems of MSTSP21-MSTSP23 is slightly worse than NRAMA. Algorithms NACS, NGA, NMA and NRAMA all provide niche technology or neighborhood strategy to find multimodal solutions. For the high-dimensional multimodal traveling salesman problem, its multimodal solutions exist in the different connection orders between certain city clusters and between certain cities. Identifying the correct key edges can achieve dimensionality reduction of the problem. Searching among the remaining edges can improve the multimodal solutions obtained by the algorithm. Algorithm MTGA provides an optimization method of "preprocessing-global convergence-local optimization" according to its characteristics. The performance of the MTGA algorithm can surpass other algorithms when the number of multimodal solutions is large. For example, the number of multimodal solutions for problem MSTSP8 is 110, the number of multimodal solutions for MSTSP12 is 196, the number of multimodal solutions for MSTSP13 is 70, and the number of multimodal solutions for MSTSP15 is 72. However, MTGA will be slightly worse than NRAMA when the number of multimodal solutions is small. For example, the number of multimodal solutions for problem MSTSP21 is 4. According to the indicator R, the NRAMA algorithm is 0.705 on this problem, and an average of 2.82 solutions are found each time, while the MTGA algorithm is 0.481 on this problem, and an average of 1.924 solutions are found each time.
[0265] From the overall analysis, the minimum dimension of simple problems and symmetric problems is 9, and the maximum dimension is 15. However, the algorithms NACS, NGA and NMA obtain the quality index F of the solution in these problems. β Very unstable. NRAMA is also poor in problems MSTSP7, MSTSP8, and MSTSP12. Among these problems, MTGA only misses some solutions in MSTSP12, but F β The value still reaches 0.992, and the F β The average value change line chart is as follows Fig. 9 As shown. Indicator F on complex test problems β As the problem size increases, F β The average value change line chart is as follows Fig.10 As shown, the difficulty of these four algorithms lies in the complexity of the problem, while MTGA does not get worse with the increase of the problem scale, but changes due to the number of multimodal solutions. For problem MSTSP25, although the number of multimodal solutions is also large, its problem scale is large and the convergence is poor.
[0266] In summary, the MTGA algorithm is superior to other algorithms in terms of multimodality and can provide users with more flexible and efficient solutions. Although its performance is poor on some problems, it is still within an acceptable range. Therefore, the MTGA algorithm is superior to other algorithms overall.
Claims
1. Optimization methods for multimodal traveling salesman problems, It is characterized in that The following steps are involved: Step 1: Preliminary optimization of the solution to prepare for step 2 to obtain the key edge set; Step 2: Based on the key edge set obtained in step 1, two individual generation strategies are used to quickly converge the solution globally, and the environment selection strategy is used to delete or retain the multimodal solution; Step 3, adaptively generate clusters based on the target space distance, and arrange the inter-class multimodal solutions according to the number of clusters; generate individuals based on the archive and inter-class multimodal arrangement, and perform local optimization on the individuals based on the local search strategy of the jump operator.
2. The optimization method for the multimodal traveling salesman problem according to claim 1, It is characterized in that Step 1 specifically includes the following steps: Step 1.1, initialize the population according to the problem scale, the population size is NP, and calculate the fitness value of the individuals in the population; Step 1.2, perform a crossover operation on the initial population to generate offspring and calculate the fitness value; Step 1.3, merge the parent generation and the offspring generation for environmental selection; Step 1.4, loop iterates until the stopping condition is reached.
3. The optimization method for the multimodal traveling salesman problem according to claim 2, It is characterized in that In step 1.2, the crossover operation includes the following steps: Step 1.2.1, initialize the population according to the problem scale, Step 1.2.2, randomly select two parents: P 1 =3 5 6 7 8 9 2 1 4 P 2 =4 7 3 1 2 5 6 8 9; Step 1.2.3, randomly generate two intersection points to divide the individual into three segments, and leave the middle part in the offspring: P 1 =3 5 6|7 8 9 2|1 4 P 2 =4 7 3|1 2 5 6|8 9 O 1 =***|1 2 5 6|** O 2 =***|7 8 9 2|**; Step 1.2.4, leave the middle part of the intersection and place it in the third segment: p 1 =1 4|3 5 6|7 8 9 2 p 2 =8 9|4 7 3|1 2 5 6; Step 1.2.5, delete the middle part of parent 1 from parent 2 to get 4-3-1-5-6, delete the middle part of parent 2 from parent 1 to get 4-3-7-8-9, and add them to get the offspring: O 1 =7 8 9|1 2 5 6|4 3 O 2 =1 5 6|7 8 9 2|4 3。 4. The optimization method for the multimodal traveling salesman problem according to claim 1, It is characterized in that Step 2 specifically includes the following steps: Step 2.1, the population preprocessed in step 1 is arranged according to its fitness value, and two individual generation strategies are used to combine the key edge set and the greedy strategy. At the same time, the population is still crossover-operated, and individuals generate multiple offspring; Step 2.2, merge the offspring, remove redundant individuals, and calculate the fitness value of the offspring; Step 2.3, merge the parent generation and the offspring generation for environmental selection; Step 2.4, Step 2 loop uses two stop conditions: (1) If the optimal value of the entire population is not updated after several iterations, the loop of step 2 will end; (2) The maximum number of evaluations in step 2 is reached.
5. The optimization method for the multimodal traveling salesman problem according to claim 4, It is characterized in that In step 2.1, the two individual generation strategies include the following steps: Step 2.1.1, sort the entire population according to the fitness value, identify the top 4 key edge sets in all individuals including the multimodal solution and mark the number of occurrences of the key edges. The more times the key edges appear, the more important they are. Step 2.1.2, the first individual generation strategy: the critical edge dimension is fixed to one-fourth of the total city dimension. After identifying and marking the number of critical edges according to step 2.1.1, individuals are generated based on the importance of the number. Each occurrence of a critical edge generates an individual. One-fourth of an individual is the critical edge dimension. The identification of critical edges requires at least three edges, and three edges require four city vertices to determine. If the critical edge dimension is less than 4, the critical edge dimension is set to 4, and the rest will be randomly inserted into the remaining sites. If the individual gene chromosome sites are not repeated, the individual is a valid solution. Step 2.1.3, the second individual generation strategy: In step 2, the initial key edge dimension is one-fifth of the total city dimension. The key edge dimension is updated as the iteration proceeds until it stops updating when it is two-thirds of the total city dimension. After identifying and marking the number of key edges according to step 2.1.1, for the two key edges without repeated genes, two individuals are generated by combining them. The specific steps are as follows: (1) The first individual: put the key edge 1 at the front, randomly generate a site at the position where there is no gene site and put it into another key edge 2, and the remaining sites will be supplemented according to the greedy strategy; (2) The second individual: reverse the two key edges, put the reversed key edge 2 at the front, randomly generate a site to put the reversed key edge 2, and fill the remaining site according to the greedy strategy; For the remaining identified key edges that cannot be combined, two individuals are still generated. The specific steps are: (1) The first individual: put the key edge at the front, and the empty sites will be filled according to the greedy strategy; (2) The second individual: reverse the key edge and put it at the front, and fill the remaining positions according to the greedy strategy; Step 2.1.4, use the above two individual generation strategies for the top 4 individuals in the entire population, and perform a crossover operation on the entire population.
6. The optimization method for the multimodal traveling salesman problem according to claim 4, It is characterized in that In step 2.3, the environment selection includes the following steps: Step 2.3.1, sort the entire population according to fitness value, and reserve 1.4*NP individuals for environmental selection; Step 2.3.2, cluster the individuals under the same target value, directly retain all individuals ranked 1, and the remaining individuals will be allocated according to the population size NP; Step 2.3.3: Individuals with 1 or 2 multimodal solutions under the same target value are directly retained. Individuals with more than 2 multimodal solutions will be retained according to the following formula: Among them, CN is the current number of clusters, NP is the population size; Step 2.3.4, according to the number of retentions calculated in step 2.3.3, retain and delete the multimodal solutions according to the similarity of the individuals, retain the one with the worst similarity, and retain the rest with good similarity; To measure the similarity between solutions, the number of common edges N between solutions will be used 1 and the number of vertices visited in the same order N 2 , for two solutions x with n-dimensional cities 1 =(x 11 ,x 12 ,…,x 1n ,x 11 ) and x 2 =(x 21 ,x 22 ,…,x 2n ,x 21 ), N 1 and N 2 Calculated by the following formula: N 1 =|Φ(x 1 )∩Φ(x 2 )| Among them, Φ(x 1 ) and Φ(x 2 ) are the solutions x 1 and x 2 The edge of Among them, if x 1i =x 2i , then k i =1, otherwise k i =0; The similarity of individuals can be understood as the distance between solutions in the decision space. The similarity between solutions is calculated by the following formula: Among them, S(x 1 ,x 2 ) has a value between 0 and 1; N 1 and N 2 The larger the value of S(x 1 ,x 2 ) value is smaller, the two solutions are more similar; when S(x 1 ,x 2 )=0, the solution is the same.
7. The optimization method for the multimodal traveling salesman problem according to claim 1, It is characterized in that In step 3, specifically: Step 3.1, create an archive and save all individuals after the environment selection in step 2 into the archive; Step 3.2, select the best individual in the archive, and use the target space distance of the best individual to adaptively generate clusters. The specific steps are: Step 3.2.1, select the best individual in the archive, calculate the distance between each city to form a 1-row n-column matrix, and calculate the individual target value, and use the following formula to calculate the average distance between cities: mean=sum / n Among them, sum is the individual target value, and n is the city dimension; Step 3.2.2, identify the number of elements in the 1-row n-column matrix that are greater than the mean, which is the number of clusters, and match the individuals with the matrix to obtain the clusters; Step 3.3, according to the number of clusters in the above step, the inter-class multimodal solution is fully arranged, and the invalid arrangements of inter-cluster loops and reverse order are removed to obtain all possible valid arrangements; Step 3.4, use the average value to find the cluster center, and find the loop distance between cluster centers based on the above effective arrangement, and arrange the order between classes according to their importance; Step 3.5, generate individuals based on archive and inter-class multimodal arrangement, and enter the loop iterative optimization. The specific steps are: Step 3.5.1, cluster the individuals in the archive segment by segment according to the above clustering method, and mark each cluster in order; Step 3.5.2: Follow all the permutations in step 3.4 and cycle through the local search. There are three ways to generate individuals based on archives and inter-class multimodal permutations: (1) The individuals are organized in order; (2) First, put the gene fragments of the first cluster in, and calculate the distances between the last gene of the first gene fragment and the first and last genes of the second cluster. If the distance to the first gene of the second cluster is shorter, put it directly into the second cluster. Otherwise, if the distance to the last gene of the second cluster is shorter, reverse the gene fragment of the second cluster and then fill it into the individual. The gene fragments of the remaining clusters are put in sequentially in the same way. (3) Using the loop principle, the gene fragment of the first cluster is placed at the end of the blank individual, and the distance between the first site of the effective fragment of the filled individual and the first and last sites of the gene fragment of the last cluster are calculated respectively, and the shortest segment is connected in the above manner; According to the above method, one individual in the archive will generate three offspring, which will be merged and deduplicated before environmental selection; Step 3.6, in problems MSTSP1-MSTSP12, step 3 evolution identifies the key edge set from the top 3 individuals in the population; in problems MSTSP13-MSTSP25, step 3 identifies the key edge set from the top 8 individuals in the population in the early stage of evolution, and identifies the key edge set from the top 3 individuals in the late stage of evolution. The identification operation of the key edge is the same as step 2 above, and the key edge dimension is a random integer; Step 3.7, remove redundant key edges; Step 3.8, set the upper limit of the generated individuals, and allocate the search resources to each individual in proportion; then, perform a local search strategy based on the jump operator on the individuals with the key edges identified, remove redundant individuals and select the environment for the generated individuals; Step 3.9, perform a crossover operation and two local mutation operations that do not protect the key edge set on the individuals obtained above, merge the parent and child individuals to remove duplicates and perform environmental selection, and save them into the archive; In step 3.10, the populations obtained from each inter-species arrangement are placed in an archive, and environmental selection is performed on all individuals in the archive and output.
8. The optimization method for the multimodal traveling salesman problem according to claim 7, It is characterized in that In step 3.6, the specific settings for randomly selecting the key edge dimensions are as follows: (1) For problems MSTSP1-MSTSP12, the identification of key edges is meaningful only when there are at least three edges. Three edges require four city vertices to be determined. Therefore, the minimum range of key edge dimensions is 4. The random selection range of key edge dimensions is: THESE len ∈(4,n-5) Among them, n is the city dimension; (2) For problems MSTSP13-MSTSP25, the lowest dimension is 28 and the highest dimension is 66. For problems with a city dimension greater than 45, the initial critical edge dimension will be set to one-third of the problem size, and for the remaining problems it will be set to one-quarter. The lower limit of the random selection range of the critical edge dimension will increase linearly with iterative evolution, that is, it will increase by 4 every 80 generations, and the upper limit will be set to n-5.
9. The optimization method for the multimodal traveling salesman problem according to claim 7, It is characterized in that In step 3.8, the local search strategy based on the jump operator is: Identify the key edges for each individual and mark the number of times the key edges appear. The local search of the individual will protect the gene fragment where the key edges are located, that is, this part of the gene fragment will be directly inherited to the offspring. Randomly select adjacent gene fragments and randomly mutate the gene sites on the fragment. Since the individual has become stable at this time, the dimensions of the gene fragments randomly mutated should not be too many, and the remaining sites are also directly inherited to the offspring; The above-mentioned random selection of gene fragments for chromosome mutation will be performed multiple times according to the number of times the marked key edges appear. An individual may have multiple key edges, resulting in a huge number of offspring individuals. Therefore, an upper limit on the number of individuals generated is set, and the search resources for each individual are allocated proportionally.
10. The optimization method for the multimodal traveling salesman problem according to claim 7, It is characterized in that In step 3.9, the two local mutation operations include: (1) Local mutation operation: The local mutation operation uses the same principle as step 3.8, except that the local mutation here no longer protects the key edge. That is, when the adjacent gene fragments containing the key edge are randomly selected, they are still mutated and replaced, and the remaining gene fragments are directly inherited to the offspring; (2) Local reversal mutation operation: Still without protecting the critical edges, two chromosomes are randomly selected on the individual and the fragment between the two chromosomes is reversed.
Citation Information
Cited By
Tourism service intelligent scheduling method and system based on big data
CN121073145A
Big data-based intelligent scheduling method and system for tourism services
CN121073145B
