The Generalized Traveling Salesman Problem solved with Ant Algorithms

A well known N P-hard problem called the Generalized Traveling Salesman Problem (GTSP) is considered. In GTSP the nodes of a complete undirected graph are partitioned into clusters. The objective is to find a minimum cost tour passing through exactly one node from each cluster. An exact exponential time algorithm and an effective meta-heuristic algorithm for the problem are presented. The meta-heuristic proposed is a modified Ant Colony System (ACS) algorithm called Reinforcing Ant Colony System (RACS) which introduces new correction rules in the ACS algorithm. Computational results are reported for many standard test problems. The proposed algorithm is competitive with the other already proposed heuristics for the GTSP in both solution quality and computational time.


Introduction
Many combinatorial optimization problems are N P-hard, and the theory of N P-completeness has reduced hopes that N P-hard problems can be solved within polynomial bounded computation times. Nevertheless, sub-optimal solutions are sometimes easy to find. Consequently, there is much interest in approximation and heuristic algorithms that can find near optimal solutions within reasonable running time. Heuristic algorithms are typically among the best strategies in terms of efficiency and solution quality for problems of realistic size and complexity.
In contrast to individual heuristic algorithms that are designed to solve a specific problem, meta-heuristics are strategic problem solving frameworks that can be adapted to solve a wide variety of problems. Meta-heuristic algorithms are widely recognized as one of the most practical approaches for combinatorial optimization problems. The most representative meta-heuristics include genetic algorithms, simulated annealing, tabu search and ant colony. Useful references regarding meta-heuristic methods can be found in [3].
The Generalized Traveling Salesman Problem (GTSP) has been introduced in [6] and [7]. The GTSP has several applications to location and telecommunication problems. More information on these problems and their applications can be found in [4,5,6].
Several approaches were considered for solving the GTSP: a branch-and-cut algorithm for Symmetric GTSP is described and analyzed in [5], in [7] is given a Lagrangian-based approach for Asymmetric GTSP, in [11] is described a random-key genetic algorithm for the GTSP, in [10] it is proposed an efficient composite heuristic for the Symmetric GTSP etc.
The aim of this paper is to provide an exact algorithm for the GTSP as well as an effective meta-heuristic algorithm for the problem. The proposed meta-heuristic is a modified version of Ant Colony System (ACS). Introduced in ( [1,2]), Ant System is a heuristic algorithm inspired by the observation of real ant colonies. ACS is used to solve hard combinatorial optimization problems including the Traveling Salesman Problem (TSP).
2 Definition and complexity of the GTSP Let G = (V, E) be an n-node undirected graph whose edges are associated with nonnegative costs. We will assume w.l.o.g. that G is a complete graph (if there is no edge between two nodes, we can add it with an infinite cost).
The generalized traveling salesman problem (GTSP) asks for finding a minimum-cost tour H spanning a subset of nodes such that H contains exactly one node from each cluster Vi, i ∈ {1, ..., p}. The problem involves two related decisions: choosing a node subset S ⊆ V , such that |S ∩ V k | = 1, for all k = 1, ..., p and finding a minimum cost Hamiltonian cycle in the subgraph of G induced by S.
Such a cycle is called a Hamiltonian tour. The GTSP is called symmetric if and only if the equality c(i, j) = c(j, i) holds for every i, j ∈ V , where c is the cost function associated to the edges of G.

An exact algorithm for the GTSP
In this section, we present an algorithm that finds an exact solution to the GTSP.
Given a sequence (V k 1 , ..., V kp ) in which the clusters are visited, we want to find the best feasible Hamiltonian tour H * (w.r.t cost minimization), visiting the clusters according to the given sequence. This can be done in polynomial time by solving |V k 1 | shortest path problems as described below.
We construct a layered network, denoted by LN, having p + 1 layers corresponding to the clusters V k 1 , ..., V kp and in addition we duplicate the cluster V k 1 . The layered network contains all the nodes of G plus some extra nodes v ′ for each v ∈ V k 1 . There is an arc (i, j) for each i ∈ V k l and j ∈ V k l+1 (l = 1, ..., p − 1), having the cost cij and an arc (i, h), i, h ∈ V k l , (l = 2, ..., p) having cost c ih . Moreover, there is an arc (i, j ′ ) for each i ∈ V kp and j ′ ∈ V k 1 having cost c ij ′ .
For any given v ∈ V k 1 , we consider paths from v to w ′ , w ′ ∈ V k 1 , that visits exactly two nodes from each cluster V k 2 , ..., V kp , hence it gives a feasible Hamiltonian tour.
Conversely, every Hamiltonian tour visiting the clusters according to the sequence (V k 1 , ..., V kp ) corresponds to a path in the layered network from a certain node v ∈ V k 1 to w ′ ∈ V k 1 .
Therefore the best (w.r.t cost minimization) Hamiltonian tour H * visiting the clusters in a given sequence can be found by determining all the shortest paths from each v ∈ V k 1 to each w ′ ∈ V k 1 with the property that visits exactly one node from cluster.
The overall time complexity is then |V k 1 |O(m + n log n), i.e. O(nm + nlogn) in the worst case. We can reduce the time by choosing |V k 1 | as the cluster with minimum cardinality.
It should be noted that the above procedure leads to an O((p − 1)!(nm + nlogn)) time exact algorithm for the GTSP, obtained by trying all the (p−1)! possible cluster sequences. Therefore we have established the following result: the above procedure provides an exact solution to the GSTP in O((p − 1)!(nm + nlogn)) time, where n is the number of nodes, m is the number of edges and p is the number of clusters in the input graph. Clearly, the algorithm presented is an exponential time algorithm unless the number of clusters p is fixed.

