As demonstrated previously, the performance of the Cohort Intelligence Algorithm (CI) algorithm was quite satisfactory for solving combinatorial problem such as Knapsack Problem (KP) [1]. The purpose of this chapter is to further demonstrate:

  1. 1.

    The ability of the CI methodology solving classic NP-hard combinatorial problem such as the Traveling Salesman Problem (TSP). In all 9 small sized test cases (14 to 29 cities) of the TSP from the TSPLIB [2] were solved.

  2. 2.

    In addition to the original CI approach incorporated with a roulette wheel selection approach [3], two different approaches such as a best behavior selection approach and a random behavior selection approach have been incorporated. In the best behavior selection approach every candidate follows the best behavior in the cohort. In the latter approach candidates randomly select any behavior in the cohort.

  3. 3.

    In order to jump out of possible local minima and further make the cohort saturate to global minimum, a generic approach of perturbation and further accepting worst behaviors was successfully incorporated.

The results highlighted the simplicity of the CI algorithm as well as robustness of the solution with the three approaches. It also underscored that the CI incorporated with the roulette wheel selection approach more realistically resembles the competitive and interactive learning behavior of the cohort candidates, which eventually makes the cohort successful. In addition, it also demonstrated that always following the best behavior/solution may make the cohort to saturate faster; however may make the cohort stuck into local minima. The encouraging results may help solve the real world problems with increasing complexity as the TSP can be further generalized to a wide variety of routing and scheduling problems [4].

6.1 Traveling Salesman Problem (TSP)

The Travelling Salesman Problem (TSP) is a classic combinatorial NP Hard problem [58]. It includes N cities and one salesman. One of the N cities is considered as origin city. The salesman must start from origin city, visit all the remaining cities exactly once and must return to the origin city. The goal is to find the minimum cost (distance, time, etc.) of route/path that the salesman should follow. It is represented as \( f({\mathbf{v}}) = f(v_{O} , \ldots v_{i} , \ldots v_{N} ,v_{O} ) \) where, \( v_{O} \) is the origin city and \( v_{i} \) represents any intermediate city and \( {\mathbf{v}} = (v_{O} , \ldots v_{i} , \ldots v_{N} ,v_{O} ) \) is the route the salesman follows or the order in which the salesman visits the N cities.

6.1.1 Solution to TSP Using CI

In the context of CI algorithm presented in Chap. 2 the edges in the route \( {\mathbf{v}} = (v_{O} , \ldots v_{i} , \ldots v_{N} ,v_{O} ) \) are considered as the characteristics/qualities which decide the overall cost of the route. The procedure begins with the initialization of number of cohort candidates C, number of variations t and the route \( {\mathbf{v}}^{c} \) of every candidate \( c,\;(c = 1, \ldots ,C) \).

