Abstract
Purpose
In this paper, we consider the maximum traveling salesman problem, a variation of the usual traveling salesman problem, in which the objective is to maximize the cost of a tour of the salesman. The main purpose of this paper is to develop a hybrid genetic algorithm (GA) for obtaining a heuristically optimal solution to the problem.
Methods
First, a simple GA and then a hybrid GA have been proposed to solve the problem. As crossover operator plays a vital role in GAs, we modify the sequential constructive crossover operator for our simple GA to solve the problem. To improve the quality of the solution obtained by the crossover operator, restricted 2-opt search is applied. Then a hybrid GA is developed by incorporating a new local search algorithm to the simple GA in order to obtain a heuristic solution to the problem.
Results
We compare the efficiency of our hybrid GA against an existing heuristic algorithm for symmetric traveling salesman problem library (TSPLIB) instances. Finally, we present solutions to the problem for asymmetric TSPLIB instances. Since, to the best of our knowledge, no literature presents solution for asymmetric instances, hence, we could not carry out any comparative study to show the efficiency of our hybrid GA for the asymmetric instances.
Conclusions
The comparative study shows the effectiveness of our hybrid GA.
Similar content being viewed by others
Avoid common mistakes on your manuscript.
Introduction
The traveling salesman problem (TSP) is a well-known problem in computer science and operations research. It has been studied for many years, and accordingly, many good algorithms have been developed to solve the problem. The maximum traveling salesman problem (Max-TSP) is a variation of the TSP in which the objective is to maximize the cost of a tour of the salesman. The problem can be defined as follows:
A network with n nodes, being ‘node 1’ as the starting node, and a cost (or distance, or time, etc.) matrix C = [cij] of order n associated with ordered pair of nodes (i, j) is given. The problem is to find a maximum cost Hamiltonian cycle. That is, the problem is to obtain a tour (1 = α0, α1, α2, …, αn − 1, α n = 1) ≈ {1 → α1 → α2 → … → αn − 1 → 1} for which the total cost
is maximum.
It is well known that both the TSP and the Max-TSP are nondeterministic polynomial time (NP)-hard problems [1]. Of course, the Max-TSP can be reduced to the TSP (and vice versa); however, the special structure that leads to a well-solvable case for the TSP does not necessarily yield a well-solvable case for the Max-TSP. On the basis of the cost matrix structure, the Max-TSP is classified as symmetric (Max-STSP) or asymmetric (Max-ATSP). The problem is symmetric if c ij = c ji , ∀ i, j, and asymmetric otherwise. Also, the problem that satisfies the triangular inequality is called the metric problem. The Max-STSP is a special case of the Max-ATSP, and hence, the latter is found to be harder than the former. The Max-STSP is shown to be NP-hard [2], and the Max-ATSP is APX-hard [3]. Therefore, a polynomial time approximation is not desirable for the Max-TSP unless P = NP. A detailed study on the Max-TSP is carried out by Barvinok et al. [4]. The Max-TSP finds application in maximum latency delivery problems [5] and in the computation of the shortest common superstrings [6].
In this paper, we consider the general Max-TSP of both symmetric and asymmetric cases. Due to the complexity of Max-TSP, it is necessary to apply heuristics to solve instances of different sizes. Genetic algorithms (GAs) are one of the best heuristics that have been successfully applied to the TSP and its variations. This paper develops a hybrid GA using sequential constructive crossover [7], restricted 2-opt search, and a new local search algorithm to obtain a heuristic solution to the problem. We compare the efficiency of our hybrid algorithm against the heuristic algorithm of Fekete et al. [8] for symmetric traveling salesman problem library (TSPLIB) instances. The comparative study shows the effectiveness of our hybrid algorithm. Finally, we present solutions to the problem for asymmetric TSPLIB instances. Since, to the best of our knowledge, our results on Max-ATSP are the first in the literature, we could not carry out any comparative study for this case.
This paper is organized as follows: the next section provides a literature review, a hybrid genetic algorithm for the Max-TSP is presented in the ‘Methods’ section, presentation of computational experience for the hybrid algorithm is in the ‘Results and discussion’ section, and finally, comments and concluding remarks are presented in the ‘Conclusions’ section.
Literature review
A number of different methods have been proposed for obtaining approximate solutions to the different cases of Max-TSP. For the Max-ATSP, Fisher et al. [9] developed a 1/2-approximation algorithm with polynomial time. The algorithm is then improved by Kosaraju et al. [10] who developed a polynomial approximation algorithm with a performance ratio of 38/63. Lewenstein and Sviridenko [11] developed a better approximation algorithm with a performance ratio of 5/8. An O(n3)-time polynomial approximation algorithm that achieves an approximation ratio of 8/13 has been developed [3]. Kaplan et al. [12] proposed an approximation algorithm that achieves an approximation guarantee of 2/3. An approximation algorithm with a performance ratio of 31/40 has been developed for the metric Max-ATSP [13]. Currently, Kowalik and Mucha [14] developed an approximation algorithm with the best approximation ratio 35/44 for metric Max-ATSP. Paluch et al. [15] proposed a simple approximation algorithm for the Max-ATSP which guarantees an approximation of 2/3; however, it matches the approximation guaranteed by Kaplan et al. [12].
For the Max-STSP, approximation algorithms with various performance ratios have been developed [16, 17]. Kowalik and Mucha [18] developed an approximation algorithm with a performance ratio of 7/8 for metric Max-TSP.
Several researchers investigated the Max-TSP on special matrices. Deineko and Woeginger [19] investigated the Max-TSP on symmetric Demidenko matrices and found that in strong contrast to the usual TSP, the Max-TSP is NP-hard to solve. They identify several special cases that are solvable in polynomial time. Blokh and Levner [20] investigated the properties of the Max-TSP on nonnegative quasi-banded matrices, and they proved that it is strongly NP-hard and derived a linear-time approximation algorithm with a guaranteed performance. Steiner and Xue [21] investigated the Max-TSP on van der Veen matrices and established that the problem stays NP-hard even on the class of distance matrices which satisfy both the van der Veen and Demidenko conditions.
However, all of the above studies do not provide any computational experience for the problems. Also, most of the literatures discussed above deal with only a particular case of Max-TSP, whereas our proposed algorithms are capable of dealing with all cases of Max-TSP without any modification of the algorithms. Fekete et al. [8] developed a heuristic algorithm for solving the Max-STSP and reported computational experience for symmetric TSPLIB instances only. We are going to compare our results with the results of Fekete et al. [8] for symmetric TSPLIB instances only.
Methods
GAs have been used widely to deal with the usual TSP. They are based on mimicking the survival of the fittest among species generated by random changes in the gene structure of the chromosomes in evolutionary biology [22]. They start with a set of chromosomes called initial population and then go through (possibly) three operations, namely reproduction/selection, crossover, and mutation, to obtain a heuristically optimal solution.
Initial population
There are various ways to represent a solution by a chromosome in GAs for the TSP and its variations. We consider the path/order representation for a chromosome that simply lists the nodes for a Max-TSP instance. We also consider a randomly generated feasible set of chromosomes of fixed size as the initial population for our GA.
Fitness function and reproduction
The fitness function is the cost of a tour represented by a chromosome. In reproduction, no new chromosome is created; some chromosomes are copied to the next generation probabilistically based on their fitness values. In our GA, the stochastic remainder selection method [23] is used for reproduction.
Sequential constructive crossover operator
The crossover operation selects a pair of parent chromosomes and exchanges their information. Since crossover is the most important operator in GAs, various crossover operators have been proposed for the usual TSP [22]. The sequential constructive crossover (SCX) [7] is found to be one of the best crossover operators. It produces only one offspring from a pair of parents. It has been applied to the bottleneck traveling salesman problem and found good results [24]. Here also, we consider this SCX for our GA. However, we slightly modify the operator to fit to our problem as follows:
-
Step 1: Start from ‘node 1’ (i.e., current node p = 1).
-
Step 2: Sequentially search both of the parent chromosomes and consider the first ‘legitimate node’ (the node that does not appear in the present incomplete offspring chromosome) that appeared after ‘node p’ in each parent. If no legitimate node after ‘node p’ is present in any of the parents, search sequentially from the starting of the parent and consider the first legitimate node and go to step 3.
-
Step 3: Suppose the ‘node α’ and the ‘node β’ are found in the 1st and the 2nd parent, respectively, then for selecting the next node, go to step 4.
-
Step 4: If cpα > cpβ, then select node α, otherwise node β, as the next node and concatenate it to the partially constructed offspring chromosome. If the offspring is a complete chromosome, then stop; otherwise, rename the present node as node p and go to step 2.
Let a pair of selected chromosomes be P1: (1, 5, 7, 3, 6, 4, 2) and P2: (1, 4, 5, 2, 6, 3, 7) with values 312 and 335, respectively, with respect to the cost matrix given in Table 1. By applying the above SCX, we obtain the offspring (1, 5, 7, 4, 2, 3, 6) with the value 376, which is larger and better than both parents.
For this crossover operation, a pair of parents is selected sequentially from the mating pool, and only one offspring is produced. In order to avoid performing the crossover operation of same parent chromosomes, we check whether the chromosomes are the same. If they are found to be the same, some of the genes (nodes) of the second parent chromosome are exchanged temporarily only for the crossover, and then we go for the crossover operation. The present second original parent will then be the first parent for the next crossover operation when pairing with the next chromosome in order and so on. To improve the quality of the solution by SCX, we follow the following method. If the offspring is better than the parent, the 2-opt search is applied to the offspring to improve further, and then the first parent is replaced by the improved offspring.
Mutation operation
The mutation operation is the occasional random alteration of the genes in a chromosome. By performing occasional random changes in the chromosomes, GAs ensure that new parts of the search space are reached, which reproduction and crossover cannot fully guarantee. In doing so, mutation ensures that no important features are prematurely lost, thus maintaining the mating pool diversity. For this investigation, we have considered the reciprocal exchange mutation, which selects two genes randomly and swaps them.
Our simple GA works by randomly generating an initial population of strings, which is referred to as gene pool, and then applying the above reproduction, crossover, and mutation operators to create new, and hopefully, better populations as successive ‘generations.’ Simple GAs focus on the global aspects of an optimization task, whereas local search methods focus on the local aspects of the optimization task. The hybridization of both genetic algorithm and local search methods has shown to be an effective route to follow for finding high-quality solutions for combinatorial optimization problems [25]. Most of the hybrid GAs in the literatures are developed by incorporating 2-opt, Or-opt, 3-opt, and LK local search heuristics to the simple GAs [25]. For our hybrid GA for the Max-TSP, the following local search algorithm is developed and incorporated to the simple GA.
Local search algorithm
The proposed local search algorithm is basically a combined mutation operator that combines three mutation operators - insertion, inversion, and reciprocal exchange, with cent per cent of probabilities, which has been proposed for the bottleneck TSP and applied to the best tour obtained by a sequential constructive sampling algorithm [26]. We modify the operator for our problem and apply to the present best tour found so far. The algorithm is as follows: Suppose the present best tour is (1 = β0, β1, β2,…, βn−1), then the local search algorithm can be developed as follows:
-
Step 1: For i = 1 to n − 2, do the following steps.
-
Step 2: For j = i + 1 to n − 1, do the following steps.
-
Step 3: If inserting node β i after node β j improves the present tour value, then insert node β i after node β j . In any case, go to step 4.
-
Step 4: If inverting substring between nodes β i and β j improves the present tour value, then invert the substring. In any case, go to step 5.
-
Step 5: If swapping nodes β i and β j improves the present tour value, then swap them.
Our hybrid genetic algorithm (HGA) may be summarized as in Figure 1.
Results and discussion
Our HGA has been encoded in Visual C++ on a Pentium IV personal computer, with a speed of 3 GHz and a 448 MB RAM under MS Windows XP operating system and is tested with TSPLIB [27] instances. The following parameters are selected for our algorithm: population size is 100, crossover probability is 1.0, maximum of 20,000 generations as termination condition, and 20 independent runs for each setting. For setting mutation probability, five mutation probabilities: 0, 0.01, 0.02, 0.03, and 0.04, have been applied on five instances.
Table 2 reports the mean and standard deviation (SD) of the best solution values over 20 trials for five mutation probabilities on instances eil101, bier127, ch150, gil262, and a280. The HGA using mutation probabilities from 0.01 to 0.03 can lead to significant improvements over HGA without a mutation operator on these five test instances. The table clearly indicates that the mutation also plays an important role in obtaining good solution to these instances. The significance of this improvement is further proved by the statistical one-tailed t test with a confidence level of 0.05. Table 2 also shows the p values of the t test with a confidence level of 0.05 on the best solution value between HGA without a mutation operator and with a mutation operator using different mutation probabilities for the instances. The italics denotes the significant improvements. It is seen that as the mutation probability increases, the quality of the solutions decreases, and for two instances, HGA with a probability of 0.04 obtains worse solutions than the HGA without a mutation operator. However, the HGA with a mutation probability of 0.01 is found to obtain the best solutions, which would be considered for later study.
Table 3 summarizes the results for some moderate-sized symmetric TSPLIB instances of sizes up to 417 only. For these instances, we compare the efficiency of our HGA against the heuristic algorithm (CROSS + Lin-Kernighan, therein) of Fekete et al. [8] in terms of solution quality. We also report the optimal solutions by Fekete et al. [8] using CONCORDE code [28]. We report the best and worst solution values in 20 runs. Also, we report the percentage of error of the average solution values as Error (%) = (Opt − Average) / Opt × 100%, where Opt is the optimal solution value calculated using CONCORDE reported in [8]. The table also reports the percentage of error of the best solutions obtained by Fekete et al. [8].
From Table 3, it is very clear that our HGA is better than algorithm by Fekete et al. [8] for the symmetric instances, in terms of solution quality. Also, on average, the solutions are at most 0.017% away from the optimal solutions, which is very good. Treating this study as a base for the effectiveness of our HGA, we can now present solutions for the asymmetric TSPLIB instances. It is to be noted that our HGA does not require any modification for solving different types and cases of TSPLIB instances, whereas algorithm by Fekete et al. [8] and CONCORDE code [28] require modifications.
Table 4 summarizes the results for 28 asymmetric TSPLIB instances of sizes up to 443. Also, the average of complete computational times and the times when the final solutions are seen for the first time are reported (in seconds) in 20 runs. For half of the instances, the solution quality is found to be insensitive to the number of runs. These instances are of sizes less than 130, and most of them are ‘ftv’ instances. For instances ry48p of size 48, ft53 of size 53, ft70 of size 70, and kro124p of size 100, the solution quality is found to be sensitive to the number of runs. We can say that these instances as well as the instances of sizes more than 130 are hard. Since no literature presents optimal solutions for the asymmetric instances, so to measure the quality of the solutions, we report the average percentage of errors from the best solution values among 20 runs. For these instances, the average percentage of error ranges from 0.0000% to 0.1257%, which is not bad. On the basis of computational time, on average, the algorithm finds a final solution for the first time within only 13% of complete computational times. That is, on average, for these instances, the algorithm finds optimal solutions in the beginning of the generations. Moreover, for the four ‘rbg’ instances, the algorithm finds the optimal solutions in the very beginning of the iteration, within 1% of complete computational times.
Conclusions
We presented a simple GA using the sequential constructive crossover operator to obtain a heuristic solution to the Max-TSP. The restricted 2-opt search and a new local search algorithm that combines three mutation operators with cent per cent of mutation probability have been incorporated for hybridizing the simple GA for obtaining better solutions for the problem. We then compared the efficiency of our hybrid algorithm against the heuristic algorithm of Fekete et al. [8] for the symmetric TSPLIB instances and then presented solutions to the problem for 28 asymmetric TSPLIB instances of sizes up to 443. The computational experience shows that our algorithm is better than the algorithm of Fekete et al. [8] for symmetric instances. Since, to the best of our knowledge, no literature presents solutions for asymmetric instances, hence, we could not carry out any comparative study to show the efficiency of the algorithm for the asymmetric instances. Since for the symmetric instances our algorithm finds very good solutions, we hope that the reported solutions for the asymmetric instances are very close to the exact optimal solutions, if not exact.
References
Lawler EL, Lenstra JK, Rinnooy Kan AHG, Shmoys DB: The Travelling Salesman Problem. Chichester: Wiley; 1985.
Garey MR, Johnson DS: Computer and Intractability: A Guide to the Theory of NP-Completeness. New York: Freeman; 1979.
Bläser M: An 8/13-approximation algorithm for the asymmetric maximum TSP. Journal of Algorithms 2004,50(1):23–48. 10.1016/S0196-6774(03)00112-3
Barvinok A, Gimaldi E, Serdyukov A: The maximum TSP. In The Traveling Salesman Problem and Its Variations. Edited by: Gutin G, Punnen A. Dordrecht: Kluwer; 2002:585–607.
Chalasani P, Motwani R: Approximating capacitated routing and delivery problems. SIAM Journal of Computing 1999, 28: 2133–2149. 10.1137/S0097539795295468
Breslauer D, Jiang T, Jiang Z: Rotations of periodic strings and short superstrings. Journal of Algorithms 1997, 24: 340–353. 10.1006/jagm.1997.0861
Ahmed ZH: Genetic algorithm for the traveling salesman problem using sequential constructive crossover. International Journal of Biometrics & Bioinformatics 2010,3(6):96–105.
Fekete SP, Meijer H, Rohe A, Tietze W: Solving a "hard" problem to approximate an "easy" one: heuristics for maximum matchings and maximum traveling salesman problems. In ALENEX, LNCS 2153. Edited by: Buchsbaum AL, Snoeyink J. Berlin: Springer; 2001:1–16.
Fisher ML, Nemhauser L, Wolsey LA: An analysis of approximations for finding a maximum weight Hamiltonian circuit. Networks 1979,12(1):799–809.
Kosaraju SR, Park JK, Stein C: Long tours and short superstrings. In Proceedings of the 35th Annual IEEE Symposium on Foundations of Computer Science. Santa Fe: ; 1994:166–177. 20–22 Nov 20–22 Nov
Lewenstein M, Sviridenko M: A 5/8-approximation algorithm for the maximum asymmetric TSP. SIAM Journal of Discrete Mathematics 2003,17(2):237–248. 10.1137/S0895480102402861
Kaplan H, Lewenstein M, Shafrir N, Sviridenko M: Approximation algorithms for asymmetric tsp by decomposing directed regular multigraphs. Journal of ACM 2005,52(4):602–626. 10.1145/1082036.1082041
Bläser M, Ram LS, Sviridenko M: Improved approximation algorithms for metric maximum ATSP and maximum 3-cycle cover problems. Operations Research Letters 2009, 37: 176–180. 10.1016/j.orl.2009.01.011
Kowalik L, Mucha M: 35/44-approximation for asymmetric maximum tsp with triangle inequality. Algorithmica 2011,59(2):240–255. 10.1007/s00453-009-9306-3
Paluch K, Elbassioni K, van Zuylen A: Simpler approximation of the maximum asymmetric traveling salesman problem. In 29th Symposium on Theoretical Aspects of Computer Science (STACS’12). Edited by: Christoph D, Thomas W. Wadern: Dagstuhl; 2012:501–506.
Hassin R, Rubinstein S: Better approximations for max TSP. Information Processing Letters 2000,75(4):251–258.
Chen Z-Z, Okamoto Y, Wang L: Improved deterministic approximation algorithms for Max TSP. Information Processing Letters 2005, 95: 333–342. 10.1016/j.ipl.2005.03.011
Kowalik L, Mucha M: Deterministic 7/8-approximation for the metric maximum TSP. Theoretical Computer Science 2009,410(47–49):5000–5009.
Deineko VG, Woeginger GJ: The Maximum Travelling Salesman Problem on symmetric Demidenko matrices. Discrete Applied Mathematics 2000, 99: 413–425. 10.1016/S0166-218X(99)00148-1
Blokh D, Levner E: An approximation algorithm with performance guarantees for the maximum traveling salesman problem on special matrices. Discrete Applied Mathematics 2002, 119: 139–148. 10.1016/S0166-218X(01)00270-0
Steiner G, Xue Z: The maximum traveling salesman problem on van der Veen matrices. Discrete Applied Mathematics 2005, 146: 1–2. 10.1016/j.dam.2004.06.014
Goldberg DE: Genetic Algorithms in Search, Optimization, and Machine Learning. New York: Addison-Wesley; 1989.
Deb K: Optimization for Engineering Design: Algorithms and Examples. New Delhi: PHI; 1995.
Ahmed ZH: A hybrid genetic algorithm for the bottleneck traveling salesman problem. ACM Transactions on Embedded Computing Systems 2013,12(1):2013. In: in press In: in press
Michalewicz Z: Genetic Algorithms + Data Structures = Evolution Problems. 2nd edition. New York: Springer; 1994.
Ahmed ZH: A hybrid sequential constructive sampling algorithm for the bottleneck traveling salesman problem. International Journal of Computational Intelligence Research 2010,6(3):475–484.
Reinelt G, TSPLIB (2013). Accessed 30 Jan 2013 http://www.iwr.uni-heidelberg.de/groups/comopt/software/TSPLIB95/ (2013). Accessed 30 Jan 2013
Cook W, CONCORDE (2013) Accessed 30 Jan 2013 http://www.tsp.gatech.edu/concorde/index.html (2013) Accessed 30 Jan 2013
Acknowledgements
The author is thankful to the honorable anonymous reviewers for their constructive comments and suggestions. This research was partially supported by King Abdulaziz City for Science and Technology, Saudi Arabia, vide grant no. 11-INF1788-08.
Author information
Authors and Affiliations
Corresponding author
Additional information
Competing interests
The author declares that he has no competing interests.
Authors’ original submitted files for images
Below are the links to the authors’ original submitted files for images.
Rights and permissions
Open Access This article is distributed under the terms of the Creative Commons Attribution 2.0 International License (https://creativecommons.org/licenses/by/2.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.
About this article
Cite this article
Ahmed, Z.H. An experimental study of a hybrid genetic algorithm for the maximum traveling salesman problem. Math Sci 7, 10 (2013). https://doi.org/10.1186/2251-7456-7-10
Received:
Accepted:
Published:
DOI: https://doi.org/10.1186/2251-7456-7-10