0% found this document useful (0 votes)
22 views4 pages

A Hill Climbing Differential Evolutionary Algorithm For Solving Multiple Travelling Salesman Problem

Uploaded by

shammaalsahly
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views4 pages

A Hill Climbing Differential Evolutionary Algorithm For Solving Multiple Travelling Salesman Problem

Uploaded by

shammaalsahly
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Frontiers in Computing and Intelligent Systems

ISSN: 2832-6024 | Vol. 9, No. 2, 2024

A Hill‐Climbing Differential Evolutionary Algorithm for


solving Multiple Travelling Salesman Problem
Jinhua Bian, Xiaoxia Zhang
School of Computer Science and Software Engineering, University of Science and Technology Liaoning, Anshan Liaoning, 114051, China

Abstract: The Multiple Travelling Salesman Problem (MTSP) is a basic deformation of the Travelling Salesman Problem
(TSP), which is a typical NP-Hard problem. For combinatorial optimization problems shaped like MTSP, researchers often use
intelligent optimization algorithms such as genetic algorithms, differential evolutionary algorithms, simulated annealing
algorithms and other intelligent optimization algorithms to approximate the solution. However, typical intelligent optimization
algorithms have the disadvantage of being prone to local convergence and failing to produce theoretically optimal solutions.
Based on this, we propose an HCA&DE algorithm that improves the DE algorithm by using the hill-climbing algorithm, and
carry out data experiments using the solution set of TSPLIB, which proves the practicality and effectiveness of the algorithm.
Keywords: MTSP Problem; Differential Evolution Algorithm; Hill Climbing Algorithm.

TSPLIB dataset. The experiments prove the superiority and


1. Introduction effectiveness of the improved algorithm.
The Multiple Travelling Salesman Problem is a variant of
the classic combinatorial optimization problem---the 2. Algorithm Design
Travelling Salesman problem, which is described as [1-2]: 2.1. Differential Evolutionary Algorithm
there are n cities and m travelers, which need to visit a certain
number of cities and return to their respective starting points, The idea of Differential Evolutionary Algorithm is similar
and each city needs to be visited at least once, and the goal is to genetic algorithm, which is an intelligent optimization
to make the total trip of these m travelers the shortest. The algorithm that simulates the criterion of biological selection
Travelling Salesman Problem has a broader utility compared and survival of the fittest in nature. It consists of four main
to the traveler problem, and is more applicable to problems operations: initial population, simulated mutation, simulated
such as logistics and transportation, and path planning. For crossover, and natural selection. the DE algorithm retains the
the MTSP problem, many researchers used different global search strategy based on population, and reduces the
improved optimization algorithms to solve it, Pin Liu [3] complexity of the genetic operation by adopting the real
divided the algorithm into a K-means clustering phase and a number coding, the simple mutation operation based on
genetic algorithm phase, thus speeding up the algorithm difference, and the one-to-one competition survival strategy.
running efficiency and ensuring a balanced distribution of the Unlike the GA algorithm, the DE algorithm links the mutation
workload among the travelers; Cong Bao[4]proposed an ant- operation to the crossover operation, where the mutated
watching mechanism as well as a modal algorithm based on individuals are parametrically mixed with some pre-
comparative crossover, which significantly improves the determined target individuals to generate test individuals and
quality of the offspring solution; Hong Rui Zhu[5]improved complete the crossover operation.
the fast uniparental genetic algorithm to enhance the diversity The mutation operation of the difference algorithm utilizes
of the population and thus avoid falling into local optimums; the difference vectors xp1, xp2 of two individuals randomly
Yafei Dong[6]introduced a new population partitioning selected from the population as the source of random
method and heterogeneous evolutionary mechanism, as well variation of the third individual xp3, and generates the mutated
as a guided and unguided jumping mechanism on the basis of individuals by weighting the difference vectors and summing
the frog-jumping algorithm, thus improving the efficiency of them with the third individual according to a certain rule,
the co-evolutionary process and ultimately obtaining a high- which is calculated by the formula:
quality solution; Bing Sun[7], based on the balanced multi-
traveler problem's optimization objective, constructed a new 
vij  t 1  xp1 j  t   xp2 j  t   xp3 j  t   (1)
type of evaluation function and designed a dual chromosome After the mutation operation, we perform a crossover
coding method, thus improving the computational ability of operation to crossover the mutated individual with the
the algorithm. probability of a particular parent individual, firstly, we set the
In this paper, for the shortcomings of Differential mutation probability Pc, and then we generate the mutation
Evolutionary Algorithm which is easy to fall into local random number and dimension random number for each
optimum and unable to obtain the optimal solution, an dimension of the individual, when the random number of a
improved DE algorithm based on Hill-Climbing algorithm- certain dimension is less than Pc or the dimension random
HCA&DE algorithm is proposed according to the strategy of number is equal to the number of the current dimension, then
Hill-Climbing algorithm, which utilizes the crossover the current dimension value of the new individual equals to
operators such as 2-opt, insert-opt ,3-opt to local search for the current dimension value of the mutated individual, or else
the solution set, to improve the algorithm's ability to local it equals to the current dimension value of the parent
search, and performs the data experiments by using the individual. individual's current dimension value, otherwise it

