Next Article in Journal
Unsupervised Forgery Detection of Documents: A Network-Inspired Approach
Previous Article in Journal
Hybrid Mode Reconfigurable Antenna with V-Shaped Extrudes for Cognitive Radio Applications
Order Article Reprints
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:

An Adaptive Layered Clustering Framework with Improved Genetic Algorithm for Solving Large-Scale Traveling Salesman Problems

College of Mathematics and Statistics, Sichuan University of Science and Engineering, Zigong 643000, China
South Sichuan Center for Applied Mathematics, Zigong 643000, China
Author to whom correspondence should be addressed.
Electronics 2023, 12(7), 1681;
Received: 14 February 2023 / Revised: 24 March 2023 / Accepted: 27 March 2023 / Published: 2 April 2023


Traveling salesman problems (TSPs) are well-known combinatorial optimization problems, and most existing algorithms are challenging for solving TSPs when their scale is large. To improve the efficiency of solving large-scale TSPs, this work presents a novel adaptive layered clustering framework with improved genetic algorithm (ALC_IGA). The primary idea behind ALC_IGA is to break down a large-scale problem into a series of small-scale problems. First, the k-means and improved genetic algorithm are used to segment the large-scale TSPs layer by layer and generate the initial solution. Then, the developed two phases simplified 2-opt algorithm is applied to further improve the quality of the initial solution. The analysis reveals that the computational complexity of the ALC_IGA is between O ( n log n ) and O ( n 2 ) . The results of numerical experiments on various TSP instances indicate that, in most situations, the ALC_IGA surpasses the compared two-layered and three-layered algorithms in convergence speed, stability, and solution quality. Specifically, with parallelization, the ALC_IGA can solve instances with 2 × 10 5 nodes within 0.15 h, 1.4 × 10 6 nodes within 1 h, and 2 × 10 6 nodes in three dimensions within 1.5 h.

1. Introduction

As an important branch of optimization, combinatorial optimization plays a significant role in management and economics, computer science, artificial intelligence, biology, engineering, etc. [1]. The traveling salesman problems (TSPs) are the main subject of combinatorial optimization problems, in which the goal is to find a closed route through all the cities once, and only once. This problem is equivalent to finding a Hamilton circuit with the minimum distance. The TSP, and its variants, such as asymmetric TSPs (ATSPs) [2], clustered TSPs (CTSPs) [3], dynamic TSPs (DTSPs) [4], multiple TSPs (MTSPs) [5], and wandering salesman problems (WSPs) [6], have wide applications in laser engraving [7], integrated circuit design [8], transportation [9], energy saving [10], logistics problems [11], communication engineering [12], and medical waste transportation, which is closely related to the COVID-19 pandemic [13]. The TSP was first considered in mathematical format in 1930 to solve a school bus routing problem, and then spread by researchers of Rand corporation. However, these problems were first considered only dozens of cities, but with the increase in applications, the scale of the problems may exceed millions [14].
Although the description of TSP is simple, it has been proven as NP-Hard, which means that the time required to obtain the exact solution for TSP will increase exponentially when the size of the problem aggrandizes. Lots of algorithms have been developed for TSPs, and they can be split into four categories: exact methods, approximation algorithms, intelligence algorithms, and heuristics algorithms. The exact solver, such as brute-force search, linear programming [15], dynamic programming [16], brand and bound [17], brand and cut [18], and cutting plane [19] are powerful tools for small scale TSPs. However, the computational complexity of an exact algorithm is very huge, such that solving the instance with 85900 nodes will take over 136 CPU-years by Concorde, which is a mature exact solver for TSPs [20]. Since there is no efficient exact solution to any NP-hard problem, numerous efficient approximation solutions are presented for finding efficient approximation solutions in polynomial time complexity and with provable solution quality [21]. Although such algorithms can obtain high approximation ratio such as 1 + ϵ for Euclidean TSPs [22] and 7 / 5 + ϵ for TSPs [23], the running times of these approaches, even though asymptotically polynomial, can be rather large, see [24].
The intelligence algorithms are inspired by the nature world and have high capabilities to approximate the global optimal for optimization problems. Evolutionary algorithm (EA) [25], ant colony optimization algorithm (ACO) [26], ant colony system (ACS) [27], shuffled frog leaping algorithm (SFLA) [28], simulated annealing algorithm (SA) [29], particle swarm optimization (PSO) [30], and other well-known algorithms [31,32] all belong to intelligence algorithms. The novel intelligence algorithm can be employed to solve the problem with 2 × 10 5 nodes with high quality in an hour on a retail computer, but it is still hard to tackle while the scale is larger [33]. There are two main drawbacks of intelligent algorithms: one is that they frequently converge to the local optimum; the other one is that the parameters affect the solution quality deeply but usually can only be determined empirically [34]. The main heuristic algorithms for TSPs can be grouped into the Lin–Kernighan family and stem-and-cycle family; they could provide high-quality solutions for nearly 2 million cities’ problems [35]. For higher quality solutions and lower running time, some researchers combined intelligence algorithms and heuristics algorithms; see [36,37,38] and the reference therein.
Genetic algorithm (GA) was proposed by Holland in 1975, the basic idea stems from “survival of the fittest” in evolutionism. Most types of GAs contain three main segments: selection operator, crossover operator, and mutation operator. Due to the high effectiveness and versatility of GAs, they have been widely employed to solve TSPs and other challenging optimization problems [39]. However, there are still several doubts about TSPs, including premature convergence, population initialization, problem encoding, etc. [40].
On the other hand, crossover operators have a significant influence on the performance of GA and are a key factor in global searching and convergence speed. As a matter of fact, various crossover operators have been proposed for TSP, including partially mapped crossover (PMX) [41], ordered crossover (OX) [42], cycle crossover (CX) [43], sequential constructive crossover operator (SCX) [44], completely mapped crossover operators (CMX) [45], and others based on heuristic algorithms such as bidirectional heuristic crossover operator (BHX) [46]. Additionally, merging GAs with local search or heuristic algorithms will reveal both of their advantages, including high convergence speed and the capacity for global optimization; therefore, it has been a hot topic of study [36,47,48].
Although the size of TSPs are larger than 10 5 , seeking a high quality solution is extremely difficult, even the high powerful implementation of the Lin–Kernighan heuristic (LKH) maintained by Helsgaun [49] will take over an hour on a 10 5 nodes instance, see the experiments in [33] and Table 1. In addition, even a small improvement in quality can take a long time; the question of how to obtain an acceptable approximation solution in a reasonable time is more useful in real-world applications [50]. Thus, a new series of two-layered algorithms has been proposed, and the fundamental concepts of them can be divided into two categories. The first type of them is to use various clustering techniques to divide the cities into small groups, calculate the sub-TSPs within those groups, and then merge the groups into a Hamilton cycle [51,52,53]. The other one is to determine the start and end points for each small group after clustering firstly, and then solve the fixed start and end points of TSPs, which are also called WSPs; finally, combine all the groups [54]. These algorithms are much faster than algorithms without clustering and can solve 180 K size TSP within a few hours [7].
Naturally, two-layered algorithms can be developed to be three-layered or multiple-layered; very recent works can be seen in [55,56]. Admittedly, in order to fully utilize all the CPUs of computers, parallelizability is becoming extremely essential for algorithms designed to solve large and complicated problems. Some parallel algorithms for TSPs can be seen in [57,58].
In this paper, in order to develop a fast, easy implementation and high parallelizability algorithm for TSPs, an adaptive layered clustering framework with improved genetic algorithms (ALC_IGA) is supposed. This algorithm is not only an improvement of GA, but also an extension of the two-layered and three-layered methods in the references [7,51,55] for TSPs. The key contributions of this study are as follows:
  • An improved genetic algorithm (IGA) integrated with hybrid selection, a selective BHX crossover operator, and simplified 2-opt local search has been proposed; a numerical comparison of IGA, GA, and ACS on TSPs shows the high performance of IGA.
  • Plentiful numerical results also prove the effectiveness of the novel IGA for solving the WSPs.
  • An adaptive layered clustering framework is proposed to break down a large-scale problem into a series of small-scale problems. The computational complexity of the ALC_IGA is between O ( n log n ) and O ( n 2 ) ; moreover, the parallelability of it has been discussed.
  • We show a numerical experiment for parameters tuning of the proposed ALC_IGA; the results reveal that the larger the parameter set, the higher the solution quality that is obtained, but a longer time is required.
  • Dozens of two-dimensional Euclidean instances have been tested with ALC_IGA and some two-layered algorithms, and the results show that ALC_IGA has advantages in terms of accuracy, stability and convergence speed over the two-layered algorithms proposed by [7,51].
  • Lots of large-scale instances ranging in size from 4 × 10 4 to 2 × 10 5 have been tested, and the results show that the parallel ALC_IGA is more than four times faster than the other three compared algorithms, and obtains the best solution in the most cases. The results on very large-scale TSPs, with sizes ranging from 2 × 10 5 to 2 × 10 6 , also demonstrate the excellent effectiveness of ALC_IGA.
The remainder of the paper is organized as follows: a brief literature review of some related concepts is presented in Section 2; the main procedures of IGA are shown in Section 3; the details ALC_IGA are discussed in Section 4; the results of experimental analyses and algorithms comparisons are shown in Section 5; A summary of this paper and future works are listed in Section 6.

2. Some GAs and Layered-Based Algorithms for TSPs

Numerous algorithms have been introduced for the TSPs, the well-known and typical combinatorial optimization problem. The four primary kinds are heuristic algorithms, approximation algorithms, intelligent algorithms, and exact algorithms. Considering exact algorithms cannot be used for middle-scale TSPs, which is NP-Hard, the intelligence algorithms and heuristic algorithms have been the focus of attention. However, for large-scale TSPs, the classical intelligence algorithms lose efficacy. The two primary methods for large-scale TSPs by intelligence algorithms are improving intelligence algorithms and partitioning the large-scale problems into smaller ones by clustering. In this section, the well-known GA is explored, and several approaches based on clustering for large-scale TSPs are briefly reviewed.

2.1. GAs for TSPs

GA is one of the intelligence algorithms that is widely applied to solve both continuous and discrete optimization problems. Grefenstette et al. [59] studied GA for TSPs in detail in 1988 and provided various proposals for further work, including merging GA with other heuristic algorithms and considering the impact of parameters. In the over 40 years that have passed ever since, the GA for TSPs has tremendous advancements in terms of representation, population initialization, fitness function, selection, crossover, mutation, and integrated with other algorithms.
First, when using GA, the primary task is to find a representation that closely relates to the structure of the problem. There are five different representations of TSPs: binary, path, adjacency, ordinal, and matrix. Larranaga et al. [60] reviewed representations and operators for TSPs. They concluded that the path representation performs well under most circumstances, and lots of powerful substantial crossover and mutation operators have been developed for it.
The crossover operator plays an important role in GA. A proper crossover operator could raise the average quality of the population, which would accelerate the convergence and save time. The most popular PMX was first proposed by Goldberg and Lingle in 1985 [41], in which each offspring only uses information from each of their parents partially. Firstly, two random cut points are generated, and then the portions from the parents between the two cut points are swapped to generate offspring. Then, the other portions are complemented in order from the original parents. Iqbal et al. [45] presented a new CMX in 2020, which differs from prior mapping crossover operators in that it uses cycle-based cut selections at the parental genes rather than random cuts. The numerical research suggests that the new CMX outperforms well-known crossover operators such as and PMX in middle-scale instances. In 2022, Zhang et al. [46] proposed a genetic algorithm with jumping gene and heuristic operators for TSPs, where the heuristic operators include 2-opt and BHX. The key distinction between the BHX and Grefenstette’s heuristic algorithm is that the BHX always chooses the candidate that is closest to the present city out of the four possible candidates. According to the numerical study, the new algorithm converges far more speedily than the CMX and other latest crossover operators.
On the other hand, because the strengths of heuristic algorithms have been shown in TSPs, numerous studies have attempted to use heuristic algorithms as crossover operators for GA. Grefenstette created a probability distribution in 1987 by using the distances between the chosen city and its four nearby neighbors [61]. They then chose the next visited city at random from this distribution until all cities were visited. Ulder et al. [62] presented a genetic local search framework in 1990, which could be combined with 2-opt, Lin–Kernighan neighborhoods, or any other heuristic algorithms. They concluded that although the new algorithms are superior to the simulated annealing and threshold accepting algorithm, combining the elements of these strategies is possible to obtain better performance.
Tsai et al. [63] proposed a genetic algorithm with a neighbor-join operator in 2002, and numerical experiments suggest that the new neighbor-join operator has lower error rates than the 2-opt and swap operator combined with GA in all compared instances, and is nearly as efficient as 2-opt. In 2014, Wang [36] constructed a hybrid genetic algorithm for TSPs that combined two local optimization strategies. The computation results demonstrate that the hybrid genetic algorithm can achieve higher accuracy than the GA in a reasonable amount of time. However, this method is also sensitive to parameter settings. A list-based simulated annealing algorithm combined with tour construction algorithms and enhancement algorithms was developed as a hybrid genetic algorithm by Ilin et al. in 2022 [29]. The tour is built using the nearest insertion algorithm, the cheapest insertion method, and the other two techniques, and a 2-opt local search is used to improve the tour.
Remark 1.
Based on the results in [64], we note that the GA-based approach seems to be clearly inferior to the local search approaches. Despite this, as a basic intelligent algorithm, research on GA is still meaningful and attracts a lot of attention, as seen in the references mentioned therein.

