# A Water Flow-Like Algorithm for the Travelling Salesman Problem

Authors: Ayman Srour; Zulaiha Ali Othman; Abdul Razak Hamdan
Journal: Advances in Computer Engineering
 (2014)

---

## Abstract

The water flow-like algorithm (WFA) is a relatively new metaheuristic that performs well on the object grouping problem encountered in combinatorial optimization. This paper presents a WFA for solving the travelling salesman problem (TSP) as a graph-based problem. The performance of the WFA on the TSP is evaluated using 23 TSP benchmark datasets and by comparing it with previous algorithms. The experimental results show that the proposed WFA found better solutions in terms of the average solution and the percentage deviation of the average solution from the best-known solution.


---

## Body

## 1. Introduction

The travelling salesman problem (TSP) is a classic combinatorial optimization problem (COP), which was introduced many years ago in 1985 [1]. The TSP searches for the shortest path among a set of cities with known distances between pairs of cities to find the route solution. The route solution can be articulated as a complete graph with a set of vertices, which is a set of edges weighted by the distance between two vertices (cities), to find the shortest route by visiting each city exactly once and returning to the original city.Numerous approaches have been proposed and have obtained good solutions. However, they vary in terms of complexity and efficiency and in being able to solve the TSP at various levels of complexity and size (small, medium, and large). Earlier studies use linear programming Dantzig et al. [2], dynamic formulation Held and Karp [3], branch and bound [4], and branch and cut [1], but their ability is limited to small problems (less than 40 cities). Later, artificial intelligent approaches were proved to have the ability to solve more complex problems; one of these approaches, the self-organized neural network [5–7], was later expanded as a metaheuristic. A metaheuristic can optimize a complex problem by searching through many candidate solutions with few or no assumptions about the problem being solved and without any guarantee of finding the optimal solution. Some metaheuristics use either a single solution-based approach (e.g. tabu search (TS) and simulated annealing (SA)) or a population-based approach (e.g. genetic algorithm (GA)) [8–10], while others use swarm intelligence (e.g. ant colony optimization (ACO)) [11], and recently, hybrid metaheuristics have been proposed [7, 12]. The results show that hybrid metaheuristics can produce the best result using 23 benchmark TSP datasets.Recently, a new metaheuristic algorithm known as the water flow-like algorithm (WFA) has been proposed [13]. The algorithm is inspired by water flowing from higher to lower altitudes. The flow can split into subflows when it traverses rigid terrains and these subflows merge when they meet at the same location. Flows stagnate in lower altitude locations if their momentum cannot expel water from the current location. The flow represents a solution agent, the flow altitude represents the objective function, and the solution space for a problem is represented by a geographical terrain.Previous metaheuristic algorithms were designed to search the problem space with a fixed number of solution agents [8, 11, 14]; however, some approaches have been proposed to obtain an appropriate setting of the algorithm population number. These approaches are categorized as either offline or online population size tuning approaches. In offline population size tuning, the aim is to find an appropriate population number before the algorithm starts the optimization process and the tuning processes, which are performed by trial and error by a human agent, which makes them time consuming and error prone and usually leads to uneven tuning of the algorithm [15]. On the other hand, online population size tuning is much more effective because, as the name implies, it tunes the population size online and it does this during the optimization process or while it is solving problem instances. Online population size tuning has a potential advantage in that it could enable the algorithm to adapt better to a particular problem instance’s characteristics.Nevertheless, using online tuning to control the population size of an algorithm remains a challenge [15–19], Gen and Cheng [20]. Many research studies have focused on finding methods to enable population-based metaheuristics to adjust the population size online while solving a problem instance, taking into account the impact of the instance characteristics and fitness landscape. However, these methods rely on analysing the accumulated information that has been gathered during the optimization process, which may relate to the global properties of the fitness landscape such as ruggedness or noise of the landscape, or may relate to the local properties of a specific landscape region. The gathering and analysing of this information add more complexity to an algorithm as well as more computation time. In addition, most of the online parameter tuning methods have been developed to handle the limitations of existing metaheuristics by extending or modifying the algorithmic framework, which is difficult to achieve in most situations, and success has been limited to those algorithms that are designed to search the problem space with a fixed population size.The WFA [13] uses the concept of the dynamic population as a fundamental framework for algorithm design. The concept can be applied to overcome many of the drawbacks of population-based metaheuristics, and, to do so, the authors addressed two main issues that affect the efficiency of algorithm optimization. The first is the need to reduce the number of redundant searches, which increases the computational cost to the algorithm during the optimization process. A redundant search occurs when combining population solutions that share the same objective value. The second issue involves giving the algorithm the ability to adapt to different population sizes during the optimization process. The size of the population in the ACO and GA algorithms is assigned in the initial stage when executing the algorithm and it cannot be changed during the optimization process.The WFA has been successfully adapted and applied to different COPs, including bin-packing [13], manufacturing cell fraction [21], and nurse scheduling [22] problems. The results of these studies show that the WFA has good potential for solving several COPs. Therefore, this paper aims to investigate the performance of the WFA when applied to a TSP in terms of accuracy and time. The past research also shows that WFA performed faster solution as it presented a dynamic solution behaviour. The remainder of this paper is organized as follows. Section 2 discusses the literature on the WFA. Section 3 presents the proposed WFA for solving the TSP, while Section 4 presents the experiments and an analysis of the results, followed by the discussion in Section 5. Lastly, Section 6 concludes the paper.


## 2. Related Work

The WFA [13] is categorized as a population-based metaheuristic algorithm and is inspired by the natural behaviour of water flowing from higher to lower altitudes. The water flows can split or merge according to the topography of the search space. The main advantages of the WFA are that it is self-adaptive and dynamic in addressing population size. In other words, the solution agent size is not fixed, unlike in traditional population-based metaheuristics. The flow number can increase or decrease during the optimization process and the population size changes based on the problem diminution and solution quality found by the agents. Yang and Wang [13] describe and map the dynamic size of the population based on the natural behaviour of water flows as they split, move, and merge.The first version of the WFA was developed by Yang and Wang [13] to solve an object grouping problem called the bin-packing problem (BPP), which is a discrete optimization problem and well known as an NP-hard problem. The BPP with its tight capacity constraint requires several heuristic methods to derive feasible and optimal solutions. The traditional BPP is the problem of minimizing the number of bins used considering its weight capacity constraint. The authors use the BPP as a benchmark to measure the feasibility of the WFA for solving such optimization problems. Their proposed algorithm mainly relies on solution neighbour searches, where a one-step movement strategy is employed to find a solution neighbour with a constant step moving forward for each flow. The flow movements (location changes) are influenced by gravitational force and the law of energy conservation. Iteration by iteration, water constantly moves to lower altitudes, which correlates with improvements in the solution search. The WFA begins searching within the problem space using one solution agent (flow) with an initial momentum. Subsequently, the flow splits into multiple subflows when the flow encounters rugged terrains and if the flow momentum exceeds the splitting amount. A flow with more momentum generates more subflow streams than one with less momentum. A flow with limited momentum yields to the landform and maintains a single flow. Many flows merge into one flow when they obtain the same objective values. To avoid redundant searches, the WFA reduces the number of solution agents when multiple agents move to the same location. Water flows are also subject to water evaporation in the atmosphere. The evaporated water returns to the ground as rain (precipitation). In the WFA, part of the water flow is removed to mimic water evaporation. This precipitation operation is implemented in the WFA to simulate natural rainfall and explore a wider area.In [13], the performance of the WFA is compared with the GA, particle swarm optimization (PSO), and ACO. The experimental results showed that the WFA outperforms the GA, PSO, and ACO in terms of both quality and execution time. Based on the experimental results, the authors concluded that the WFA may have the ability to solve complex optimization problems and suggested that it could be used to solve sequencing problems such as the TSP.In 2010, the WFA was improved to solve the manufacturing cell fraction problem [21]. The model utilizes the similarity coefficient and machine assignment methods, as well as part assignments, to generate an initial feasible solution in the first stage and then, in the second stage, a flow splitting and moving step is employed to improve the solution using a neighbour search to obtain a near-optimal solution. The results showed that the WFA outperforms the hybrid genetic algorithm (HGA) and SA. Shahrezaei et al. [22] used the WFA to solve the nurse scheduling problem, which is a multiobjective optimization problem. The authors compared the WFA with the differential evaluation algorithm (DE), and the results showed that a better solution quality could be achieved by using the WFA.The strength of the WFA for solving the TSP lies in a specific feature of the WFA, namely, the dynamic behaviour of the population size. The WFA uses population solutions, which are mapped to water flows, and the objective functions are mapped as terrains. Flow splitting occurs when rugged terrains are traversed. Conversely, water flows merge with each other when they join at the same point. The proposed WFA for the TSP (WFA-TSP) is based on the basic WFA used by [13].


## 3. Proposed Water Flow-Like Algorithm for the TSP