Ant Colony System
Ant System proposed in [1,2] is a multi-agent approach used for various combinatorial optimization problems. The algorithms were inspired by the observation of real ant colonies.
An ant can find shortest paths between food sources and a nest. While walking from food sources to the nest and vice versa, ants deposit on the ground a substance called pheromone, forming a pheromone trail. Ants can smell pheromone and, when choosing their way, they tend to choose paths marked by stronger pheromone concentrations. It has been shown that this pheromone trail following behavior employed by a colony of ants can lead to the emergence of shortest paths.
When an obstacle breaks the path ants try to get around the obstacle randomly choosing either way. If the two paths encircling the obstacle have the different length, more ants pass the shorter route on their continuous pendulum motion between the nest points in particular time interval. While each ant keeps marking its way by pheromone the shorter route attracts more pheromone concentrations and consequently more and more ants choose this route. This feedback finally leads to a stage where the entire ant colony uses the shortest path. There are many variations of the ant colony optimization applied on various classical problems. Ant System make use of simple agents called ants which iterative construct candidate solution to a combinatorial optimization problem. The ants solution construction is guided by pheromone trails and problem dependent heuristic information.
An individual ant constructs candidate solutions by starting with an empty solution and then iterative adding solution components until a complete candidate solution is generated. Each point at which an ant has to decide which solution component to add to its current partial solution is called a choice point. After the solution construction is completed, the ants give feedback on the solutions they have constructed by depositing pheromone on solution components which they have used in their solution. Solution components which are part of better solutions or are used by many ants will receive a higher amount of pheromone and, hence, will more likely be used by the ants in future iterations of the algorithm. To avoid the search getting stuck, typically before the pheromone trails get reinforced, all pheromone trails are decreased by a factor.
Ant Colony System (ACS) was developed to improve Ant System, making it more efficient and robust. Ant Colony System works as follows: m ants are initially positioned on n nodes chosen according to some initialization rule, for example randomly. Each ant builds a tour by repeatedly applying a stochastic greedy rule -the state transition rule. While constructing its tour, an ant also modifies the amount of pheromone on the visited edges by applying the local updating rule. Once all ants have terminated their tour, the amount of pheromone on edges is modified again by applying the global updating rule. As was the case in ant system, ants are guided, in building their tours by both heuristic information and by pheromone information: an edge with a high amount of pheromone is a very desirable choice. The pheromone updating rules are designed so that they tend to give more pheromone to edges which should be visited by ants.
The ants solutions are not guaranteed to be optimal with respect to local changes and hence may be further improved using local search methods. Based on this observation, the best performance are obtained using hybrid algorithms combining probabilistic solution construction by a colony of ants with local search algorithms as 2-3 opt, tabu-search etc. In such hybrid algorithms, the ants can be seen as guiding the local search by constructing promising initial solutions, because ants preferably use solution components which, earlier in the search, have been contained in good locally optimal solutions.

Reinforcing Ant Colony System for GTSP
An Ant Colony System for the GTSP it is introduced. In order to enforces the construction of a valid solution used in ACS a new algorithm called Reinforcing Ant Colony System (RACS) it is elaborated with a new pheromone rule as in [8] and pheromone evaporation technique as in [12].
Let V k (y) denote the node y from the cluster V k . The RACS algorithm for the GTSP works as follows: • Initially the ants are placed in the nodes of the graph, choosing randomly the clusters and also a random node from the chosen cluster • At iteration t + 1 every ant moves to a new node from an unvisited cluster and the parameters controlling the algorithm are updated.
• Each edge is labeled by a trail intensity. Let τij(t) represent the trail intensity of the edge (i, j) at time t. An ant decides which node is the next move with a probability that is based on the distance to that node (i.e. cost of the edge) and the amount of trail intensity on the connecting edge. The inverse of distance from a node to the next node is known as the visibility, ηij = 1 c ij . • At each time unit evaporation takes place. This is to stop the intensity trails increasing unbounded. The rate evaporation is denoted by ρ, and its value is between 0 and 1. In order to stop ants visiting the same cluster in the same tour a tabu list is maintained. This prevents ants visiting clusters they have previously visited. The ant tabu list is cleared after each completed tour.
• To favor the selection of an edge that has a high pheromone value, τ , and high visibility value, η a probability function p k iu is considered. J k i are the unvisited neighbors of node i by ant k and u ∈ J k i, u = V k (y), being the node y from the unvisited cluster V k . This probability function is defined as follows: where β is a parameter used for tuning the relative importance of edge cost in selecting the next node. p k iu is the probability of choosing j = u, where u = V k (y) is the next node, if q > q0 (the current node is i). If q ≤ q0 the next node j is chosen as follows: where q is a random variable uniformly distributed over [0, 1] and q0 is a parameter similar to the temperature in simulated annealing, 0 ≤ q0 ≤ 1.
• After each transition the trail intensity is updated using the correction rule from [8]: where L + is the cost of the best tour.
• In Ant Colony System only the ant that generate the best tour is allowed to globally update the pheromone. The global update rule is applied to the edges belonging to the best tour. The correction rule is where ∆τij(t) is the inverse cost of the best tour.
• In order to avoid stagnation we used the pheromone evaporation technique introduced in [12]. When the pheromone trail is over an upper bound τmax, the pheromone trail is re-initialized. The pheromone evaporation is used after the global pheromone update rule.
The RACS algorithm computes for a given time timemax a sub-optimal solution, the optimal solution if it is possible and can be stated as follows in the pseudo-code description.