2.2. Layered-Based Algorithms for TSPs

Even though intelligence algorithms are becoming more sophisticated, they can only solve a TSP with 2 × 10 5 nodes in 1 h by using fast C++ programming and parallel techniques [33]. Because the small-scale TSPs can be solved efficiently and precisely, some researchers attempt to cluster the large-scale TSPs into a succession of small-scale TSPs. In this subsection, we give a summary of the advancements produced to the clustering-based (layered-based) algorithms.
As far as is known, Ding et al. [51] may be the first to employ the well-known k-means clustering algorithm for TSPs. The k-means algorithm is used to partition the large-scale cities into several small clusters, and a two-level GA is used to generate the final tour. The low-level GA is used to find the shortest Hamilton cycle inside each cluster, and the high-level GA is utilized to determine the in and out nodes of each cluster. The numerical experiment illustrates that the new algorithm handled the 1000 cities instance in 66 s on Matlab, which is substantially faster than the classical genetic algorithm. Due to the uneven distribution of cities, the scales of clusters produced by k-means may still be quite large, leading the low-layer computation to take a long time.
In 2009, Yang et al. [54] introduced an adaptive clustering method to reduce the computational complexity of the sub-clusters. It checks whether each cluster is smaller than the specified size after k-means and if so, repeats k-means until all clusters are smaller. Then, a GA is used to find the visited order of the clusters based on the coordinates of the clusters’ centers. Finally, the clusters are connected using the nearest nodes between the adjacent traveled clusters. The numerical experiment shows that the adaptive clustering method can solve an instance with 85,900 cities in 1 h. Although Yang’s algorithm ensures that the low layer is solved quickly, there may be too many clusters produced, resulting in slow computation of the high level.
The influences of different clustering and intelligence algorithms combined for layered algorithms were first investigated by Phienthrakul [65] in 2014. He developed a greedy cluster connection procedure and then analyzed the influence of GA and ACO based on k-means and Gaussian mixer models. The numerical results show that the four algorithms have only minor differences in accuracy and execution time and can be efficiently applied to large-scale TSPs.
Although the notion of using a clustering method to solve large-scale TSPs has developed and grown, the work mentioned above does not verify the algorithms’ efficacy for TSPs with more than 10 5 nodes. Wu et al. [7] investigated large-scale laser engraving in 2020, which is a widely used technology in modern production and can be represented as a TSP. They suggested a new two-layered ant colony system algorithm (TLACS) based on k-means, in which the ACS optimizes the visited order of clusters, and the start point and the end point for each cluster are determined. After the start point and the end point of each cluster have been determined, the local traveling path of each cluster can be depicted as a WSP. The ACS will then be used to find the shortest route of each groups. Finally, all groups are connected by the order and entrance and exit nodes, and the global path is determined. The numerical experiment shows that the TLACS can solve the large-scale TSPs with 2 × 10 5 nodes in approximately 1 h.
Naturally, based on clustering algorithms, the two-layered method could be expanded to a three-layered method. This concept was realized recently by Liang et al. [55]. Firstly, they applied k-medoids algorithm to divide the large-scale instance into some medium-scale groups, and then applied k-medoids algorithm for all medium-scale groups again to divide them into small-scale groups. The authors then proposed a three-layered evolutionary optimization framework comprised of two GAs and a parallel multifactorial evolutionary algorithm (3L-MFEA-MP). Their results show that three-layered algorithms have two main advantages over two-layered algorithms. One is speeding up the computation, whereas the other is that the three-layered algorithms reduce path length by almost 30% on four large-scale instances.
As can be seen, the global tour generated by the two-layered or three-layered algorithms is rough and unrefined, so a further optimization phase is necessary. In 2018, Liao and Liu [66] first applied the k-opt algorithm to optimize the tour generated by the hierarchical hybrid algorithm, which is a method proposed by them based on ACO and density peaks clustering algorithms. Although their results demonstrate that k-opt will significantly improve the performance of the hierarchical hybrid algorithm, the numerical experiments only test on the medium-scale instances on no more than 3038 cities. We remark that the computational complexity of k-opt is usually not affordable [67], so the direct application to complex issues is not feasible.

3. IGA for TSPs and WSPs

The GA is a popular optimization algorithm and is frequently applied to TSPs. As the main idea of the adaptive layered clustering framework is to break down a large-scale problem into a series of small-scale problems, GA is suitable for these sub-tasks. However, the poor convergence speed and accuracy of the traditional GAs will increase the total time consumption of the new framework. In this section, a novel IGA is introduced to fast and precisely solve small-scale TSPs and WSPs with the following key modifications: a hybrid selection algorithm is introduced; a selective bidirectional heuristic crossover is adopted to speed up the convergence; a hybrid mutation operator is suggested to jump the local optimal; and a simplified 2-opt is used to balance the convergence speed and global searching capability.

3.1. Path Encoding and Population Initialization

Path encoding is the fundamental task involved in using GA. Due to the conclusion in [60], one of the most intuitive and high-performance route encoding methods for TSPs is path representation. In path representation, all cities are encoded as unique integers and arranged into a chromosome. The position in the chromosome indicates the visited order of the city, that is, for i , j = 1 , 2 , , n , if city i is the j-th element in a chromosome, then city i is the j-th to be traveled. The initial population will impact both the rate of convergence and the capacity of global searching for GA. In this study, the initial population is generated randomly, and then a 2-opt local search is applied to improve the quality of the initial population.

3.2. Fitness Function and Selection Operator

The role of the selection operator is to choose some eligible chromosomes for the next generation; a decent selection operator will help to converge rapidly and prevent local optimal, but a poor one will not. Because the objective values of TSPs are not stable, a proper transformation for the objective values is required, which is called the fitness function [46].
Assuming there are N individuals in the population, C i is the i individual, L ( C i ) represents the tour length of C i , and f ( C i ) denotes the fitness value of C i . Some well-known fitness functions are as follows:
  • Reciprocal-based fitness function is one of the most used fitness functions; it is the reciprocal of objective function value:
    f ( C i ) = 1 / L ( C i ) .
  • A linear order-based fitness function that sorts individuals in ascending order by objective function values, where R ( C i ) denotes the order of C i . Then, f ( C i ) presented by:
    f ( C i ) = N R ( C i ) N .
  • Nonlinear order-based fitness function also sorts the individuals, but f ( C i ) is defined by:
    f ( C i ) = α ( 1 α ) R ( C i ) 1 ,
    where α is a constant in [ 0.01 , 0.3 ] .
Some deserving individuals will be picked for the following generation once all the fitness values of individuals have been evaluated. Once all fitness values of individuals have been confirmed, some good individuals will be selected for the next generation. The most common selection method is roulette wheel selection. If M individuals must be chosen for the next generation, see the detailed steps in Algorithm 1.
Algorithm 1 Roulette wheel selection.
  • Input: A set of N individuals, the number of selected requirements M, current iteration number of GA I t e r .
  • Output: A set of M selected individuals.
for  I t e r = 1 To M do
   Calculate the selection probability of C i :
p ( C i ) = f ( C i ) j = 1 2 N f ( C j ) .
   Generate a random number P between 0 and 1.
   Select the first C j satisfied P h = 1 j p ( C h ) .
   Remove C j from the population.
end for
The pseudo-code of the proposed hybrid selection algorithm is shown in Algorithm 2.
Algorithm 2 Hybrid selection algorithm.
  • Input: A set of N individuals, the number of selected requirements M, current iteration number of GA I t e r .
  • Initialize parameters:  α = 0.15 , and r 1 , r 2 are two random numbers.
  • Output: A set of M selected individuals.
Calculate the objective value for each individuals.
if  r 1 1 / I t e r   then
   if  r a n d r 2  then
     Calculate fitness values by nonlinear order-based fitness function.
     Calculate fitness values by linear order-based fitness function.
   end if
   Select M individuals by roulette wheel selection.
   Calculate fitness values by reciprocal-based fitness values.
   Select M individuals according to the smallest fitness values.
end if

3.3. Selective Bidirectional Heuristic Crossover

The crossover operation is the primary role of GA in producing new offspring. As stated in Section 2.1, there are numerous crossover operators proposed for path representation. Recently, Zhang et al. [46] presented a novel BHX, and the numerical results show its excellent effectiveness in enhancing the quality of the offspring.
The drawback of the BHX is that two parents will only have one unique offspring, which will reduce the size of the population gradually. Hence, a method of enriching the population must be developed to use BHX. It is known that monogamy is not the only type of mating system in nature; polygynandry is another prevalent mating system in species that live in troupes. An individual can mate with several individuals, and the number of mates is governed by individual quality. Inspired by the polygynandry mating system, a selective bidirectional heuristic crossover (SBHX) has been developed, in which the good gene of a parent may be preserved for two or more offspring.
Algorithm 3 depicts the main steps of SBHX.
Algorithm 3 Selective bidirectional heuristic crossover.
  • Input: A set of N individuals, the number of selected offspring M, current iteration number I t e r .
  • Output: A set of M selected individuals.
Calculate the reciprocal-based fitness f ( C i ) of each individual C i .
for  I t e r = 1 to M / 2  do
Apply Algorithm 1 to select two individuals C 1 and C 2 .
The start and end points are connected in C 1 and C 2 , and then each chromosome becomes a ring. Let O 1 and O 2 represent the two rings.
Randomly generate a start city s between 1 and n, and a blank offspring C n e x t .
   while  C n e x t is not filled up do
Starting from s in O 1 , searching for the first city O 1 r that C n e x t has not yet visited on the right, and O 1 l on the left.
     Similarly to the last operation, remark the two cities as O 2 r and O 2 l .
     Compute the distance between s and the four feasible cities.
   Choose the nearest city to s and replace s as the selected city.
   end while
end for

3.4. Mutation Operator

The mutation operator is another important phase of GA. Similar to how genetic mutations never stop happening and are essential to biodiversity, the mutation operator also enriches population diversity, which prevents the GA from falling into a local optimal. Lots of swap, inversion, and heuristic mutation operators have been applied in GA for TSPs; see [36,46]. Suppose that there are n cities in the i-th individual C i ; to employ the swap or inversion mutation operator, two integers p 1 and p 2 between [ 1 , n ] will be generated first. In the swap operator, the two cities C i p 1 and C i p 2 are exchanged. In the inversion operator, the gene fragmentation between p 1 and p 2 is reversed.
As the heuristic mutation operators usually have high computational complexity, a hybrid mutation operator combined with a swap mutation operator and inversion mutation operator is proposed in this paper. Firstly, a mutation probability is set by hand, and then if individual C i has a chance to be mutated, the probability will control which mutation operator will be selected. The pseudo-code of the new mutation operator is shown in Algorithm 4.
Algorithm 4 Hybrid mutation operator.
  • Input: A population of N individuals.
  • Initialize parameters: The probability p of mutation, the probabilities r 1 and r 2 to select of mutation operator, r 1 r 2 .
  • Output: The population after mutation.