In the cohort of C candidates, every individual candidate \( c,\;(c = 1, \ldots ,C) \) has a route \( {\mathbf{v}}^{c} = (v_{O}^{c} , \ldots v_{i}^{c} , \ldots v_{N}^{c} ,v_{O}^{c} ) \) which is the order in which the candidate visits the N cities. The origin city \( v_{O}^{c} \) of the route of every candidate \( c,\;(c = 1, \ldots ,C) \) was fixed. The remaining cities were arranged randomly in the route. This way \( C \) routes \( ({\mathbf{v}}^{1} , \ldots ,{\mathbf{v}}^{c} , \ldots ,{\mathbf{v}}^{C} ) \) are formed. And associated costs are calculated \( {\mathbf{F}}^{C} = \left\{ {f\left( {{\mathbf{v}}^{1} } \right), \ldots ,f\left( {{\mathbf{v}}^{c} } \right), \ldots ,f\left( {{\mathbf{v}}^{C} } \right)} \right\} \). The following procedure is explained in the context of the roulette wheel selection approach.

  1. (a)

    In the context of roulette wheel approach, the probability \( p^{c} \) of selecting the route \( {\mathbf{v}}^{c} \) of every associated candidate \( c,\;(c = 1, \ldots ,C) \) is calculated.

  2. (b)

    Every candidate \( c,\;(c = 1, \ldots ,C) \) using roulette wheel approach selects to follow a certain route \( {\mathbf{v}}^{\left( c \right)} \) of some other candidate (c), i.e. it incorporates an edge from within \( {\mathbf{v}}^{(c)} = \left( {v_{O}^{(c)} , \ldots v_{i}^{(c)} , \ldots v_{N}^{(c)} ,v_{O}^{(c)} } \right) \) and incorporates into its existing route \( {\mathbf{v}}^{c} = \left( {v_{O}^{c} , \ldots v_{i}^{c} , \ldots v_{N}^{c} ,v_{O}^{c} } \right) \). Following a route \( {\mathbf{v}}^{(c)} = \left( {v_{O}^{(c)} , \ldots v_{i}^{(c)} , \ldots v_{N}^{(c)} ,v_{O}^{(c)} } \right) \) means incorporating an edge from it into its existing route \( {\mathbf{v}}^{c} = \left( {v_{O}^{c} , \ldots v_{i}^{c} , \ldots v_{N}^{c} ,v_{O}^{c} } \right) \). More specifically, an edge \( (v_{i}^{(c)} ,v_{i + 1}^{(c)} ) \) from within \( {\mathbf{v}}^{(c)} = \left( {v_{O} , \ldots v_{i}^{(c)} , \ldots v_{N}^{(c)} ,v_{O} } \right) \) is selected. The positions of the cities of this edge in the route \( {\mathbf{v}}^{c} = \left( {v_{O} , \ldots v_{i}^{c} , \ldots v_{N}^{c} ,v_{O} } \right) \) of candidate c are identified. Then the position of the city which is farther from the city of origin \( v_{O}^{c} \) in the route is swapped with the position of the city immediately after the city which is closer to origin \( v_{O}^{c} \). In other words, the positions of the cities of this edge \( \left(\text{i.e.}\; \left( {v_{i}^{(c)} ,v_{i + 1}^{(c)} } \right)\right) \) in the route \( {\mathbf{v}}^{c} = (v_{O} , \ldots v_{i}^{c} , \ldots v_{N}^{c} ,v_{O} ) \) of candidate \( c \) are identified (say a and b). Then cities at positions a + 1 and b are swapped, which makes the edge \( \left( {v_{i}^{(c)} ,v_{i + 1}^{(c)} } \right) \) a part of the route \( {\mathbf{v}}^{c} \).

  3. (c)

    In this way, every candidate \( c,\;(c = 1, \ldots ,C) \) forms \( t \) new independent routes with associated costs \( {\mathbf{F}}^{c,t} = \left\{ {f\left( {{\mathbf{v}}^{c} } \right)^{1} , \ldots ,f\left( {{\mathbf{v}}^{c} } \right)^{j} , \ldots ,f\left( {{\mathbf{v}}^{c} } \right)^{t} } \right\},\;(c = 1, \ldots ,C) \) and further selects the best cost route amongst them. This makes the cohort available with \( C \) updated routes with their costs represented as \( {\mathbf{F}}^{C} = \left\{ {f^{*} \left( {{\mathbf{v}}^{1} } \right), \ldots ,f^{*} \left( {{\mathbf{v}}^{c} } \right), \ldots ,f^{*} \left( {{\mathbf{v}}^{C} } \right)} \right\} \).

This process continues until saturation, i.e. every candidate finds the same route and does not change for successive considerable number of learning attempts. The above discussed procedure of solving TSP using CI algorithm is illustrated in Figs. 6.1, 6.2 and 6.3 with a 5 city TSP, \( C = 3 \), origin city \( v_{O} \) as 1, the corresponding route \( {\mathbf{v}}^{c} \).

Fig. 6.1
figure 1

Illustrative example with 5 cities

Fig. 6.2
figure 2

Illustrative example with 5 cities (candidate solutions)

Fig. 6.3
figure 3

Illustrative example with 5 cities (variations obtained)

  1. 3.1(a)

    The probability \( p^{c} \) of each candidate \( c,(c = 1, \ldots ,3) \) is calculated. The calculated probability values are presented in Fig. 6.2.

  2. 3.1(b)

    Using roulette wheel selection approach, assume that candidate 1 decides to follow candidate 2. An edge is selected randomly from within the route \( {\mathbf{v}}^{2} \) and incorporated it into \( {\mathbf{v}}^{1} \) forming a new route.

  3. 3.1(c)

    In such manner \( t = 3 \) new routes are formed. It is represented in Fig. 6.3 along with the associated route cost vector \( {\mathbf{F}}^{1,3} = \left\{ {f\left( {{\mathbf{v}}^{1} } \right)^{1} ,f\left( {{\mathbf{v}}^{1} } \right)^{2} ,f\left( {{\mathbf{v}}^{1} } \right)^{3} } \right\} \) and the selected best route with cost \( f^{*} ({\mathbf{v}}^{1} ) \). It is presented in Fig. 6.3 In this way, candidates 2 and 3 also follow certain candidate’s route and update their own routes. It makes the cohort available with 3 updated routes with costs \( {\mathbf{F}}^{3} = \left\{ {f^{*} \left( {{\mathbf{v}}^{1} } \right),f^{*} \left( {{\mathbf{v}}^{2} } \right),f^{*} \left( {{\mathbf{v}}^{3} } \right)} \right\} \).

This process continues until saturation (convergence) i.e. every candidate finds the same route and does not change for successive considerable number of learning attempts.

In the context of the illustration provided in Figs. 6.1 and 6.2, in case of the best behavior selection approach every candidate in the cohort will follow candidate 2 as it has the minimum cost the current learning attempt. And the in case of the random behavior selection approach, every candidate selects a candidate randomly and follows its behavior. The results of the CI approach solving the TSP are discussed in the next section.

6.2 Results and Discussion