Representation and computational results
A graphic representation of Reinforcing Ant Colony System for solving GTSP is show in Fig. 2. At the beginning, the ants are in their nest and will start to search food in a specific area. Assuming that each cluster has specific food and the ants are capable to recognize this, they will choose each time a different cluster. The pheromone trails will guide the ants to the shorter path, a solution of GTSP, as in Fig. 2.
To evaluate the performance of the proposed algorithm, the RACS was compared to the basic ACS algorithm for GTSP and furthermore to other heuristics from literature: Nearest Neighbor (NN), a composite heuristic GI 3 and a random key-Genetic Algorithm [10,11]. The numerical experiments that compare RACS with other heuristics used problems from TSP library [9]. TSPLIB provides optimal objective values for each of the problems. Several problems with Euclidean distances have been considered. The exact algorithm proposed in section 3, is clearly outperformed by heuristics including RACS, because his running time is exponential, while heuristics including RACS are polynomial time algorithms and provide good sub-optimal solution for reasonable sizes of the problem.
To divide the set of nodes into subsets we used the procedure proposed in [4]. This procedure sets the number of clusters m = [n/5], identifies the m farthest nodes from each other, called centers, and assigns each remaining node to its nearest center. Obviously, some real world problems may have different cluster structures, but the solution procedure presented in this paper is able to handle any cluster structure.
The initial value of all pheromone trails, τ0 = 1/(n · Lnn), where Lnn is the result of Nearest Neighbor, (NN) algorithm. In NN algorithm the rule is always to go next to the nearest as-yet-unvisited location. The corresponding tour traverses the nodes in the constructed order. For the pheromone evaporation phase, let denote the upper bound with τmax = 1/((1 − ρ)Lnn).
The decimal values can be treated as parameters and can be changed if it is necessary. The parameters for the algorithm are critical as in all other ant systems.  Currently there is no mathematical analysis developed to give the optimal parameter in each situation. In the ACS and RACS algorithm the values of the parameters were chosen as follows: β = 5, ρ = 0.5, q0 = 0.5.
In table from Figure 3 we compare the computational results for solving the GTSP using the ACS and RACS algorithm with the computational results obtained using NN, GI 3 and random key-Genetic Algorithm mentioned above.
The columns in table from Figure 3 are as follows: Problem-the name of the test problem; the first digits give the number of clusters (nc)and the last ones give the number of nodes (n); Opt.val.-the optimal objective value for the problem [11]; ACS, RACS, NN, GI 3 , GA-the objective value returned by ACS, RACS, NN, GI 3 and random-key Genetic Algorithm.
The best solutions are in Table 3 in the bold format. All the solutions of ACS and RACS are the average of five successively run of the algorithm, for each problem. Termination criteria for ACS and RACS is given by the timemax the maximal computing time set by the user; in this case ten minutes. Table 3 shows that Reinforcing Ant Colony System performed well finding the optimal solution in many cases. The results of RACS are better than the results of ACS. The RACS algorithm for the Generalized Traveling Salesman Problem can be improved if more appropriate values for the parameters are used. Also, an efficient combination with other algorithms can potentially improve the results.

Conclusion
The basic idea of ACS is that of simulating the behavior of a set of agents that cooperate to solve an optimization problem by means of simple communications. The algorithm introduced to solve the Generalized Traveling Salesman Problem, called Reinforcing Ant Colony System, is an ACS-based algorithm with new correction rules.
The computational results of the proposed RACS algorithm are good and competitive in both solution quality and computational time with the existing heuristics from the literature [10,11]. The RACS results can be improved by considering better values for the parameters or combining the RACS algorithm with other optimization algorithms. Some disadvantages have also been identified and they refer the multiple parameters used for the algorithm and the high hardware resources requirements.