for  C i in population do
   if  r a n d < p  then
     Randomly generated q [ 0 , 1 ] .
     if  q > r 1  then
        The swap mutation operator is used for C i .
     else if  q > r 2  then
        The inversion mutation operator is used for C i .
     end if
  end if
end for

3.5. Simplified 2-Opt Local Optimization

k-opt is a well-known class of local optimization algorithms; here, k is an integer greater than 1. The first proposed and simplest algorithm of them is 2-opt, which was developed by Croes [68] for solving TSPs in 1958. Although k-opt have better quality than 2-opt when k > 2 , they involve high computational complexity. The 2-opt local optimization applied in GA can improve the quality of the current population and speed up the convergence under suitable parameters set. However, since BHX and 2-opt are heuristic algorithms with drawbacks in searching the global optimal, combining them will almost certainly result in premature convergence. In the proposed improved genetic algorithm, a simplified 2-opt (S_2-opt) is developed to enhance the quality of individuals after mutation. The pseudo-code of the S_2-opt for GA is shown in Algorithm 5. The simplified 2-opt operator has a simple iterative structure, and only one parameter must be set. It can avoid the local optimal by setting T to a small value or achieve a fast convergence speed by setting T to large.
Algorithm 5 Simplified 2-opt for GA.
  • Input: A population of N individuals.
  • Initialize parameters: Max iteration T for simplified 2-opt, the number n of cities in each individual.
  • Output: The optimized population.
for  C i in population do
   for h = 1 to T do
     Calculate the tour distance d 1 of C i .
     Randomly generated p 1 and p 2 in [ 1 , n ] .
     Inverse the gene fragment between p 1 and p 2 , set as C n e w .
     Compute the tour length d 2 of C n e w .
     if  d 1 > d 2  then
        Replace C i by C n e w .
     end if
   end for
end for
The main flow of the IGA can be seen in Figure 1; the stop condition of IGA is set as no improvement of solution in specified iterations. Since the WSP is a TSP with fixed start and end nodes, it can be solved as a TSP by setting the distance between the start node and the end node to M , where M is a large positive number [6]. With the help of this feature, the proposed IGA can also be employed to solve WSPs.

4. The Framework of ALC_IGA for Large-Scale TSPs

In recent years, some two-layered algorithms have been proposed, and they significantly reduce the time expenditure for large-scale TSPs [7,51]. Liang et al. [55] recently proposed a three-layered algorithm with k-means and indicated that it outperforms some two-layered algorithms by numerical experiments. Notwithstanding, both two-layered and three-layered algorithms may still have medium-scale or large-scale groups. Naturally, this will require a significant amount of time to solve the underlying problems. Thus, upgrading the two-layered and three-layered algorithms to the adaptive layered algorithm stands to reason.
We propose a brand new framework for adaptive layered clustering that takes into account the IGA created in the previous section. The framework is divided into two parts: the first is applying clustering and IGA to initialize the solution, and the second is optimizing the initial solution. Based on our new algorithm, the large-scale TSPs can be transformed into solving some TSPs and WSPs that are smaller than the specified size. The processing flows are illustrated in Figure 2, and the details of solution initialization and optimization are represented subsequently in Section 4.1 and Section 4.2.

4.1. Solution Initialization

In the solution initialization phase, we combine the adaptive layered clustering and IGA. For each cluster that is larger than the specified size, k-means will be applied to divide the problem into some small clusters and then determine the number of layers, visit order, entry cities, and exit cities of the sub-clusters. When the size of a cluster is smaller than the specified size, IGA is used to determine the Hamiltonian path from the entry node to the exit node within the cluster. When the size of a cluster is larger than the specified size, k-means is used again to split the cluster. These processes are repeated until the paths of all clusters are determined. Then, combining all sub-paths, and we obtain the initial feasible path.
The procedure of main steps of the solution initialization phase is illustrated in Figure 2. Its pseudo-code is given in Algorithm 6.
Algorithm 6 Solution initialization framework.
  • Input: A TSP problem G, the size N of G, the nodes are designated by c 1 , c 2 , , c N , a positive integer M, and denote the size of G i by S ( G i ) .
  • Output: The initial solution R ( G ) for TSP G.
if  S ( G ) M   then
   Apply IGA to solve G, and output the solution R ( G ) .
   Divide the problem G into k 1 clusters by k-means.
Denote the groups by { G 1 , G 2 , , G k 1 } , the coordinate vectors of centers are { V ( G 1 ) , V ( G 2 ) , , V ( G k 1 ) } , the sizes of groups marked as { S ( G 1 ) , S ( G 2 ) , , S ( G k 1 ) } .
   if  max { S ( G 1 ) , S ( G 2 ) , , S ( G k 1 ) } M  then
Set D i j as min k , h d ( c i k , c j h ) , where c i k G i , c j h G h , k { 1 , 2 , , S ( G i ) } , j { 1 , 2 , , S ( G h ) } .
Use IGA to solve the distance matrix M and record the visited order { O ( G 1 ) , O ( G 2 ) , , O ( G k 1 ) } .
Obtain the visited order { O ( G 1 ) , O ( G 2 ) , , O ( G k 1 ) } by IGA for solving { V ( G 1 ) , V ( G 2 ) , , V ( G k 1 ) } .
   end if
   for  G i in { G 1 , G 2 , , G k 1 }  do
     Find the last visit group G h and the next visit group G j .
Set G i e n t r y as the nearest city in G i to G h , and set G i e x i t as the nearest city to G j .
     if  G i e n t r y = G i e x i t  then
        Set G i e x i t as the second nearest city to G j .
     end if
   end for
   while some groups are unsolved do
     for  G i in { G 1 , G 2 , }  do
        if  G i is unsolved then
          if  S ( G i ) M  then
             Apply IGA to obtain the shortest route from G i e n t r y to G i e x i t .
             Divide the G i into k i h clusters by k-means.
Denote the groups by { G i 1 , G i 2 , , G i k i h } , the coordinate vectors of centers are { V ( G i 1 ) , V ( G i 2 ) , , V ( G i k i h ) } , the sizes of groups marked as { S ( G i 1 ) , S ( G i 2 ) , , S ( G i k i h ) } .
Find the visited order { O ( G i 1 ) , O ( G i 2 ) , , O ( G i k i h ) } by the same method in lines 6–11.
Set the entry and exit cities of each groups by the same method mentioned in lines 12–18.
          end if
        end if
     end for
   end while
Organize the visit orders, entry cities, exit cities, and the internal route of each cluster, and output the initial feasible path R ( G ) .
end if
Remark 2.
We point out that there are many different clustering techniques, which makes it hard to select the ideal clustering strategy for TSPs. The results in [64] indicate that the simple grid-based methods are better than the k-means methods. Because the numerical experiments are only focused on one particular instance, we still use the standard k-means as models.
An example of a 100-cities TSP and M set to 20 is shown in Figure 3. In the first layer, the cities have been divided into two groups G 1 , G 2 by k-means, and the visit order found by IGA is O ( G 1 ) = 1 and O ( G 2 ) = 2 . On the one hand, since the size of G 2 equals M, the visit route P ( G 2 ) of the 20 cities in G 2 could be solved by IGA quickly. On the other hand, because there are 80 cities in G 1 , that is larger than M, so G 1 needs to be divided into small groups again. Repeat the procedures are until all of the group sizes are less than M, resulting in six groups and four layers being determined during the solution initialization phase. To combine the six routes, first, from the bottom layer, connect P ( G 1311 ) with P ( G 1312 ) sequentially, and obtain P ( G 131 ) = { P ( G 1311 ) , P ( G 1312 ) } . Then, in the third layer, connect P ( G 131 ) with P ( G 132 ) , then P ( G 13 ) = { P ( G 131 ) , P ( G 132 ) } . Following these steps, the path for the 100-cities TSP is eventually { P ( G 1311 ) , P ( G 1312 ) , P ( G 132 ) , P ( G 11 ) , P ( G 12 ) , P ( G 2 ) } .

4.2. Two Phases 2-Opt for Solution Optimization

Because of the clustering algorithm used, the solution obtained in the solution initialization stage is a little rough and can be continue to be optimized. In [66], Liao and Liu first applied the 2-opt and 3-opt operators to optimize the initial route with the clustering algorithm involved, and the numerical studies show a marked improvement when k-opt is used. Nevertheless, when the number of cities in the problem is exceptionally enormous, the k-opt struggles to work.
To improve the quality of the initial solution in an affordable time, a two-phase simplified 2-opt algorithm (TS_2-opt) is given in Algorithm 7. The TS_2-opt is aimed to optimize the routes and orders of all the groups which belong to a cluster at a higher layer. Once the solution is initialized, TS_2-opt is used to optimize the route of each group in the penultimate layer and repeated layer by layer until the top layer is optimized. Depicted in Figure 3, the green lines show the workflow of solution optimization. Firstly, from the bottom layer, the routes P ( G 1311 ) and P ( G 1312 ) are combined by TS_2-opt to the local optimal routes P ( G 131 ) o p t . Then, the two routes in the third layer also are optimized to P ( G 13 ) o p t by using TS_2-opt. Follow these steps until the final solution P ( G ) o p t is obtained.
Algorithm 7 Two-phase simplified 2-opt algorithm.
  • Input: A batch of groups { G i j 1 , G i j 2 , , G i j h } , suppose the order of them is 1 , 2 , , h , and the travel routes of them { P ( G i j 1 ) , P ( G i j 2 ) , , P ( G i j h ) } .
  • Initialize parameters: The first phase max iteration L 1 ; the second phase max iteration L 2 ; the length selected for optimization R.
  • Output: An optimized route P ( G i j ) for G i j .
Compute the distance d b k s of the tour { P ( G i j 1 ) , P ( G i j 2 ) , , P ( G i j h ) } .
for  i t e r 1 = 1 to L 1  do
   Randomly generated two different integers p 1 , p 2 between [ 2 , h 1 ] .
Denote the route between G i j p 1 and G i j p 2 as P p 1 p 2 ; denote the route between G i j 1 and G i j p 1 1 as P 1 p 1 1 ; denote the route between G i j p 2 and G i j h as P p 2 + 1 h .
   Inverse P p 1 p 2 , denote the new route as I n v ( P p 1 p 2 ) .
Generate two routes P 1 and P 2 , where P 1 is combined by the last R elements of P 1 p 1 1 and the first R elements of I n v ( P p 1 p 2 ) ; P 2 is combined by the last R elements of I n v ( P p 1 p 2 ) and the first R elements of P p 2 + 1 h . Denote the new order of groups as { O ( G i j 1 ) , O ( G i j 2 ) , , O ( G i j h ) } , the sizes of groups is noted as { S ( G i j 1 ) , S ( G i j 2 ) , , S ( G i j h ) } .
The Algorithm 5 with max iteration number L 2 is applied to optimize P 1 and P 2 . Denote the new routes as P 1 o p t and P 2 o p t .
Replace P 1 and P 2 in { P 1 p 1 1 , I n v ( P p 1 p 2 ) , P p 2 + 1 h } with P 1 o p t and P 2 o p t , respectively. Denote the new route as P o p t .
   Compute the distance d o p t of P o p t .
   if  d b k s > d o p t  then
     Assign d o p t to d b k s .
Divide P o p t into h segments { P m 1 , P m 2 , , P m h } , here S ( P m k ) is equal to { S ( G i j r ) | r = m k } .
   end if
Replace { P ( G i j 1 ) , P ( G i j 2 ) , , P ( G i j h ) } by { P m 1 , P m 2 , , P m h } .
end for
Output R = P o p t .
Suppose there are three groups { G 11 , G 12 , G 13 } belonging to the same higher group G 1 , and the visit orders of them are { 2 , 3 , 1 } , respectively. Figure 4 illustrates the major processing of TS_2-opt in detail. Each cluster is represented by a different color, whereas the start and end locations are marked by larger shapes. In Step 1 of Figure 4, the three routes are arranged by order and assume the G 11 is chosen, then the path of G 11 is inverted. In Step 2, the segments at the junctions of the clusters are determined according to R, where R equals 5 for simplicity. The next step is to optimize the two segments provided by Step 2. In Step 4, three new routes are generated according to Step 3 and the input routes. Once all four steps have been completed, return to Step 1 until the termination condition is met.
We note that the purpose of the TS_2-opt is not to reach the global optimal, but rather to optimize the visit orders and junctions between groups that belong to the same group at the higher layer. Despite sacrificing some precision, the computation speed of TS_2-opt is very fast, which is critical in large-scale TSPs.

