In this paper, a recently developed nature-inspired optimization algorithm called the hydrological cycle algorithm (HCA) is evaluated on the traveling salesman problem (TSP). The HCA is based on the continuous movement of water drops in the natural hydrological cycle. The HCA performance is tested on various geometric structures and standard benchmarks instances. The HCA has successfully solved TSPs and obtained the optimal solution for 20 of 24 benchmarked instances, and near-optimal for the rest. The obtained results illustrate the efficiency of using HCA for solving discrete domain optimization problems. The solution quality and number of iterations were compared with those of other metaheuristic algorithms. The comparisons demonstrate the effectiveness of the HCA.
Nature provides inspiration that can be used for computational processes. Many nature-inspired algorithms have emerged for solving optimization problems. The HCA is one of the newly proposed algorithms in the field of the swarm intelligence. The HCA is a water-based algorithm that simulates water movement through the hydrological cycle. The HCA uses a collection of artificial water drops that pass through various hydrological water cycle stages in order to generate solutions. The algorithm has been divided into four main stages: flow, evaporation, condensation, and precipitation. Each stage has a counterpart in the natural hydrological cycle and has a role in constructing the solution. Moreover, these stages work to complement each other and occur sequentially. The result of one stage is input to the next stage. Temperature is the main factor driving the water cycle through all stages. The algorithm starts with a low temperature and gradually increases until the cycle begins, then the temperature drops, as is natural in the real hydrological cycle.
Water-based algorithms are considered to be a subclass of nature-inspired algorithms that are based on certain factors or processes related to the activities and natural movements of water. Therefore, they share certain aspects of their conceptual framework. Each algorithm has a set of parameters and operations that form a procedure used to find a solution in an iterative process. However, they differ in their mathematical models and stages. These algorithms are frequently and widely used in solving many optimization problems.
Although there are already several water-based algorithms, none of them takes into account the full water cycle and the activities associated with water movement. The partial simulation of a natural process may limit the algorithm performance, especially in terms of exploration and exploitation capabilities which can lead to problems such as stagnation, increased computational effort, or premature convergence. Adding extra stages to an algorithm should only be done when there are clear advantages in doing so. One of the aims of this paper is to provide evidence that, for solving the TSP, including all stages of the water cycle has benefits over including only some stages.
The intelligent water drops (IWD) algorithm is a water-based algorithm proposed by Shah-Hosseini [
The water cycle algorithm (WCA) is another water-based algorithm, proposed by Eskandar et al. [
A major problem in some of these algorithms is the process of choosing the next point to visit. They use one heuristic for controlling the movement of the entities in the search space. In particular, this can be observed when most algorithm entities keep choosing the same nodes repeatedly because there is no other factor affecting their decisions. For instance, the IWD algorithm uses only the soil as heuristic for guiding the entities through the search space. For this reason, the IWD suffers from inability to make a different selection among a set of nodes that have similar probabilities [
Furthermore, some existing particle swarm algorithms rely on either direct or indirect communication for sharing information among the entities. Enabling both direct and indirect communication leads to better results and may reduce the iterations to reach the global optimum solution. Otherwise, the entities are likely to fall into the local optimum solution or produce the same solutions in each iteration (stagnation), and this leads to a degradation of the overall performance of the algorithm.
These aspects have been considered when designing the HCA by taking into account the limitations and weaknesses of previous water-based algorithms. This refinement involved enabling direct and indirect communication among the water drops. Such information sharing improved the overall performance and solution quality of the algorithm. Indirect communication was achieved in the flow stage by depositing and removing soil on/from paths and using path-depth heuristics. Direct communication was implemented via the condensation stage and was shown to promote the exploitation of good solutions. Furthermore, the condensation is a problem-dependent stage that can be customized according to the problem specifications and constraints. The cyclic nature of the HCA also provided a self-organizing and a feedback mechanism that enhanced the overall performance. The search capability of the HCA was enhanced by including the depth factor, velocity fluctuation, soil removal and deposition processes. The HCA provides a better balance between exploration and exploitation processes by considering these features. This confirmed that changing certain design aspects can significantly improve the algorithm’s performance. The HCA was successfully applied and evaluated on continuous optimization problems [
This paper aims to present a new approach for solving TSP using HCA. This application also helps to evaluate the performance of the HCA on a discrete domain problem. Although many approaches can solve the TSP with high quality, the TSP remains an effective way of testing a new algorithm on discrete problems. Therefore, the main goal of this application is to measure the algorithm’s ability to optimize (or nearly optimize) the solution for a simple discrete NP-hard problem. Through the success of this application, we can define the strength of HCA and whether it is able to deal with other NP-hard problems.
The rest of this paper is organized as follows. Section 2 provides an overview of some algorithms have been used to solve TSPs. Section 3 reviews the TSP and its formulation. Section 4 presents the configuration of HCA and explains its application to the TSP. Section 5 demonstrates the feasibility of solving TSP instances by HCA and compares the results with those of other algorithms. Discussion and conclusions are presented in Section 6.
In general, small TSPs are most easily solved by trying all possibilities (i.e. exhaustive searching). This can be achieved by brute-force and branch-and-bound. These methods generate all possibilities and choose the least-cost solution at various choice points. Although these techniques will guarantee the optimal solution, they become impractical and expensive (i.e. require unreasonable time) when solving large TSP instances. A simple alternative is a greedy heuristic algorithm, which solves the TSP using a heuristic function. Such algorithms cannot guarantee the optimal solution, as they do not perform an exhaustive search. However, they perform sufficiently many evaluations to find the optimal/near optimal solution. Many greedy algorithms have been developed for TSPs, such as the nearest-neighbor (NN), insertion heuristics, and dynamic programming (DP) techniques. Metaheuristic algorithms can also provide high-quality solutions to large TSP instances.
The TSP has been extensively solved by different metaheuristic algorithms owing to its practical applications. The IWD algorithm was tested on the TSP [
Wu, Liao, and Wang [
The water flow-like algorithm (WFA) is also used to solve the TSP [
In solving the TSP using river formation dynamics (RFD), Rabanal, Rodríguez, and Rubio [
Zhan, Lin, Zhang, and Zhong [
Geng, Chen, Yang, Shi, and Zhao [
Genetic algorithm (GA) has also been applied to TSPs in different configurations [
Ant colony optimization (ACO) has been applied to the TSP ( [
Zhong, Zhang, and Chen [
Wang, Huang, Zhou, and Pang [
Other algorithms like the bat algorithm has also used to solve several TSPs [
The TSP is a well-known classical combinatorial optimization problem in which a salesperson must visit every designated city exactly once, and return to the starting point, via the shortest possible route. Such a path is known as a Hamiltonian cycle [
Typically, a TSP is represented as a complete undirected weighted graph, where each node is connected to all other nodes. The graph G = (V, E) consists of a set of V nodes (i.e. cities) connected by a set of E edges (i.e. roads), where the edges are associated (assigned) with various weights. The weight is a nonnegative number reflecting the distance, the travel cost, or time of traveling that edge. Given the node coordinates (locations), the Euclidean distance between two nodes i and j can be calculated as follows:
D i s t a n c e ( i , j ) = ( x i − x j ) 2 + ( y i − y j ) 2 (1)
The TSP can be a symmetric or asymmetric weighted problem. In the symmetric problem, the path from node A to node B has the same weight as the path from node B to node A. In contrast, paths in the asymmetric problem may be unidirectional or carry different weights in each direction. Mathematically, the TSP can be formulated as Equation (2) [
Minimise ∑ i = 1 N D i j X i j , N ≥ 3 (2)
subject to
X i j ∈ { 0 , 1 } , i , j = 1 , ⋯ , N , i ≠ j (3)
In Equation (3), the decision variables Xij are set to 1 if the connecting edge is part of the solution, and 0 otherwise:
X i j = { 1 , if ( i , j ) ∈ Solution 0 , if ( i , j ) ∉ Solution (4)
The TSP is considered as an NP-hard problem, meaning that its complexity increases non-linearly with increasing number of cities. Therefore, the number of possible solutions rises rapidly as the number of cities increases. Practically, the TSP finds the best order of the visited nodes at the lowest cost, which can be interpreted as a permutation problem. The number of possible solutions for an n-city problem is given by:
Number of solutions = ( n − 1 ) ! 2 , where n ≥ 3 (5)
Equation (5) calculates the number of possible ways of arranging n cities into an ordered sequence (with no repeats). As the starting node is unimportant, there are (n − 1)! rather than n! possible solutions. The result is divided by two because the reverse routes are ignored.
In this example, one of the best solutions is (2 → 1 → 5 → 4 → 3 → 2) with a cost of 190. Another repeated solution with the same cost but a different starting node is (1 → 5 → 4 → 3 → 2 → 1).
Typically, the input of the HCA algorithm is represented as a graph. To solve the TSP, the input to the HCA will be a fully connected graph that represents the problem solution space. The graph has a set of nodes (cities) and set of undirected edges (roads) between the nodes. The characteristics associated with each edge are the initial amount of soil and edge depth. The HCA uses a set of artificial water drops to generate solutions, where each water drop has three properties: velocity, amount of carried soil, and solution quality. The procedure of HCA is specified in the following steps:
1) Initialization of the variables and read the problem data.
2) Distribution of the water drops on the nodes of the graph at random.
3) Repeat steps 4) to 7) until termination conditions are met.
4) The flow stage (repeat sub-steps a) - d) until temperature reaches a specific value).
A water drop iteratively constructs a solution for the problem by continuously moving between the nodes.
a) Choosing next node
The movements are affected by the amount of soil and the path depths. The probability of choosing node j from node i is calculated using Equation (6).
P i W D ( j ) = f ( S o i l ( i , j ) ) 2 × g ( D e p t h ( i , j ) ) ∑ k ∉ v c ( W D ) ( f ( S o i l ( i , k ) ) 2 × g ( D e p t h ( i , k ) ) ) (6)
where P i W D ( j ) is the probability of choosing node j from node i, and vc is the
visited list of each water drop. The f(Soil(i, j)) is equal to the inverse of the soil between i and j, and is calculated using Equation (7).
f ( S o i l ( i , j ) ) = 1 ε + S o i l ( i , j ) (7)
ε = 0.01 is a small value that is used to prevent division by zero. The second factor of the transition rule is the inverse of depth, which is calculated based on Equation (8).
g ( D e p t h ( i , j ) ) = 1 D e p t h ( i , j ) (8)
Depth (i, j) is the depth between two nodes i and j, and calculated by dividing the length of the path by the amount of soil. The depth of the path needs to be updated when the amount of soil existing on the path changes. The depth is updated as follows:
D e p t h ( i , j ) = L e n g t h ( i , j ) S o i l ( i , j ) (9)
After selecting the next node, the water drop moves to the selected node and marks it as visited.
b) Update velocity
The velocity of a water drop might be increased or decreased while it is moving. Mathematically, the velocity of a water drop at time (t + 1) is calculated using Equation (10).
V t + 1 W D = [ K × V t W D ] + α ( V t W D S o i l ( i , j ) ) + V t W D S o i l W D 2 + ( 100 ψ W D ) + V t W D D e p t h ( i , j ) 2 (10)
where V t + 1 W D is the current water drop velocity, and K is a uniformly distributed random number between [0, 1] that refers to the roughness coefficient. Alpha (α) is a relative influence coefficient that emphasizes this term in the velocity update equation and helps the water drops to emphasize and favor the path with fewer soils over the other factors. The expression is designed to prevent one water drop from dominating the other drops. That is, a high-velocity water drop is able to remove more soil than slower ones. Consequently, the water drops are more likely to follow the carved paths, which may guide the swarm towards local optimal solution.
c) Update soil
Next, the amount of soil existing on the path and the depth of that path are updated. A water drop can remove (or add) soil from (or to) a path while moving based on its velocity. This is expressed by Equation (11).
S o i l ( i , j ) = { [ P N ∗ S o i l ( i , j ) ] − Δ S o i l ( i , j ) − 1 D e p t h ( i , j ) 2 if V W D ≥ A v g ( a l l V W D S ) ( Erosion ) [ P N ∗ S o i l ( i , j ) ] + Δ S o i l ( i , j ) + 1 D e p t h ( i , j ) 2 else ( Deposition ) (11)
PN represents a coefficient (i.e., sediment transport rate, or gradation coefficient) that may affect the reduction in the amount of soil. The increasing soil amount on some paths favors the exploration of other paths during the search process and avoids entrapment in local optimal solutions. The rate of change in the amount of soil existing between node i and node j depends on the time needed to cross that path, which is calculated using Equation (12).
Δ S o i l ( i , j ) = 1 t i m e i , j W D (12)
such that,
t i m e i , j W D = D i s t a n c e ( i , j ) V t + 1 W D (13)
In HCA, the amount of soil the water drop carries reflects its solution quality. Therefore, the water drop with a better solution will carry more soil, which can be expressed by Equation (14).
S o i l W D = S o i l W D + Δ S o i l ( i , j ) ψ W D (14)
One iteration is considered complete when all water drops have generated solutions based on the problem constraints (i.e., when each water drop has visited each node). A solution represents the order of visiting all the nodes and returning to the starting node. The qualities of the evaluated solutions are used to update the temperature.
d) Update temperature
The new temperature value depends on the solution quality generated by the water drops in the previous iterations. The temperature will be increased as follows:
T e m p ( t + 1 ) = T e m p ( t ) + Δ T e m p (15)
where,
Δ T e m p = { β ∗ ( T e m p ( t ) Δ D ) Δ D > 0 T e m p ( t ) 10 otherwise (16)
and where coefficient β is determined based on the problem. The difference ( Δ D ) is calculated using Equation (17).
Δ D = M a x V a l u e − M i n V a l u e (17)
Such that,
M a x V a l u e = max [ Solutions Quality ( W D s ) ] M i n V a l u e = min [ Solutions Quality ( W D s ) ] (18)
According to Equation (17), increase in temperature will be affected by the difference between the best solution (MinValue) and the worst solution (MaxValue). At the end of each iteration, the HCA checks whether the temperature is high enough to evaporate the water drops. Thus, the flow stage may run several times before the evaporation stage starts. When the temperature increases and reaches a specified value, the evaporation stage is invoked.
5) The evaporation stage:
A certain number of water drops evaporates based on the evaporation rate. The evaporation rate is determined by generating a random number between one and the total number of water drops (see Equation 19).
Evaporation rate = Random_Integer ( 1 , N ) (19)
The evaporated water drops are selected by the roulette wheel technique. The evaporation process is an approach to avoid stagnation or local-optimal solutions.
6) The condensation stage:
The condensation stage is executed as a result of the evaporation process, which is a problem-dependent process and can be customized to improve the solution quality by performing certain tasks (i.e., local improvement method). The condensation stage collides and merges the evaporated water drops, eliminating the weak drops and favoring the best drop (i.e., the collector), see Equation (20).
O P ( W D 1 , W D 2 ) = { Bounce ( W D 1 , W D 2 ) , Similarity < 50 % Merge ( W D 1 , W D 2 ) , Similarity ≥ 50 % (20)
Finding the similarity between the solutions is problem-dependent, and measures how much two solutions are close to each other. For the TSP, the similarities between the solutions of the water drops are measured by the Hamming distance [
Parameter name | Parameter value |
---|---|
Number of water drops | Equal to number of nodes |
Maximum number of iterations | Triple the number of nodes |
Initial soil on each edge | 10,000 |
Initial velocity | 100 |
Initial depth | Edge length/soil on that edge |
Initial carrying soil | 1 |
Velocity updating | α = 2 |
Soil updating | PN = 0.99 |
Initial temperature | 50, β = 10 |
Maximum temperature | 100 |
7) The precipitation stage:
This precipitation is considered as a termination stage, as the algorithm has to check whether the termination condition is met. If the condition has been met, the algorithm stops with the last global-best solution. Otherwise, this stage is responsible for reinitializing all the dynamic variables, such as the amount of the soil on each edge, depth of paths, the velocity of each water drop, and the amount of soil it holds. The re-initialization of the parameters happens after certain iterations and helps the algorithm to avoid being trapped in local optima, which may affect the algorithm’s performance in the next cycle. Moreover, this stage is considered as a reinforcement stage, which is used to place emphasis on the collector drop. This is achieved by reducing the amount of soil on the edges that belong to the best water drop solution, see Equation (21).
S o i l ( i , j ) = 0.9 ∗ s o i l ( i , j ) , ∀ ( i , j ) ∈ B e s t W D (21)
The idea behind that is to favor these edges over the other edges in the next cycle. These stages are repeated until the maximum number of iterations is reached. The HCA goes through a number of cycles and iterations to find a solution to a problem.
In this paper, the TSP is assumed to be symmetric, and acting on a fully connected graph. The candidate TSP solutions are stored in a matrix, where each row represents a different solution generated by a water drop. Therefore, a water drop solution consists of the order of the visited nodes (with no repeat visits). The length of each row (i.e. the number of columns) is denoted by n and determined by the total number of nodes (see Equation 22).
Solutions = [ W D 1 1 2 ⋯ n W D 2 1 2 ⋯ n W D 3 1 2 ⋯ n ⋮ ⋮ ⋮ ⋱ ⋮ W D n 1 2 ⋯ n ] (22)
The quality of generated tours can be improved by many operations, such as k-Opt (where k = 2, 3, or 4) [
The HCA was tested and evaluated on two groups of TSP instances; structural and benchmark. The runtime and solution quality of the benchmark results were compared with those of other algorithms.
The HCA parameter values used for TSP are listed in
The depth values had a very small value. Therefore, it has been normalized to be within [1 - 100]. The amount of soil has been restricted to be within a maximum and minimum value for avoiding negative values. The maximum value is regarded as the initial value, while the minimum value is fixed to equal one. The algorithm was implemented using MATLAB. All the experiments were conducted on a computer with Intel Core i5-4570 (3.20 GHz) CPU and 16 GB RAM,
under Microsoft Windows 7 Enterprise as an operating system.
To assess the validity of the generated output, we designed and generated synthetic TSP structures with different geometric shapes (circle, square, and triangle). These TSP structures are easier to evaluate than randomized instances. Several instances with different numbers of nodes were generated for each structure, and were input to the HCA algorithm with and without the 2-Opt operation. The percentage difference (i.e., the deviation percentage) between the obtained and the optimal value was calculated as follows:
Difference = ( Obtained Value − Optimal Value ) Optimal Value × 100 % (23)
In the circular structure, the circle circumference was divided into various numbers of nodes. Note that the number of nodes influences the inter-nodal distance, with fewer nodes increasing the distance between nodes. The node number was varied as 25, 50, 75, 100, 125, and 150. By dividing the circumference of the circle into a specific number of nodes, the first and last nodes will have the same coordinate. The shortest path length was calculated by the circle circumference formula (2 × π × r). The circle was centered at (1, 1) and its diameter was set to 2 (i.e., r = 1). Consequently, its circumference was 6.28. The obtained results are reported in
As shown in
Next, the TSP was solved on a square structure. Here, the nodes were evenly spaced in an N × N grid. The shortest tour distance was the product of the number of nodes and the distance between the nodes (assumed as one unit). For example, in the 16-point (8 × 8) grid, the shortest path was (1 × 16 = 16). For an odd number of nodes, the cost of traveling to the last node was based on the length of the hypotenuse (1.41 in the present examples). Ten instances with different numbers of nodes were generated, and solved by the HCA with and without the 2-Opt operation. The results are listed in
As shown in
outputs of HCA with 2-Opt on square grids of different sizes are shown in
Finally, the TSP was solved on an equilateral triangular grid. The number of nodes was varied as 9, 25, 49, 81, 121, and 169.
Instance Name | Optimal Solution | With 2-Opt | Without 2-Opt | ||||
---|---|---|---|---|---|---|---|
Result | Avg. | Difference | Result | Avg. | Difference | ||
Circle_25 | 6.28 | 6.28 | 0.72 | 0% | 6.28 | 0.65 | 0% |
Circle_50 | 6.28 | 6.28 | 4.48 | 0% | 6.28 | 4.47 | 0% |
Circle_75 | 6.28 | 6.28 | 15.43 | 0% | 6.28 | 15.13 | 0% |
Circle_100 | 6.28 | 6.28 | 38.60 | 0% | 6.28 | 37.23 | 0% |
Circle_125 | 6.28 | 6.28 | 80.49 | 0% | 6.28 | 74.50 | 0% |
Circle_150 | 6.28 | 6.28 | 146.68 | 0% | 6.28 | 136.99 | 0% |
Instance Name | Optimal Solution | With 2-Opt | Without 2-Opt | ||||
---|---|---|---|---|---|---|---|
Result | Avg. | Difference | Result | Avg. | Difference | ||
Square_9 | 9.41 | 9.41 | 0.10 | 0% | 9.41 | 0.01 | 0% |
Square_16 | 16 | 16 | 0.22 | 0% | 16 | 0.22 | 0% |
Square_25 | 25.41 | 25.41 | 0.65 | 0% | 25.41 | 0.64 | 0% |
Square_36 | 36 | 36 | 1.74 | 0% | 36 | 1.72 | 0% |
Square_49 | 49.41 | 49.41 | 4.35 | 0% | 49.41 | 4.33 | 0% |
Square_64 | 64 | 64 | 9.90 | 0% | 64 | 9.55 | 0% |
Square_81 | 81.41 | 81.41 | 20.53 | 0% | 81.41 | 19.58 | 0% |
Square_100 | 100 | 100 | 39.55 | 0% | 100 | 39.44 | 0% |
Square_121 | 121.41 | 121.41 | 74.054 | 0% | 121.41 | 72.38 | 0% |
Square_144 | 144 | 144 | 130.93 | 0% | 146.89 | 125.18 | 0.02% |
Instance Name | Optimal Solution | With 2-Opt | Without 2-Opt | ||||
---|---|---|---|---|---|---|---|
Result | Avg. | Difference | Result | Avg. | Difference | ||
Square_9 | 9.41 | 9.41 | 0.10 | 0% | 9.41 | 0.01 | 0% |
Square_16 | 16 | 16 | 0.22 | 0% | 16 | 0.22 | 0% |
Square_25 | 25.41 | 25.41 | 0.65 | 0% | 25.41 | 0.64 | 0% |
Square_36 | 36 | 36 | 1.74 | 0% | 36 | 1.72 | 0% |
Square_49 | 49.41 | 49.41 | 4.35 | 0% | 49.41 | 4.33 | 0% |
Square_64 | 64 | 64 | 9.90 | 0% | 64 | 9.55 | 0% |
Square_81 | 81.41 | 81.41 | 20.53 | 0% | 81.41 | 19.58 | 0% |
Square_100 | 100 | 100 | 39.55 | 0% | 100 | 39.44 | 0% |
Square_121 | 121.41 | 121.41 | 74.054 | 0% | 121.41 | 72.38 | 0% |
Square_144 | 144 | 144 | 130.93 | 0% | 146.89 | 125.18 | 0.02% |
The HCA with and without 2-Opt operation produced almost similar results, except for the triangles with 121 and 169 nodes where using 2-Opt gave better
results. The TSP is more difficult on the triangular structure than on the other structures, because many hypotenuses connect the nodes to different layers. The outputs of the HCA using 2-Opt on triangular grids with different node numbers are reported in
The average execution times for solving all the TSP structural instances by HCA are presented by
Next, the HCA was applied to a number of standard benchmark instances from the TSPLIB library [
from the optimal solution using Equation (7).
No. | Instance name | Node number | Optimal result | HCA | Difference % |
---|---|---|---|---|---|
1 | berlin52 | 52 | 7542 | 7542 | 0 |
2 | ch130 | 130 | 6110 | 6110 | 0 |
3 | ch150 | 150 | 6528 | 6528 | 0 |
7 | d198 | 198 | 15,780 | 15,780 | 0 |
4 | eil51 | 51 | 426 | 426 | 0 |
5 | eil76 | 76 | 538 | 538 | 0 |
6 | eil101 | 101 | 629 | 629 | 0 |
8 | kroA100 | 100 | 21,282 | 21,282 | 0 |
9 | kroA150 | 150 | 26,524 | 26,614 | 0.00339 |
10 | kroA200 | 200 | 29,368 | 29,368 | 0 |
11 | kroB100 | 100 | 22,141 | 22,141 | 0 |
12 | kroB150 | 150 | 26,130 | 26,132 | 0.00008 |
13 | kroB200 | 200 | 29,437 | 29,455 | 0.00061 |
14 | kroC100 | 100 | 20,749 | 20,749 | 0 |
15 | kroD100 | 100 | 21,294 | 21,294 | 0 |
16 | kroE100 | 100 | 22,068 | 22,068 | 0 |
17 | lin105 | 105 | 14,379 | 14,379 | 0 |
18 | pr76 | 76 | 108,159 | 108,159 | 0 |
19 | pr107 | 107 | 44,303 | 44,303 | 0 |
20 | pr124 | 124 | 59,030 | 59,030 | 0 |
21 | pr136 | 136 | 96,772 | 96,861 | 0.00092 |
22 | rat195 | 195 | 2323 | 2323 | 0 |
23 | st70 | 70 | 675 | 675 | 0 |
24 | ts225 | 225 | 126,643 | 126,643 | 0 |
Average | 29534.6 | 29542.9 | |||
T-test (P-value) | 0.12174 |
The results in
The minimal cost in HCA was compared with the reported results of other water-based algorithms, namely, the intelligent water drops (IWD) algorithm and its modifications, water wave optimization (WWO), the water flow-like
Instance name | Cost | Time(s) | #Iteration | Instance name | Cost | Time(s) | Iteration | ||
---|---|---|---|---|---|---|---|---|---|
berlin52 | Min | 7542 | 5.15 | 5 | kroB200 | Min | 29,455 | 455.53 | 35 |
Avg. | 7565.3 | 5.36 | 37.9 | Avg. | 29519.9 | 464.62 | 200.6 | ||
Max | 7758 | 5.78 | 55 | Max | 29,612 | 474.95 | 305 | ||
ch130 | Min | 6110 | 93.08 | 53 | kroC100 | Min | 20,749 | 39.54 | 11 |
Avg. | 6128.9 | 95.79 | 168.2 | Avg. | 20,751 | 39.74 | 71 | ||
Max | 6177 | 101.61 | 359 | Max | 20,769 | 39.96 | 303 | ||
ch150 | Min | 6528 | 149.98 | 17 | kroD100 | Min | 21,294 | 40.10 | 5 |
Avg. | 6550.8 | 157.55 | 154.4 | Avg. | 21416.4 | 40.43 | 151.4 | ||
Max | 6570 | 162.05 | 347 | Max | 21,772 | 40.79 | 299 | ||
d198 | Min | 15780 | 415.00 | 47 | kroE100 | Min | 22,068 | 40.27 | 23 |
Avg. | 15785.3 | 422.04 | 209.6 | Avg. | 22152.9 | 40.63 | 107 | ||
Max | 15,794 | 432.66 | 593 | Max | 22,389 | 41.07 | 203 | ||
eil51 | Min | 426 | 4.70 | 11 | lin105 | Min | 14,379 | 46.59 | 11 |
Avg. | 426.85 | 4.73 | 47.2 | Avg. | 14385.6 | 47.25 | 111.8 | ||
Max | 430 | 4.79 | 86 | Max | 14,412 | 47.75 | 263 | ||
eil76 | Min | 538 | 16.19 | 11 | pr76 | Min | 108,159 | 16.47 | 5 |
Avg. | 538.5 | 16.34 | 47.8 | Avg. | 108163.3 | 16.58 | 32 | ||
Max | 539 | 16.45 | 137 | Max | 108,202 | 16.84 | 215 | ||
eil101 | Min | 629 | 41.37 | 34 | pr107 | Min | 44,303 | 48.25 | 5 |
Avg. | 632 | 41.60 | 99.9 | Avg. | 44367.5 | 48.84 | 80 | ||
Max | 638 | 41.85 | 274 | Max | 44,438 | 49.35 | 293 | ||
kroA100 | Min | 21,282 | 40.39 | 23 | pr124 | Min | 59,030 | 78.60 | 5 |
Avg. | 21308.1 | 40.70 | 112.4 | Avg. | 59,030 | 79.19 | 47 | ||
Max | 21,369 | 41.03 | 275 | Max | 59,030 | 79.96 | 101 | ||
kroA150 | Min | 26,614 | 161.42 | 11 | pr136 | Min | 96,861 | 109.96 | 41 |
Avg. | 26742.2 | 162.67 | 204.2 | Avg. | 96985.1 | 110.93 | 204.2 | ||
Max | 26,917 | 163.69 | 371 | Max | 97,235 | 113.14 | 371 | ||
kroA200 | Min | 29,368 | 461.13 | 29 | rat195 | Min | 2323 | 385.41 | 29 |
Avg. | 29396.3 | 469.99 | 150.2 | Avg. | 2334.6 | 390.44 | 314.6 | ||
Max | 29,518 | 479.46 | 299 | Max | 2343 | 396.57 | 557 | ||
kroB100 | Min | 22,141 | 39.72 | 5 | st70 | Min | 675 | 12.42 | 11 |
Avg. | 22,222 | 40.00 | 19.4 | Avg. | 676.5 | 12.59 | 77.2 | ||
Max | 22,258 | 40.38 | 101 | Max | 681 | 12.71 | 182 | ||
kroB150 | Min | 26,132 | 157.96 | 83 | ts225 | Min | 126,643 | 626.73 | 125 |
Avg. | 26216.2 | 161.33 | 217.4 | Avg. | 126788.1 | 636.24 | 336.2 | ||
Max | 26,329 | 165.14 | 419 | Max | 126,962 | 643.72 | 647 |
algorithm (WFA), and river formation dynamics (RFD). The comparisons are summarized in
The numbers of instances solved by these algorithms are insufficient for calculating an accurate P-value statistic. Moreover, some of these algorithms perform as well as HCA in certain instances. However, as confirmed in
Instance name | Optimal result | HCA | Original IWD (4) | IWD (5) | ERS-IWD (6) | Adaptive IWD | WWO (9) | WFA (10) | RFD (11) | |
---|---|---|---|---|---|---|---|---|---|---|
IWD (7) | AIWD (8) | |||||||||
berlin52 | 7542 | 7542 | - | 7542 | - | - | - | - | - | - |
ch130 | 6110 | 6110 | - | - | 6316 | - | - | 6338 | 6110 | - |
ch150 | 6528 | 6528 | - | - | - | - | - | 7014 | 6528 | - |
eil51 | 426 | 426 | 471 | 426 | 429 | 434 | 426 | 427 | 426 | 441.9 |
eil76 | 538 | 538 | 559 | 540 | 545 | 552 | 538 | 557 | 538 | - |
eil101 | 629 | 629 | - | 639 | 654 | - | - | - | 629 | - |
kroA100 | 21,282 | 21,282 | 23,156 | 21,429 | 21,959 | 23,183 | 21,304 | 21,668 | 21,282 | - |
kroA150 | 26,524 | 26,614 | - | - | - | - | - | - | 26,524 | - |
kroA200 | 29,368 | 29,368 | - | - | 31,680 | - | - | 31,064 | 29,368 | - |
kroC100 | 20,749 | 20,749 | - | 20,816 | - | - | - | - | - | - |
lin105 | 14,379 | 14,379 | - | 14,393 | 14,696 | - | - | - | - | - |
pr76 | 108,159 | 108,159 | - | 109,608 | - | - | - | - | - | - |
rat195 | 2323 | 2323 | - | - | - | 2461 | 2338 | - | ||
st70 | 675 | 675 | - | 676 | - | 710 | 675 | - | - | - |
ts225 | 126,643 | 126,643 | - | - | - | 275791 | 127325 | - | - | - |
Average | 24791.7 | 24797.7 | 8062 | 19563.2 | 10,897 | 50521.8 | 25434.3 | 11178 | 11426 | 441.9 |
P-values vs HCA | 0.4025 | 0.2701 | 0.1598 | 0.3219 | 0.1878 | 0.1302 | 0.2813 | - |
was originally designed for continuous-domain problems, and its operations need adjustment for combinatorial problems. Moreover, the WWO adopts a reducing population-size strategy, which degrades its performance in some problems. Finally, the WWO suffers from slow convergence because it depends only on the altitude of the nodes.
The performances of HCA, IWD, adaptive IWD (AIWD) and modified IWD (MIWD) are further compared in
This comparison aims to compare the robustness of HCA and other algorithms. Despite there being no significant differences between the results (best, average), the average results are closer to the optimal in HCA than in the other algorithms, suggesting the superior robustness of HCA.
According to
Optimal-solution searching by HCA was compared with those of other well-known algorithms, namely, an ACO algorithm combined with fast opposite gradient search (FOGS-ACO) [
Instance Name | HCA | IWD | AIWD | MIWD | ||||
---|---|---|---|---|---|---|---|---|
Best | Avg. | Best | Avg. | Best | Avg. | Best | Avg. | |
Eil51 | 426 | 426.85 | 434 | 443.2 | 426 | 428.4 | 428.98 | 432.62 |
St70 | 675 | 676.5 | 710 | 724.93 | 675 | 682.5 | 677.1 | 684.08 |
Eil76 | 538 | 538.5 | 552 | 564.43 | 538 | 542.86 | 549.96 | 558.23 |
KroA100 | 21282 | 21308.1 | 23183 | 23548.37 | 21,304 | 21586.73 | 21407.57 | 21904.03 |
rat195 | 2323 | 2334.6 | 2461 | 2480.6 | 2338 | 2347.8 | - | - |
ts225 | 126643 | 126788.1 | 755791 | 276140.75 | 127,325 | 128323.5 | - | - |
Average | 29912.8 | 29947.6 | 130521.8 | 50650.4 | 25434.3 | 25652.0 | 5765.9 | 5894.7 |
T-test (P-values) vs HCA | 0.3722 | 0.3656 | 0.3570 | 0.2867 | 0.3209 | 0.3611 |
Instance name | HCA | IWD | Adaptive IWD | |||
---|---|---|---|---|---|---|
Avg. Time (s) | Iteration [Best, Avg.] | Avg. Time (s) | Iteration [Best, Avg.] | Avg. Time (s) | Iteration [Best, Avg.] | |
eil51 | 4.73 | [57, 47.2] | 154.537 | [1509, 3000] | 180.648 | [190, 3000] |
st70 | 12.59 | [83, 77.2] | 434.193 | [960, 3,500] | 453.631 | [1769, 3500] |
eil76 | 16.34 | [46, 47.8] | 567.208 | [2147, 3,500] | 571.251 | [752, 3500] |
kroA100 | 40.7 | [89, 112.4] | 1364.979 | [3698, 3750] | 1365.752 | [2397, 3750] |
rat195 | 390.44 | [401, 314.6] | 2023.162 | [604, 5000] | 2335.9392 | [4995, -] |
ts225 | 636.24 | [365, 336.2] | 3969.892 | [1, 5000] | 4162.92 | [3850, 5000] |
Average | 142.1 | 1419.0 | 1511.7 | |||
T-test (P-value) for Avg. Time | 0.1162 | 0.1200 |
Instance name | Optimal result | HCA | FOGS-ACO | GSAACS-PSO | IBA | S-CLPSO | C3D-PSO | ASA-GS | FA | ACOMAC-DNN | DPSO | ABNET-TSP | IDCS |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
berlin52 | 7542 | 7542 | 7546.6 | 7542 | 7542 | 7542 | 7544.7 | 7544.36 | - | 7542 | 7542 | 7542 | |
ch130 | 6110 | 6110 | - | 6141 | - | - | 6110.7 | - | - | - | 6145 | 6110 | |
ch150 | 6528 | 6528 | - | 6528 | - | - | 6530.9 | - | - | - | 6602 | 6528 | |
eil51 | 426 | 426 | 426 | 427 | 426 | 426 | 426 | 428.87 | 428.87 | 430.01 | 427 | 427 | 426 |
eil76 | 538 | 538 | 546.83 | 538 | 539 | 538 | 538 | 544.37 | 552.61 | 546 | 541 | 538 | |
eil101 | 629 | 629 | 633.40 | 630 | 634 | 629 | 640.21 | - | 638 | 629 | |||
d198 | 15,780 | 15,780 | - | - | 15,809 | 15830.6 | 15,955.6 | - | 15,781 | ||||
kroA100 | 21,282 | 21,282 | 22,414 | 21,282 | 21,282 | 21,282 | 21,282 | 21285.4 | 21285.4 | 21,408.2 | - | 21,333 | 21,282 |
kroA150 | 26,524 | 26,614 | - | 26,524 | - | 26,537 | 26524.9 | - | - | 26,678 | 26,524 | ||
kroA200 | 29,368 | 29,368 | 29,717 | 29383 | - | 29,399 | 29411.5 | - | - | 29,600 | 29,382 | ||
kroB100 | 22,141 | 22,141 | - | 22141 | 22,140* | - | 22139.1 | 22139.1 | - | - | 22,343 | 22,141 | |
kroB150 | 26,130 | 26,132 | - | 26130 | - | - | 26140.7 | - | - | - | 26,264 | 26,130 | |
kroB200 | 29,437 | 29,455 | - | 29541 | - | - | 29504.2 | - | - | - | 29,637 | 29,448 | |
kroC100 | 20,749 | 20,749 | - | 20,749 | 20,749 | 20824.6 | 20750.8 | - | - | - | 20,915 | 20,749 | |
kroD100 | 21,294 | 21,294 | - | 21,309 | 21,294 | 21405.6 | 21294.3 | - | - | - | 21,374 | 21,294 | |
kroE100 | 22,068 | 22,068 | - | 22,068 | 22,068 | - | 22106.3 | - | - | - | 22,395 | 22,068 | |
lin105 | 14,379 | 14,379 | - | 14,379 | - | 14379 | 14383 | 14383 | - | - | 14,379 | 14,379 | |
pr76 | 108,159 | 108,159 | 108,864 | - | - | 108159 | 108159 | - | 108280 | - | 108,159 | ||
pr107 | 44,303 | 44,303 | - | - | 44,303 | 44301.7* | 44346 | - | - | - | 44,303 | ||
pr124 | 59,030 | 59,030 | - | - | 59,030 | 59030.7 | 59030 | - | - | - | 59,030 | ||
pr136 | 96,772 | 96,861 | - | - | 97,547 | 96966.3 | 97182.7 | - | - | - | 96,790 | ||
rat195 | 2323 | 2323 | - | - | - | 2345.2 | - | - | - | 2324 | |||
st70 | 675 | 675 | 678.93 | - | 675 | 675 | 675 | 677.11 | 677.11 | - | 675 | - | 675 |
ts225 | 126,643 | 126,643 | - | - | - | - | 126646 | - | - | - | - | 126,643 | |
Average | 29534.6 | 29542.9 | 21353.3 | 16062.2 | 24479.2 | 20585.0 | 5730 | 29,554 | 29,669 | 9587 | 23,494 | 16,051 | 29536.5 |
P-values versus HCA | 0.1120 | 0.6755 | 0.3327 | 0.3088 | - | 0.1129 | 0.2684 | 0.1536 | 0.3360 | 0.0014 | 0.1890 |
* Incorrect.
Although the complexity of the TSP increases with increasing number of cities, the HCA outperformed the other algorithms in most instances. The P-values indicate there are no significant differences between HCA and other algorithms, except between HCA and ABNET-TSP, where the HCA was better. The HCA competed with other algorithms such as the IDCS algorithm; indeed, the results of HCA and IDCS were not noticeably different even for large problems. The high performance of HCA was again attributed to the effective design of the HCA and that included an information sharing process among the water drops. This process helps the HCA exploit the promising solutions and increases the speed of algorithm convergence. The additional stages of the HCA assist with exploring different solutions (enhancing the search capability), and prevent trapping in local optima.
This section analyses the performance of the HCA and its convergence rate. As previously stated, the maximum iteration number was set to three times the number of nodes in the instance.
According to
optimized at the 64th iteration.
In summary, the convergence rate of the HCA proves the effectiveness of the algorithm design. Furthermore, the algorithm searches the optimal solution until the final iterations, without stagnation in local optima. It also converges rapidly on easy instances.
In this paper, HCA was applied on an archetypal NP-hard problem (the TSP). Initially, the performance of the algorithm was tested on simple geometric structures which are easy to design and understand. Parameter tuning was also performed on these structures. The obtained results indicate the flexibility and capability of the algorithm in solving such problems. Moreover, the algorithm provided different same-cost solutions to the same problem. This validates the effective design of the exploration and exploitation processes of the algorithm. The geometric TSP instances are useful for evaluating other new algorithms due to their simple design, and different shapes can be designed by the same principle.
Next, the algorithm was tested on various standard benchmarks taken from the literature. The algorithm provided high-quality solutions and outperformed other metaheuristic algorithms in seeking the minimum path. Also, the HCA found the optimal solution within a few iterations. The HCA showed its ability to escape from local optima and find the global solution. The strong optimization capability of the HCA is conferred by the efficient design of the exploration and exploitation processes. Moreover, by utilizing both direct and indirect communication to share information among the water drops, the algorithm steers towards better solutions within a small number of iterations and helps to diversify the search space. Significance figures show that, at the very least, HCA is no worse than other algorithms. The added advantage of HCA is that all stages of the hydrological water cycle are included, leading to an overall conceptual framework under which other water-based algorithms can be placed. In addition, the inclusion of all stages allows both direct and indirect communication to take place among particles, leading to enhanced swarm intelligence.
In summary, the HCA demonstrated strong performance in structural and benchmark TSP instances. It obtained the optimal solution in most instances, confirming the effectiveness of the algorithm framework. Therefore, the HCA structure is a feasible approach for solving TSPs. The HCA tends to fully explore the graph, providing diverse solutions at fast convergence speeds. Also, as confirmed by the convergence behavior of the algorithm, the HCA successfully avoids potential stagnation in local optima.
The HCA performance could additionally be investigated on asymmetric TSP instances. Although the HCA optimizes the TSP solution within a reasonable timeframe, further enhancements would reduce its execution time on large instances. Furthermore, the HCA can be used for solving other NP-hard optimization problems.
Wedyan, A., Whalley, J. and Narayanan, A. (2018) Solving the Traveling Salesman Problem Using Hydrological Cycle Algorithm. American Journal of Operations Research, 8, 133-166. https://doi.org/10.4236/ajor.2018.83010
This appendix provides the outputs of HCA when applied on the benchmark instances.