4
is equal to the parent's current dimension value. The formula Algorithm 1: DE algorithm
is as follows: Input: Population:P;Dimension:D;Generation:R;
vij (t  1) randij  Pc or j  rand(i) Output: The Best solution path: BestPath
uij (t  1)  { (2) 1: r←1(initialization):
xij (t ) randij  Pc and j  rand(i) 2: for i = 1 to P do
randij is a random decimal between [0,1], Pc is the 3: for j=1 to D do
crossover probability, Pc∈[0, 1], and rand (i) is a random 4:

integer between [1,n]. This crossover strategy ensures that at 5: end


6: end
least one component of xi (t+1) is contributed by the
7: while( )or( )do
corresponding component of xi (t).
for i=1 to P do
After the above crossover and selection algorithms, the 8:
9: //Mutation and Crossover operation
selection operation is executed, using tournament one-to-one 10: for j=1 to D do
selection, i.e., the parent individual is compared with its own 11:
children, and whoever is better adapted survives. This 12:
concludes the round of Differential Evolutionary Algorithm. 13: end
The pseudo-code of DE algorithm is shown in Algorithm 1. 14: //Selection operation
15: if then
16:

17: if then
18:

19: end
20: else
21:

22: end
23: end
24: r←r+1;
25: end
26: return the Best solution path BestPath

2.2. Hill Climbing Algorithm

Figure 1. Flowchart of HCA search algorithm

The Hill-Climbing algorithm is a typical local optimal 3-opt algorithm is to randomly select the cities in an interval
search algorithm, which uses various crossover operators to and randomly insert a sequence of cities into the solution set.
generate the neighbors of the current solution, and iterates another location. The 3-opt algorithm is to randomly select
using the better individuals in the generated neighboring three cities, exchange their order and generate a new path. The
solutions to keep updating the current optimal solution until flowchart of the Hill-Climbing algorithm designed in this
there is no better solution in the current generated neighboring paper is shown in Figure 1.
solutions. For the MTSP problem, the more classical
crossover operators include 2-opt, double-bridge-swap, 3. HCA&DE Algorithm
insert-swap, etc. These operators are able to form new
neighboring individuals flexibly and extensively, thus 3.1. HCA&DE Algorithm Introduction
effectively forming and updating the current optimal solution. HCA&DE algorithm is a combination algorithm of
As a typical local search algorithm, hill-climbing algorithm Differential Evolutionary Algorithm and Hill-Climbing
can effectively solve the problem that DE algorithm is easy to search algorithm, he has the powerful global search
fall into the local optimum and cannot obtain the optimal performance of Differential Evolutionary Algorithm, and at
solution. the same time, the local search ability of DE algorithm is
The performance of Hill-Climbing algorithm depends on enhanced by the Hill-Climbing algorithm, which makes the
the selection of crossover operators, and in this paper, 2-opt, HCA&DE algorithm have both powerful local search ability
insert-opt and 3-opt are selected as the crossover operators of and global search ability, and it can search for better solutions
Hill-Climbing algorithm. 2-opt-swap algorithm is to more efficiently. The HCA&DE algorithm includes
exchange all the cities in the two cities in the reverse order to initialization, mutation, crossover, selection, 2-opt, insert-opt,
form a new path. insert-opt algorithm is to randomly select 3-opt and other operations.
the cities in an interval and randomly insert a sequence of First, initialize the population and randomly generate N
cities in the segment into another position of the solution set. paths that meet the requirements. After that, we set the

5
crossover and mutation probabilities of DE algorithm and better solution than the current solution i in Si1, update the
start to calculate the number of iterations of HCA & DE current solution and re-execute Step6, otherwise go to Step7.
algorithm, perform the regular DE mutation, crossover and Step7:Execute insert-swap crossover operator to randomly
selection operations, update the current population solution select a city in an interval and randomly insert this sequence
and then select an city path solution set i from the current of cities into another position in the solution set to form the
population in a roulette wheel way, and then enter into the neighbor Si2 of the current solution, if there exists a solution
Hill-Climbing search algorithm, which first performs the 2- in Si2 that is better than the current solution i, then update the
opt algorithm to form the neighbors of the current solution, current solution and execute Step6, otherwise go to Step8.
then the 2-opt algorithm to form the neighbors of the current Step8:Perform 3-opt algorithm operation, randomly select
solution. opt algorithm to form the neighbor S of the current three cities at a time to form the neighbor Si3 of the current
solution, if the fitness of all the individuals in the current solution, if there exists a better solution than the current
neighbor S is lower than the fitness of the current optimal solution i in Si3, update the current solution and execute Step6,
solution, then enter insert-swap swap algorithm, if the fitness otherwise go to Step9.
of all the individuals in the neighbor of the current solution Step9:make g=g+1,if g<800 then go to Step2,otherwise it
formed by the insert-swap algorithm is lower than the fitness represents that the upper limit of iteration number of
of the current optimal solution, then enter the 3-opt algorithm, HCA&DE algorithm is reached at this time, end HCA&DE
and if it still can't replace the optimal solution, then the algorithm.
HCA&DE will be used. The current round of HCA&DE
algorithm ends, so that the number of HCA&DE iterations is 4. Experiment
increased by 1. If one of the solutions generated during the
The HCA&DE algorithm proposed in this paper is
execution of the three local search algorithms is better than
implemented in Codeblocks software using C++. In order to
the current optimal solution, the current optimal solution is
test the performance of the HCA&DE algorithm in solving
updated immediately and the search is restarted by jumping
the multi-starting-point MTSP problem and to compare the
to the 2-opt algorithm. The HCA&DE algorithm ends when
difference in performance between the HCA&DE algorithm
the upper limit of the HCA&DE algorithm iterations is
and the ordinary DE algorithm, we use the TSPLIB test
reached.
dataset and choose three city datasets with a large difference
3.2. HCA&DE Algorithm Design in the number of cities, for each test set, we set the number of
travel quotients as 4, 8, and 12, and set fixed starting points
Step1: Initialize HCA&DE parameters: set DE mutation
for each of them, after which the algorithm is run for testing.
probability 0.08, crossover probability 0.65, HCA&DE
In order to set the optimal HCA&DE algorithm parameters
algorithm iteration number upper limit is 800, Population size
for the multi-starting point MTSP problem, we utilize the
Pop_Size=500, make current HCA&DE iteration count
eil51 dataset, which has fewer cities and is relatively easy to
variable g=0, greedy initialization to generate initial
compute the optimal solution, for the parameter test, and
population P.
finally determine the optimal crossover probability parameter
Step2: Randomly select three solution sets from the current
for the DE algorithm to be 0.65, the variance probability to be
population, perform DE algorithm mutation operation to
0.08, the population size to be 500, and the upper limit of the
generate new city solution paths, and calculate the fitness of
iteration number of the HCA&DE algorithm to be 800.
the new solutions.
Table 1 gives the optimal paths generated by DE algorithm,
Step3: Select city solution sets from the current population
HCA algorithm and HCA&DE algorithm under the test of
and perform DE algorithm crossover operation with mutated
dataset with city size of 51,100,150. The data show that under
individuals to generate new city solution paths and calculate
the same parameter settings, HCA&DE is not only able to
the fitness of new solutions.
find a better path to the city solution set, but also the solution
Step4:Perform the DE algorithm selection operation,
differences are more stable than the ordinary DE algorithm
update the current population, and select an city solution set
and HCA algorithm, which proves that HCA&DE can jump
by the rule of “roulette”.
out of the localoptimum timely when the algorithm falls into
Step5:Start Hill-Climbing algorithm and select an initial
the local optimum, ensure the diversity of the population
solution i in the rule of “roulette”.
solution, and find the optimal solution with a greater
Step6:Execute 2-opt crossover algorithm, randomly select
probability.
two cities at a time, exchange their order in the solution set,
and form the neighbor Si1 of the current solution, if there is a

Table 1. Running results of DE algorithm, HCA algorithm and HCA&DE algorithm


Number of DE HCA HCA&DE
Number of cities
Salesman Best Average Best Average Best Average
4 507 530 516 543 497 513
51 8 673 702 656 708 613 640
12 987 1033 946 979 876 891
4 26475 28571 24968 26092 23377 23609
100 8 27876 31016 27348 31648 25099 26002
12 32547 34879 31954 33399 30174 30453
4 30153 31797 30092 32017 28176 28791
150 8 39880 43097 38987 40188 34049 36804
12 48901 50013 49073 49975 38042 40035

6
[2] YANG Hua, CHEN Yanhua, LI Hongyi. Automatic
5. Conclusion preparation method of contact network maintenance plan based
on multi-traveler problem[J]. Electrified Railway,2023,34(01):
In this paper, for the shortcomings of DE algorithm which 81-85.DOI:10.19587/j.cnki.1007-936x.2023.01.016.
is easy to fall into local optimization, the hill-climbing search [3] Liu Pin. Research based on two-stage heuristic algorithm for
algorithm is introduced to enhance the local search ability of multi-traveler problem[D].Northern-Nationalities-University,
DE algorithm, so that DE algorithm can jump out of the local 2024. DOI:10.27754/d.cnki.gbfmz.2024.000383.
optimization in time and obtain the optimal solution more
[4] Bao Cong.Research on Evolutionary Algorithms for Access-
efficiently. The experimental data proves that for the multi- Constrained Multi-Traveler Problem[D]. Nanjing University of
start MTSP problem, the results of the HCA&DE algorithm Information Engineering, 2023.DOI: 10.27248/ d.cnki. gnjqc.
proposed in this paper are proved to be better than the 2023.001033.
ordinary DE algorithm and the ordinary hill-climbing search
[5] H.R. Zhu. Research on Improving Monophilic Genetic
algorithm, and the probability of obtaining the optimal Algorithm to Solve Multi-TravelerProblem[D]. West-China-
solution is larger, which proves that the HCA&DE algorithm NormalUniversity,2023.DOI:10.27859/d.cnki.gxhsf.2023.000
combines the local search ability of the HCA algorithm and 111.
the global search ability of the DE algorithm, and proves the
[6] Dong Yafei. Optimization study of two classes of complex
effectiveness of the HCA&DE algorithm. However, the time multi-traveler problems based on evolutionary algorithms[D].
complexity of HCA&DE algorithm is larger, and with the Chongqing University, 2022.DOI: 10.27670/ d.cnki. gcqdu.
increase of city scale, the time complexity of HCA&DE 2022.002674.
algorithm needs to be further improved.
[7] SUN Bing, WANG Chuan, YANG Qiang, et al. Evolutionary
algorithms for the multiple starting point equilibrium multi-
Acknowledgments traveler problem[J]. Computer Engineering and Design, 2023,
44(07):2030-2038.DOI:10.16208/j.issn1000-7024.
This work it was supported by National College Students'
2023.07.015.
innovation and entrepreneurship training program project
(No. ???).

References
[1] Zhao Xiaoqiang,Tuo Mingfu. An applied study of task
planning problem based on multi-traveler problem model for
solving workload equalization[J]. Internet of Things
Technology, 2024,14(07): 84-89.DOI:10.16667/j.issn.2095-
1302. 2024.07.022.

You might also like