4.3. Parallelizability and Computational Complexity Analysis

We show the highly parallelizable capability of the proposed ALC_IGA. In the phase of solution initialization, the operations for clusters are independent in each layer; the operations of subgroups that do not belong to the same cluster in different layers are also independent. As an illustration, there are three tasks in the third layer shown in Figure 3; find the visit route for G 11 and G 12 , and apply k-means to divide G 13 into small groups. As they are stand-alone, if there are three or more cores of the CPU, they can be computed on different cores simultaneously. Furthermore, if k-means is faster than the other two tasks, then the computations of G 131 and G 132 in the next layer can also be allocated to the free cores even if P ( G 11 ) and P ( G 12 ) are still being calculated.
In the second phase of ALC_IGA, solution optimization also can be parallelized, but the parallel effectiveness is not as high as in the first phase. Firstly, the complex calculation in solution optimization is only the optimization of the junctions, but there are only two junctions in each iteration, so parallel computing is unnecessary. Secondly, the optimization of the solution starts from the bottom and ends at the top layer, but the higher-layer optimizations must wait for lower-layer optimizations to finish. In the example shown in Figure 3, there is only one task in the fourth layer, which is connecting G 1311 and G 1312 . Because the route of G 131 is not determined before the computation of the fourth layer is finished, the free cores can not be used to combine G 131 and G 132 in the third layer.
Notwithstanding, parallel techniques can be used in each layer to speed up computation while the scale of the problem is very large. The computational complexity of the major stages of the proposed ALC_IGA is presented in the remainder of this subsection.
We recall that the time complexity of k-means is known as O ( N K I D ) , where N is the number of points, K is the number of clusters, I is the specified max iterations, and D is the number of dimensions. For the sake of simplicity, we assume that there are n nodes in the TSP, and m and k are two positive integers, T 1 is the max run time of the IGA for solving m-nodes TSP, I and D are fixed. After that, we look at the time complexity in two parts.
In the best-case scenario, we assume that n = m k , and each use of clustering divides the cluster into m sub-clusters, where the number of nodes of each sub-cluster is equal. Firstly, in the second layer, the IGA well is used once to obtain the visited cluster order, and in the third layer, it is m times. We deduce that the total times of IGA are 1 + m + m 2 + + m k 1 , and by n = m k we have n 1 m 1 , then the upper bound of the total time of IGA is n 1 m 1 T 1 , which is O ( n ) . Secondly, in the top layer, the time complexity of k-means is O ( n m ) ; in the second layer, the time complexity of k-means is O ( n m m ) m , which is O ( n m ) . Subsequently, we can infer that the time complexity of each layer is always O ( n m ) . Note that when there are k = log m n layers, then the total time complexity of ALC_IGA is O ( m n log m n ) , and since the m is a given constant, the time complexity of ALC_IGA is O ( n log n ) .
In the worst case, each cluster ends up with m 1 groups that contain a single city and a single group that contains all the other cities. It can be seen that in this condition, the numbers of k-means and IGA are both far more than the best scenario. Suppose n = k ( m 1 ) + m , then there will be k times clustering and k + 1 times IGA. The time of IGA applied is no more than ( k + 1 ) T 1 , it is O ( n ) . Similar to the best-case analysis, the computational complexity of clustering in the worst condition is O ( m n ) + O ( m ( n ( m 1 ) ) ) + + O ( m ( n ( k 1 ) ( m 1 ) ) ) ; by some calculation, we obtain that the time complexity of the k-means used is O ( n 2 ) . Accordingly, the computational complexity of ALC_IGA in the worst condition is O ( n 2 ) .
In summary, the computational complexity of the ALC_IGA ranges from O ( n log n ) to O ( n 2 ) . The computational complexity of ALC_IGA is closer to O ( n log n ) , however, in the majority of cases. This is supported by the numerical experiments presented in Section 5.
Remark 3.
Comparing with the algorithms in [7,51,55], we note briefly that ALC_IGA exhibits several innovations and advantages as follows:
  • As a tool for solving sub-TSPs, IGA has been improved in some aspects based on existing techniques, and has shown significant improvements compared to GA [51] and ACS [7] on small-scale TSP problems; see the experiments in Section 5.
  • ALC_IGA only requires attention to one parameter: the maximum number of clusters for k-means. This simplicity is more convenient than that of two- or three-layered algorithms and is crucial for solving large-scale TSPs.
  • Based on the characteristics of layered-clustering computation, we have proposed a fast fine-tuning algorithm; this step has not been introduced in [7,51,55].
  • By applying adaptive layered clustering, we are able to analyze the time complexity of ALC_IGA, which is still challenging to in the case of two or three-layered algorithms.

5. Numerical Results and Discussions

Four-part numerical experiments are presented in this paper to illustrate the effectiveness of ALC_IGA. First, Section 5.4 shows that IGA is substantially superior to GA and ACS in terms of accuracy and convergence speed. The implications of the primary parameter setting performance on ACL_IGA are examined in the second part. The third part proves the superiority of ALC_IGA on middle-scale benchmark datasets over two two-layered algorithms from the literature. The last part proves the excellent performance and parallelizability of the proposed ALC_IGA in comparison to some representative algorithms.

5.1. Experimental Setting

In this study, all experiments were computed on a Dell PowerEdge R620 with two Intel Xeon E5-2680V2 10-core processors and 64.0 GB of 1066 MHz DDR3 memory under Windows 10 OS. The speed of all cores is locked to 2.80 GHz without turbo boost technology and disabled hyperthreading to ensure the fairness and stability of the numerical experiments. All the programs are edited and run on MATLAB R2020a, the used parallel technique is the parallel computing toolbox in MATLAB, and only the experiments in Section 5.7 were run in parallel. By default, each instance was computed 20 times under the same setting. In detail, if the algorithm was single-threaded, the instance on 20 cores was executed simultaneously; if the algorithm was multi-threaded, they were run one by one. The sources of GA, ACS [27], IGA, two-level genetic algorithm (TLGA) [51], TLACS [7], and ALC_IGA are published on GitHub (, published on 4 January 2023), and the instances involved are also on this repository.

5.2. Benchmark Instances

Numerous instances are used to study the effectiveness of the proposed IGA and ALC_IGA. The major instances come from three sources: the famous benchmark TSP datasets TSPLIB (, accessed on 30 October 2022); the TSP test data gathered by William Cook for large instances (, accessed on 30 October 2022); hard to solve instances of the Euclidean TSPs (TNM) [69]. The TSP test data used in this research can be divided into three categories: National TSPs; VLSI TSPs; and Art TSPs. Moreover, the TNM data were generated by the C++ source provided by the authors of [69]. A two-dimensional Santa (, accessed on 30 October 2022) and a three-dimensional Gaia (, accessed on 30 October 2022) with millions of nodes were also investigated.
For various experimental tasks, the instances are classified into three categories: small-scale TSPs ( n 500 ) , medium-scale TSPs ( 500 < n 4 × 10 4 ) , and large-scale TSPs ( n > 4 × 10 4 ) . Small-scale TSPs were used to study the effectiveness of IGA, middle-scale TSPs were employed to tune parameters and compare ALC_IGA with TLACS and TLGA in a single thread, and large-scale TSPs were adopted to compare ALC_IGA with some relevant algorithms in parallel and verify the efficiency of ALC_IGA.

5.3. Evaluation Criteria

The following are the evaluation criteria for the algorithmic analyses on instances:
  • The minimum objective value among all runs: R b e s t .
  • The average objective value among all runs: R a v g .
  • The standard deviation of results among all runs: R s t d .
  • The best known solution of the instance: B K S .
  • The deviation percentage of R b e s t is defined by:
    P D b e s t = R b e s t B K S B K S × 100 % .
  • The deviation percentage of R a v g is defined by:
    P D a v g = R a v g B K S B K S × 100 % .
  • The running time T R b in seconds while R b e s t was found.
  • The average of the running time in seconds among all runs: T a v g .
  • The count of the best R b e s t , R a v g , R s t d , and T a v g are denoted as C R b , C R a , C s t d , and C T a .

5.4. Performance Comparison of IGA, GA, and ACS

In addition to clustering, the most time-consuming part of ALC is eliminating the sub-TSPs. That is why the IGA proposed. To illustrate that IGA is efficient on TSPs, a comparison of IGA, GA, and ACS is imperative, and 42 small-scale benchmark instances were used in this numerical comparison. The parameters setting of IGA were as follows: the population was set to 0.4 times the number of nodes; the maximum number of iterations for S_2-opt was set to 20 times the number of nodes; the parameters of selection operator, r 1 and r 2 , were set to 0.15 and 0.5; and the probability of mutation was set to 0.05. The population size of GA was set to 0.8 times the size of the instance and the mutation number was always set at three individuals. The parameters setting of ACS is as same as the literature [7]. Finally, the termination condition for the three compared algorithms is when there has been no improvement in the population for X iterations. In this experiment, X were set to 100, 100, and 10 4 for IGA, ACS, and GA, respectively. The results of the comparison without parallelization are displayed in Table 2, and various evaluation criteria were considered, including R b e s t , P D b e s t , R a v g , P D a v g , R s t d , T R b , T a v g , C R b / C R a / C s t d / C T a , and the average value for P D a v g , R s t d , and T a v g .
From Table 2, the C R b / C R a / C s t d / C T a of IGA, GA, and ACS are 42 / 42 / 39 / 41 , 2 / 0 / 0 / 0 , and 1 / 0 / 3 / 1 , respectively. It is clear that the innovative IGA consistently produces superior results over GA and ACS. Additionally, the average computation time of IGA is the least in 97% instances, and its stability also has a far higher level than the other two algorithms. More specifically, the average P D b e s t of IGA is 0.27%, but GA and ACS are 2.79% and 5.19%, respectively, 10 times and 19 times of IGA. In almost all cases, the P D a v g of IGA is less than 2%, but GA and ACS are often greater than 5%, especially ACS, and even greater than 10% in some instances. In the view of stability, the average of the evaluation criteria R s t d of IGA is 125.45, only 22.56% of GA and 63.52% of ACS. The average computation time of IGA is 90.43 s, which is less than one-sixth as long as GA or half as long as ACS. The above discussion indicates that all the accuracy and the convergence speeds of IGA are substantially superior to the traditional GA and ACS, which proves that the proposed IGA can reduce the computation time and improve the solution of ALC_IGA.
In Figure 5, the convergence speeds of IGA, GA, and ACS are compared under four instances with sizes ranging from 51 to 226. It can be observed that the convergence speed of IGA in the initial stage is much faster than that of GA and ACS. This is due to the heuristic crossover SBHX and the local search S_2-opt combined in IGA.
We know that the suggested IGA can be utilized to solve WSP as stated in Section 3, with just a minor adjustment to the distance between the start and end cities. In this part, to validate the effectiveness of IGA for WSP, the 42 instances in Table 2 were re-investigated. The start and end cities of these instances were determined using the first and last elements of the best known solutions provided by TSPLIB and TSP test data, and the distances between start and end cities were set to − 10 5 . The benchmark algorithm is the famous TSP solver LKH proposed by Helsgaun [49]. The results, which include R b e s t , P D B e s t , R a v g , P D a v g , R w o r s t , R s t d , T R b , and T a v g are shown in Table 3.
It is clear from Table 3 that the IGA can produce the solution of WSP with a high level of accuracy. We note that all P D b e s t are lower than 1% and 18 out of 42 are as good as LKH. The P D b e s t of 25 out of 42 instances produced by IGA are less than 0.1%, and all the P D b e s t are lower than 1%. The outcomes on WSPs are even superior to those of IGA on TSPs in some aspects. In detailed, the averages of P D b e s t , R s t d , and T a v g are 0.2%, 134.28, and 81.83, respectively. By comparison, they are 0.27%, 125.45, and 90.43 on TSPs, that indicating that the IGA is able to find better solutions on WSPs in a shorter time than on TSPs. Especially on d493, the average execution time T a v g of IGA on WSPs is only 473.19, whereas it is 650.09 on TSPs.
According to the aforementioned analyses, the proposed IGA significantly outperforms GA and ACS in terms of convergence speed, solution quality, and stability. Additionally, on the WSP, which appeared more often in ALC_IGA, IGA also performed very well.