This section presents the proposed WFA for the TSP. The proposed algorithm adopts the basic operations of initialization, flow splitting and moving, flow merging, water evaporation, and water precipitation. Figure2 shows the flow of WFA-TSP is adopted from the basic TSP. It starts optimization process with initialization operation, which is not repetitive operation that is responsible for assigning the initial state of the algorithm. The initialization operation includes the parameter settings and initial solution generation. In general, solutions improvement starts after the completion of the initialization operation. The algorithm interactively executes the remaining operations such as flow splitting and moving, flow merging, water evaporation, and water precipitation until the termination condition is met. The main differences between the WFA-TSP and the basic WFA [13] are on the solution representation, technique used in initialisation and the flow splitting and moving procedure, and precipitation operation, which always depends on the definition of the neighbourhood structure of a given COP. The three different operations are shown as dark processes in Figure 2. The basic WFA is applied for bin packing problem where it used a two-diminution array to store a set of bins and its objects for the solution representation, while for WFA-TSP used solution is represented as one-dimensional array with a length M, where M is the number of cities in the original dataset. Each cell value in the array represents the number of city selected in specific order in the solution. Figure 1 shows a sample solution representation of a TSP solution. A feasible solution is represented as a sequence of nodes, where 1,2
,
3
…
M represents the indexed city and 4,3
,
10
…
7 represents the city number arranged in the sequence representing a specific tour path.Figure 1
Example of solution representation of TSP in WFA.Figure 2
Main operations of WFA-TSP.The WFA-TSP used similar parameter setting with the basic WFA. However, the basic WFA uses random solution construction technique for generating the initial solution, while WFA-TSP used nearest neighbour heuristic for generating the initial solution.In the splitting and moving operation, the design of flow moving operation is problem dependent. Different problem types will have their own designs in the flow moving operations [13]. The basic WFA uses one-step move neighbourhood structure, while the flow moving procedure in the WFA-TSP is designed and proposed based on the neighbourhood structure of TSP problem, which combines two types of neighbourhood structure, namely, insertion move and 2-opt neighbourhood structure in order to find the best neighbourhood solution of the current flow. More illustrations about moving procedure and the proposed neighbourhood structure are presented in the following algorithm steps description.The flow merging operation is the operation that follows the flow splitting and moving operation. This operation has a conditional execution and it works only if there are two or more flows in a specific iteration that generates redundant solutions. Similarly, water evaporation operation, which is performed after the flow merging operation, is conditionally executed if the evaporation condition is met. Note that both the flow merging operation and the water evaporation operation are adopted in WFA-TSP without any modifications, as their behaviour does not depend on domain problem that is being solved by algorithm. In the water precipitation, the operation is conditionally executed when all flows pour down to zero velocity. Similar to the flow movement procedure, the enforce precipitation procedure is problem dependent. Therefore, in the WFA-TSP, a special solution modification procedure is designed. A stochastic modification to the pour-down flows is performed by using the insertion move procedure in order to modify all locations of the pour-down flows (see Steps8–10).Step 1.
Construct initial solution using the nearest neighbour (NN) algorithm and initialize the WFA parametersG, W
0, and V
0.Step 2.
Perform flow splitting for all flows if they have enough momentum.Step 3.
Perform flow moving for all nonzero velocity subflows to new locations using the insertion move procedure.Step 4.
Find the best neighbourhood solution for all subflows using the 2-opt neighbour search procedure.Step 5.
Calculate the mass and velocity of all subflows.Step 6.
Merge subflows if they have the same objective value and update the mass and velocity.Step 7.
Check evaporation conditions; if yes, perform the evaporation operation for each flow.Step 8.
Check regular precipitation conditions; if yes, pour down the evaporated water by addingN flows to the current flows set; then assign the initial velocity of the poured-down flows. Next, the locations of the poured-down flows are derived stochastically from the original flow locations using the insertion move procedure.Step 9.
Check enforce precipitation conditions; if yes, return and distribute the evaporated water to the current flows set. Then, reset the velocity of the current flows set to the initial velocity value. The locations of the current flows are stochastically changed using the insertion move procedure.Step 10.
After performing any kind of water precipitation, check whether the new solutions have the same objective value; if yes, perform Step6.Step 11.
Repeat Steps2–10 until the termination condition is met.Step  1 (initialization). A solution structure is necessary to map the TSP solution in one-dimension array of size n (n: the number of cities that should be visited). The TSP solutions are associated with flows; thus each water flow contains one-dimension array to store the generated TSP solution. However, as previously mentioned, the WFA starts the searching process with a single flow, so this flow needs to be constructed with an initial mass W
0 and an initial velocity V
0 such that the values of W
0 and V
0 allow the initial flow to fork into at least two subflows, as recommended by [13], where the flow can split if its momentum T
=
W
0
*
V
0. The location of the WFA’s one-water flow (a single solution agent) is assigned based on the initial solution value. In the WFA-TSP, the initial solution is generated using a greedy constructive method known as the NN heuristic, as used in [23], to generate a close approximate solution for the problem. Table 1 describes the parameters of the WFA-TSP.Table 1
Description of WFA parameters.
G
Iteration limit
W
0
Initial mass of original flow
W
i
Mass offlow
i
V
0
Initial velocity of original flow
V
i
Velocity offlow
i
T
Base momentum
n
-
Upper limit on the number of subflows that can split from a flow
n
i
Number of subflows forked fromflow
i
N
Total number of water flows in the current iteration
X
i
Solution corresponding toflow
i
U
i
k
Solution corresponding to subflowk that splits from flow
i
µ
i
k
Mass of subflowk that splits from flow
i
σ
i
k
Altitude decrease fromflow
i to its subflow k
g
Gravitational acceleration
t
Prescribed number of iterations until a flow is removed Completely by evaporationSteps  2–4 (flow splitting and moving). The WFA is characterized by its ability to adapt to a dynamic population size when searching the solution space. As mentioned above, the WFA begins with a single flow and then several branching flows are created based on the quality of the discovered solutions. The flow splits based on its momentum; a flow with a higher momentum generates more subflows than one with less momentum. Taking into account gravitational force and the law of energy conservation, the flow moves to a new location. The locations of the split subflows are derived from the neighbouring locations of the original flow. A flow movement is a solution search from the current location to a new location.LetN be the number of water flows in the current iteration. In the water flow operation, the number of subflows n
i that branch from flo
w
i, where i
∈
1,2
,
…
,
N, are determined by the flow momentum T
=
W
i
*
V
i. A flow with zero momentum does not split and stays at the same location; its solution is considered a stagnant solution. Conversely, a flow can split into subflows if its momentum value exceeds a base momentum T. The base momentum T is thus defined to compute the number of subflows. If the value of W
i
V
i is between zero and T, 0
<
W
i
V
i
<
T, then flow
i does not split and instead moves to a new location as a single stream solution. This avoids the generation of extra subflows that may lead to unnecessary consumption of resources. Yang and Wang [13] reported that the upper limit n
- is defined as the number of subflows that split from the original flow in each iteration. However, at any iteration, the number of subflows can be calculated based on (1) as follows:
(1)
n
i
=
min
⁡
⁡
{
max
⁡
⁡
{
1
,
int
⁡
(
W
i
V
i
T
)
}
,
n
-
}
.
When flow
i splits into subflows n
i, the mass of flow
i is distributed to the subflows based on their ranks. The mass of subflow k, which splits from f
low
i, is calculated using (2) as follows:
(2)
W
i
k
=
(
n
i
+
1
-
k
∑
r
=
1
n
i
r
)
W
i
,
k
=
1,2
,
…
,
n
i
.
The velocity of a subflow is calculated using the equation of energy conservation; μ
i
k is the velocity of subflow k, which splits fromflow
i, as shown:
(3)
μ
i
k
=
{
V
i
2
+
2
g
σ
i
k
,
V
i
2
+
2
g
σ
i
k
>
0
,
0
,
otherwise
,
where g is the gravitational acceleration and σ is the improvement in the objective value of solution i to its neighbouring solution. σ represents the altitude decrease from solution i to solution k and can be obtained using (3). If V
i
2
+
2
g
σ
i
k
<
0, there is no improvement in solution i and it stagnates at the local optimal with no splitting or moving. Such a stagnant flow gradually evaporates into the atmosphere, returning to the ground as precipitation. At the end of the flow splitting and moving operation, the original flow is discarded because subflows have been generated. The information regarding the current number of subflows and solution sets is then recorded.The flow movement procedure always depends on the definition of the neighbourhood structure of a given COP, where the flows can move from one location (solution) to another location (neighbourhood solution) based on a small modification of that solution. A neighbourhood for a given solution is defined as any other solution obtained by a pair-wise exchange of any two nodes in the solution. This always guarantees that any neighbourhood for a feasible solution is always a feasible solution. There are many neighbourhood search strategies in the literature that have been developed especially for the TSP. These strategies evaluate the cost of moving to one or more cities to find better neighbourhood solutions.In the WFA-TSP, the splitting and moving of any flow is associated with a neighbourhood search of the current solution. The subflow location is derived from the neighbourhood location of the original flow. However, the number of subflowsn
i from flow
i is calculated using the momentum of flow
i, and, for each k subflow that splits from flow
i, the location of flow
k is assigned by the objective value of the new neighbour solution obtained using a random insertion move of one city. If the location of all subflows X
i
1
,
X
i
2
,
…
,
X
i
n is known, the second stage intensely searches for the neighbour solution of the new assigned locations by using the 2-opt neighbourhood search procedure [24] until the best neighbour of the new location is found. The main idea of the 2-opt procedure is to cut two edges of the tour, turn one of the two partial sequences, and reconnect those edges in some way.Figure3 illustrates the splitting and moving operation used in Step 4 to search for the neighbourhood solutions for the TSP. As shown in the figure, flo
w
i splits into a number of subflows and this number is calculated based on the momentum of the initial flow; for example, let n
i equal k; then the insertion move procedure is used to determine the new locations for the k subflows. When the locations of X
i
1
,
X
i
2
,
…
,
X
i
k are obtained, Step 4 performs the 2-opt procedure to search for the best neighbourhood solution for the neighbourhood solutions of X
i
1. This step is repeated until the algorithm stops searching based on a predefined termination condition. The 2-opt algorithm in [24] is used in this work. Iteration by iteration, the newly generated subflows may merge with other subflows sharing the same location thereby creating a single flow. However, during the optimization process, additional subflows are likely to be generated at later iterations or they may become stuck in the current location until the stopping criteria of the algorithm are met.The basic TSP just used insertion move for every iteration.Figure 3
One insertion move of city 5 to index 6.Step  6 (flow merging operation). When two or more flows meet at the same location, they merge into a single flow with greater mass and momentum to reduce the number of solution agents at that location. The merging operation prevents redundant searching by solution agents with the same objective value. Flow merging may also help stop stagnated flows from becoming trapped in certain locations. This operation regularly checks the current flows to see if they share the same location. Assuming that flows i and j share the same location, flow
i, then mass W
i and velocity V
i are updated using the following, respectively:
(4)
W
i
=
W
i
+
W
j
,
(5)
V
i
=
W
i
V
i
+
W
j
V
j
W
i
+
W
j
.Step  7 (water evaporation operation). As a neutral behaviour, water evaporates and returns to the ground as precipitation. The WFA uses the concept of water evaporation and precipitation after moving from one location to another to help flows escape from local optima and search within a greater solution space. In this operation, the flow mass is updated using the following:
(6)
W
i
=
(
1
-
1
t
)
W
i
,
i
=
1,2
,
…
,
N
,
where W
i is the mass at the time when flow
i was initially generated or when it merged with another flow. Each water flow is subject to water evaporation into the atmosphere based on a fixed ratio (
1
/
t
), as in (6). If a splitting or merging operation does not update a flow, the flow is removed after t iterations.Steps  8–10 (water precipitation operation). Two types of precipitation are performed in the WFA to simulate the natural lifecycle of water [13]. The first type is enforced precipitation, which is used to revive all grounded flows. The second type is regular precipitation, which is executed one time for each t iteration to get all the evaporated water to rain down to the ground again.Enforced Precipitation. When the velocity of all flows is at zero, this means there is no improvement in the solution search and all flows are stuck in local optima. In this situation, a process to revive the flows is necessary to stochastically deviate the locations (generate new solutions) of the flows from the original locations (original solutions) and reset the flows’ mass and velocity. All the masses of the poured flows should be updated without changing the current flow numbers, and an initial velocity V
0should be assigned to them. Mass W
0 is proportionally distributed to all flows according to their original mass using the following:
(7)
W
i
′
=
(
W
i
∑
k
=
1
N
W
k
)
W
0
.
The main reason for applying enforced precipitation is to increase the exploration of the solution space and prevent flows from stopping the searching process. Stochastic relocation of the current flows means a stochastic modification of the solution that is associated with each flow. Similar to the flow movement procedure, the enforce precipitation procedure needs to be customized based on the structure of the optimization problem solution. Therefore, in the WFA-TSP, a special solution modification procedure is designed. In the following, a complete illustration of the enforce precipitation procedure is provided.As mentioned, the relocation of flow locations is carried out by stochastic modification of the solutions associated with the flows. A certain number of cities in each solution should be selected for modification. The modification of the selected cities is carried out by performing the insertion move procedure, where each selected city moves to a new, randomly selected position in the solution. However, in the proposed method, the criterion for the selection of the potential cities to be modified in aflo
w
i is obtained stochastically from the original coordinate X
i
h of that flow. For example, if the new location of flow
i is X
i
′
=
{
x
i
1
′
,
x
i
2
′
,
…
,
x
i
q
′
} each X
i
h
′ is obtained stochastically from the original coordinate X
i
h by using (8) as in the following:
(8)
X
i
h
′
=
{
X
i
h
+
d
h
+
,
if
~
U
(
0,1
)
>
0.5
,
X
i
h
-
d
h
-
,
otherwise
,
where
d
h
+
=
{
ε
h
,
if
b
h
u
≥
ε
h
+
X
i
h
,
0
,
otherwise
,
d
h
-
=
{
ε
h
,
if
b
h
l
≥
X
i
h
-
ε
h
,
0
,
otherwise
.
Here, ε
h
=
~
U
(
0,1
)
*
e
h, where e
h is the coordination offset. ~
U
(
0,1
) is the runtime random generation value, which ranges from 0 to 1. By using the above formula, it can be guaranteed that the deviated locations of the flows are either bounded within the allowed relocation range or remain at the same location.Regular Precipitation. This type of precipitation is performed periodically to return the evaporated water back to the ground. In each iteration, the operation executes once to get the evaporated water to pour down. The accumulated mass of evaporated water is W
0
-
∑
k
=
1
N
W
k, which is reassigned to ground flows, as in (9). However, the revived flows may generate the same objective values and location assignments as those of other flows. Therefore, a merging operation is performed after precipitation is applied to remove possible redundant solutions:
(9)
W
i
′
=
(
W
i
∑
k
=
1
N
W
k
)
W
0
-
∑
k
=
1
N
W
k
.This operation can be regarded as a wide exploration of the solution space. Here, as suggested by [13], a number of flows are poured down again to the ground and added to the current flows set to represent the water rainfall operation. The number of poured-down flows is considered as equal to the number of current flows N, which thus duplicates the number of flows in order to increase the solution space exploration ability of the algorithm. However, if X
i
′
=
{
X
1
′
,
X
2
′
,
…
,
X
N
′
} is the set of newly generated flows, similar to the enforce precipitation deviation, the location of X
i
′ is driven stochastically, but from the current flows set using the insertion move procedure.


## 4. Experiments and Results

The performance of the proposed WFA-TSP is evaluated by conducting several experiments using standard benchmark TSP datasets available from TSPLIB [25]. The experiments were performed on 23 city datasets, ranging from 51 to 3795 cities. The WFA-TSP was implemented using Java platform JDK 1.6, a Windows environment and a personal computer with an Intel core i5 processor (3.00 GHz CPU speed and 4 GB RAM). The experiments measure the solution cost and computation time, which are obtained from 10 runs for each dataset, with 10,000 iterations for each independent run. This number of iterations is required to reach the best solution. The minimum, average, and standard deviation (Std.) of the solution cost for 10 independent runs are calculated. The distances between any two cities are calculated by using the Euclidian distance and are rounded off after the decimal point. The average computational cost is also determined. The results are compared with ant colony system (ACS) [11] and other algorithms in the literature. Table 2 shows the parameter settings for the tested algorithms. The parameter setting of the WFA-TSP follows the same parameter settings in [9]. Preexperiment shows that these parameter settings obtained the best result.Table 2
Parameter settings.
Algorithm
Parameter
Value
WFA-TSP
Base momentumT
20
Initial massW
0
8
Initial velocityV
0
5
Subflow number limitn
-
3
ACS
Number of ants
10
β
2
ρ
0.1
τ
0
1
/
n
C
n
n, where n is the number of cities and C
n
n is the nearest neighbor value
ε
0.1


### 4.1. The Performance of WFA-TSP Compared to ACS

This section provides the comparison results between ACS and WFA-TSP in datasets that include problems with the number of city which ranged from 51 to 3795 cities, which represent small, medium, and large size datasets. Table3 presents comparison results in terms of the best solution quality, average iterations number, and computation time of the algorithms tested. The table also shows the comparison between ACS and WFA-TSP in terms of the solution accuracy (in percentage) and the solution deviation of the mean values regarding the best-known solution. The P values are provided for the computation time and solution quality to see if there is any significant difference between the ACS and WFA-TSP algorithms. The discussion in the section is divided into two main parts: (i) best performance and (ii) solution accuracy. Note that the best results are presented in bold in Table 3.Table 3
Results of the comparison between ACS and WFA-TSP algorithms in small and medium TSP datasets.
Datasets
ACS
WFA-TSP
P-value
Improvement %
Best
Worst
Mean
Std.
Avg. iteration
Avg. time
PDavg
Best
Worst
Mean
Std.
Avg. iteration
Avg. time
PDavg
Time
Solution quality
Accuracy
Time
eil51
427
434
428.80
2.82
5133.5
1.11
0.66
426
427
426.40
0.52
939.5
0.22
0.09
~
0.027
0.56
79.8
eil76
538
555
545.70
6.11
5327.1
2.13
1.43
538
538
538.00
0.00
1638.5
0.55
0.00
0.006
0.003
1.41
74.0
kroA100
21292
22255
21,585.60
311.51
4546.9
2.84
1.43
21282
21282
21,282.00
0.00
1057.7
0.56
0.00
0.001
0.013
1.81
80.2
eil101
638
651
642.30
3.65
5624.2
3.55
2.11
629
638
630.70
2.83
2648.8
1.23
0.27
~
~
1.26
65.2
bier127
118616
121876
119,965.10
1,134.08
5654.2
5.13
1.42
118282
118728
118,451.40
177.62
5616.9
3.56
0.14
0.092
0.003
2.06
30.6
ch130
6184
6447
6,263.00
89.22
6720.3
6.61
2.50
6110
6201
6,133.90
29.29
4892.1
3.45
0.39
0.011
0.004
1.23
47.8
ch150
6556
6756
6,623.50
59.13
7373.7
9.42
1.46
6528
6559
6,542.20
14.22
4204.4
3.53
0.22
~
0.001
2.04
62.5
kroA150
26886
27437
27,122.40
170.31
7217.1
9.33
2.26
26524
26719
26,568.40
58.45
4901.8
4.41
0.17
~
~
1.91
52.7
kroA200
29691
30556
30,011.90
295.79
7299.7
16.06
2.19
29368
29744
29,438.20
114.84
6774.9
9.81
0.24
0.001
~
2.69
38.8
lin318
43119
44089
43,666.10
313.43
8567.7
39.40
3.90
42278
42946
42,490.10
208.54
7695.3
23.18
1.10
~
~
2.06
41.1
rat575
7198
7398
7,293.60
62.71
9712.4
151.50
7.69
6971
7042
7,000.80
21.73
9090.8
79.43
3.36
~
~
4.01
47.5
rat783
9319
9448
9,380.40
35.49
9588.8
287.10
6.52
9126
9256
9,180.20
40.79
9535
147.65
4.25
~
~
2.13
48.5
u1060
257839
259794
258944.30
572.93
9398.3
474.10
15.55
230481
231887
231401.50
478.10
9608.6
317.62
3.26
~
~
10.64
33.0
fl1400
21014
21705
21321.80
254.23
9947.1
879.60
5.94
20365
20523
20449.00
50.46
9095.1
571.01
1.60
~
~
4.09
35.0
d1655
68602
71263
70128.90
1058.69
9952.8
1217.30
12.88
64313
65406
64878.60
344.25
9673.3
746.34
4.43
~
~
7.49
38.6
u1817
70236
71021
70520.00
253.51
9400.9
1324.10
23.28
59713
60839
60155.00
339.21
9607.6
980.08
5.16
~
~
14.70
25.9
d2103
85539
106793
92467.50
8141.66
9880.4
1883.40
14.94
81769
84547
82769.70
883.40
9472.1
1240.28
2.88
~
0.006
10.49
34.1
fl3795
30991
35073
32589.40
1139.27
9951.4
6204.00
13.27
29400
29805
29578.80
135.70
9376
4971.05
2.80
~
~
9.24
19.8
The overall average  improvement
4.4
47.5
Note: minimum (Min), maximum (Max), standard deviation (std.), the percentage deviations of the average with the best-known solution (PDavg), ~ denotes to 0.000, accuracy % = ((meanACS  − meanWFA-tsp)/meanACS) * 100.


#### 4.1.1. The Best Performance

Table3 compares the WFA-TSP performance with ACS algorithm performance using the best solution found and average iterations and time collapsed to find the best solution for 10 independent runs. The results presented in the table show that WFA-TSP outperforms the ACS algorithm in all datasets in terms of the best solution found. Furthermore, WFA-TSP can reach the optimal solution in 9 out of 18 datasets. These datasets are “eil51,” “eil76,” “kroA100,” “eil101,” “bier127,” “ch130,” “ch150,” “kroA150,” and “kroA200,” whereas ACS algorithm reached the optimal solution for datasets “eil76” and “kroA100.” Table 3 and Figure 4 indicate how the average of the computational time of both algorithms changed when the number of cities is gradually increased. It can be seen from the figure that the computation time of the ACS and WFA-TSP is relatively closed. WFA-TSP performed slightly faster than ACS in small size cities. However, WFA-TSP significantly outperformed ACS in medium size cities. Additionally, it can also be seen from Table 3 and Figure 5 that the average computation time of ACS in the 10 runs clearly increases with the large dataset size until it reaches up to 6204 seconds. Meanwhile WFA-TSP has shown much faster solution search and its average computation time reaches less than 5000 seconds with large datasets.Figure 4
The comparison of the average computation time of WFA-TSP and ACS for small data set.Figure 5
The comparison of the average computation time of WFA-TSP and ACS for large data set.The table also shows the percentage improvement in the computation time of the WFA-TSP when the average time of the two algorithms is compared. WFA-TSP shows that in all datasets the improvement percentage can reach up to 80%. Table3 also demonstrates the significant of the statistical results of all datasets. It can be seen that WFA-TSP has a significant improvement in terms of the computation time where the P values for all datasets are less than 0.05. By this, a conclusion can be drawn about the scalability of WFA-TSP in small, medium, and large dataset size, where WFA-TSP outperforms ACS in both solution quality and computation time.


#### 4.1.2. Solution Accuracy

Table3 shows the statistical descriptive test used on the experimental results of the algorithms tested. The statistical test was used to evaluate the search accuracy of the proposed method compared to the ACS algorithm. The solution quality results reported in Table 3 show that WFA-TSP algorithm has shown better searching performance than ACS, while the mean and the standard deviation values obtained by WFA-TSP algorithm on all datasets are less and better than the ACS algorithm, indicating that WFA-TSP has more stability in its searching performance than ACS. The table also outlines the improvement percentage in the searching accuracy of the proposed method by comparing the mean of the two algorithms. The difference in the searching accuracy obtained by WFA-TSP is clearly significant. WFA-TSP shows in all the datasets a better improvement percentage, which ranges from 0% to 4%. In addition, the table shows that the improvement percentage is increased when the number of cities increased, which indicates that WFA-TSP algorithm can search solutions far more accurately than ACS.Table3 also shows the summary of the percentage deviation of the experimental results obtained by WFA-TSP and ACS compared to the best-known results. The table compares the experimental results using the percentage deviation of the average with the best-known solution (PDavg) of both algorithms. From the results shown in the table, the deviation of the average solution from the best-known solution of the WFA-TSP for all datasets is significantly better than ACS. From these comparisons, it can be observed that WFA-TSP is generally better than ACS in terms of the solution accuracy. Additionally, based on the reported P values in Table 3, it can be seen that WFA-TSP has a significant improvement in terms of the solution quality where the P values for all datasets are less than 0.05. Generally, the findings have revealed that WFA-TSP has faster computation time and can find better quality of solutions than ACS algorithm in small and medium size dataset problems.


### 4.2. Performance of WFA-TSP versus Other State of the Art Metaheuristics in TSP

The results of the experiments are presented in Table3 in which the performance of the WFA-TSP is compared with that of the algorithms proposed by Somhom et al. [5], Pasti and De Castro [6], Masutti and de Castro [7], and the genetic simulated annealing ant colony system with particle swarm optimization (GSAACS-PSO) technique proposed by [12], by considering the best solution found and the average solutions from 10 independent runs. In the table, BKS represents the best-known solution, mean represents the average, SD represents the standard deviation, and best represents the best solution found, which is highlighted in bold.It can be seen that the results of the WFA-TSP are generally better than those of Somhom et al. [5], Pasti and de Castro [6], Masutti and de Castro [7], and GSAACS-PSOT [12]. As the table shows, the WFA-TSP outperformed the GSAACS-PSO in 18 out of 23 datasets in terms of the best solution found. These datasets are eil51, eil76, eil101, berlin52, bier127, ch130, ch150, rd100, lin105, kroA100, kroA150, kroA200, kroB100, kroC100, kroD100, kroE100, lin318, and fl1400. The WFA-TSP also outperformed the GSAACS-PSO in nearly all datasets in terms of the average solutions, except for datasets rat575 and rat783. It also can be seen that the algorithms of Somhom et al. [5], Pasti and de Castro [6], and Masutti and de Castro [7] could not reach the optimal solution for the tested datasets, whereas the WFA-TSP reached the optimal solution for 13 of the 23 datasets. The analysis therefore shows that the WFA-TSP performs consistently well compared with other algorithms. Also, the SD of the best solution cost for the WFA-TSP in 10 runs was lower than that of the other algorithms.Table4 presents a comparison of the experimental results by using the percentage deviations of the average and best solutions from the best-known solution of the WFA-TSP, Somhom et al. [5], Pasti and de Castro [6], Masutti and de Castro [7], and GSAACS-PSO [12]. The percentage deviation of the average solution from the best-known solution is denoted as PDavg while the calculated deviation of the best solution from the best-known solution is denoted as PDbest. The table shows that the deviation of the average solution from the best-known solution (PDavg) of the WFA-TSP for all datasets except rat575 and rat783 was significantly better than that of the other algorithms. The difference in the performance of WFA-TSP in each dataset compared with that of the GSAACS-PSOT in terms of the PDavg value can be observed clearly in the graph (Figure 6), where the WFA-TSP PDavg values are compared with the PDavg values of the other algorithms. Table 5 also shows that in 19 of the 23 datasets, the deviation of the best solution from the best-known solution (PDbest) of the WFA-TSP is generally better than that of the other algorithms for datasets eil51, eil76, eil101, berlin52, bier127, ch130, ch150, rd100, lin105, kroA100, kroA150, kroA200, kroB100, kroC100, kroD100, kroE100, lin318, and fl1400.Table 4
Comparison of the experimental WFA-TSP results with the results of other algorithms.
TSP instance
BKS
Somhom et al. algorithm [5]
Pasti and De Castro algorithm [6]
Masutti and De Castro algorithm [7]
GSAACS-PSO [12]
WFA-TSP
Mean
SD
Best
Mean
SD
Best
Mean
SD
Best
Mean
SD
Best
Mean
SD
Best
eil51
426
440.60
3.44
433
438.70
3.52
429
437.47
4.20
427
427.27
0.45
427
426.40
0.52
426
berlin52
7542
8025.00
249.00
7715
8074.00
270.00
7716
7932.50
277.30
7542
7542
0
7542
7542.00
0.00
7542
eil76
538
562.30
5.23
552
556.10
8.03
542
556.33
5.30
541
540.2
2.94
538
538
0.00
538
kroA100
21282
21617.00
164.00
21410
21868.00
246.00
21369
21522.73
93.34
21333
21370.47
123.36
21,282
21282
0.00
21,282
kroB100
22141
22623.00
75.30
22548
22854.00
209.00
22596
22661.47
193.50
22343
22283
183.99
22,141
22243.5
54.05
22141
kroC100
20749
21150.00
188.00
20921
21232.00
216.00
20915
20971.23
108.20
20915
20879
158.64
20,749
20782.6
28.41
20749
kroD100
21294
21846.00
154.00
21500
22028.00
303.00
21457
21697.37
157.00
21374
21620
226.6
21,309
21469.222
83.58
21342
kroE100
22068
22682.00
214.00
22379
22816.00
268.00
22427
22715.63
260.20
22395
22183
103.32
22,068
22203.9
59.56
22106
rd100
7910
8239.00
104.00
8028
8253.90
149.00
7947
8199.77
80.77
7982
7987.6
62.06
7910
7942.6
15.33
7911
eil101
629
655.60
5.95
640
654.83
6.57
641
648.63
3.85
638
635.23
3.59
630
630.7
2.83
629
lin105
14379
14476.00
118.00
14379
14702.00
328.00
14379
14400.17
44.03
14379
14406
37.28
14,379
14379
0.00
14379
bier127
118282
121733.33
1240.00
119840
121780.00
1564.00
118760
120886.30
1159.00
118970
119421.8
580.83
118,282
118714.94
167.16
118282
ch130
6110
6307.00
63.00
6203
6291.80
65.00
6142
6282.40
60.15
6145
6205.63
43.7
6141
6,133.90
29.29
6110
ch150
6528
6751.00
62.20
6631
6753.20
83.00
6629
6738.37
76.14
6602
6563.7
22.45
6528
6,542.20
14.22
6528
kroA150
26524
27401.00
252.00
26930
27346.00
223.00
26932
27355.97
327.90
26678
26899.2
133.02
26,524
26,568.40
58.45
26524
kroB150
26130
26806.00
250.00
26342
26752.00
210.00
26395
26631.87
232.90
26264
26448
266.76
26,130
26347.32
72.25
26160
kroA200
29368
30416.00
133.00
30144
30258.00
343.00
29594
30190.27
273.40
29600
29738.73
356.07
29,383
29,438.20
114.84
29368
kroB200
29437
30286.00
301.00
29703
30416.00
350.00
29831
30135.00
276.80
29637
30035
357.48
29,541
29931.97
132.89
29634
lin318
42029
43923.00
382.00
43154
43705.00
391.00
42975
43696.87
410.10
42834
43002.9
307.51
42487
42,490.10
208.54
42278
rat575
6773
7174.00
39.50
7090
7125.10
40.90
7039
7115.67
37.47
7047
6933.87
27.62
6891
7,000.80
21.73
6971
rat783
8806
9388.00
39.40
9316
9326.30
48.50
9185
9343.77
46.97
9246
9079.23
52.69
8988
9,180.20
40.79
9126
fl1400
20127
20743.00
116.00
20558
21071.00
205.00
20745
21110.00
163.30
20851
21349.63
527.88
20,593
20449
50.46
20365
d1655
62128
68046.00
379.00
67459
71432.00
589.00
70323
72113.17
698.60
70918
65621.13
1031.94
64,151
64878.6
344.25
64313Table 5
Comparison of the experimental WFA-TSP results with the results of other algorithms, where BKS represents the best-known solution.
TSP instance
BKS
Pasti and De Castro algorithm [6]
Cochrane and Beasley method [26]
Masutti and De Castro algorithm [7]
GSAACS-PSO [12]
WFA-TSP
PDavg
PDbest
PDavg
PDbest
PDavg
PDbest
PDavg
PDbest
PDavg
PDbest
eil51
426
2.98
0.70
2.89
0.94
2.69
0.23
0.30
0.23
0.09
0.00
berlin52
7542
7.05
2.31
7.01
0.00
5.18
0.00
0.00
0.00
0.00
0.00
eil76
538
3.36
0.74
4.35
2.04
3.41
0.56
0.41
0.00
0.00
0.00
kroA100
21282
2.75
0.41
1.31
0.57
1.13
0.24
0.42
0.00
0.00
0.00
kroB100
22141
3.22
2.06
2.20
1.53
2.35
0.91
0.64
0.00
0.46
0.00
kroC100
20749
2.33
0.80
1.70
0.80
1.07
0.80
0.63
0.00
0.16
0.00
kroD100
21294
3.45
0.77
1.87
0.80
1.89
0.38
1.53
0.07
0.82
0.23
kroE100
22068
3.39
1.63
2.56
1.52
2.93
1.48
0.52
0.00
0.62
0.17
rd100
7910
4.35
0.47
3.64
1.19
3.66
0.91
0.98
0.00
0.41
0.01
eil101
629
4.11
1.91
3.78
1.11
3.12
1.43
0.99
0.16
0.27
0.00
lin105
14379
2.25
0.00
1.08
0.00
0.15
0.00
0.19
0.00
0.00
0.00
bier127
118282
2.96
0.40
3.00
0.69
2.20
0.58
0.96
0.00
0.37
0.00
ch130
6110
2.98
0.52
2.82
1.13
2.82
0.57
1.57
0.51
0.39
0.00
ch150
6528
3.45
1.55
3.23
1.78
3.22
1.13
0.55
0.00
0.22
0.00
kroA150
26524
3.10
1.54
3.06
1.55
3.14
0.58
1.41
0.00
0.17
0.00
kroB150
26130
2.38
1.01
2.60
1.06
1.92
0.51
1.22
0.00
0.83
0.11
kroA200
29368
3.03
0.77
3.27
0.92
2.80
0.79
1.26
0.05
0.24
0.00
kroB200
29437
3.33
1.34
2.31
0.88
2.37
0.68
2.03
0.35
1.68
0.67
lin318
42029
3.99
2.25
4.31
2.65
3.97
1.92
2.32
1.09
1.10
0.59
rat575
6773
5.20
3.93
6.20
4.89
5.06
4.05
2.38
1.74
3.36
2.92
rat783
8806
5.91
4.30
6.57
5.66
6.11
5.00
3.10
2.07
4.25
3.63
fl1400
20127
4.69
3.07
4.26
2.12
4.88
3.60
6.07
2.32
1.60
1.18
d1655
62128
14.98
13.19
10.09
9.10
16.07
14.15
5.62
3.26
4.43
3.52Figure 6
Percentage deviation of the average solution of the tested algorithms from the best-known solution for each TSP dataset.


## 4.1. The Performance of WFA-TSP Compared to ACS

This section provides the comparison results between ACS and WFA-TSP in datasets that include problems with the number of city which ranged from 51 to 3795 cities, which represent small, medium, and large size datasets. Table3 presents comparison results in terms of the best solution quality, average iterations number, and computation time of the algorithms tested. The table also shows the comparison between ACS and WFA-TSP in terms of the solution accuracy (in percentage) and the solution deviation of the mean values regarding the best-known solution. The P values are provided for the computation time and solution quality to see if there is any significant difference between the ACS and WFA-TSP algorithms. The discussion in the section is divided into two main parts: (i) best performance and (ii) solution accuracy. Note that the best results are presented in bold in Table 3.Table 3
Results of the comparison between ACS and WFA-TSP algorithms in small and medium TSP datasets.
Datasets
ACS
WFA-TSP
P-value
Improvement %
Best
Worst
Mean
Std.
Avg. iteration
Avg. time
PDavg
Best
Worst
Mean
Std.
Avg. iteration
Avg. time
PDavg
Time
Solution quality
Accuracy
Time
eil51
427
434
428.80
2.82
5133.5
1.11
0.66
426
427
426.40
0.52
939.5
0.22
0.09
~
0.027
0.56
79.8
eil76
538
555
545.70
6.11
5327.1
2.13
1.43
538
538
538.00
0.00
1638.5
0.55
0.00
0.006
0.003
1.41
74.0
kroA100
21292
22255
21,585.60
311.51
4546.9
2.84
1.43
21282
21282
21,282.00
0.00
1057.7
0.56
0.00
0.001
0.013
1.81
80.2
eil101
638
651
642.30
3.65
5624.2
3.55
2.11
629
638
630.70
2.83
2648.8
1.23
0.27
~
~
1.26
65.2
bier127
118616
121876
119,965.10
1,134.08
5654.2
5.13
1.42
118282
118728
118,451.40
177.62
5616.9
3.56
0.14
0.092
0.003
2.06
30.6
ch130
6184
6447
6,263.00
89.22
6720.3
6.61
2.50
6110
6201
6,133.90
29.29
4892.1
3.45
0.39
0.011
0.004
1.23
47.8
ch150
6556
6756
6,623.50
59.13
7373.7
9.42
1.46
6528
6559
6,542.20
14.22
4204.4
3.53
0.22
~
0.001
2.04
62.5
kroA150
26886
27437
27,122.40
170.31
7217.1
9.33
2.26
26524
26719
26,568.40
58.45
4901.8
4.41
0.17
~
~
1.91
52.7
kroA200
29691
30556
30,011.90
295.79
7299.7
16.06
2.19
29368
29744
29,438.20
114.84
6774.9
9.81
0.24
0.001
~
2.69
38.8
lin318
43119
44089
43,666.10
313.43
8567.7
39.40
3.90
42278
42946
42,490.10
208.54
7695.3
23.18
1.10
~
~
2.06
41.1
rat575
7198
7398
7,293.60
62.71
9712.4
151.50
7.69
6971
7042
7,000.80
21.73
9090.8
79.43
3.36
~
~
4.01
47.5
rat783
9319
9448
9,380.40
35.49
9588.8
287.10
6.52
9126
9256
9,180.20
40.79
9535
147.65
4.25
~
~
2.13
48.5
u1060
257839
259794
258944.30
572.93
9398.3
474.10
15.55
230481
231887
231401.50
478.10
9608.6
317.62
3.26
~
~
10.64
33.0
fl1400
21014
21705
21321.80
254.23
9947.1
879.60
5.94
20365
20523
20449.00
50.46
9095.1
571.01
1.60
~
~
4.09
35.0
d1655
68602
71263
70128.90
1058.69
9952.8
1217.30
12.88
64313
65406
64878.60
344.25
9673.3
746.34
4.43
~
~
7.49
38.6
u1817
70236
71021
70520.00
253.51
9400.9
1324.10
23.28
59713
60839
60155.00
339.21
9607.6
980.08
5.16
~
~
14.70
25.9
d2103
85539
106793
92467.50
8141.66
9880.4
1883.40
14.94
81769
84547
82769.70
883.40
9472.1
1240.28
2.88
~
0.006
10.49
34.1
fl3795
30991
35073
32589.40
1139.27
9951.4
6204.00
13.27
29400
29805
29578.80
135.70
9376
4971.05
2.80
~
~
9.24
19.8
The overall average  improvement
4.4
47.5
Note: minimum (Min), maximum (Max), standard deviation (std.), the percentage deviations of the average with the best-known solution (PDavg), ~ denotes to 0.000, accuracy % = ((meanACS  − meanWFA-tsp)/meanACS) * 100.


### 4.1.1. The Best Performance

Table3 compares the WFA-TSP performance with ACS algorithm performance using the best solution found and average iterations and time collapsed to find the best solution for 10 independent runs. The results presented in the table show that WFA-TSP outperforms the ACS algorithm in all datasets in terms of the best solution found. Furthermore, WFA-TSP can reach the optimal solution in 9 out of 18 datasets. These datasets are “eil51,” “eil76,” “kroA100,” “eil101,” “bier127,” “ch130,” “ch150,” “kroA150,” and “kroA200,” whereas ACS algorithm reached the optimal solution for datasets “eil76” and “kroA100.” Table 3 and Figure 4 indicate how the average of the computational time of both algorithms changed when the number of cities is gradually increased. It can be seen from the figure that the computation time of the ACS and WFA-TSP is relatively closed. WFA-TSP performed slightly faster than ACS in small size cities. However, WFA-TSP significantly outperformed ACS in medium size cities. Additionally, it can also be seen from Table 3 and Figure 5 that the average computation time of ACS in the 10 runs clearly increases with the large dataset size until it reaches up to 6204 seconds. Meanwhile WFA-TSP has shown much faster solution search and its average computation time reaches less than 5000 seconds with large datasets.Figure 4
The comparison of the average computation time of WFA-TSP and ACS for small data set.Figure 5
The comparison of the average computation time of WFA-TSP and ACS for large data set.The table also shows the percentage improvement in the computation time of the WFA-TSP when the average time of the two algorithms is compared. WFA-TSP shows that in all datasets the improvement percentage can reach up to 80%. Table3 also demonstrates the significant of the statistical results of all datasets. It can be seen that WFA-TSP has a significant improvement in terms of the computation time where the P values for all datasets are less than 0.05. By this, a conclusion can be drawn about the scalability of WFA-TSP in small, medium, and large dataset size, where WFA-TSP outperforms ACS in both solution quality and computation time.


### 4.1.2. Solution Accuracy

Table3 shows the statistical descriptive test used on the experimental results of the algorithms tested. The statistical test was used to evaluate the search accuracy of the proposed method compared to the ACS algorithm. The solution quality results reported in Table 3 show that WFA-TSP algorithm has shown better searching performance than ACS, while the mean and the standard deviation values obtained by WFA-TSP algorithm on all datasets are less and better than the ACS algorithm, indicating that WFA-TSP has more stability in its searching performance than ACS. The table also outlines the improvement percentage in the searching accuracy of the proposed method by comparing the mean of the two algorithms. The difference in the searching accuracy obtained by WFA-TSP is clearly significant. WFA-TSP shows in all the datasets a better improvement percentage, which ranges from 0% to 4%. In addition, the table shows that the improvement percentage is increased when the number of cities increased, which indicates that WFA-TSP algorithm can search solutions far more accurately than ACS.Table3 also shows the summary of the percentage deviation of the experimental results obtained by WFA-TSP and ACS compared to the best-known results. The table compares the experimental results using the percentage deviation of the average with the best-known solution (PDavg) of both algorithms. From the results shown in the table, the deviation of the average solution from the best-known solution of the WFA-TSP for all datasets is significantly better than ACS. From these comparisons, it can be observed that WFA-TSP is generally better than ACS in terms of the solution accuracy. Additionally, based on the reported P values in Table 3, it can be seen that WFA-TSP has a significant improvement in terms of the solution quality where the P values for all datasets are less than 0.05. Generally, the findings have revealed that WFA-TSP has faster computation time and can find better quality of solutions than ACS algorithm in small and medium size dataset problems.


## 4.1.1. The Best Performance

Table3 compares the WFA-TSP performance with ACS algorithm performance using the best solution found and average iterations and time collapsed to find the best solution for 10 independent runs. The results presented in the table show that WFA-TSP outperforms the ACS algorithm in all datasets in terms of the best solution found. Furthermore, WFA-TSP can reach the optimal solution in 9 out of 18 datasets. These datasets are “eil51,” “eil76,” “kroA100,” “eil101,” “bier127,” “ch130,” “ch150,” “kroA150,” and “kroA200,” whereas ACS algorithm reached the optimal solution for datasets “eil76” and “kroA100.” Table 3 and Figure 4 indicate how the average of the computational time of both algorithms changed when the number of cities is gradually increased. It can be seen from the figure that the computation time of the ACS and WFA-TSP is relatively closed. WFA-TSP performed slightly faster than ACS in small size cities. However, WFA-TSP significantly outperformed ACS in medium size cities. Additionally, it can also be seen from Table 3 and Figure 5 that the average computation time of ACS in the 10 runs clearly increases with the large dataset size until it reaches up to 6204 seconds. Meanwhile WFA-TSP has shown much faster solution search and its average computation time reaches less than 5000 seconds with large datasets.Figure 4
The comparison of the average computation time of WFA-TSP and ACS for small data set.Figure 5
The comparison of the average computation time of WFA-TSP and ACS for large data set.The table also shows the percentage improvement in the computation time of the WFA-TSP when the average time of the two algorithms is compared. WFA-TSP shows that in all datasets the improvement percentage can reach up to 80%. Table3 also demonstrates the significant of the statistical results of all datasets. It can be seen that WFA-TSP has a significant improvement in terms of the computation time where the P values for all datasets are less than 0.05. By this, a conclusion can be drawn about the scalability of WFA-TSP in small, medium, and large dataset size, where WFA-TSP outperforms ACS in both solution quality and computation time.


## 4.1.2. Solution Accuracy

Table3 shows the statistical descriptive test used on the experimental results of the algorithms tested. The statistical test was used to evaluate the search accuracy of the proposed method compared to the ACS algorithm. The solution quality results reported in Table 3 show that WFA-TSP algorithm has shown better searching performance than ACS, while the mean and the standard deviation values obtained by WFA-TSP algorithm on all datasets are less and better than the ACS algorithm, indicating that WFA-TSP has more stability in its searching performance than ACS. The table also outlines the improvement percentage in the searching accuracy of the proposed method by comparing the mean of the two algorithms. The difference in the searching accuracy obtained by WFA-TSP is clearly significant. WFA-TSP shows in all the datasets a better improvement percentage, which ranges from 0% to 4%. In addition, the table shows that the improvement percentage is increased when the number of cities increased, which indicates that WFA-TSP algorithm can search solutions far more accurately than ACS.Table3 also shows the summary of the percentage deviation of the experimental results obtained by WFA-TSP and ACS compared to the best-known results. The table compares the experimental results using the percentage deviation of the average with the best-known solution (PDavg) of both algorithms. From the results shown in the table, the deviation of the average solution from the best-known solution of the WFA-TSP for all datasets is significantly better than ACS. From these comparisons, it can be observed that WFA-TSP is generally better than ACS in terms of the solution accuracy. Additionally, based on the reported P values in Table 3, it can be seen that WFA-TSP has a significant improvement in terms of the solution quality where the P values for all datasets are less than 0.05. Generally, the findings have revealed that WFA-TSP has faster computation time and can find better quality of solutions than ACS algorithm in small and medium size dataset problems.


## 4.2. Performance of WFA-TSP versus Other State of the Art Metaheuristics in TSP

The results of the experiments are presented in Table3 in which the performance of the WFA-TSP is compared with that of the algorithms proposed by Somhom et al. [5], Pasti and De Castro [6], Masutti and de Castro [7], and the genetic simulated annealing ant colony system with particle swarm optimization (GSAACS-PSO) technique proposed by [12], by considering the best solution found and the average solutions from 10 independent runs. In the table, BKS represents the best-known solution, mean represents the average, SD represents the standard deviation, and best represents the best solution found, which is highlighted in bold.It can be seen that the results of the WFA-TSP are generally better than those of Somhom et al. [5], Pasti and de Castro [6], Masutti and de Castro [7], and GSAACS-PSOT [12]. As the table shows, the WFA-TSP outperformed the GSAACS-PSO in 18 out of 23 datasets in terms of the best solution found. These datasets are eil51, eil76, eil101, berlin52, bier127, ch130, ch150, rd100, lin105, kroA100, kroA150, kroA200, kroB100, kroC100, kroD100, kroE100, lin318, and fl1400. The WFA-TSP also outperformed the GSAACS-PSO in nearly all datasets in terms of the average solutions, except for datasets rat575 and rat783. It also can be seen that the algorithms of Somhom et al. [5], Pasti and de Castro [6], and Masutti and de Castro [7] could not reach the optimal solution for the tested datasets, whereas the WFA-TSP reached the optimal solution for 13 of the 23 datasets. The analysis therefore shows that the WFA-TSP performs consistently well compared with other algorithms. Also, the SD of the best solution cost for the WFA-TSP in 10 runs was lower than that of the other algorithms.Table4 presents a comparison of the experimental results by using the percentage deviations of the average and best solutions from the best-known solution of the WFA-TSP, Somhom et al. [5], Pasti and de Castro [6], Masutti and de Castro [7], and GSAACS-PSO [12]. The percentage deviation of the average solution from the best-known solution is denoted as PDavg while the calculated deviation of the best solution from the best-known solution is denoted as PDbest. The table shows that the deviation of the average solution from the best-known solution (PDavg) of the WFA-TSP for all datasets except rat575 and rat783 was significantly better than that of the other algorithms. The difference in the performance of WFA-TSP in each dataset compared with that of the GSAACS-PSOT in terms of the PDavg value can be observed clearly in the graph (Figure 6), where the WFA-TSP PDavg values are compared with the PDavg values of the other algorithms. Table 5 also shows that in 19 of the 23 datasets, the deviation of the best solution from the best-known solution (PDbest) of the WFA-TSP is generally better than that of the other algorithms for datasets eil51, eil76, eil101, berlin52, bier127, ch130, ch150, rd100, lin105, kroA100, kroA150, kroA200, kroB100, kroC100, kroD100, kroE100, lin318, and fl1400.Table 4
Comparison of the experimental WFA-TSP results with the results of other algorithms.
TSP instance
BKS
Somhom et al. algorithm [5]
Pasti and De Castro algorithm [6]
Masutti and De Castro algorithm [7]
GSAACS-PSO [12]
WFA-TSP
Mean
SD
Best
Mean
SD
Best
Mean
SD
Best
Mean
SD
Best
Mean
SD
Best
eil51
426
440.60
3.44
433
438.70
3.52
429
437.47
4.20
427
427.27
0.45
427
426.40
0.52
426
berlin52
7542
8025.00
249.00
7715
8074.00
270.00
7716
7932.50
277.30
7542
7542
0
7542
7542.00
0.00
7542
eil76
538
562.30
5.23
552
556.10
8.03
542
556.33
5.30
541
540.2
2.94
538
538
0.00
538
kroA100
21282
21617.00
164.00
21410
21868.00
246.00
21369
21522.73
93.34
21333
21370.47
123.36
21,282
21282
0.00
21,282
kroB100
22141
22623.00
75.30
22548
22854.00
209.00
22596
22661.47
193.50
22343
22283
183.99
22,141
22243.5
54.05
22141
kroC100
20749
21150.00
188.00
20921
21232.00
216.00
20915
20971.23
108.20
20915
20879
158.64
20,749
20782.6
28.41
20749
kroD100
21294
21846.00
154.00
21500
22028.00
303.00
21457
21697.37
157.00
21374
21620
226.6
21,309
21469.222
83.58
21342
kroE100
22068
22682.00
214.00
22379
22816.00
268.00
22427
22715.63
260.20
22395
22183
103.32
22,068
22203.9
59.56
22106
rd100
7910
8239.00
104.00
8028
8253.90
149.00
7947
8199.77
80.77
7982
7987.6
62.06
7910
7942.6
15.33
7911
eil101
629
655.60
5.95
640
654.83
6.57
641
648.63
3.85
638
635.23
3.59
630
630.7
2.83
629
lin105
14379
14476.00
118.00
14379
14702.00
328.00
14379
14400.17
44.03
14379
14406
37.28
14,379
14379
0.00
14379
bier127
118282
121733.33
1240.00
119840
121780.00
1564.00
118760
120886.30
1159.00
118970
119421.8
580.83
118,282
118714.94
167.16
118282
ch130
6110
6307.00
63.00
6203
6291.80
65.00
6142
6282.40
60.15
6145
6205.63
43.7
6141
6,133.90
29.29
6110
ch150
6528
6751.00
62.20
6631
6753.20
83.00
6629
6738.37
76.14
6602
6563.7
22.45
6528
6,542.20
14.22
6528
kroA150
26524
27401.00
252.00
26930
27346.00
223.00
26932
27355.97
327.90
26678
26899.2
133.02
26,524
26,568.40
58.45
26524
kroB150
26130
26806.00
250.00
26342
26752.00
210.00
26395
26631.87
232.90
26264
26448
266.76
26,130
26347.32
72.25
26160
kroA200
29368
30416.00
133.00
30144
30258.00
343.00
29594
30190.27
273.40
29600
29738.73
356.07
29,383
29,438.20
114.84
29368
kroB200
29437
30286.00
301.00
29703
30416.00
350.00
29831
30135.00
276.80
29637
30035
357.48
29,541
29931.97
132.89
29634
lin318
42029
43923.00
382.00
43154
43705.00
391.00
42975
43696.87
410.10
42834
43002.9
307.51
42487
42,490.10
208.54
42278
rat575
6773
7174.00
39.50
7090
7125.10
40.90
7039
7115.67
37.47
7047
6933.87
27.62
6891
7,000.80
21.73
6971
rat783
8806
9388.00
39.40
9316
9326.30
48.50
9185
9343.77
46.97
9246
9079.23
52.69
8988
9,180.20
40.79
9126
fl1400
20127
20743.00
116.00
20558
21071.00
205.00
20745
21110.00
163.30
20851
21349.63
527.88
20,593
20449
50.46
20365
d1655
62128
68046.00
379.00
67459
71432.00
589.00
70323
72113.17
698.60
70918
65621.13
1031.94
64,151
64878.6
344.25
64313Table 5
Comparison of the experimental WFA-TSP results with the results of other algorithms, where BKS represents the best-known solution.
TSP instance
BKS
Pasti and De Castro algorithm [6]
Cochrane and Beasley method [26]
Masutti and De Castro algorithm [7]
GSAACS-PSO [12]
WFA-TSP
PDavg
PDbest
PDavg
PDbest
PDavg
PDbest
PDavg
PDbest
PDavg
PDbest
eil51
426
2.98
0.70
2.89
0.94
2.69
0.23
0.30
0.23
0.09
0.00
berlin52
7542
7.05
2.31
7.01
0.00
5.18
0.00
0.00
0.00
0.00
0.00
eil76
538
3.36
0.74
4.35
2.04
3.41
0.56
0.41
0.00
0.00
0.00
kroA100
21282
2.75
0.41
1.31
0.57
1.13
0.24
0.42
0.00
0.00
0.00
kroB100
22141
3.22
2.06
2.20
1.53
2.35
0.91
0.64
0.00
0.46
0.00
kroC100
20749
2.33
0.80
1.70
0.80
1.07
0.80
0.63
0.00
0.16
0.00
kroD100
21294
3.45
0.77
1.87
0.80
1.89
0.38
1.53
0.07
0.82
0.23
kroE100
22068
3.39
1.63
2.56
1.52
2.93
1.48
0.52
0.00
0.62
0.17
rd100
7910
4.35
0.47
3.64
1.19
3.66
0.91
0.98
0.00
0.41
0.01
eil101
629
4.11
1.91
3.78
1.11
3.12
1.43
0.99
0.16
0.27
0.00
lin105
14379
2.25
0.00
1.08
0.00
0.15
0.00
0.19
0.00
0.00
0.00
bier127
118282
2.96
0.40
3.00
0.69
2.20
0.58
0.96
0.00
0.37
0.00
ch130
6110
2.98
0.52
2.82
1.13
2.82
0.57
1.57
0.51
0.39
0.00
ch150
6528
3.45
1.55
3.23
1.78
3.22
1.13
0.55
0.00
0.22
0.00
kroA150
26524
3.10
1.54
3.06
1.55
3.14
0.58
1.41
0.00
0.17
0.00
kroB150
26130
2.38
1.01
2.60
1.06
1.92
0.51
1.22
0.00
0.83
0.11
kroA200
29368
3.03
0.77
3.27
0.92
2.80
0.79
1.26
0.05
0.24
0.00
kroB200
29437
3.33
1.34
2.31
0.88
2.37
0.68
2.03
0.35
1.68
0.67
lin318
42029
3.99
2.25
4.31
2.65
3.97
1.92
2.32
1.09
1.10
0.59
rat575
6773
5.20
3.93
6.20
4.89
5.06
4.05
2.38
1.74
3.36
2.92
rat783
8806
5.91
4.30
6.57
5.66
6.11
5.00
3.10
2.07
4.25
3.63
fl1400
20127
4.69
3.07
4.26
2.12
4.88
3.60
6.07
2.32
1.60
1.18
d1655
62128
14.98
13.19
10.09
9.10
16.07
14.15
5.62
3.26
4.43
3.52Figure 6
Percentage deviation of the average solution of the tested algorithms from the best-known solution for each TSP dataset.


## 5. Discussion

Finally, based on the experimental results for the different size of datasets of the test problems, the following discussion can be presented.Searching Behaviour. The aforementioned performance of WFA-TSP represents how the concept of dynamic population in WFA influences the solution search behavior, where changing flows number using flow splitting and merging helps WFA to assign an appropriate population size along the optimization process. The dynamic behaviour of WFA depends on the problem landscape characteristics of the problem instance that is being solved. Therefore, from the experimental results, it can be noted that the complexity WFA is smoothly increased compared to ACS when the number of cities increased. Nevertheless, Figure 7 shows a general WFA-TSP searching behaviour and the performance of the algorithm in terms of exploration and exploitation. The use of water evaporation and precipitation operations has improved the algorithm performance in finding good solution in less amount of time. Using water evaporation and precipitation operations prevents WFA-TSP from early convergence and avoids the algorithm of being trapped in local optima.Figure 7
Searching behaviour of the WFA on TSP dataset ch130.The black colour arrow points to the local best values area, which represents the highest objective values. The solution exploration areas clearly appeared several times during the optimization process, which indicates that the exploration process can occur several times too. On the other hand, the green arrow marks a sample of solution exploitation area. It can be seen in this area that the objective values are coupled with lowest values, which indicates that the exploitation process is performed in this region. However, similar to the solution exploration, solution exploitation appears several times in the graph. By this, a good balancing between exploration and exploitation process is clearly seen in the graph, where the exploration and exploitation area somehow appear equally.Scalability. Both algorithms are scalable in small and medium size datasets. The computation time of ACS and WFA-TSP increases linearly when the number of cites increases. They do not change significantly when the number of cities increases until the number of cities reaches up to 318 cities. Figure 8 clearly shows log graph of dataset “lin318” that shows the convergence speed of WFA in reaching the optimal solution is faster compared to ACS. Furthermore, the differences of the convergence speed are increased when the number of cities higher than 575 cities. It can be seen clearly in Figure 3 and for more large datasets in Figure 4. In fact, although ACS is faster in small and medium size datasets, WFA-TSP improves the search speed to reach up to 80% compared to ACS. However, in large size datasets, the scalability of ACS is poor. Its computation time increases, as the problem becomes larger and more complex, whereas WFA-TSP has shown to be a far more scalable method than ACS for solving large size problems. Its improvement percentage in large size datasets can reach up to 38% compared to ACS algorithm.Figure 8
Comparison of the best objective value during the optimization process of WFA-TSP and ACS for “lin318” TSP dataset.Performance. WFA-TSP is more efficient compared to ACS. WFA-TSP can find optimal solution in 9 out of 19 datasets, whereas ACS can just obtain the optimal solution in two datasets. In small and medium size datasets, ACS and WFA-TSP are able to perform well until the number of cities increases up to 318 cities, where the percentage deviation of the best and the average solution quality to the best-known solutions are less than 3.9% and 2.6% for ACS and 1.1% and 0.6% for WFA-TSP, respectively. However, when the number of cities increases up to 575 cities, the percentage deviation of the best and average solution quality to the best-known solutions of ACS has increased to reach up to 7.6% and 6.2%. In general, WFA-TSP performs better than ACS, where the percentage deviation is lower and the improvement of the searching accuracy of WFA-TSP can reach up to 4%. However, in the large size datasets, the situation is much different between the performance of ACS and WFA-TSP. WFA-TSP is significantly outperforming ACS in terms of solution quality, where the percentage deviation of the best and the average solution quality to the best-known solutions reached up to 23.2% and 22.7% for ACS and 4.4% and 4.3% for WFA-TSP, respectively. Generally, WFA-TSP performs better than ACS in large size datasets, where the percentage deviation is much lower and the improvement of the searching accuracy of WFA-TSP can reach up to 14.7%. This is because of the fast convergence of WFA-TSP towards the good solution area due the dynamic behaviour in the population size of WFA, especially when the solution agent of water flow can split or fork intensively in more promising solution regions. The dynamic behaviour in the population size of WFA can be seen clearly in Figure 9. The figure shows that the number of population size is changing during the optimization process when solving the “d1665” TSP dataset. The increase of the flows number indicates that the algorithm has found a promising solution area, whereas the decreasing in the flows number highlights the redundancy in the search for solutions.Figure 9
The dynamic behaviour of WFA-TSP in solving “d1655” dataset.


## 6. Conclusion

This paper has presented the WFA algorithm for TSP, which differs from the basic TSP algorithm due to domain of TSP versus group object problem. The WFA-TSP uses the NN heuristic for initialization, applies the one-step insertion move with 2-opt neighbour search strategies for splitting and moving, has different representation solution changing in the precipitation according the problem domain of TSP. The experimental results show that the WFA-TSP has outperformed ACO in terms of the best solution and computation time for all data sets. The WFA-TSP also presents the best performance algorithm when compared with the recent metaheuristic algorithm. This study has demonstrated that the WFA is suitable to use for obtaining a good solution to TSP. The strength of WFA-TSP is the fact that it has shown as a fast computation time, as its very potential is used for solution problem which concerns computation time such as web service composition or real time solution. Since the WFA consists of several components that influence the performance of the algorithm, there are many potential improvements that could be made to the WFA-TSP; particularly the water flow splitting and moving procedure could be improved by using better neighbour search strategies. Past researches in TSP have shown various other neighbour search strategies such as 3-opt, 4-opt, simulated annealing, and tabu search used to improve their metaheuristic algorithms for TSP.



---

*Source: 436312-2014-08-07.xml*