Large-scale traveling salesman problem solving method and system based on clustering strategy
By decomposing large-scale TSP problems into smaller subproblems and optimizing the path using the Pointerformer model and local search algorithm, the problems of low complexity and efficiency in solving large-scale TSP problems are solved, and an efficient global optimal solution is achieved.
Patent Information
- Application Number
- CN202511111931.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-08
- Publication Date
- 2025-10-31
AI Technical Summary
Existing methods for solving the large-scale traveling salesman problem suffer from high solution complexity, low efficiency, and poor scalability. In particular, in large-scale TSP problems, existing algorithms struggle to guarantee a globally optimal solution and are computationally inefficient.
A clustering-based approach is adopted to decompose the large-scale TSP problem into multiple smaller subproblems. The Pointerformer model is used to optimize the TSP subproblems within each cluster, and the overall path is optimized by a greedy algorithm with multiple entry/exit points and a 2-opt local search algorithm. The cluster boundary optimization algorithm is combined to improve the solution quality.
It significantly improves the solution accuracy and computational efficiency of large-scale TSP problems, overcomes the scalability bottleneck of deep learning methods in large-scale scenarios, and provides efficient global optimal solutions.
Smart Images

Figure CN120873648A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of combinatorial optimization technology, specifically to a method and system for solving the large-scale traveling salesman problem based on a clustering strategy. Background Technology
[0002] The Traveling Salesman Problem (TSP) is a classic combinatorial optimization problem. It is defined as follows: given a set of cities and the distances between each pair of cities, the goal is for a traveler to start from a given city, visit each city exactly once, and return to the starting point, minimizing the total distance traveled. From a graph theory perspective, this problem is equivalent to finding the minimum weight Hamiltonian cycle (i.e., a closed cycle that visits each vertex exactly once) in a weighted complete undirected graph. Since the feasible solution to this problem is a permutation of all vertices, combinatorial explosion occurs as the number of vertices increases, making it an NP-hard problem. The TSP has wide applications in transportation, circuit board design, and logistics, and has been extensively studied by scholars both domestically and internationally. Early researchers used exact algorithms to solve this problem, commonly including branch and bound, linear programming, and dynamic programming. However, exact algorithms have high computational complexity and are only suitable for small-scale problems; as the problem size increases, exact algorithms become inadequate. Therefore, in later research, scholars at home and abroad have focused on using approximation algorithms or heuristic algorithms, mainly including greedy algorithms, genetic algorithms, simulated annealing, ant colony algorithms and neural networks. However, all of the above algorithms have the defect of poor scalability in terms of problem size. Approximation algorithms cannot guarantee the global optimal solution, while heuristic algorithms have the problems of parameter sensitivity and poor stability. Summary of the Invention
[0003] This invention addresses the problems of high solution complexity, low efficiency, and poor scalability in existing methods for solving the large-scale traveling salesman problem. The aim is to provide a method and system for solving the large-scale traveling salesman problem based on a clustering strategy.
[0004] To achieve the above objectives, the present invention adopts the following technical solution: In a first aspect, the present invention provides a method for solving the large-scale traveling salesman problem based on a clustering strategy, comprising the following steps: (1) Determine the set of city nodes V and the number of clusters in the clustering algorithm. : Representing the large-scale traveling salesman problem in two-dimensional Euclidean space as an undirected complete graph ,in , representing a city / node , represents the set of all edges; from node arrive Cost Equal to the Euclidean distance between two nodes, given a path Its total cost for: In the formula, express The first 1 node It is a path The length of the cluster; the number of clusters in the clustering algorithm. Represented as: In the formula, It is the total number of nodes. It is a preset constant that represents the desired number of nodes in each cluster, with a value range of 100-500. (2) Node clustering: The nodes are grouped by clustering algorithm, so that the original large-scale TSP problem is decomposed into multiple small-scale subproblems; (3) Sub-path generation: The Pointerformer model, which is pre-trained on TSP cases of different sizes, is used to solve the TSP sub-problems for each cluster node; (4) Path integration optimization: After connecting and integrating sub-paths through a greedy algorithm with multiple entry / exit points, the overall path is optimized using a cluster boundary optimization algorithm and a 2-opt local search algorithm; (5) Output the optimal TSP path sequence.
[0005] Further, in step (2), the clustering algorithm is: Mean clustering algorithm, fuzzy Either the mean clustering algorithm or the hierarchical clustering algorithm.
[0006] Preferably, the Mean value clustering algorithm iteratively assigns nodes to the nearest cluster centers, minimizing the distance between nodes by making nodes within the same cluster as close as possible to their cluster centers. Its mathematical model is to minimize the objective function: In the formula, Indicates the first The collection of cities in a cluster For all cities in this cluster The mean.
[0007] Preferably, the fuzziness Mean clustering allows nodes to belong to multiple clusters with different membership degrees, and ultimately determines the node's affiliation based on the highest membership degree. Its objective function is: In the formula, Indicates the first A city, For the first The center of each cluster, Represents city Belongs to cluster membership degree It is a fuzziness index used to adjust the degree of fuzziness in membership.
[0008] Preferably, the hierarchical clustering algorithm adopts a bottom-up agglomerative approach, initially treating each node as an independent cluster, and then gradually merging the most similar cluster pairs until the target number of clusters is reached.
[0009] Furthermore, in step (4), the multi-entry / exit point greedy algorithm is to divide the start and end parts of the sub-path... Each node serves as a potential entry and exit point, and the connection cost is defined as: In the formula, It is the first The set of exit points of each cluster It is the first The set of entry points for each cluster. and Represent the coordinates of the exit point and the entrance point, respectively, and the number of entrance / exit points. Experiments were conducted to determine a balance between solution quality and computational efficiency; the specific steps included: S1. Potential Ingress / Exit Point Selection: For each cluster, determine the previous... Each node is a potential entry point, and then... Each node is a potential exit point; S2. Inter-cluster link cost calculation: Calculate the link cost between all possible combinations of ingress / egress points between all cluster pairs; S3. Greedy construction of cluster access sequence: A greedy strategy is used to construct the cluster access sequence - starting from the initial cluster, each time the next unvisited cluster with the minimum connection cost with the current cluster is selected, until all clusters have been visited once; S4. Full Path Concatenation: Concatenates all sub-paths and their connection point pairs into a complete global path according to the selected order.
[0010] Further, in step (4), the cluster boundary optimization algorithm sets a window for each cluster boundary and tries all possible permutations of these nodes, selecting the permutation with the shortest total distance. The objective function is: In the formula, This represents the set of nodes within the bounding window. Represents all possible permutations, It is a specific arrangement. Indicates the number of rows in the permutation The coordinates of each node.
[0011] Furthermore, in step (4), the 2-opt local search algorithm is based on a given path: If two points are randomly selected and ,Will Add the previous path to the new path. In the middle, and The paths between them are flipped and their numbers are added to the new path. In the middle, Add the remaining paths to the new path. In the middle, if this operation can reduce the original path The total distance is then used to rearrange the paths as follows:
[0012] When a better solution is not found in multiple consecutive iterations, the algorithm terminates early and only performs swap operations on a subset of randomly sampled nodes and their neighboring regions.
[0013] Secondly, the present invention provides a system for solving the large-scale traveling salesman problem based on a clustering strategy, comprising: The node clustering module is used to cluster city nodes based on Euclidean distance using a clustering algorithm. The sub-path generation module uses a Pointerformer model pre-trained on TSP examples of different sizes to solve the TSP sub-problems for nodes within each cluster after clustering. The path integration and optimization module is used to connect and integrate sub-paths using a greedy algorithm with multiple entry / exit points, and then optimize the overall path using a cluster boundary optimization algorithm and a 2-opt local search algorithm.
[0014] Compared with existing technologies, the beneficial effects of this invention are as follows: This invention decomposes TSP cases into subproblems through clustering, then uses the Pointerformer model to optimize the solutions of each TSP subproblem, and finally combines a greedy algorithm with multiple entry / exit points to initialize the connection integration subpaths, a cluster boundary optimization algorithm, and a 2-opt local search algorithm to fine-tune the global path, thereby improving the solution quality. For large-scale TSP problems with a node size ≥ 103, the method of this invention is significantly superior to the ant colony optimization algorithm, the neural combinatorial optimization algorithm, and the Pointerformer algorithm in terms of solution accuracy, computational efficiency, and scalability, effectively overcoming the scalability bottleneck of deep learning methods in large-scale scenarios. Attached Figure Description
[0015] Figure 1 This is a flowchart illustrating the large-scale traveling salesman problem solution based on clustering strategy in Example 1. Figure 2 This is a schematic diagram of the system for solving the large-scale traveling salesman problem based on clustering strategy in Example 2. Detailed Implementation
[0016] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0017] Example 1 Please see Figure 1 This invention provides a method for solving the large-scale traveling salesman problem based on a clustering strategy, comprising the following steps: (1) Determine the set of city nodes V and the number of clusters in the clustering algorithm. : Representing the large-scale traveling salesman problem in two-dimensional Euclidean space as an undirected complete graph ,in , representing a city / node , represents the set of all edges; from node arrive Cost Equal to the Euclidean distance between two nodes, given a path Its total cost for: In the formula, express The first 1 node It is a path The length of the cluster; the number of clusters in the clustering algorithm. Represented as: In the formula, It is the total number of nodes. It is a preset constant that represents the desired number of nodes in each cluster, with a value range of 100-500. (2) Node clustering: The nodes are grouped by clustering algorithm, so that the original large-scale TSP problem is decomposed into multiple small-scale subproblems; (3) Sub-path generation: The Pointerformer model, which is pre-trained on TSP cases of different sizes, is used to solve the TSP sub-problems for each cluster node; (4) Path integration optimization: After connecting and integrating sub-paths through a greedy algorithm with multiple entry / exit points, the overall path is optimized using a cluster boundary optimization algorithm and a 2-opt local search algorithm; (5) Output the optimal TSP path sequence.
[0018] Specifically, in step (2), the clustering algorithm is as follows: Mean clustering algorithm, fuzzy Either the mean clustering algorithm or the hierarchical clustering algorithm.
[0019] In one specific embodiment of the present invention, the following is adopted: Mean value clustering algorithm iteratively assigns nodes to the nearest cluster centers, minimizing the distance between nodes by making nodes within the same cluster as close as possible to their cluster centers. Its mathematical model is to minimize the objective function: In the formula, Indicates the first The collection of cities in a cluster For all cities in this cluster The mean.
[0020] In one specific embodiment of the present invention, fuzzy logic is employed. Mean value clustering allows nodes to belong to multiple clusters with different membership degrees, and ultimately determines the node's affiliation based on the highest membership degree. Its objective function is: In the formula, Indicates the first A city, For the first The center of each cluster, Represents city Belongs to cluster membership degree It is a fuzziness index used to adjust the degree of fuzziness in membership.
[0021] In one specific embodiment of the present invention, a hierarchical clustering algorithm is adopted, which is a bottom-up agglomeration method. Initially, each node is regarded as an independent cluster, and then the most similar cluster pairs are gradually merged until the target number of clusters is reached.
[0022] Specifically, in this embodiment, the Pointerformer model adopts a multi-pointer Transformer architecture, combined with a reversible residual network and enhanced context embedding technology. This model, through its encoder-decoder structure, can effectively capture the spatial relationships between nodes while maintaining a balance between memory consumption and computational efficiency, making it very suitable for solving the clustering sub-problem in this experiment. For each city cluster... Utilizing the Pointerformer model to generate optimal sub-paths The Pointerformer model is pre-trained on TSP instances of varying sizes to ensure its efficient handling of subproblems of all sizes. Notably, due to the small size of each subproblem, the solution process is highly efficient and can be parallelized to further improve efficiency.
[0023] Specifically, in step (4), the multi-entry / exit point greedy algorithm is to divide the start and end parts of the sub-path... Each node serves as a potential entry and exit point, and the connection cost is defined as: In the formula, It is the first The set of exit points of each cluster It is the first The set of entry points for each cluster. and Represent the coordinates of the exit point and the entrance point, respectively, and the number of entrance / exit points. Experiments were conducted to determine a balance between solution quality and computational efficiency; the specific steps included: S1. Potential Ingress / Exit Point Selection: For each cluster, determine the previous... Each node is a potential entry point, and then... Each node is a potential exit point; S2. Inter-cluster link cost calculation: Calculate the link cost between all possible combinations of ingress / egress points between all cluster pairs; S3. Greedy construction of cluster access sequence: A greedy strategy is used to construct the cluster access sequence - starting from the initial cluster, each time the next unvisited cluster with the minimum connection cost with the current cluster is selected, until all clusters have been visited once; S4. Full Path Concatenation: Concatenates all sub-paths and their connection point pairs into a complete global path according to the selected order.
[0024] Specifically, in step (4), the cluster boundary optimization algorithm sets a window for each cluster boundary and tries all possible permutations of these nodes, selecting the permutation with the shortest total distance. The objective function is: In the formula, This represents the set of nodes within the bounding window. Represents all possible permutations, It is a specific arrangement. Indicates the number of rows in the permutation The coordinates of each node.
[0025] Specifically, in step (4), the 2-opt local search algorithm is given a path: If two points are randomly selected and ,Will Add the previous path to the new path. In the middle, and The paths between them are flipped and their numbers are added to the new path. In the middle, Add the remaining paths to the new path. In the middle, if this operation can reduce the original path The total distance is then used to rearrange the paths as follows: When a better solution is not obtained after multiple iterations, the algorithm terminates early and only performs swap operations on a subset of randomly sampled nodes and their neighboring regions.
[0026] like Figure 2 As shown, this embodiment provides a system for solving the large-scale traveling salesman problem based on a clustering strategy, including: The node clustering module is used to cluster city nodes based on Euclidean distance using a clustering algorithm. The sub-path generation module uses a Pointerformer model pre-trained on TSP examples of different sizes to solve the TSP sub-problems for nodes within each cluster after clustering. The path integration and optimization module is used to connect and integrate sub-paths using a greedy algorithm with multiple entry / exit points, and then optimize the overall path using a cluster boundary optimization algorithm and a 2-opt local search algorithm.
[0027] The system works as follows: Input the node coordinates and number of clusters of the TSP problem; the node clustering module uses a clustering algorithm to group the nodes; the sub-path generation module uses the Pointerformer model to solve the TSP sub-problems for the nodes in each cluster; the path integration and optimization module uses a greedy algorithm with multiple entry / exit points to integrate the sub-paths, and then uses the cluster boundary optimization algorithm and the 2-opt local search algorithm to optimize the overall path; output the optimal TSP path sequence.
[0028] Comparative Example 1 The ant colony optimization (ACO) algorithm was selected to solve the TSP problem.
[0029] Inspired by the foraging behavior of ants, the ACO algorithm gradually constructs a high-quality solution by simulating the communication mechanism of ants releasing and sensing pheromones along their paths. When solving the TSP problem, the ACO algorithm maintains a pheromone matrix between cities. ,in Indicates from the city to the city The path attraction of ants. When constructing a path, ants determine their direction of movement based on the pheromone concentration along the path and heuristic information (such as the distance between cities), thereby achieving the search and discovery of the optimal path. In each iteration, the ant selects the next city according to the following probability formula: In the formula, This is heuristic information (usually referring to the reciprocal of the distance between cities). and These are relative weights, which respectively control the influence of pheromones on path selection and the influence of heuristic information on path selection. For ants In the city The set of unvisited cities. After all ants have completed one path construction, the pheromone matrix is updated based on the quality of the paths traversed by the ants. The pheromone update formula is as follows: In the formula, For pheromone evaporation rate, The amount of new pheromone is typically inversely proportional to path quality. The implementation employs an elitist strategy to ensure the optimal path receives more pheromone enhancements. (Pheromone increment) Usually with ants Optimal path length taken Related, represented as: ,in It is a constant.
[0030] Comparative Example 2 The neural combinatorial optimization (NCO) algorithm is used to solve the TSP problem.
[0031] NCO, proposed by Bello et al., is a method combining reinforcement learning and neural networks, often referred to as DRL_PtrNet. Its innovation lies in training the model without pre-computing the optimal solution, effectively overcoming the dependence of pointer networks on labeled optimal solution data. This method models the Traveling Salesman Problem (TSP) as a Markov decision process, using a policy network based on a pointer network architecture to sequentially select cities to construct travel paths. Unlike pointer networks, it is trained through reinforcement learning, with the goal of minimizing the desired travel distance. In the formula, The model parameters of the policy network are represented. Indicates according to strategy The generated complete city visit sequence, It is a sequence The corresponding travel path length.
[0032] Comparative Example 3 The Pointerformer model is used to solve the TSP problem.
[0033] The Pointerformer model architecture is specifically designed for large-scale TSPs. The encoder employs an 8-head revmha (reversible multi-head self-attention) mechanism, equipped with 8 attention heads, and performs 8x data augmentation on the 2D node coordinates to capture complex relationships. The network consists of 6 layers, with both the decoder and embedding layers having a dimension of 128. The decoder integrates an 8-pointer mechanism and an extended query strategy, significantly improving pathfinding efficiency. These designs aim to effectively handle large-scale graph data, providing high-quality near-optimal solutions for TSPs through precise encoder-decoder interactions.
[0034] Experimental Example 1 1. Experimental Objective Using the algorithms of Comparative Examples 1-3 as benchmark algorithms, the performance of the ClusterTSP of the present invention is verified by comparing it with that of Example 1.
[0035] 2. Experimental Setup The experiments used the TSP_random dataset (i.e., a certain number of nodes uniformly sampled from a unit square) to evaluate the performance of various algorithms. This dataset contains five TSP test cases, each with a certain number of city nodes. The numbers are 1000, 2000, 3000, 4000, and 5000 respectively.
[0036] To ensure fair comparison, the ACO algorithm employs a dynamic parameter adjustment strategy, adjusting the number of ants based on the city size. value, The NCO model is trained using PyTorch and the Actor-Critic architecture, with negative path lengths as rewards. The ClusterTSP in Example 1 is based on PyTorch, with the node clustering module developed using the scikit-learn and scikit-fuzzy libraries, and the sub-path generation module utilizing a pre-trained Pointerformer model. All benchmark algorithms were evaluated on the same TSP_random dataset. Hardware configuration and algorithm characteristics were matched: the ACO algorithm, due to its serial computation characteristics, ran on an AMD EPYC 9654 CPU (32-core), while the deep learning-based DRL_PtrNet, Pointerformer, and ClusterTSP ran on an NVIDIA 3090Ti GPU (24GB). The main experimental parameters are shown in Table 1.
[0037] Table 1 Parameter Setting Table
[0038] 3. Performance Evaluation The performance of the algorithm was evaluated using two metrics: path length and solution time. The results are shown in Table 2.
[0039] Table 2. Comparison results with the benchmark algorithm on TSP randomized cases.
[0040] Note: OOM indicates insufficient memory to complete the task; Table 2 compares the performance of ClusterTSP in Example 1 with the benchmark algorithms in Comparative Examples 1-3 on randomized TSP instances of different scales. The results show that ClusterTSP achieves the best solution quality at scales above 2000 instances, only slightly inferior to Pointerformer on TSP_random1000. As the scale increases, the advantages of ClusterTSP become more pronounced, especially above 4000 instances, making it the only deep learning method that can effectively handle TSP instances without experiencing OutOfMemory (OOM) errors. Due to the randomness of ACO, each instance was repeated 15 times, but the results were still inferior to the best algorithm. DRL_PtrNet in Comparative Example 2 performed the worst across all scales, with significantly longer path lengths than other methods.
[0041] In summary, the experimental results strongly demonstrate the effectiveness and scalability of ClusterTSP in Example 1 for large-scale TSP problems. Its decomposition and hierarchical solution strategy overcomes the memory bottleneck of existing deep learning methods for large-scale TSP examples while ensuring solution quality. Although the solution time is longer, the significantly improved solution quality justifies the time investment.
[0042] 4. The impact of different clustering algorithms Table 3 shows that hierarchical clustering performs best across all sizes of TSP randomized instances. Notably, FCM outperforms [the algorithm] on small and medium-sized datasets (1000-4000). -means. However, at the largest scale (5000), FCM performance slightly decreases, indicating slightly poorer stability when handling large-scale TSPs. In contrast, hierarchical clustering exhibits robust and consistent performance advantages across all scales, making it the best clustering algorithm in the ClusterTSP framework of Example 1. These results further confirm the significant impact of different clustering strategies on the quality of the final solution. Specifically, hierarchical clustering can more effectively capture urban spatial structure, laying a good foundation for solving subsequent sub-problems and path connectivity.
[0043] Table 3 Comparison of results for different clustering strategies on TSP randomized cases
[0044] 5. Ablation test Table 4 shows the impact of different path integration optimization algorithms on the performance of ClusterTSP in Example 1. Experimental results show that 2-opt local search performs best across all test scales and significantly improves the quality of the final solution. The multi-entry / exit greedy algorithm shows a slight performance improvement on small and large-scale examples, but no significant improvement on medium-scale examples. The cluster boundary optimization algorithm shows no significant improvement on most examples, and even performs slightly worse than the benchmark on some examples. In contrast, 2-opt local search performs best across all test scales. The performance improvement is most significant at scale.
[0045] Ablation experiments show that 2-opt local search is the key to improving ClusterTSP performance and an indispensable component for enhancing the algorithm's performance.
[0046] Table 4 Ablation experiments of three path optimization algorithms on TSP randomized cases.
[0047] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the technical solution and conceptual framework of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for solving the large-scale traveling salesman problem based on a clustering strategy, characterized in that, Includes the following steps: (1) Determine the set of city nodes V and the number of clusters in the clustering algorithm. : Representing the large-scale traveling salesman problem in two-dimensional Euclidean space as an undirected complete graph ,in , representing a city / node , represents the set of all edges; from node arrive Cost Equal to the Euclidean distance between two nodes, given a path Its total cost for: In the formula, express The first 1 node It is a path The length of the cluster; the number of clusters in the clustering algorithm. Represented as: In the formula, It is the total number of nodes. It is a preset constant that represents the desired number of nodes in each cluster, with a value range of 100-500. (2) Node clustering: The nodes are grouped by clustering algorithm, so that the original large-scale TSP problem is decomposed into multiple small-scale subproblems; (3) Sub-path generation: The Pointerformer model, which is pre-trained on TSP cases of different sizes, is used to solve the TSP sub-problems for each cluster node; (4) Path integration optimization: After connecting and integrating sub-paths through a greedy algorithm with multiple entry / exit points, the overall path is optimized using a cluster boundary optimization algorithm and a 2-opt local search algorithm; (5) Output the optimal TSP path sequence.
2. The method for solving the large-scale traveling salesman problem based on a clustering strategy as described in claim 1, characterized in that: In step (2), the clustering algorithm is: Mean clustering algorithm, fuzzy Either the mean clustering algorithm or the hierarchical clustering algorithm.
3. The method for solving the large-scale traveling salesman problem based on a clustering strategy as described in claim 2, characterized in that: The Mean value clustering algorithm iteratively assigns nodes to the nearest cluster centers, minimizing the distance between nodes by making nodes within the same cluster as close as possible to their cluster centers. Its mathematical model is to minimize the objective function: In the formula, Indicates the first The collection of cities in a cluster For all cities in this cluster The mean.
4. The method for solving the large-scale traveling salesman problem based on a clustering strategy as described in claim 2, characterized in that: The ambiguity Mean clustering allows nodes to belong to multiple clusters simultaneously with different membership degrees. The node's affiliation is ultimately determined by its maximum membership degree. Its objective function is: In the formula, Indicates the first A city, For the first The center of each cluster, Represents city Belongs to cluster membership degree It is a fuzziness index used to adjust the degree of fuzziness in membership.
5. The method for solving the large-scale traveling salesman problem based on a clustering strategy as described in claim 2, characterized in that: The hierarchical clustering algorithm adopts a bottom-up agglomerative approach, initially treating each node as an independent cluster, and then gradually merging the most similar cluster pairs until the target number of clusters is reached.
6. The method for solving the large-scale traveling salesman problem based on a clustering strategy as described in claim 1, characterized in that: In step (4), the multi-entry / exit point greedy algorithm is to divide the start and end parts of the sub-path... Each node serves as a potential entry and exit point, and the connection cost is defined as: In the formula, It is the first The set of exit points of each cluster It is the first The set of entry points for each cluster. and Represent the coordinates of the exit point and the entrance point, respectively, and the number of entrance / exit points. Experiments were conducted to determine the balance between solution quality and computational efficiency. The specific steps include: S1. Potential Ingress / Exit Point Selection: For each cluster, determine the previous... Each node is a potential entry point, and then... Each node is a potential exit point; S2. Inter-cluster link cost calculation: Calculate the link cost between all possible combinations of ingress / egress points between all cluster pairs; S3. Greedy construction of cluster access sequence: A greedy strategy is used to construct the cluster access sequence - starting from the initial cluster, each time the next unvisited cluster with the minimum connection cost with the current cluster is selected, until all clusters have been visited once; S4. Full Path Concatenation: Concatenates all sub-paths and their connection point pairs into a complete global path according to the selected order.
7. The method for solving the large-scale traveling salesman problem based on a clustering strategy as described in claim 1, characterized in that: In step (4), the cluster boundary optimization algorithm sets a window for each cluster boundary and tries all possible permutations of these nodes, selecting the permutation with the shortest total distance. The objective function is: In the formula, This represents the set of nodes within the bounding window. Represents all possible permutations, It is a specific arrangement. Indicates the number of rows in the permutation The coordinates of each node.
8. The method for solving the large-scale traveling salesman problem based on a clustering strategy as described in claim 1, characterized in that: In step (4), the 2-opt local search algorithm is given a path: If two points are randomly selected and ,Will Add the previous path to the new path. In the middle, and The paths between them are flipped and their numbers are added to the new path. In the middle, Add the remaining paths to the new path. In the middle, if this operation can reduce the original path The total distance is then used to rearrange the paths as follows: When a better solution is not obtained after multiple iterations, the algorithm terminates early and only performs swap operations on a subset of randomly sampled nodes and their neighboring regions.
9. A system for solving the large-scale traveling salesman problem based on a clustering strategy, characterized in that, include: The node clustering module is used to cluster city nodes based on Euclidean distance using a clustering algorithm. The sub-path generation module uses a Pointerformer model pre-trained on TSP examples of different sizes to solve the TSP sub-problems for nodes within each cluster after clustering. The path integration and optimization module is used to connect and integrate sub-paths using a greedy algorithm with multiple entry / exit points, and then optimize the overall path using a cluster boundary optimization algorithm and a 2-opt local search algorithm.