5.5. Parameters Tuning for ALC_IGA

The solution initialization phase of ALC_IGA shown in Section 4.1 shows that the main parameter of ALC_IGA in only the first phase is M, which limits the time required to solve TSP or WSP less than T 1 . The results from the previous subsection show that, under ordinary situations, the IGA can handle TSPs with less than 100 nodes in 6 s and solve TSPs with less than 150 nodes in 20 s. Consequently, a decent M should not go beyond 150 too much. In order to choose a favorable M for ALC_IGA to balance the computation time and quality of solution, numerical comparison of M was set to 50, 100, and 150 on 45 instances, which are considered in this subsection. These instances were medium-scale, with sizes ranging from 1.3 × 10 3 to 2.5 × 10 4 . Due to the fact that the distribution of nodes greatly affects the clustering effect, in order to fairly study the influence of M on the results of ALC_IGA, a variety of instances coming from TSPLIB, TSP test data, and TNM data were studied in this experiment. In the following subsections of this paper, the termination condition of IGA is set to when there has been no improvement in the population for 30 iterations, and the other parameters are as same as in the last Section 5.7. Denote the ALC_IGA with M = 50 , 100 , 150 as ALC_IGA50, ALC_IGA100, and ALC_IGA150, respectively; the major five evaluation criteria R b e s t , P D b e s t , R a v g , P D a v g , T a v g and C R b / C R a / C T a of the results, which ran without parallelization, are presented in Table 4.
From Table 4, the C R b / C R a / C T a of the ALC_IGA50, ALC_IGA100, and ALC_IGA150 are 3 / 3 / 45 , 5 / 4 / 0 , and 37 / 38 / 0 , respectively. As can be seen, the ALC_IGA50 is the fastest, whereas the ALC_IGA150 algorithm usually produces the best results. When the size of instance is less than 2 × 10 3 , ALC_IGA50 has the minimum P D b e s t and P D a v g on fl1400, and ALC_IGA10 has the lowest P D b e s t on dca1389 and dkd1973. However, the P D b e s t and P D a v g of ALC_IGA150 on the three instances are all less than 10%, and this is still a respectable result. When the instance size is larger than 2 × 10 3 , the ALC_IGA50 and ALC_IGA100 only perform better than the ALC_IGA150 on TNM instances. Concerning specifics, the ALC_IGA50 works well on Tnm2002 and Tnm4000, the ALC_IGA100 excels on Tnm6001, Tnm8002, and Tnm10000, but the ALC_IGA150 provided the best result on the large instance of Tnm20002. The results of ALC_IGA150 are therefore superior to those of ALC_IGA50 and ALC_IGA100 in TSPLIB and TSP test data, and it is still a suitable approach for TNM data. The average of P D b e s t and P D a v g for the three algorithms shown at the bottom of Table 4 also support this.
Furthermore, considering the algorithms’ running times, the mean of T a v g of ALC_IGA50 is 91.02, which is three-fifths of the time taken by ALC_IGA100 and two-fifths of ALC_IGA-150. This indicates that the fastest algorithm is ALC_IGA50, and the ratio of running time hardly changes with the size of the instance. However, even the slowest proposed ALC_IGA150 could handle the 10 4 nodes instance with just approximately 10% deviation percentage in the same amount of running time as the IGA, which can only solve the instance with a size of roughly 400 nodes. The fastest ALC_IGA50, which is more than 60 times faster than the IGA, can deal with 2.5 × 10 4 nodes in the same amount of time. Thus, the high efficiency of ALC_IGA has been verified.
Figure 6 displays the deviation percentage of each run among all instances. It is noteworthy that for all three algorithms, most of the deviation percentages are under 20%. In particular, the deviation percentages of the ALC_IGA100 and ALC_IGA150 are less than 10% in the majority of instances. Furthermore, the figure also reveals that the ALC_IGA100 and ALC_IGA150 have many overlapping regions, indicating that the performance of the two algorithms is roughly equivalent.
Additionally, the relationship between the running time of ALC_IGA and the value of M is taken into account. The average execution time for the instances of the three algorithms is plotted in Figure 7 in different colors. In order to discuss the computational complexity of the algorithms, the exponential curve fitting for each group was calculated. Because the computation time of ALC_IGA150 is larger than the other two, its slope shown in the figure is undoubtedly the steepest. The approximated time complexities of ALC_IGA50, ALC_IGA100, and ALC_IGA150 are O ( n 0.9992 ) , O ( n 0.9958 ) , and O ( n 1.02 ) , respectively, which are all extremely close to the linear computational complexity O ( n ) . With 95% confidence bounds, the upper bound of the computational complexity for ALC_IGA50 is 1.0326, and the other two are 1.0963 and 1.151. The statistical outcomes of curve fitting are shown in Table 5. It can be seen that all three fitting models have high confidence, especially the R 2 of ALC_IGA50, which is over 0.99. The above results prove the computational complexity analysis of the proposed ALC_IGA in Section 4.3.
To sum up, the quality of the solution obtained by ALC_IGA has a strong relationship with the data distribution and the value of M. On the other hand, the larger M is set, the longer the computation time required by ALC_IGA according to the numerical experiments. In most cases, setting M to 100 is a typical compromise choice to balance computation time and quality.

5.6. ALC_IGA Compared with Two-Layered Algorithms

The effectiveness of ALC_IGA on medium-scale problems was confirmed in Section 5.5, although it is unclear whether it is superior to the other layered algorithms. To illustrate the performance of ALC_IGA, the proposed ALC_IGA was compared with two typical algorithms, which were TLGA [51] and TLACS [7]. The TLGA and TLACS were re-coded in Matlab, and to be fair, the running time and the solution quality were improved to be better than the literature. The main parameters were set as follows: the M of ALC_IGA was set to 100; the numbers of cluster centers of TLACS and TLGA were automatically adjusted according to the size of the instance; the termination conditions of ALC_IGA, TLACS, and TLGA were that when there has been no improvement of the solution for 30, 30, and 100 iterations, respectively. All of the algorithms were implemented in single-thread. There were 45 medium-scale instances whose sizes ranging from 1 × 10 3 to 4 × 10 5 were investigated in this experiment.
As is shown in Table 6, the evaluation criteria C R b / C R a / C T a of ALC_IGA are 41 / 40 / 30 , the C R b / C R a / C T a of TLACS are 4 / 5 / 15 , and C R b / C R a / C T a of TLGA are 0 / 0 / 0 . First of all, it is pointed out that TLGA has no advantage in all instances compared with the other two algorithms in terms of solution quality and convergence speed. The TLACS obtained the four best P D b e s t and five best P D a v g among all 45 instances. In detail, TLACS outperforms ALC_IGA on fl1400 and fl1577, but ALC_IGA defeats TLACS on fl3795. The other three instances where TLACS performs better are all hard-to-solve instances [69]. That is because the fewer clusters generated, the better solution produced, which is according to the results in Section 5.5. The averages of P D b e s t and P D a v g for ALC_IGA are 8.51 and 9.74, whereas for TLACS and TLGA, they are 12.89 and 14.10, and 88.84 and 102.43, respectively. The analyses above verify that the accuracy of ALC_IGA is superior to TLACS and TLGA in all scenarios except for TNM instances.
From Table 6, the average values of T a v g of ALC_IGA, TLACS and TLGA are 209.98, 489.48, and 1020.86 s. It can be seen that the proposed ALC_IGA is much faster than the other two algorithms. In detail, when the size of the instance is less than 4.5 × 10 3 , TLACS is faster than ALC_IGA in most cases. When the size of the instance is between 4.5 × 10 3 and 10 4 , the running times of ALC_IGA and TLACS are very close. When the size of the instance is larger than 10 4 , the proposed ALC_IGA has huge advantages, especially when the problem size is greater than 3 × 10 4 , as the computation time of ALC_IGA is less than one-third of TLACS and less than one-fifth of TLGA.
Figure 8 converts a large amount of data in Table 6 into an explicit image. The real lines represent the P D a v g and T a v g of ALC_IGA. It is closer to the horizontal axis, which means that the ALC_IGA has a high performance in accuracy and convergence speed. The results of the run times for ALC_IGA, TLACS, and TLGA with exponential curve fittings were O ( n 0.945 ) , O ( n 1.611 ) , and O ( n 1.221 ) . This reveals that the gap in computation time between ALC_IGA and the other two algorithms will increase as the size of the problem increases.

5.7. Results on Large-Scale TSP Instances

In this section, to investigate the performance of ALC_ IGA in large-scale instances, the new ALC_IGA is compared to the TLACS [7], an accelerating genetic algorithm evolution via ant-based mutation and crossover (ER-ACO) [32] and a 3L-MFEA-MP [55]. The ALC_IGA and TLACS were implemented in Matlab R2022a and parallelized by the parallel computing toolbox in Matlab. The ER-ACO was set on an AMD Ryzen 2700 CPU with 16 threads in parallel. The parallel 3L-MFEA-MP was coded in Python, and it was implemented on a server with a 24-core Intel Xeon CPU and 96 GB RAM. The sizes of the 15 involved instances range from 4 × 10 4 to 2 × 10 5 .
The results and five evaluation criteria R b e s t , P D b e s t , R a v g , P D a v g , and T a v g are shown in Table 7. Compared to ALC_IGA with TLACS, the advantage of ALC_IGA in running time is apparent again. The running time of ALC_IGA is roughly one-sixth of TLACS when the problem size is around 5 × 10 4 , but when the size approaches 2 × 10 5 , the running time of it is just one-ninth of TLACS. The performance of ALC_IGA is better than TLACS in most conditions, but TLACS works pretty well on TNM instances.
There are four instances compared with 3L-MFEA-MP; results shown in Table 7 reveal that the performance of it is very close to TLACS, and the difference between them in terms of P D b e s t and P D a v g is about 2%, whereas, compared with ALC_IGA, the 3L-MFEA-MP is far worse than it in terms of convergence speed and solution quality. On the involved six instances, the P D b e s t and P D a v g of the novel intelligence algorithm ER-ACO exceeded ALC_IGA by 2.5 times. Additionally, the proposed ALC_IGA runs significantly faster than ER-ACO.
Figure 9 shows the average computation times and deviation percentages of the four algorithms. It is clear that ALC_IGA performs well in most situations and is significantly faster than the others. According to the results illustrated in Section 5.5, the only drawback of ALC_IGA is on TNM instances, which can be improved by setting M larger.
Finally, the results of ALC_IGA under M set to 50, 100, and 150 for five huge instances are also given. The ara238025, lra498378, and lrb744710 are three instances containing hundreds of thousands of nodes, which are the very large-scale integration instances of TSP test data. The Santa, which has 1437195 cities, as a benchmark instance for large-scale TSPs, has been investigated thoroughly by several well-known solvers in [64]. Gaia was published by William Cook in 2019 and includes two million coordinates of stars.
Five evaluation criteria and the averages of them are presented in Table 8. It shows again that the larger the M set, the better the solution obtained and the longer computation time needed. For ALC_IGA50, ALC_IGA100, and ALC_IGA150, the averages of P D b e s t are 13.944, 11.122, and 10.308, respectively, which are extremely close to the average of P D a v g . This illustrates the strong stability of ALC_IGA, which the average of R s t d has also proven. While M was set to 50 or 100, the 1.4 × 10 6 nodes instance can be handled within 1 h on our implement, and even the large three-dimensional Gaia can be fixed within 1.5 h. Figure 10 depicts the best solutions obtained by the ALC_IGA with M = 100 .

6. Conclusions and Discussion