The CI algorithm discussed in Chap. 2 applied for solving the TSP was coded in MATLAB 7.7.0 (R2008b) and simulations were run on a Windows platform using i3-M380, 2.53 GHz processor speed with 3 GB RAM. The number of candidates C and variations t were chosen to be 5 and 5, respectively. In all, nine cases of the TSP [2] with number of cities varying from 14 to 29 were solved. Every case was solved 20 times. In the earlier version of CI [3], the CI candidates used roulette wheel approach for the selection of the behaviour in the cohort to follow. In addition to it, the CI algorithm here was successfully implemented with the best behavior selection and random behavior selection approach. The results are summarized in Table 6.1 with representative saturation history plots of the cohort with 5 candidates are presented in Fig. 6.4a–c.

Table 6.1 Summary of CI performance solving the TSP
Fig. 6.4
figure 4

CI saturation history solving the TSP (P01, 5 candidates)

It could be understood that, the cohort with roulette wheel selection approach saturated/converged in every run solving every case of the TSP to a marginally better solution than the best behaviour and random behaviour selection approach. In addition, even though the computational cost (time and function evaluations) of the CI with roulette wheel approach was more than CI with the best behaviour approach incorporated, the standard deviation (SD) exhibited comparatively more robustness (refer to Fig. 6.5b). The inherent probabilistic nature of the roulette wheel selection approach helped the algorithm explore a better solution from within the cohort. Also in some of the runs, similar to the feasibility-based rule developed in [9, 10], this approach necessarily helped the CI candidates jump out of local minima by following worse behaviour. It is important to mention here that the overall tendency to improve by competition and interaction ensured the saturation to an optimal solution. Furthermore, as presented in Table 6.1 and Fig. 6.5a, c the best behavior selection approach was found to be computationally (time and function evaluations) cheaper; however, the cohort stuck into local minima and did not yield a better solution. This happened because all the candidates in the cohort followed the best behaviour in every learning attempt, and the variation necessary for exploration and avoidance of the local minima was restricted. In the CI with random selection approach, following any candidate randomly forced the candidates explore the larger search space; however resulted into extremely slow saturation of the cohort behavior. Moreover as exhibited in Table 6.1, the saturation was not achieved in every run of the algorithm. The SD presented in Table 6.1 and Fig. 6.5a–c indicated that for solving all the cases the CI with roulette wheel selection approach was comparatively more robust. However, as the problem size increased, robustness of all the approaches was reduced. It was also observed that the computational cost of all the approaches increased with the increase in problem size.

Fig. 6.5
figure 5

Illustration of CI performance

Once the cohort behavior was saturated every candidate perturbed its individual solution. More specifically, the routes of all the candidates were randomly altered by changing the order of a certain number of cities in the vector \( {\mathbf{v}}^{c} = \left( {v_{O}^{c} , \ldots v_{i}^{c} , \ldots v_{n}^{c} ,v_{O}^{c} } \right) \) for every candidate \( c,\;(c = 1, \ldots ,N) \). It is important to mention here that the perturbation approach in [9, 10] required several parameters to be tuned which was completely avoided here. As evident in Fig. 6.4a–c, this approach was found to be helping the individual candidate’s solution jump out of local minima and further saturates the cohort behavior to a significantly improved solution.

6.3 Concluding Remarks and Future Directions

For the first time emerging CI algorithm has been applied for solving combinatorial NP-hard problem such as the TSP with number of cities varying from 14 to 29. The rational and self supervising learning nature of the cohort candidates was successfully formulated and demonstrated along with the learning and improving qualities which further improved their individual behavior. The application of the CI methodology for solving combinatorial NP-hard problem such as the TSP is successfully demonstrated. The CI incorporated with the roulette wheel approach, best behavior selection as well as random behavior selection approaches was successfully presented. The results highlighted the overall simplicity of the algorithm as well as robustness of the solution with the roulette wheel approach. It also underscored that the CI incorporated with the roulette wheel selection approach more realistically resembles the competitive and interactive learning behavior of the cohort candidates, which eventually drove the cohort to marginally improved solution. Moreover, it is also demonstrated that always following the best behavior/solution may make the cohort to saturate faster; however may make the cohort stuck into local minima. In addition, in order to jump out of possible local minima and further make the cohort saturate to global minimum, a generic approach such as accepting worst behaviors was incorporated. The encouraging results may help solve the real world problems with increasing complexity as the TSP can be further generalized to a wide variety of routing and scheduling problems [4]. In addition, CI approach could be modified to make it solve Multiple TSP (MTSP) and Vehicle Routing Problem (VRP).

In addition to the advantages few limitations are also observed. A generic fine parameter tuning approach needs to be developed for selection of the parameters such as number of candidates \( C \) and number of variations \( t \). In this chapter we have solved problems of sizes up to 29 cities. As the problem size was increased, the solutions obtained were less robust and the global minimum was found only intermittently. A possible solution to this problem is to develop a distributed CI approach wherein larger sized problems could be decomposed into smaller size problems and solve them independently. In this context, author see potential real world applications related to the distributed communication system such as, path planning of Unmanned Aerial vehicles (UAV) and addressing the ever growing traffic control problem using Vehicular ad hoc network (VANET).