CN115271273A - Traveler problem solving method and system based on improved whale optimization algorithm - Google Patents
Traveler problem solving method and system based on improved whale optimization algorithm Download PDFInfo
- Publication number
- CN115271273A CN115271273A CN202211204883.9A CN202211204883A CN115271273A CN 115271273 A CN115271273 A CN 115271273A CN 202211204883 A CN202211204883 A CN 202211204883A CN 115271273 A CN115271273 A CN 115271273A
- Authority
- CN
- China
- Prior art keywords
- individual
- algorithm
- updating
- current
- optimal
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 109
- 241000283153 Cetacea Species 0.000 title claims abstract description 61
- 238000005457 optimization Methods 0.000 title claims abstract description 43
- 238000013178 mathematical model Methods 0.000 claims description 42
- 230000008569 process Effects 0.000 claims description 35
- 239000013598 vector Substances 0.000 claims description 26
- 150000001875 compounds Chemical class 0.000 claims description 14
- 238000011161 development Methods 0.000 claims description 12
- 230000033001 locomotion Effects 0.000 claims description 8
- 125000004432 carbon atom Chemical group C* 0.000 claims description 6
- 239000000126 substance Substances 0.000 claims description 6
- 238000012360 testing method Methods 0.000 abstract description 15
- 238000011160 research Methods 0.000 abstract description 4
- 238000013473 artificial intelligence Methods 0.000 abstract description 2
- 238000004364 calculation method Methods 0.000 abstract 1
- 238000004088 simulation Methods 0.000 description 12
- 230000005653 Brownian motion process Effects 0.000 description 4
- 238000005537 brownian motion Methods 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 3
- 230000035772 mutation Effects 0.000 description 3
- 238000013461 design Methods 0.000 description 2
- 230000001788 irregular Effects 0.000 description 2
- 241000282461 Canis lupus Species 0.000 description 1
- 241000720287 Decapterus tabl Species 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000006243 chemical reaction Methods 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 230000008602 contraction Effects 0.000 description 1
- 238000007796 conventional method Methods 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000002474 experimental method Methods 0.000 description 1
- 235000003642 hunger Nutrition 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 239000002245 particle Substances 0.000 description 1
- 230000002028 premature Effects 0.000 description 1
- 239000011541 reaction mixture Substances 0.000 description 1
- 238000010845 search algorithm Methods 0.000 description 1
- 230000001360 synchronised effect Effects 0.000 description 1
- 238000001926 trapping method Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q10/00—Administration; Management
- G06Q10/08—Logistics, e.g. warehousing, loading or distribution; Inventory or stock management
- G06Q10/083—Shipping
- G06Q10/0835—Relationships between shipper or supplier and carriers
- G06Q10/08355—Routing methods
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/004—Artificial life, i.e. computing arrangements simulating life
- G06N3/006—Artificial life, i.e. computing arrangements simulating life based on simulated virtual individual or collective life forms, e.g. social simulations or particle swarm optimisation [PSO]
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02T—CLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
- Y02T10/00—Road transport of goods or passengers
- Y02T10/10—Internal combustion engine [ICE] based vehicles
- Y02T10/40—Engine management systems
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Business, Economics & Management (AREA)
- Theoretical Computer Science (AREA)
- Economics (AREA)
- General Physics & Mathematics (AREA)
- Computational Linguistics (AREA)
- Development Economics (AREA)
- Data Mining & Analysis (AREA)
- Evolutionary Computation (AREA)
- General Health & Medical Sciences (AREA)
- Molecular Biology (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- Biomedical Technology (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Artificial Intelligence (AREA)
- Life Sciences & Earth Sciences (AREA)
- Biophysics (AREA)
- Health & Medical Sciences (AREA)
- Entrepreneurship & Innovation (AREA)
- Human Resources & Organizations (AREA)
- Marketing (AREA)
- Operations Research (AREA)
- Quality & Reliability (AREA)
- Strategic Management (AREA)
- Tourism & Hospitality (AREA)
- General Business, Economics & Management (AREA)
- Complex Calculations (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The invention belongs to the technical field of computer artificial intelligence, and discloses a traveler problem solving method and system based on an improved whale optimization algorithm, which comprises the following steps: optimizing parameters of a standard WOA algorithm, designing and developing a new search structure and a whale individual position updating method, and providing a MnWOA algorithm; and meanwhile, the actual performance of the MnWOA is verified by utilizing a classical traveling salesman problem test set. Compared with the prior art, the MnWOA algorithm provided by the invention can effectively solve the problem of travelers, has the characteristics of high search speed, low calculation complexity, high convergence precision and strong global search capability, has the capability of further avoiding a local optimal value, and has good reference value and research significance.
Description
Technical Field
The invention belongs to the technical field of computer artificial intelligence, and particularly relates to a traveler problem solving method and system based on an improved whale optimization algorithm.
Background
With the advancement of science and technology and the continuous development of industries, complex optimization problems attract more and more researchers in various fields. The Traveling Salesman Problem (TSP), a classic NP problem, requires the shortest length of a path to a loop from a city, visiting each city once and back to the origin, given the location of each city and the distance between cities. Because the problem has considerable complexity and practical significance, the problem has a very important position in operation research and theoretical computer science. The conventional method usually needs to consume a large amount of CPU execution time when solving the problems, and high-precision convergence is difficult to realize. This has greatly facilitated the development of metaheuristic algorithms. Unlike the traditional method, the meta-heuristic algorithm gradually becomes an effective technical means for solving the TSP problem because of independence of prior knowledge, strong subject cross characteristics and self-adaptive capacity to complex and variable environments. To date, this efficient method of solving by simulating natural behavior has been successfully applied in a number of classical TSP problems in a short time. However, some improved algorithms still have the problems of insufficient exploration capability and insufficient convergence accuracy when solving the TSP problem. To this end, numerous domain scholars have been working on developing different optimization methods to solve the TSP problem.
The whale optimization algorithm is a new optimization algorithm based on a colony, and the inspiration of the algorithm is derived from a unique bubble net capturing method of whales at the whale head. Because the structure is simple and easy to realize, the required parameters are few, the convergence capability is strong, and the like, the WOA is widely applied to various subject fields. Meanwhile, according to some literature reports, it is also considered as an effective candidate solution for solving the complex optimization problem. However, some existing WOA variants still have difficulty in avoiding premature convergence and insufficient convergence accuracy when solving the TSP problem, and when the problem type is complex, the local optimal evasion capability of these algorithms is weak so that the algorithms almost stagnate in a large number of iterations.
The difficulty of solving the technical problems is as follows: some existing methods are difficult to implement and long in running time, and when the solved TSP problem is complex, an algorithm does not have a method for effectively avoiding a local optimal value.
The significance of solving the technical problems is as follows: the method can simplify the structure and complexity of the algorithm, reduce the running time, and meanwhile, can remarkably enhance the global exploration capability of the algorithm and the capability of avoiding local optimal values; the optimized algorithm can better balance exploration and development to effectively TSP problems.
Disclosure of Invention
The purpose of the invention is as follows: aiming at the problems in the prior art, the invention provides a traveler problem solving method based on an improved whale optimization algorithm. The method has strong global exploration capability and high convergence precision, and can effectively improve the robustness and reliability of the method so as to better solve the problem of the traveling salesman.
The technical scheme is as follows: the invention provides a traveler problem solving method based on an improved whale optimization algorithm, which comprises the following steps:
a traveler problem solving method based on an improved whale optimization algorithm comprises the following steps:
establishing a mathematical model of the distance between cities and determining a total mathematical model of a closed passing loop according to a plurality of mathematical models;
and (3) initializing parameters by using real-time city data of the established mathematical model and adopting an improved whale optimization algorithm, sequentially performing the processes of algorithm iteration, judgment, variation and updating of position information and fitness value of the optimal individual, and finally outputting a position vector of the optimal individual as an optimal path.
In the method, the distance between the city coordinates in the traveler problem is mathematically modeled, and specifically, after the data in the data set is imported, the corresponding city set is obtainedWherein, in the step (A),represents the nth city and its location coordinates are recordedDistance between city 1 and city n
Expressed as:
the distances between all cities are traversed using equation (1, 1) and used as a reserve value.
In the method, the distance between different cities is traversed according to a distance formula to be used as a reserve value, and a total mathematical model of a closed passing circuit is determined on the basis, specifically, a searched route forms a closed loop, and the following requirements are met:
in the above formula, the first and second carbon atoms are,andare all integers and must satisfy:(ii) a M different search routes are set, and the first route is set as,The serial number of the nth city of the traveler in the path; mathematical model of path lengthType i was constructed as follows:
representing based on routeTotal path length of (a); if there are m paths, the optimal solution path is represented as follows:
In the above-described method of the present invention,
initialization of the algorithm's own and common parameters, i.e. initializing the population size N, maximum number of iterations of the algorithmA random number l, and a constant b defining the shape of the logarithmic spiral in the location update method;
initializing whale populations in a random generation mode, and randomly initializing to obtain position vectors of individuals; in the initially formed population, the firstIndividual one,(ii) a This is the one obtained by the algorithmA strip line;
calculating to obtain the path length of the route corresponding to the position vector of each individual by utilizing the established total mathematical model, wherein the path length is the fitness value of the corresponding individual, and substituting the position information of the individual into a formula (1.3) to obtain the fitness value of the individual; the fitness values are sequenced to determine the path length corresponding to the current best individual and the position vector of the individual, and the position information and the fitness value of the best individual are kept unchanged or updated each time the fitness value of the individual is calculated;
iteration is carried out, the current iteration time t is set to be 1, the value of the convergence factor a is updated in a self-adaption mode through a new method, and meanwhile, the random number C and the random number l are updated;
and (3) performing algorithm iteration, judgment, variation and updating of the position information and the fitness value of the optimal individual, outputting the position vector of the optimal individual as an optimal path after the iteration condition is met, and outputting the path length corresponding to the optimal solution as the optimal result of the current search of the problem of the traveling salesman.
In the method, during the judgment process, the random generation is uniformly distributedRandom number in (1)(ii) a The search is performed in a new search structure, and,
when random numberThen, the population executes a global exploration process and updates the current position of each individual by a position updating method;
when random numberIn time, the population performs a local development process,at this time, the current position of each individual is updated by a position updating method.
In the above-described method of the present invention,
during the variation process, updating the position of each individual by using a variation strategy and calculating a fitness value; meanwhile, according to the rule of the greedy strategy, if the fitness value of the updated individual is better, the updated position vector of the individual whale is accepted as the current position vector of the whale;
updating and recording the position information and the fitness value of the optimal individual, and simultaneously judging whether the current iteration times t meet the requirementsIf yes, iteration is finished and the optimal solution is output, otherwise, the optimal solution is output according to the principle thatAnd updating t and continuously performing parameter initialization.
In the above method, the convergence factorThe specific mathematical model of the new updating method of (2) is:
in the formula (I), the compound is shown in the specification,is a constant coefficient, and has a value of 1/4, that is, newThe non-linearity will be varied to facilitate a balance between the search phases.
The new search structure is a new search stage switching method, and the specific implementation process is as follows:
in the formula (I), the compound is shown in the specification,will be updated according to the update rule given by equation (1.5).
In the above method, when the algorithm enters the exploration phase, a specific mathematical model of the location updating method is as follows:
in the formula (I), the compound is shown in the specification,is a random number that follows a normal distribution,is the value in the j-th dimension of a random individual in the population; by the method, the current individual can further expand the search range of the current individual under the condition of keeping randomness, so that a more efficient exploration process is realized;
when the algorithm enters a development stage, the second position updating method comprises the following steps:
the first stage is as follows: the position of the current individual is obtained by using a position updating method of a classical whale optimization algorithm in a spiral position updating stage, and the specific process is as follows:
in the formula (I), the compound is shown in the specification,is the position of the currently best individual and,is the location of the current individual;is a constant defining the shape of a logarithmic spiral, and takes the value of 1;is distributed within a distribution interval of
The random number of (2);
and a second stage: after obtaining the position of the new individual, entering a second stage, and further updating the position of the individual by using a newly proposed position updating mode, wherein the specific process is as follows:
wherein the content of the first and second substances,andrespectively are constant coefficients and satisfy constraint conditions:;is the position of a new individual obtained by a classical spiral position updating method formula (1.8) of a population;is the value on the random dimension of the current best individual; the position of the new individual is determined by the local componentAnd a global componentAre formed together.
In the method, the mutation stage specifically includes:
randomly selecting an individual from a populationAnd making the individual perform a small-range random motion to further explore the local search space where the individual is located and obtain a new individual;
The new individual isWith the current individualComparing, and the individuals with better fitness become new current individuals; the specific mathematical model is as follows:
wherein, the first and the second end of the pipe are connected with each other,is a function of the sign of the symbol,representing an objective function;are random numbers uniformly distributed between 0-1, andare random numbers uniformly distributed between 0-0.5;are random individuals in the current population,a vector that follows a normal distribution is used to refer to the current motion pattern of an individual.
A traveler problem solving system based on a new structure improved whale optimization algorithm comprises:
a first module: establishing a mathematical model of the distance between cities and determining a total mathematical model of a closed passing loop according to a plurality of mathematical models;
a second module: and (3) initializing parameters by using the real-time city data of the established mathematical model and adopting an improved whale optimization algorithm, sequentially performing the processes of algorithm iteration, judgment, variation and updating of position information and fitness value of the optimal individual, and finally outputting the position vector of the optimal individual as an optimal path.
Has the advantages that: the invention adapts to the conversion of the control stage through the newly designed convergence factor a, and is beneficial to better balance exploration and development. Meanwhile, the invention also simplifies the WOA algorithm structure and designs a new position updating method, which can effectively improve the global searching capability and convergence accuracy of the algorithm. In addition, a newly proposed greedy strategy based on brownian motion is also introduced to help the algorithm jump out of local optimality further. The MnWOA is preliminarily tested under the environment of 500-dimension and 2000-dimension through 15 functions in an IEEE expandable function test set, meanwhile, the actual performance of the MnWOA is verified by utilizing two classical data sets in a TSP problem, and an experimental result shows that the MnWOA algorithm is high in running speed and strong in convergence capacity, can stably converge to a global optimum value in most functions without being influenced by problem scale, and has high ductility. Also, in the TSP problem, mnWOA always gives good results, with better global search capability.
Drawings
FIG. 1 is a flowchart of a traveler problem solving method based on an improved whale optimization algorithm according to an embodiment of the present invention.
FIG. 2 is a simplified two-dimensional schematic diagram of a multi-peak function in an IEEE high-dimensional test set provided by an embodiment of the present invention.
Fig. 3 is a simulation test result of the MnWOA and other high performance improved algorithms provided by the embodiment of the present invention in a unimodal function F1 under a 500-dimensional environment.
Fig. 4 is a simulation test result of the MnWOA and other high performance improved algorithms provided by the embodiment of the present invention in the unimodal function F1 under the 2000-dimensional environment.
Fig. 5 is a simulation test result of the MnWOA and other high performance improvement algorithms provided by the embodiment of the present invention in a unimodal function F14 under a 500-dimensional environment.
Fig. 6 is a simulation test result of the MnWOA and other high performance improved algorithms provided by the embodiment of the present invention in the unimodal function F14 under the 2000-dimensional environment.
Fig. 7 is a simulation result of MnWOA in the TSP problem of data set eil76 provided by an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is further described in detail with reference to the following embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The problem of the traveling salesman has important practical significance to the fields of operational research and computer science, and the problems of low convergence speed and low solving precision still exist in the prior art method when the problem of the traveling salesman is solved. Aiming at the problems, the invention discloses a traveler problem solving method based on an improved whale optimization algorithm, and the traveler problem solving method is further described in the following by combining the attached drawings.
As shown in fig. 1, the method for solving the traveler problem based on the improved whale optimization algorithm provided by the embodiment of the invention comprises the following steps:
step one, mathematical modeling is carried out on the distance between city coordinates in the problem of the traveling salesman, then, the distance between different cities is traversed according to a distance formula to be used as a reserve value, and finally, a total mathematical model of a closed passing loop is determined on the basis. The specific implementation process of the process is divided into two steps, and specifically comprises the following steps:
a1: a mathematical model of the distance between cities is established. After importing the data in the dataset, a corresponding city set may be obtainedWherein, in the step (A),represents the nth city and its position coordinate is recorded asDistance between city 1 and city nExpressed as:
the algorithm will use the above equation to traverse the distances between all cities and act as a reserve value.
A2: the final mathematical model is determined. On the basis of A1, in order to enable the route searched by the algorithm to form a closed loop, the following must be satisfied:
in the above formula, the first and second carbon atoms are,andare all integers and must satisfy:(ii) a M different search routes are set, and the first route is set as,The serial number of the nth city of the traveler in the path; the mathematical model of path length is constructed as follows:
in the above formula, the first and second carbon atoms are,representing route-basedThe total length of the path of the traveler problem. If there are m paths, then the optimal solution path for the traveler's problem can be represented as follows:
in the above formula, the first and second carbon atoms are,is the current shortest path of the route set L formed based on the m routes.
Step two, initializing the own parameters and the public parameters of the algorithm, namely initializing the population size N of the algorithm and maximizing the population size NNumber of iterationsA random number l, and a constant b defining the shape of the logarithmic spiral in the location update method; wherein, the common parameters of the population size and the maximum iteration times can be modified by the user according to the requirement, and the random numbers l are distributed inB is a constant, and the fixed value is 1.
And step three, initializing the whale population by adopting a random generation mode, and calculating by utilizing the mathematical model established in the step one to obtain the path length of the route corresponding to the position vector of each individual, namely the fitness value of the individual. These fitness values are ranked to determine the path length corresponding to the current best individual and the location vector of the individual. The specific process of the step comprises the following steps:
s1: random initialization results in the position vector of the individual. In the initially formed population, the firstIndividual(s) of,. This is the first one obtained by the algorithmA bar path.
S2: the fitness value is obtained using the position vector. The path length stated in step three is the fitness value of the corresponding individual, and the fitness value of the individual can be obtained by substituting the position information of the individual stated in S1 into the formula (3.3). The location information and fitness value of the optimal individual will remain unchanged or be updated each time the algorithm performs step three.
Step four, the algorithm starts an iteration process, the current iteration times t is set to be 1, and the convergence factor is updated in a self-adaptive manner by a new methodThe specific method is as follows:
in the formula (I), the compound is shown in the specification,is a constant coefficient, takes a value of 1/3, that is, a new oneThe non-linearity will be varied to facilitate a balance between the search phases. Meanwhile, updating the random number C and the random number l;
step five, the algorithm enters a judging stage and is randomly generated and uniformly distributed inRandom number in (1)At this point, the algorithm will search with a new search structure, i.e., when the random number is presentAnd then, the population executes a global exploration process and updates the current position of each individual by a position updating method, wherein a specific mathematical model is as follows:
in the formula (I), the compound is shown in the specification,is a random number that follows a normal distribution,is the value in the j-th dimension for a random individual in the population. By the method, the current individual can further expand the search range of the current individual under the condition of keeping randomness, so that a more efficient exploration process is realized. When the random numberThe population executes a local development process, updates the current position of each individual by a position updating method, and comprises two stages, wherein in the first stage, the position of the current individual is obtained by using a position updating method of a classical whale optimization algorithm in a spiral position updating stage, and the specific process is as follows:
in the formula (I), the compound is shown in the specification,is the location of the currently best individual,is the location of the current individual;is a constant defining the shape of a logarithmic spiral, and takes the value of 1;is distributed within a distribution interval of
The random number of (2); after obtaining the location of the new individual, the second phase is started, that is, we use the newly proposed location updating method to further update the location of the individual, and the specific process is as follows:
in the formula (I), the compound is shown in the specification,andrespectively are constant coefficients and satisfy constraint conditions:。is the position of a new individual obtained by the classical spiral position update method (formula (3.7)) of the population;is the value in the random dimension of the currently best individual. In the process, the optimal fitness value and the corresponding position information are obtained by utilizing a high-dimensionality complex function problem;
and step six, the algorithm enters a variation stage, the position of each individual is updated by using a variation strategy, and a fitness value is calculated. The specific mutation process is based on the Brownian motion, and the Brownian motion is an irregular motion, and the step length of the irregular motion can be obtained by a probability function satisfying a gaussian distribution. Specifically, the control probability density function for brownian motion at point x is as follows:
in the above formula, the mean valueVariance of. Based on the background knowledge, an individual is randomly selected from the populationAnd let this individual make a small range of random motions to further explore the local search space in which it resides. Subsequently, the new individuals obtained in this step are combinedWith the current individualAnd comparing, and the individual with better fitness can become a new current individual. Specific mathematical models of the above steps are as follows
Wherein the content of the first and second substances,is a function of the sign of the signal,representing an objective function;are random numbers uniformly distributed between 0-1, andare random numbers uniformly distributed between 0-0.5;are random individuals in the current population,a vector that follows a normal distribution is used to refer to the current motion pattern of an individual. If the fitness value of the updated individual is better, the updated position of the individual whale is accepted as the current position of the whale;
step seven, updating and recording the position information and the fitness value of the optimal individual, and meanwhile, judging whether the current iteration times t meet the requirementsIf not, entering step eight, if yes, according toAnd updating t and continuing to execute the step three.
And step eight, finishing the iteration process, outputting the position vector of the optimal individual as an optimal path, and simultaneously outputting the path length corresponding to the optimal solution as an optimal result of the current search of the problem of the traveling salesman.
The present invention is described further below in conjunction with the background information associated with the present technology.
(1) Problem description and model construction.
The Traveling Salesman Problem (TSP) refers to the set of coordinates containing multiple cities for a given point, requiring the design of a shortest path to satisfy the following two constraints:
1. the traveler must travel once and only once through each city (except the starting city);
2. the final path must be a strictly closed loop, i.e. the traveler's end point must be the initial starting point on a route to each different city basis.
Based on the above, a mathematical model of the problem of the traveler can be constructed, and the specific steps include:
a1: a mathematical model of the distance between cities is established. After importing the data in the data set, a corresponding city set may be obtainedWherein, in the process,represents the nth city and its position coordinate is recorded asDistance between city 1 and city nExpressed as:
the algorithm will use the above equation to traverse the distances between all cities and act as a reserve value.
A2: the final mathematical model is determined. On the basis of A1, in order to enable the route searched by the algorithm to form a closed loop, the following must be satisfied:
in the above-mentioned formula, the compound has the following structure,andare all integers and must satisfy:(ii) a M different search routes are set, and the first route is set as,The number of the nth city to which the traveler goes in the route. Then a mathematical model of the path length of the traveler's question can be constructed as follows:
in the above formula, the first and second carbon atoms are,representing based on routeTotal path length of (c); if there are m paths, then the optimal solution path for the traveler's problem can be represented as follows:
in the above-mentioned formula, the compound has the following structure,is the current shortest path of the route set L formed based on the m routes.
(2) Basic whale optimization algorithm.
The whale optimization algorithm is a group-based meta-heuristic algorithm proposed by australian scholars in 2016. Its inspiration comes from the bubble net trapping method of whales at the whale head. In general, the algorithm has three search modes, namely shrink wrapping, spiral updating of positions and extensive search.
1. Shrink wrap phase
The number of whale populations participating in predation is assumed to be N, and the dimensionality is d. The individuals in the current optimal positions can be set as leaders, and other whale individuals can update the positions of the individuals by taking the area where the leaders are located as targets. The mathematical formula at this stage is:
wherein t is the current iteration number; a and C are coefficients of the ratio,is the position vector of the leader and,
then is the location vector of the current individual whale. The coefficients A and C can be obtained by the following equations:
wherein the content of the first and second substances,and withAre random numbers distributed in (0, 1),will decrease linearly with the number of iterations from 2 to 0, t is the current number of iterations,is the maximum number of iterations.
2. And a spiral position updating stage.
At this stage, the whale population has established the current target. The whole population spirally updates the position of the population so as to attack the prey, and the mathematical expression of the whole population is as follows:
in the above equation, it is noted that b is a constant for defining the shape of the logarithmic spiral. l is a random number in (-1, 1). Its mathematical model is as follows:
in the above-mentioned formula, the reaction mixture,will decrease linearly from-1 to-2,is distributed atThe random number of (1).
In the development stage, the whale population can spirally update the position of the whale population while contracting and surrounding the whale population. For such a synchronous behavior model, in order to simulate a real attack process, the algorithm will assume that the probability of whale selecting a spiral update position is the same as the probability of selecting a contraction enclosure, i.e. both occur at 50%, and the mathematical formula at this stage can be expressed as:
wherein, the first and the second end of the pipe are connected with each other,is uniformly distributed inThe random number of (1). In WOA, the search phase including the two processes of shrink wrap and spiral update position shown by the algorithm specification formula (4.11) is collectively referred to as a development phase, and in this phase, the search phase is followed by the development phaseA is satisfiedThat is, A may take on a value of
This facilitates local searching by whales.
3. And (5) a large-scale searching stage.
In order to search the search space more fully, the search space is searchedAnd isIn time, the algorithm will randomly select one individual whale as a leader to lead the individual whale in the existing population. This allows whale populations to be searched away from existing locations. The mathematical model for this phase is very similar to that for the shrink wrap phase, as follows:
wherein the content of the first and second substances,are random individuals in the current population. It is worth mentioning that this phase is also referred to as WOA exploration phase.
The invention is further described below in connection with the simulation test problem of MnWOA.
In the TSP problem, the size of the problem is gradually enlarged as the number of cities increases. In order to preliminarily check the capacity of the MnWOA to solve different-scale optimization problems, the MnWOA and some prior arts are tested by adopting 15 functions in an IEEE high-dimensional test set, wherein the first 7 functions are complex unimodal functions and are used for evaluating the local search capacity of the algorithm; the last 8 are complex multi-peak functions to evaluate the global exploratory power of the algorithm and the ability to bypass local optima, such as function F10 shown in fig. 2, and the problem contains multiple peaks, which means that such problems have a large number of local extrema, and if the problem is scaled up to more than 500 dimensions, the difficulty of solving the problem will increase exponentially. In this experiment, the maximum number of iterations was set to 1000, and the population size was set to 60.
The invention is further described below in connection with simulation test results for MnWOA. From the results presented in tables 3, 4, 5 and 6, mnWOA is very powerful in search, and regardless of the type of problem, mnWOA always achieves the best results of all algorithms, rapidly reaching or approaching the theoretical optimum, most of the time. In addition, when the scale of the problem is enlarged from 500 dimensions to 2000 dimensions, the MnWOA algorithm still keeps the advantages of the MnWOA algorithm, and all results are not obviously changed, so that the MnWOA algorithm has strong ductility, can well cope with the change of the solving environment of the problem, and has the potential of solving the TSP problem with a large number of cities.
Fig. 3 and 4 are simulation experiment results of MnWOA and a standard whale optimization algorithm WOA, an improved version of WOA algorithm eWOA, OBCWOA, an improved version of wolf optimization algorithm GWO, RSMGWO, GWO-WD, an improved version of particle swarm algorithm PSO, an improved version of sine and cosine optimization algorithm SCA, a hunger game search algorithm HGS and a balance algorithm EO in a unimodal function F1. Fig. 5 and 6 show the results of simulation experiments of MnWOA and these prior arts in the multimodal function F14. The horizontal axis of the simulation graph represents the number of iterations, and the vertical axis represents the fitness value. From the results presented in the figure, mnWOA not only possesses the fastest convergence speed but is always able to effectively jump out of the local optimum. In addition, when the dimension changes, the MnWOA can still stably maintain excellent searching performance, which fully proves that the invention has reliable performance when the optimization problem of different scales is solved.
The invention is further described below in connection with simulation results of TSP problems.
Table 7 presents the proposed MnWOA with some prior art: compared with simulation results obtained by WOA (basic whale optimization algorithm), EWOA (enhanced whale optimization algorithm) and IWOA (whale optimization algorithm embedded with inertial weight strategy) in classical TSP problem data sets Oliver30 and eil76, in a specific experimental process, the maximum iteration times of all the algorithms are 500, and the population scale is 30. Compared with other technologies, the invention can effectively provide the shortest path length in the TSP problem and has more reliable searching capability.
The invention is further described below in connection with the effects of the actual comparison table.
Table 1 is detailed information of 15 functions in the IEEE high-dimensional test set, where F1-F7 are unimodal functions and F8-F15 are complex multimodal functions. Tables 3 and 4 are tables comparing the test results of the present invention with those of the mainstream prior art under the condition of 500 d. Tables 5 and 6 are tables comparing the test results of the present invention with those of the mainstream prior art under the condition of 2000 dimensions.
TABLE 1 seven unimodal test problems
Table 2 eight multimodal test problems
TABLE 3 comparison of MnWOA algorithm and high-performance improved algorithm under 500-dimensional environment
TABLE 4 comparison of MnWOA algorithm with the high Performance improved algorithm in a 500-dimensional environment
TABLE 5 comparison of MnWOA algorithm with high Performance improved Algorithm in 2000-dimensional Environment
TABLE 6 comparison of MnWOA algorithm with high-performance improved algorithm in 2000-D environment
TABLE 7 MnWOA results with some prior art in TSP problem
The traveler problem solving method based on the improved whale optimization algorithm has the characteristics of high operation speed, strong searching capability and good robustness. On the mathematical model, compared with WOA, mnWOA has a more simplified structure and lower computational complexity, and meanwhile, the MnWOA also comprises a new mutation strategy and a position updating method, so that the algorithm can be helped to obtain stronger problem solving capability and local extreme value avoiding capability in a complex environment. Therefore, the MnWOA has good research significance and value in solving the problem of the traveling salesman.
The above description is intended to be illustrative of the preferred embodiment of the present invention and should not be taken as limiting the invention, but rather, the intention is to cover all modifications, equivalents, and alternatives falling within the spirit and scope of the invention.
Claims (10)
1. A traveler problem solving method based on an improved whale optimization algorithm is characterized by comprising the following steps:
establishing a mathematical model of the distance between cities and determining a total mathematical model of a closed passing loop according to a plurality of mathematical models;
and (3) initializing parameters by using real-time city data of the established mathematical model and adopting an improved whale optimization algorithm, sequentially performing the processes of algorithm iteration, judgment, variation and updating of position information and fitness value of the optimal individual, and finally outputting a position vector of the optimal individual as an optimal path.
2. The traveler problem solving method based on improved whale optimization algorithm as claimed in claim 1, characterized in that distance between city coordinates in traveler problem is mathematically modeled, in particular after importing data in data set, acquiring corresponding city setWherein, in the step (A),represents the nth city and its location coordinates are recordedDistance between city 1 and city n
Expressed as:
the distances between all cities are traversed using equation (1, 1) and used as a reserve value.
3. The method for solving the problem of the traveling salesman based on the improved whale optimization algorithm as claimed in claim 2, wherein the distance between different cities is traversed according to a distance formula to serve as a reserve value, and an overall mathematical model of the closed traffic loop is determined on the basis of the distance formula, and the searched route forms a closed loop and satisfies the following conditions:
in the above formula, the first and second carbon atoms are,andare all integers and must satisfy:(ii) a M different search routes are set, and the first route is set as,The serial number of the nth city of the traveler in the path; the mathematical model of the path length is constructed as follows:
representing route-basedTotal path length of (a); if there are m paths, the optimal solution path is expressed as follows:
4. The traveler problem solving method based on improved whale optimization algorithm as claimed in claim 3,
initialization of the algorithm's own and common parameters, i.e. initializing the population size N, maximum number of iterations of the algorithmA random number l, and a constant b defining the shape of the logarithmic spiral in the location update method;
initializing whale populations in a random generation mode, and randomly initializing to obtain position vectors of individuals; in the initially formed population, the firstIndividual(s) of,(ii) a This is the one obtained by the algorithmA strip line;
calculating by using the established total mathematical model to obtain the path length of the route corresponding to the position vector of each individual, wherein the path length is the fitness value of the corresponding individual, and substituting the position information of the individual into a formula (1.3) to obtain the fitness value of the individual; the fitness values are sequenced to determine the path length corresponding to the current best individual and the position vector of the individual, and the fitness value of the individual is calculated each time, the position information and the fitness value of the best individual are kept unchanged or updated;
performing iteration, setting the current iteration times t to be 1, adaptively updating the value of the convergence factor a by a new method, and updating the random number C and the random number l at the same time;
and performing algorithm iteration, judgment, variation and updating of the position information and the fitness value of the optimal individual, outputting the position vector of the optimal individual as an optimal path after the iteration condition is met, and outputting the path length corresponding to the optimal solution as the optimal result of the current search of the problem of the traveling salesman.
5. The method as claimed in claim 4, wherein the random generation is uniformly distributed during the determination processRandom number in (1)(ii) a The search is performed in a new search structure, and,
when the random numberThen, the population executes a global exploration process and updates the current position of each individual by a position updating method;
6. The traveler problem solving method based on improved whale optimization algorithm as claimed in claim 5,
during the variation process, updating the position of each individual by using a variation strategy and calculating a fitness value; meanwhile, according to the rule of a greedy strategy, if the fitness value of the updated individual is better, the updated position vector of the individual whale is accepted as the current position vector of the whale;
updating and recording the position information and the fitness value of the optimal individual, and simultaneously judging whether the current iteration times t meet the requirementsIf yes, iteration is finished and the optimal solution is output, otherwise, the optimal solution is output according to the principle thatAnd updating t and continuing to perform parameter initialization.
7. The traveler problem solving method based on improved whale optimization algorithm as claimed in claim 6, wherein convergence factor isThe specific mathematical model of the new updating method of (2) is:
in the formula (I), the compound is shown in the specification,is a constant coefficient, and has a value of 1/4, that is, newVarying the non-linearity to facilitate a balance between search phases;
the new search structure is a new search stage switching method, and the specific implementation process is as follows:
8. The traveler problem solving method based on improved whale optimization algorithm as claimed in claim 7, wherein when the algorithm enters the exploration phase, a specific mathematical model of the location updating method is as follows:
in the formula (I), the compound is shown in the specification,is a random number that follows a normal distribution,is the value in the j-th dimension of a random individual in the population; by this method, whenThe former individuals can further expand the search range of the former individuals under the condition of keeping randomness, so that a more efficient exploration process is realized;
when the algorithm enters a development stage, the second position updating method comprises the following steps:
the first stage is as follows: the position of the current individual is obtained by using a position updating method of a classical whale optimization algorithm in a spiral position updating stage, and the specific process is as follows:
in the formula (I), the compound is shown in the specification,is the position of the currently best individual and,is the location of the current individual;is a constant defining the shape of a logarithmic spiral, and the value is 1;is distributed within a distribution interval ofThe random number of (2);
and a second stage: after obtaining the position of the new individual, entering a second stage, and further updating the position of the individual by using a newly proposed position updating mode, wherein the specific process is as follows:
wherein the content of the first and second substances,andrespectively are constant coefficients and satisfy constraint conditions:;is the position of a new individual obtained by a classical spiral position updating method formula (1.8) of a population;is the value on the random dimension of the current best individual; the position of the new individual is determined by the local componentAnd a global componentAre formed together.
9. The traveler problem solving method based on new structure improved whale optimization algorithm as claimed in claim 8, characterized in that the variation stage specifically includes:
randomly selecting an individual from a populationAnd making the individual perform small-range random motion to further explore the local search space where the individual is located and obtain a new individual;
The new individualWith the current individualComparing, and enabling the individuals with better fitness to become new current individuals; the specific mathematical model is as follows:
wherein the content of the first and second substances,is a function of the sign of the signal,representing an objective function;are random numbers uniformly distributed between 0-1, andare random numbers uniformly distributed between 0-0.5;is the current populationThe random number of individuals in (a),a vector that follows a normal distribution is used to refer to the current motion pattern of an individual.
10. A traveler problem solving system based on a whale optimization algorithm with a new structure is characterized by comprising:
a first module: establishing a mathematical model of the distance between cities and determining a total mathematical model of a closed passing loop according to a plurality of mathematical models;
a second module: and (3) initializing parameters by using real-time city data of the established mathematical model and adopting an improved whale optimization algorithm, sequentially performing the processes of algorithm iteration, judgment, variation and updating of position information and fitness value of the optimal individual, and finally outputting a position vector of the optimal individual as an optimal path.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211204883.9A CN115271273A (en) | 2022-09-30 | 2022-09-30 | Traveler problem solving method and system based on improved whale optimization algorithm |
CN202310328414.6A CN116384870A (en) | 2022-09-30 | 2023-03-30 | Logistics distribution route planning method and system based on improved whale optimization algorithm |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211204883.9A CN115271273A (en) | 2022-09-30 | 2022-09-30 | Traveler problem solving method and system based on improved whale optimization algorithm |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115271273A true CN115271273A (en) | 2022-11-01 |
Family
ID=83758041
Family Applications (2)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211204883.9A Pending CN115271273A (en) | 2022-09-30 | 2022-09-30 | Traveler problem solving method and system based on improved whale optimization algorithm |
CN202310328414.6A Pending CN116384870A (en) | 2022-09-30 | 2023-03-30 | Logistics distribution route planning method and system based on improved whale optimization algorithm |
Family Applications After (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310328414.6A Pending CN116384870A (en) | 2022-09-30 | 2023-03-30 | Logistics distribution route planning method and system based on improved whale optimization algorithm |
Country Status (1)
Country | Link |
---|---|
CN (2) | CN115271273A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116149166A (en) * | 2023-04-19 | 2023-05-23 | 济南大学 | Unmanned rescue boat course control method based on improved beluga algorithm |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117784623B (en) * | 2024-02-28 | 2024-05-14 | 航天宏图信息技术股份有限公司 | Multi-strategy collaborative intelligent optimization method and device for vehicle path with load constraint |
-
2022
- 2022-09-30 CN CN202211204883.9A patent/CN115271273A/en active Pending
-
2023
- 2023-03-30 CN CN202310328414.6A patent/CN116384870A/en active Pending
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116149166A (en) * | 2023-04-19 | 2023-05-23 | 济南大学 | Unmanned rescue boat course control method based on improved beluga algorithm |
Also Published As
Publication number | Publication date |
---|---|
CN116384870A (en) | 2023-07-04 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN115271273A (en) | Traveler problem solving method and system based on improved whale optimization algorithm | |
CN112905801B (en) | Stroke prediction method, system, equipment and storage medium based on event map | |
Zhang et al. | Deep representation learning of activity trajectory similarity computation | |
Liang et al. | Applying genetic algorithm and ant colony optimization algorithm into marine investigation path planning model | |
JP2022517100A (en) | Systems and methods for hybrid algorithms using cluster shrinkage | |
Li et al. | A novel complex network community detection approach using discrete particle swarm optimization with particle diversity and mutation | |
CN106021990B (en) | A method of biological gene is subjected to classification and Urine scent with specific character | |
Wang et al. | An evolutionary autoencoder for dynamic community detection | |
WO2018166270A2 (en) | Index and direction vector combination-based multi-objective optimisation method and system | |
Zhang et al. | Learning to walk with dual agents for knowledge graph reasoning | |
CN109743196A (en) | It is a kind of based on the network characterisation method across double-layer network random walk | |
CN114611801A (en) | Traveler problem solving method based on improved whale optimization algorithm | |
CN111695668A (en) | Ant colony algorithm optimization method based on reverse learning | |
CN103150614A (en) | Automatic configuration method for land utilization space | |
Liang et al. | A covariance matrix adaptation evolution strategy variant and its engineering application | |
Ajibade et al. | A hybrid chaotic particle swarm optimization with differential evolution for feature selection | |
Felten et al. | A toolkit for reliable benchmarking and research in multi-objective reinforcement learning | |
Huang et al. | A global network alignment method using discrete particle swarm optimization | |
Qu et al. | GPU‐Based Parallel Particle Swarm Optimization Methods for Graph Drawing | |
Sun et al. | Particle swarm algorithm: convergence and applications | |
Li et al. | Search experience-based search adaptation in artificial bee colony algorithm | |
Liu et al. | Swarm intelligence for classification of remote sensing data | |
Yan et al. | Bilevel-search particle swarm optimization for computationally expensive optimization problems | |
Coello | Research Directions in Evolutionary Multi-Objective Optimization Current and Future Research Topics | |
Yiu et al. | Hierarchical evolutionary heuristic a* search |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
WD01 | Invention patent application deemed withdrawn after publication | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20221101 |