Inspired by two-layered [7,51] and three-layered [55] algorithms for TSPs, ALC_IGA with high parallelizability is proposed to solve large-scale TSPs with millions of nodes in this paper. In the first phase, ALC_IGA ensures that all sub-TSPs and sub-WSPs are smaller than the specified size through k-means repeatedly applied, thereby reducing the computation time. In the second phase, the TS_2-opt is developed to rapidly improve the initial solution. The IGA is also proposed for small-scale TSPs and WSPs, with the following significant modifications: the polygynandry-inspired SBHX is designed for high convergence speed; the S_2-opt for balancing convergence speed and falling into local optimum is created. According to the study, the computational complexity of ALC_IGA is between O ( n log n ) and O ( n 2 ) .
The numerical results on 42 instances show that the proposed IGA is better than both GA and ACS in terms of convergence speed and accuracy, and it performs better on WSP than on TSP. According to the numerical results on lots of instances from diverse sources, in most conditions, ALC_IGA outperforms TLGA, TLACS, and 3L-MFEA-MP and the novel ER-ACO in terms of precision, stability, and computation speed. The worst situation of ALC_IGA is on the hard-to-solve TSP instances, where the errors are still less than 20% and can be improved by adjusting the parameters.
Mariescu-Istodor and Fränti [64] compared three types of algorithms for solving the large-scale Santa problem within 1 h on an enterprise server without parallelization. They achieved a high-quality solution (111,636 km) using their LKH and grid clustering implement (, accessed on 20 March 2023), which outperforms the best result (121,831 km) obtained by ALC_IGA with parallelization. Moreover, it is worth noting that LKH without clustering achieved a 108,996 km solution, which is over 12% better than our result. As a result, we give the following suggestions for future research:
  • It is worth combining the adaptive layered clustering framework with LKH and some new techniques in [64] and other references.
  • Investigate the impact of different clustering algorithms on the quality of solutions.
  • Explore better tuning algorithm to enhance solution quality.
  • Extending ALC_IGA to tackle large-scale ATSPs, CTSPs, DTSPs, and other related problems would also be meaningful.

Author Contributions

Conceptualization, software, investigation, data curation, and writing—original draft preparation, H.X.; methodology, validation, formal analysis, and writing—review and editing, H.L. All authors have read and agreed to the published version of the manuscript.


This research received no external funding.

Data Availability Statement

The data involved in this study are available on (accessed on 4 January 2023).


We would like to express our thanks to the anonymous referees and editors for their valuable comments and advantageous suggestions, which improved the quality of this paper and will undoubtedly be of great help to our future research.

Conflicts of Interest

The authors declare no conflict of interest.


The following abbreviations are used in this manuscript:
TSPsTraveling salesman problems
ALC_IGA       Adaptive layered clustering framework with improved genetic algorithm
ATSPsAsymmetric TSPs
CTSPsClustered TSPs
DTSPsDynamic TSPs
MTSPsMultiple TSPs
WSPsWandering salesman problems
EAEvolutionary algorithm
ACOAnt colony optimization algorithm
ACSAnt colony system
SFLAShuffled frog leaping algorithm
SASimulated annealing algorithm
PSOParticle swarm optimization
GAGenetic algorithm
LKHAn implementation of the Lin–Kernighan heuristic developed by K. Helsgaun
PMXPartially mapped crossover
OXOrdered crossover
CXCycle crossover
SCXSequential constructive crossover operator
CMXCompletely mapped crossover operators
BHXBidirectional heuristic crossover operator
IGAImproved genetic algorithm
TLACSTwo-layered ant colony system algorithm
3L-MFEA-MPThe three-layered evolutionary optimization framework
SBHXSelective bidirectional heuristic crossover
S_2-optSimplified 2-opt
TS_2-optTwo phases simplified 2-opt algorithm
TLGATwo-level genetic algorithm
TNMHard to solve instances of the Euclidean TSPs
ER-ACOAccelerating genetic algorithm evolution via ant-based mutation and crossover


  1. Zgurovsky, M.Z.; Pavlov, A.A. Combinatorial Optimization Problems in Planning and Decision Making: Theory and Applications; Springer: Cham, Switzerland, 2018. [Google Scholar] [CrossRef]
  2. Öncan, T.; Altınel, I.K.; Laporte, G. A comparative analysis of several asymmetric traveling salesman problem formulations. Comput. Oper. Res. 2009, 36, 637–654. [Google Scholar] [CrossRef]
  3. Chisman, J.A. The clustered traveling salesman problem. Comput. Oper. Res. 1975, 2, 115–119. [Google Scholar] [CrossRef]
  4. Groba, C.; Sartal, A.; Vázquez, X.H. Solving the dynamic traveling salesman problem using a genetic algorithm with trajectory prediction: An application to fish aggregating devices. Comput. Oper. Res. 2015, 56, 22–32. [Google Scholar] [CrossRef]
  5. Cheikhrouhou, O.; Khoufi, I. A comprehensive survey on the multiple traveling salesman problem: Applications, approaches and taxonomy. Comput. Sci. Rev. 2021, 40, 100369. [Google Scholar] [CrossRef]
  6. Gutin, G.; Punnen, A.P. The Traveling Salesman Problem and Its Variations; Springer: New York, NY, USA, 2006. [Google Scholar] [CrossRef]
  7. Wu, Z.; Wu, J.; Zhao, M.; Feng, L.; Liu, K. Two-layered ant colony system to improve engraving robot’s efficiency based on a large-scale TSP model. Neural Comput. Appl. 2021, 33, 6939–6949. [Google Scholar] [CrossRef]
  8. Castellani, M.; Otri, S.; Pham, D.T. Printed circuit board assembly time minimisation using a novel bees algorithm. Comput. Ind. Eng. 2019, 133, 186–194. [Google Scholar] [CrossRef]
  9. Crişan, G.C.; Pintea, C.M.; Calinescu, A.; Pop Sitar, C.; Pop, P.C. Secure traveling salesman problem with intelligent transport systems features. Log. J. IGPL 2021, 29, 925–935. [Google Scholar] [CrossRef]
  10. Cacchiani, V.; Contreras-Bolton, C.; Escobar-Falcón, L.M.; Toth, P. A matheuristic algorithm for the pollution and energy minimization traveling salesman problems. Int. Trans. Oper. Res. 2021, 30, 655–687. [Google Scholar] [CrossRef]
  11. Baniasadi, P.; Foumani, M.; Smith-Miles, K.; Ejov, V. A transformation technique for the clustered generalized traveling salesman problem with applications to logistics. Eur. J. Oper. Res. 2020, 285, 444–457. [Google Scholar] [CrossRef]
  12. Wei, Z.; Xia, C.; Yuan, X.; Sun, R.; Lyu, Z.; Shi, L.; Ji, J. The path planning scheme for joint charging and data collection in WRSNs: A multi-objective optimization method. J. Netw. Ccomput. Appl. 2020, 156, 102565. [Google Scholar] [CrossRef]
  13. Eren, E.; Tuzkaya, U.R. Safe distance-based vehicle routing problem: Medical waste collection case study in COVID-19 pandemic. Comput. Ind. Eng. 2021, 157, 107328. [Google Scholar] [CrossRef]
  14. Xu, L.; Geman, D.; Winslow, R.L. Large-scale integration of cancer microarray data identifies a robust common cancer signature. BMC Bioinform. 2007, 8, 275. [Google Scholar] [CrossRef] [PubMed][Green Version]
  15. Roberti, R.; Toth, P. Models and algorithms for the asymmetric traveling salesman problem: An experimental comparison. EURO J. Transp. Logist. 2012, 1, 113–133. [Google Scholar] [CrossRef][Green Version]
  16. Chauhan, C.; Gupta, R.; Pathak, K. Survey of methods of solving TSP along with its implementation using dynamic programming approach. Int. J. Comput. Appl. 2012, 52, 12–19. [Google Scholar] [CrossRef]
  17. Volgenant, T.; Jonker, R. A branch and bound algorithm for the symmetric traveling salesman problem based on the 1-tree relaxation. Eur. J. Oper. Res. 1982, 9, 83–89. [Google Scholar] [CrossRef]
  18. Fischetti, M.; Salazar González, J.J.; Toth, P. A branch-and-cut algorithm for the symmetric generalized traveling salesman problem. Oper. Res. 1997, 45, 378–394. [Google Scholar] [CrossRef]
  19. Miliotis, P. Using cutting planes to solve the symmetric travelling salesman problem. Math. Program. 1978, 15, 177–188. [Google Scholar] [CrossRef]
  20. Bazylevych, R.; Kuz, B.; Kutelmakh, R.; Dupas, R.; Prasad, B.; Haxhimusa, Y.; Bazylevych, L. A parallel ring method for solving a large-scale traveling salesman problem. Int. J. Inf. Technol. Comput. Sci. 2016, 8, 5. [Google Scholar] [CrossRef][Green Version]
  21. Laporte, G. The traveling salesman problem: An overview of exact and approximate algorithms. Eur. J. Oper. Res. 1992, 59, 231–247. [Google Scholar] [CrossRef]
  22. Arora, S. Polynomial time approximation schemes for Euclidean TSP and other geometric problems. In Proceedings of the 37th Conference on Foundations of Computer Science, Burlington, VT, USA, 14–16 October 1996; pp. 2–11. [Google Scholar]
  23. Sebő, A.; Vygen, J. Shorter tours by nicer ears: 7/5-Approximation for the graph-TSP, 3/2 for the path version, and 4/3 for two-edge-connected subgraphs. Combinatorica 2014, 34, 597–629. [Google Scholar] [CrossRef]
  24. Rodeker, B.; Cifuentes, M.V.; Favre, L.M. An Empirical Analysis of Approximation Algorithms for Euclidean TSP. In Proceedings of the International Conference on Scientific Computing, Las Vegas, NV, USA, 13–16 July 2009. [Google Scholar]
  25. Ali, I.M.; Essam, D.; Kasmarik, K. A novel design of differential evolution for solving discrete traveling salesman problems. Swarm Evol. Comput. 2020, 52, 100607. [Google Scholar] [CrossRef]
  26. Deng, W.; Xu, J.; Zhao, H. An improved ant colony optimization algorithm based on hybrid strategies for scheduling problem. IEEE Access 2019, 7, 20281–20292. [Google Scholar] [CrossRef]
  27. Dorigo, M.; Gambardella, L.M. Ant colony system: A cooperative learning approach to the traveling salesman problem. IEEE Trans. Evol. Comput. 1997, 1, 53–66. [Google Scholar] [CrossRef][Green Version]
  28. Huang, Y.; Shen, X.; You, X. A discrete shuffled frog-leaping algorithm based on heuristic information for traveling salesman problem. Appl. Soft Comput. 2021, 102, 107085. [Google Scholar] [CrossRef]
  29. Ilin, V.; Simić, D.; Simić, S.D.; Simić, S.; Saulić, N.; Calvo-Rolle, J.L. A hybrid genetic algorithm, list-based simulated annealing algorithm, and different heuristic algorithms for travelling salesman problem. Log. J. IGPL 2022. [Google Scholar] [CrossRef]
  30. Zhong, Y.; Lin, J.; Wang, L.; Zhang, H. Discrete comprehensive learning particle swarm optimization algorithm with Metropolis acceptance criterion for traveling salesman problem. Swarm Evol. Comput. 2018, 42, 77–88. [Google Scholar] [CrossRef]
  31. Xu, Y.; Che, C. A Brief Review of the Intelligent Algorithm for Traveling Salesman Problem in UAV Route Planning. In Proceedings of the 2019 IEEE 9th International Conference on Electronics Information and Emergency Communication (ICEIEC), Beijing, China, 12–14 July 2019; pp. 1–7. [Google Scholar] [CrossRef]
  32. Chitty, D.M. Accelerating Genetic Algorithm Evolution via Ant-based Mutation and Crossover for Application to Large-scale TSPs. In Proceedings of the Genetic and Evolutionary Computation Conference Companion. Association for Computing Machinery, Boston, MA, USA; 2022; pp. 2046–2053. [Google Scholar] [CrossRef]
  33. Skinderowicz, R. Improving ant colony pptimization efficiency for solving large TSP instances. Appl. Soft Comput. 2022, 120, 108653. [Google Scholar] [CrossRef]
  34. Karafotias, G.; Hoogendoorn, M.; Eiben, Á.E. Parameter control in evolutionary algorithms: Trends and challenges. IEEE Trans. Evol. Comput. 2014, 19, 167–187. [Google Scholar] [CrossRef]
  35. Rego, C.; Gamboa, D.; Glover, F.; Osterman, C. Traveling salesman problem heuristics: Leading methods, implementations and latest advances. Eur. J. Oper. Res. 2011, 211, 427–441. [Google Scholar] [CrossRef]
  36. Wang, Y. The hybrid genetic algorithm with two local optimization strategies for traveling salesman problem. Comput. Ind. Eng. 2014, 70, 124–133. [Google Scholar] [CrossRef]
  37. Zhou, Y.; Luo, Q.; Chen, H.; He, A.; Wu, J. A discrete invasive weed optimization algorithm for solving traveling salesman problem. Neurocomputing 2015, 151, 1227–1236. [Google Scholar] [CrossRef]
  38. Créput, J.C.; Koukam, A. A memetic neural network for the Euclidean traveling salesman problem. Neurocomputing 2009, 72, 1250–1264. [Google Scholar] [CrossRef]
  39. Jain, R.; Singh, K.P.; Meena, A.; Rana, K.B.; Meena, M.L.; Dangayach, G.S.; Gao, X. Application of proposed hybrid active genetic algorithm for optimization of traveling salesman problem. Soft Comput. 2023, 27, 4975–4985. [Google Scholar] [CrossRef]
  40. Katoch, S.; Chauhan, S.S.; Kumar, V. A review on genetic algorithm: Past, present, and future. Multimed. Tools Appl. 2021, 80, 8091–8126. [Google Scholar] [CrossRef] [PubMed]
  41. Goldberg, D.E.; Lingle, R. Alleles, Loci, and the Traveling Salesman Problem. In Proceedings of the 1st International Conference on Genetic Algorithms, Pittsburgh, PA, USA, 1 July 1985; pp. 154–159. [Google Scholar] [CrossRef]
  42. Deep, K.; Mebrahtu, H. New variations of order crossover for travelling salesman problem. Int. J. Comb. Optim. Prob. Inf. 2011, 2, 2–13. [Google Scholar]
  43. Hussain, A.; Muhammad, Y.S.; Nauman Sajid, M.; Hussain, I.; Mohamd Shoukry, A.; Gani, S. Genetic algorithm for traveling salesman problem with modified cycle crossover operator. Comput. Intell. Neurosci. 2017, 2017, 7430125. [Google Scholar] [CrossRef]
  44. Zakir, H.A. Genetic algorithm for the traveling salesman problem using sequential constructive crossover operator. Int. J. Biom. Bioinf. 2010, 3, 96–105. [Google Scholar]
  45. Iqbal, Z.; Bashir, N.; Hussain, A.; Cheema, S.A. A novel completely mapped crossover operator for genetic algorithm to facilitate the traveling salesman problem. Comput. Math. Methods 2020, 2, e1122. [Google Scholar] [CrossRef]
  46. Zhang, P.; Wang, J.; Tian, Z.; Sun, S.; Li, J.; Yang, J. A genetic algorithm with jumping gene and heuristic operators for traveling salesman problem. Appl. Soft Comput. 2022, 127, 109339. [Google Scholar] [CrossRef]
  47. Alipour, M.M.; Razavi, S.N.; Feizi Derakhshi, M.R.; Balafar, M.A. A hybrid algorithm using a genetic algorithm and multiagent reinforcement learning heuristic to solve the traveling salesman problem. Neural Comput. Appl. 2018, 30, 2935–2951. [Google Scholar] [CrossRef]
  48. Ganesan, V.; Sobhana, M.; Anuradha, G.; Yellamma, P.; Devi, O.R.; Prakash, K.B.; Naren, J. Quantum inspired meta-heuristic approach for optimization of genetic algorithm. Comput. Ind. Eng. 2021, 94, 107356. [Google Scholar] [CrossRef]
  49. Helsgaun, K. An effective implementation of the Lin-Kernighan traveling salesman heuristic. Eur. J. Oper. Res. 2000, 126, 106–130. [Google Scholar] [CrossRef][Green Version]
  50. Huerta, I.I.; Neira, D.A.; Ortega, D.A.; Varas, V.; Godoy, J.; Asín-Achá, R. Improving the state-of-the-art in the traveling salesman problem: An anytime automatic algorithm selection. Expert Syst. Appl. 2022, 187, 115948. [Google Scholar] [CrossRef]
  51. Ding, C.; Cheng, Y.; He, M. Two-level genetic algorithm for clustered traveling salesman problem with application in large-scale TSPs. Tsinghua Sci. Technol. 2007, 12, 459–465. [Google Scholar] [CrossRef]
  52. Anaya Fuentes, G.E.; Hernández Gress, E.S.; Seck Tuoh Mora, J.C.; Medina Marín, J. Solution to travelling salesman problem by clusters and a modified multi-restart iterated local search metaheuristic. PloS ONE 2018, 13, e0201868. [Google Scholar] [CrossRef]
  53. Anantathanavit, M.; Munlin, M. Using K-means radius particle swarm optimization for the travelling salesman problem. IETE Tech. Rev. 2016, 33, 172–180. [Google Scholar] [CrossRef]
  54. Yang, J.; Yang, J.; Chen, G. Solving Large-Scale TSP Using Adaptive Clustering Method. In Proceedings of the 2009 Second International Symposium on Computational Intelligence and Design, Changsha, China, 12–14 December 2009; Volume 1, pp. 49–51. [Google Scholar] [CrossRef]
  55. Liang, A.; Yang, H.; Sun, L.; Sun, M. A three-layered multifactorial evolutionary algorithm with parallelization for large-scale engraving path planning. Electronics 2022, 11, 1712. [Google Scholar] [CrossRef]
  56. Yu, J.; You, X.; Liu, S. Dynamically induced clustering ant colony algorithm based on a coevolutionary chain. Knowl.-Based Syst. 2022, 251, 109231. [Google Scholar] [CrossRef]
  57. Honda, K.; Nagata, Y.; Ono, I. A parallel genetic algorithm with edge assembly crossover for 100,000-city scale TSPs. In Proceedings of the 2013 IEEE Congress on Evolutionary Computation, Cancun, Mexico, 20–23 June 2013; pp. 1278–1285. [Google Scholar] [CrossRef]
  58. Wang, Z.; Shen, Y.; Li, S.; Wang, S. A fine-grained fast parallel genetic algorithm based on a ternary optical computer for solving traveling salesman problem. J. Supercomput. 2022, 79, 4760–4790. [Google Scholar] [CrossRef]
  59. Grefenstette, J.; Gopal, R.; Rosmaita, B.; Van Gucht, D. Genetic algorithms for the traveling salesman problem. In Proceedings of the First International Conference on Genetic Algorithms and Their Applications, Pittsburgh, PA, USA, 24–26 July 1985; pp. 160–168. [Google Scholar]
  60. Larranaga, P.; Kuijpers, C.M.H.; Murga, R.H.; Inza, I.; Dizdarevic, S. Genetic algorithms for the travelling salesman problem: A review of representations and operators. Artif. Intell. Rev. 1999, 13, 129–170. [Google Scholar] [CrossRef]
  61. Davies, L. Genetic Algorithms and Simulated Annealing; Morgan Kaufmann: Los Altos, CA, USA, 1987. [Google Scholar] [CrossRef]
  62. Ulder, N.L.; Aarts, E.H.; Bandelt, H.J.; Van Laarhoven, P.J.; Pesch, E. Genetic Local Search Algorithms for the Traveling Salesman Problem. In Proceedings of the International Conference on Parallel Problem Solving from Nature, Dortmund, Germany, 1–3 October 1990; pp. 109–116. [Google Scholar] [CrossRef]
  63. Tsai, H.K.; Yang, J.M.; Kao, C.Y. Solving Traveling Salesman Problems by Combining Global and Local Search Mechanisms. In Proceedings of the Evolutionary Computation on 2002, Honolulu, HI, USA, 12–17 May 2002; pp. 1290–1295. [Google Scholar] [CrossRef]
  64. Mariescu-Istodor, R.; Fränti, P. Solving the large-scale TSP problem in 1 h: Santa Claus challenge 2020. Front. Robot. AI 2021, 8, 689908. [Google Scholar] [CrossRef] [PubMed]
  65. Phienthrakul, T. Clustering evolutionary computation for solving travelling salesman problems. Int. J. Adv. Comput. Sci. Inf. Technol. 2014, 3, 243–262. [Google Scholar]
  66. Liao, E.; Liu, C. A hierarchical algorithm based on density peaks clustering and ant colony optimization for traveling salesman problem. IEEE Access 2018, 6, 38921–38933. [Google Scholar] [CrossRef]
  67. Englert, M.; Röglin, H.; Vöcking, B. Worst case and probabilistic analysis of the 2-Opt algorithm for the TSP. Algorithmica 2014, 68, 190–264. [Google Scholar] [CrossRef][Green Version]
  68. Croes, G.A. A method for solving traveling-salesman problems. Oper. Res. 1958, 6, 791–812. [Google Scholar] [CrossRef]
  69. Hougardy, S.; Zhong, X. Hard to solve instances of the Euclidean traveling salesman problem. Math. Program. Comput. 2021, 13, 51–74. [Google Scholar] [CrossRef][Green Version]
