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

C 1 = α 0 , α 1 , α 2 , , α n 1 , α n = 1 i = 0 n 1 c α i , α i + 1

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 c > c, 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.

Table 1 The cost matrix

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.

Figure 1
figure 1

Flow chart of our hybrid genetic algorithm.

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 2 Results over five different instances using different mutation probabilities

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].

Table 3 Results for symmetric TSPLIB instances

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.

Table 4 Results for asymmetric TSPLIB instances

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.