Figure 1. Flowchart of the proposed IGA.
Figure 1. Flowchart of the proposed IGA.
Electronics 12 01681 g001
Figure 2. Main steps of the novel ALC_IGA.
Figure 2. Main steps of the novel ALC_IGA.
Electronics 12 01681 g002
Figure 3. An example of the ALC_IGA on a 100 nodes instance. The black lines represent the solution initialization phase, and the green lines denote the solution optimization phase.
Figure 3. An example of the ALC_IGA on a 100 nodes instance. The black lines represent the solution initialization phase, and the green lines denote the solution optimization phase.
Electronics 12 01681 g003
Figure 4. The major processes of TS_2-opt for optimizing three subgroups.
Figure 4. The major processes of TS_2-opt for optimizing three subgroups.
Electronics 12 01681 g004
Figure 5. Comparison of the convergence speed of IGA, GA, and ACS on eil51 (a), lin105 (b), ch150 (c) and pr226 (d).
Figure 5. Comparison of the convergence speed of IGA, GA, and ACS on eil51 (a), lin105 (b), ch150 (c) and pr226 (d).
Electronics 12 01681 g005
Figure 6. The deviation percentage of each run on 45 medium-scale instances with M set to 50, 100, and 150.
Figure 6. The deviation percentage of each run on 45 medium-scale instances with M set to 50, 100, and 150.
Electronics 12 01681 g006
Figure 7. Computational complexity analysis of the proposed ALC_IGA in single thread.
Figure 7. Computational complexity analysis of the proposed ALC_IGA in single thread.
Electronics 12 01681 g007
Figure 8. The computation time analysis of the proposed algorithm; TLGA and TLACS in single thread.
Figure 8. The computation time analysis of the proposed algorithm; TLGA and TLACS in single thread.
Electronics 12 01681 g008
Figure 9. The computation time of the compared algorithms with parallelization on large-scale TSPs.
Figure 9. The computation time of the compared algorithms with parallelization on large-scale TSPs.
Electronics 12 01681 g009
Figure 10. Visualization of the best solutions obtained by the ALC_IGA with M = 100 on ara238025 (a), lra498378 (d), lrb744710 (c), santa1437195 (d) and gaia2079471 (e).
Figure 10. Visualization of the best solutions obtained by the ALC_IGA with M = 100 on ara238025 (a), lra498378 (d), lrb744710 (c), santa1437195 (d) and gaia2079471 (e).
Electronics 12 01681 g010
Table 1. The results of LKH with single core on some large-scale TSPs.
Table 1. The results of LKH with single core on some large-scale TSPs.
InstanceBKSAscent (s)Preprocessing (s)LKH (s)Total (s)Solution
Table 2. Results obtained by IGA, GA, and ACS on 42 small-scale instances.
Table 2. Results obtained by IGA, GA, and ACS on 42 small-scale instances.
Instance IGA GA ACS
NameBKS R best PD best R std T Rb R best PD best R std T Rb R best PD best R std T Rb
R avg PD avg T avg R avg PD avg T avg R avg PD avg T avg
eil51426426 (0)0.371.94428 (0.47)3.189.02427 (0.23)4.033.8
426.85 (0.2) 1.72436 (2.35) 11.42430.95 (1.16) 2.56
berlin5275427542 (0)01.817542 (0)206.628.857542 (0)103.393.56
7542 (0) 1.717836.95 (3.91) 6.147600.25 (0.77) 2.3
st70675675 (0)3.13.49675 (0)8.316.28682 (1.04)7.25.91
676.65 (0.24) 2.88689.45 (2.14) 17.56696.4 (3.17) 4.39
pr76108,159108,159 (0)465.24.89108,936 (0.72)3423.5718.91112,647 (4.15)657.377.05
108,611.3 (0.42) 3.6113,302.85 (4.76) 20.53113,573.65 (5.01) 7.3
eil76538538 (0)2.64.12549 (2.04)8.4316.76539 (0.19)4.227.8
540.3 (0.43) 3.57558.65 (3.84) 26.14546.25 (1.53) 9.55
rat9912111211 (0)5.46.351230 (1.57)19.2425.941229 (1.49)6.9515.89
1217.25 (0.52) 5.921276.5 (5.41) 23.331239.05 (2.32) 15.39
kroA10021,28221,282 (0)49.285.9421,389 (0.5)510.4629.0321,867 (2.75)246.0116.23
21,327 (0.21) 5.5322,134.75 (4.01) 21.5822,310.65 (4.83) 10.49
rd10079107910 (0)12.886.047965 (0.7)181.4229.278074 (2.07)80.0816.68
7917.3 (0.09) 5.668332.3 (5.34) 40.38195.65 (3.61) 23.02
eil101629630 (0.16)4.497.92638 (1.43)7.7329.4635 (0.95)11.2615.31
636.45 (1.18) 5.76658.35 (4.67) 22.05661.2 (5.12) 16.56
lin10514,37914,379 (0)43.057.8214,531 (1.06)319.2231.1114,486 (0.74)60.6917.37
14,414.05 (0.24) 5.9915,080.8 (4.88) 26.7314,596.25 (1.51) 14.62
pr10744,30344,303 (0)119.049.4944,577 (0.62)728.5633.5844,707 (0.91)198.6115.89
44,460.9 (0.36) 6.8845,283.25 (2.21) 38.5545,054.75 (1.7) 13.55
pr12459,03059,030 (0)270.361059,838 (1.37)746.5640.459,210 (0.3)326.3122.74
59,357.15 (0.55) 11.5160,725.3 (2.87) 35.1759,664.95 (1.08) 22.61
bier127118,282118,423 (0.12)352.2414.27120,538 (1.91)2110.4555.57121,306 (2.56)643.6321.38
118,982.65 (0.59) 15.57124,348.1 (5.13) 46.66122,591 (3.64) 20.44
ch13061106128 (0.29)32.3513.46221 (1.82)87.4755.166292 (2.98)32.1426.49
6178.45 (1.12) 12.966397.35 (4.7) 66.316331.55 (3.63) 21.52
xqf131564565 (0.18)3.7113.32577 (2.3)10.4648.99593 (5.14)4.2630.3
575.05 (1.96) 11.29594.85 (5.47) 46.33599.3 (6.26) 63.67
pr13696,77296,870 (0.1)691.423.0597,605 (0.86)1340.6468.59105,463 (8.98)657.7130.5
97,810.2 (1.07) 20.19100,223.55 (3.57) 75.11106,761.45 (10.32) 19.16
pr14458,53758,537 (0)23.6622.1658,746 (0.36)1379.6562.258,701 (0.28)87.3130.3
58,561.15 (0.04) 16.8860,252.7 (2.93) 48.2858,824.15 (0.49) 46.68
kroA15026,52426,583 (0.22)137.7419.8127,276 (2.84)499.3471.7727,840 (4.96)224.0143.56
26,758.25 (0.88) 18.1828,026.55 (5.66) 71.9228,334.55 (6.83) 59.19
ch15065286533 (0.08)8.5514.916697 (2.59)180.4478.566720 (2.94)28.9535.78
6556.85 (0.44) 12.316914.5 (5.92) 84.226758 (3.52) 29
pr15273,68273,682 (0)207.1716.6374,424 (1.01)983.0574.1274,849 (1.58)410.1631.11
73,968.05 (0.39) 16.2675,970.1 (3.11) 65.5575,539.3 (2.52) 44.05
u15942,08042,080 (0)185.9116.2542,396 (0.75)138.3156.4943,582 (3.57)406.4544.13
42,201.9 (0.29) 12.3542,470.45 (0.93) 41.844,194.8 (5.03) 39.03
rat19523232332 (0.39)9.6832.842402 (3.4)31.16119.442402 (3.4)9.5771.04
2343.25 (0.87) 48.162450.75 (5.5) 93.942422.45 (4.28) 90.99
d19815,78015,885 (0.67)76.1340.3415,979 (1.26)179.24163.1416,487 (4.48)188.4863.99
15,993.45 (1.35) 50.1216,270.4 (3.11) 147.316,731.7 (6.03) 93.31
kroA20029,36829,380 (0.04)112.1231.5730,196 (2.82)448.98172.3130,798 (4.87)256.2166.66
29,526.75 (0.54) 25.1630,935.75 (5.34) 160.7231,320.5 (6.65) 79.73
pr22680,36980,500 (0.16)255.0146.7181,124 (0.94)1789.16168.1783,027 (3.31)435.4384.47
80,883.05 (0.64) 39.6384,492.25 (5.13) 15484,005.2 (4.52) 113.67
pr26449,13549,135 (0)243.773.8550,411 (2.6)1627.27380.451,893 (5.61)333.2135.88
49,287.35 (0.31) 92.2253,602.05 (9.09) 497.3152,451.6 (6.75) 256.38
pr29948,19148,248 (0.12)330.8108.5650,372 (4.53)1029.18433.7952,663 (9.28)330.56182.62
48,645.35 (0.94) 91.9851,657.1 (7.19) 472.8153,056.7 (10.1) 221.02
lin31842,02942,203 (0.41)310.79131.1644,466 (5.8)838.64573.2146,273 (10.1)344.83198.23
42,630.25 (1.43) 168.9545,454.3 (8.15) 656.2247,145.25 (12.17) 156.24
pma34313681373 (0.37)4.57125.751423 (4.02)15.67652.511478 (8.04)15.32281.64
1379.5 (0.84) 82.221450.25 (6.01) 792.981512.55 (10.57) 462.81
pka37913321337 (0.38)5.89175.621390 (4.35)18.06898.631416 (6.31)18.21373.21
1344.7 (0.95) 173.241424.55 (6.95) 910.521442.9 (8.33) 387.1
bcl38016211630 (0.56)8.52125.361723 (6.29)29.131106.531732 (6.85)13.06368.99
1644.05 (1.42) 94.351789.95 (10.42) 1344.21753.1 (8.15) 475.46
pbl39512811288 (0.55)5.57181.81369 (6.87)19.781265.451427 (11.4)10.27347.13
1300.6 (1.53) 184.751401.95 (9.44) 1269.971444.7 (12.78) 563.52
rd4001528115,350 (0.45)74.95261.8715,993 (4.66)196.731581.5417,338 (13.46)105.81419.85
15,512.55 (1.52) 200.6716,414.55 (7.42) 1617.6717,519.65 (14.65) 375.42
pbk41113431359 (1.19)7.02216.661421 (5.81)24.531419.091492 (11.09)15.07462.24
1368.15 (1.87) 202.871472.55 (9.65) 1940.951518.5 (13.07) 447.8
fl41711,86111,910 (0.41)49.41218.0911,993 (1.11)338.811548.4412,559 (5.88)101.44432.18
11,973.75 (0.95) 253.4312,488.4 (5.29) 1585.4512,664.55 (6.77) 554.4
pbn42313651369 (0.29)8.61214.11459 (6.89)29.161508.731515 (10.99)15.95504.08
1386.45 (1.57) 231.721512.15 (10.78)1677.52 1545.6 (13.23) 542.73
pbm43614431446 (0.21)7.19189.321538 (6.58)22.711881.991570 (8.8)11.29527.42
1458.55 (1.08) 238.131594.9 (10.53) 2523.161595 (10.53) 744.35
pr439107217107,666 (0.42)754.5264.02110,702 (3.25)2445.652097.05117,852 (9.92)1099.39464.33
108,535.5 (1.23) 218.1115,479.95 (7.71) 2074.73120,033.4 (11.95) 463.28
pcb4425077851,380 (1.19)176.5233254,091 (6.52)990.521888.4456,711 (11.68)348.22554.25
51,597.35 (1.61) 443.9755,595.1 (9.49) 1889.0857,762.95 (13.76) 572.78
d49335,00235,484 (1.38)194.6469.0936,888 (5.39)336.553096.7838,744 (10.69)412.42771.14
35,750 (2.14) 650.0937,488.9 (7.11) 3437.5339,710 (13.45) 753.55
Average 0.27125.4590.432.79556.08585.955.19197.51192.60
C R b / C R a / C s t d / C T a 42/42/39/41 2/0/0/0 1/0/3/1
Table 3. Results obtained by IGA on 42 small-scale WSPs.
Table 3. Results obtained by IGA on 42 small-scale WSPs.
Instance IGA
NameLKH R best PD best R avg PD avg R worst R std T Rb T avg
Average -0.20-0.86-134.3887.3381.83
Table 4. Comparison of results obtained by ALC_IGA in single core with M setting to 50, 100, and 150, respectively.
Table 4. Comparison of results obtained by ALC_IGA in single core with M setting to 50, 100, and 150, respectively.
Instance ALC_IGA50ALC_IGA100ALC_IGA150
NameBKS PD best PD avg T avg PD best PD avg T avg PD best PD avg T avg
Average 10.6412.3191.027.969.4148.097.238.76231.93
C R b / C R a / C T a 3/3/45 5/4/0 37/38/0
Table 5. The exponential curve fitting a · n b of the running time of ALC_IGA with single core while M is set to 50, 100, and 150.
Table 5. The exponential curve fitting a · n b of the running time of ALC_IGA with single core while M is set to 50, 100, and 150.
MabSSE R 2 Adjusted R 2 RMSE
500.0118 ± 0.00380.9992 ± 0.033417050.99380.99366.297
1000.0198 ± 0.01920.9958 ± 0.1005412460.94590.944630.97
1500.0247 ± 0.03141.02 ± 0.1311679000.91460.912662.49
Table 6. Results obtained by ALC_IGA, TLACS, and TLGA with single thread on medium-scale instances.
Table 6. Results obtained by ALC_IGA, TLACS, and TLGA with single thread on medium-scale instances.
NameBKS PD best PD avg T avg PD best PD avg T avg PD best PD avg T avg
Average 8.519.74209.9812.8914.1489.4889.84102.431020.86
C R b / C R a / C T a 41/40/30 4/5/15 0/0/0
Table 7. Comparison of ALC_IGA and three relevant algorithms in parallel in large-scale instances.
Table 7. Comparison of ALC_IGA and three relevant algorithms in parallel in large-scale instances.
InstanceBKSAlgorithms R best PD best R avg PD avg T avg
Table 8. Results obtained by the ALC_IGA with parallelization on five large instances over 2 × 10 5 nodes.
Table 8. Results obtained by the ALC_IGA with parallelization on five large instances over 2 × 10 5 nodes.
InstanceBKSM R best PD best R avg PD avg R std T avg T Rb
Average 100-11.122-11.4281,397.82196.9522180.546
150-10.308 10.36256,3123342.3483210.844
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Xu, H.; Lan, H. An Adaptive Layered Clustering Framework with Improved Genetic Algorithm for Solving Large-Scale Traveling Salesman Problems. Electronics 2023, 12, 1681.

AMA Style

Xu H, Lan H. An Adaptive Layered Clustering Framework with Improved Genetic Algorithm for Solving Large-Scale Traveling Salesman Problems. Electronics. 2023; 12(7):1681.

Chicago/Turabian Style

Xu, Haiyang, and Hengyou Lan. 2023. "An Adaptive Layered Clustering Framework with Improved Genetic Algorithm for Solving Large-Scale Traveling Salesman Problems" Electronics 12, no. 7: 1681.

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop