CN108764570A - A kind of Hybrid Algorithm based on ant group algorithm Yu Lin-Kernighan algorithm Traveling Salesman Problems - Google Patents
A kind of Hybrid Algorithm based on ant group algorithm Yu Lin-Kernighan algorithm Traveling Salesman Problems Download PDFInfo
- Publication number
- CN108764570A CN108764570A CN201810522528.3A CN201810522528A CN108764570A CN 108764570 A CN108764570 A CN 108764570A CN 201810522528 A CN201810522528 A CN 201810522528A CN 108764570 A CN108764570 A CN 108764570A
- Authority
- CN
- China
- Prior art keywords
- ant
- city
- path
- algorithm
- lin
- 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
Classifications
-
- 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]
-
- 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/04—Forecasting or optimisation specially adapted for administrative or management purposes, e.g. linear programming or "cutting stock problem"
- G06Q10/047—Optimisation of routes or paths, e.g. travelling salesman problem
Abstract
The present invention provides a kind of Hybrid Algorithm based on ant group algorithm Yu Lin-Kernighan algorithm Traveling Salesman Problems, will be combined with the advantages of Lin-kernighan algorithms the advantages of ant group algorithm and searches optimal path.The hybrid process of ant group algorithm and Lin-kernighan algorithms is as follows:First with ant group algorithm after ant group algorithm of every iteration, it executes Lin-kernighan algorithms and obtains shortest path, then by the path that ant group algorithm obtains and the path that Lin-kernighan algorithms obtain for fresh information element, then this process is repeated until meeting end condition, exports optimal path.
Description
Technical field
Calculation is hybridized based on ant group algorithm and Lin-Kernighan algorithm Traveling Salesman Problems the present invention relates to a kind of
Method belongs to Path Planning Technique field.
Background technology
In traveling salesman problem research, global optimization approach ant group algorithm and Local Optimization Algorithm Lin-Kernighan are calculated
Method is all the important research method of Traveling Salesman Problem.The shortcomings that for ant group algorithm:Such as be susceptible to precocious stagnation behavior,
Need long search time etc..Li Chengbing, Guo Ruixue et al. exist《Improve application of the ant group algorithm in traveling salesman problem》One text
In by change pheromones update mode, improve information ant group algorithm ability of searching optimum, improve the performance of solution.Jiang Xinzi
?《The mixing of ant group algorithm and other algorithms》It is proposed that ant group algorithm is calculated with immune algorithm, tabu search algorithm, heredity in one text
The combination algorithm of method and simulated annealing improves the ability of the search optimal solution of algorithm.
Lin-Kernighan algorithms firstly generate an initial solution, then searching operators are applied to current solution party
Case, if searching more preferably path, optimal path before being replaced using this path.These steps can be performed repeatedly until nothing
Method searches more preferably path.But the space of searching operators search is a sub-spaces of entire search space, so
Lin-Kernighan algorithms can fast search locally optimal solution, therefore convergence rate is one of Lin-Kernighan algorithms
Advantage.The characteristics of ant group algorithm is always using one group of ant colony as solution.Using selection, recombination and mutation operator are gradually
Improve the quality of entire ant colony.The search space of ant colony can cover the search space wider than Lin-Kernighan algorithm.Due to
Ant group algorithm purpose is to maintain diversified solution, and the excellent solution that not only current search arrives, although ant
Group's algorithm can have wider array of search space than Lin-Kernighan algorithm, but the calculating speed of ant group algorithm can be caused to subtract
It is slow.Since ant group algorithm and Lin-Kernighan algorithms have the characteristics that different and are complementary to one another, the present invention is by both algorithms
It is mixed.
Invention content
The purpose of the invention is to provide one kind to ask based on ant group algorithm and Lin-Kernighan algorithms solution travelling salesman
The Hybrid Algorithm of topic.
The object of the present invention is achieved like this:Steps are as follows:
Step 1, traveling salesman problem analysis
It is tested using data set rand100 in the libraries TSPLIB, therefore each member in the Cost matrix of traveling salesman problem
Element is two-dimentional Euclidean distance;
Step 2, initialization ant and pheromones
It is defined as follows symbol first:N is city numbers;bi(t) it is the ant number for being located at city i in t moment;M is ant
Ant number in group;tabuk(k=1,2 ..., m) it is the city that ant k has passed by;C={ c1,c2,...,cnIt is n city
Gather in city;α is information heuristic factor;β is desired heuristic factor;allowedk={ C-tabukCan be selected in next step for ant k
City;dijFor two intercity distances;τijPheromones intensity between city i and city j on path;
For heuristic function, i.e., ant is from city i to the expected degree of city j;ρ is pheromones volatility coefficient,It is indicated for 1- ρ
Pheromones residual coefficients;For moment t ant k by city i to the state transition probability of city j, and
Step 3, every ant are according to pheromones planning path
3.1. according to the allowed of ant kkTable selects next city of ant k by wheel disc principle, and is added to taboo
Avoid table tabukIn;
3.2. repeat step 3.1 until ant k taboo list tabukIncluding n city;
3.3 repeat step 3.1 and step 3.2 until the taboo list of m ant is all comprising n city;
Step 4, execution Lin-Kernighan algorithms obtain path
Note T is current path, elementary path path between any two endpoint, in iterative process each time, Lin-
Kernighan algorithms find two groups of link sets, X={ x1,x2,...,xrAnd Y={ y1,y2,...,yr, ensure obtain for
So that then the link for deleting X from current path T is added to the link of Y under the premise of closed loop path, shorter path length is obtained
Degree;Two groups of set X and Y are made of elementary path respectively;Before iteration starts, link set X and Y are sky;
4.1:Input initial path T;
4.2:I=1 is set, t is randomly choosed1;
4.3:Select arbitrary elementary path x1=(t1,t2)∈T;
4.4:SelectionMake G1> 0;If it does not, executing step 4.12;
4.5:(i+1)→i;
4.6:Select xi=(t2i-1,t2i) ∈ T when, if meeting t2iWith t1It is connected and for all s < i, xi≠ys, obtain
To path T ', if the length of path T ' is less than the length of path T, T=T ' executes step 4.2;
4.7:SelectionWhen, it is necessary to meet Gi> 0 and for all s≤i, ys≠xiAnd there are xi+1Item
Part, if there is y at this timei, execute step 4.5;
4.8:If there is y2New selection executes step 4.7 then enabling i=2;
4.9:If there is x2New selection executes step 4.6 then enabling i=2;
4.10:If there is y1New selection executes step 4.4 then enabling i=1;
4.11:If there is x1New selection executes step 4.3 then enabling i=1;
4.12:If there is t1New selection, then executing step 4.2;
4.13:Export the path of Lin-Kernighan algorithms;
Step 5, according to the routing update pheromones of step 3 and step 4
Using Ant-Cycle modelsPheromone update is carried out, it will
The path that the m paths and step 4 that step 3 obtains obtain, according to following formula
The pheromones between city i and city j are calculated, the pheromones between all cities are updated;
Step 6 executes step 3,4 and 5 until meeting end condition repeatedly.
The invention also includes some such structure features:
1. it is 70 that the value of the n in step 2, which is 100, m values, iterations 1000, the value of α is the value of 1.0, β
Value for 2.0, ρ is 0.5, initialization information element pijAll values to be that 1.0, m ant initial position is randomly dispersed in n a
Some city and it is added to the taboo list tabu of ant k in citykIn.
2. step 6 is specifically:Taboo list is emptied first, then under conditions of step 5 fresh information element, by m ant
Initial position is randomly dispersed in some city in n city, and then cycle executes step 3, step 4, step 5 until following in total
Ring number is 1000 times, when after circulation terminates, exports optimal path.
Compared with prior art, the beneficial effects of the invention are as follows:The present invention does not believe merely with the routing update of Ant Search
Breath element carries out the update of pheromones also with the path that Lin-Kernighan algorithms obtain.Since Lin-kernighan is calculated
Method is more excellent for local search ability, therefore the path obtained using it carries out the updates of pheromones compared with ant group algorithm not only speed
Faster and obtain more preferably solution path.
Description of the drawings
Fig. 1 hybridizes calculation based on ant group algorithm for what the present invention used with Lin-Kernighan algorithm Traveling Salesman Problems
The flow chart of method;
Fig. 2 is the flow chart for the ant group algorithm that the present invention uses.
Specific implementation mode
Present invention is further described in detail with specific implementation mode below in conjunction with the accompanying drawings.
A kind of flow such as Fig. 1 based on ant group algorithm Yu Lin-Kernighan algorithm Traveling Salesman Problem Hybrid Algorithms
It is shown, it is as follows:
Step 1. traveling salesman problem is analyzed
The present invention uses data set rand100 in the libraries TSPLIB to test, therefore in the Cost matrix of traveling salesman problem
Each element is two-dimentional Euclidean distance.Euclidean distance only related with position independent of direction, then the present invention study
Traveling salesman problem is symmetrical traveling salesman problem.
Step 2. initializes ant and pheromones
It is defined as follows symbol first:n:City numbers;bi(t):It is located at the ant number of city i in t moment;m:In ant colony
Ant number;tabuk(k=1,2 ..., m):The city that ant k has passed by;C={ c1,c2,...,cn}:N city collection
It closes;α:Information heuristic factor;β:It is expected that heuristic factor;allowedk={ C-tabuk}:The city that ant k can be selected in next step;
dij:Two intercity distances;τij:Pheromones intensity between city i and city j on path;Inspire letter
Number, i.e., ant is from city i to the expected degree of city j;ρ indicates pheromones volatility coefficient,1- ρ indicate pheromones
Residual coefficients;Moment t ant k is by city i to the state transition probability of city j.WhereinIt is 70 that the value of n, which is 100, m values, in the present invention, iteration time
The value that the value that the value that number is 1000, α is 1.0, β is 2.0, ρ is 0.5.Initialization information element pijAll values be
1.0, m ant initial positions are randomly dispersed in some city in n city and are added to the taboo list of ant k
tabukIn.
Every ant of step 3. is according to pheromones planning path
Step 3.1. is according to the allowed of ant kkTable selects next city of ant k by wheel disc principle, and adds
To taboo list tabukIn.
Step 3.2. repeat step 3.1 until ant k taboo list tabukIncluding n city.
Step 3.3 repeats step 3.1 and step 3.2 until the taboo list of m ant is all comprising n city.
Step 4. executes Lin-Kernighan algorithms and obtains path
Note T is current path, elementary path path between any two endpoint, in iterative process each time, Lin-
Kernighan algorithms find two groups of link sets, X={ x1,x2,...,xrAnd Y={ y1,y2,...,yr, ensure obtain for
So that then the link for deleting X from current path T is added to the link of Y under the premise of closed loop path, shorter road can be obtained
Electrical path length.Two groups of set X and Y are made of elementary path respectively.Before iteration starts, link set X and Y are sky.?
In step i, a pair of of elementary path xiAnd yiIt is added to set X and Y respectively.Remember yiReplace xiGain gi=c (xi)-c(yi),
And total gain GiIt is g1+g2+...+giThe sum of.
Step 4.1:Input initial path T;
Step 4.2:I=1 is set, t is randomly choosed1;
Step 4.3:Select arbitrary elementary path x1=(t1,t2)∈T;
Step 4.4:SelectionMake G1> 0;If it does not, executing step 12;
Step 4.5:I=i+1;
Step 4.6:Select xi=(t2i-1,t2i) ∈ T when, if meeting t2iWith t1It is connected and for all s < i, xi≠
ys, path T ' is obtained, if the length of path T ' is less than the length of path T, T=T ' executes step 2;
Step 4.7:SelectionWhen, it is necessary to meet Gi> 0 and for all s≤i, ys≠xiAnd exist
xi+1Condition, if there is y at this timei, execute step 5;
Step 4.8:If there is y2New selection executes step 7 then enabling i=2;
Step 4.9:If there is x2New selection executes step 6 then enabling i=2;
Step 4.10:If there is y1New selection executes step 4 then enabling i=1;
Step 4.11:If there is x1New selection executes step 3 then enabling i=1;
Step 4.12:If there is t1New selection, then executing step 2;
Step 4.13:Export the path of Lin-Kernighan algorithms.
Step 5. is according to the routing update pheromones of step 3 and step 4
The present invention uses Ant-Cycle modelsCarry out pheromones
Update.By the m paths that step 3 obtains and the paths that step 4 obtains, according to following formulaThe pheromones between city i and city j are calculated, it will be between all cities
Pheromones be updated.
Step 6. executes step 3,4 and 5 until meeting end condition repeatedly.
Taboo list is emptied first, and then under conditions of step 5 fresh information element, m ant initial position is divided at random
Cloth some city in n city, then cycle execution step 3, step 4, step 5 are until cycle-index is 1000 in total
It is secondary.When after circulation terminates, optimal path is exported.
Claims (3)
1. a kind of Hybrid Algorithm based on ant group algorithm Yu Lin-Kernighan algorithm Traveling Salesman Problems, it is characterised in that:
Steps are as follows:
Step 1, traveling salesman problem analysis
It is tested using data set rand100 in the libraries TSPLIB, therefore each element is in the Cost matrix of traveling salesman problem
Two-dimentional Euclidean distance;
Step 2, initialization ant and pheromones
It is defined as follows symbol first:N is city numbers;bi(t) it is the ant number for being located at city i in t moment;M is ant in ant colony
Ant quantity;tabuk(k=1,2 ..., m) it is the city that ant k has passed by;C={ c1,c2,...,cnIt is n city collection
It closes;α is information heuristic factor;β is desired heuristic factor;allowedk={ C-tabukIt is the city that ant k can be selected in next step
City;dijFor two intercity distances;τijPheromones intensity between city i and city j on path;To open
It sends a letter number, i.e., ant is from city i to the expected degree of city j;ρ is pheromones volatility coefficient,Information is indicated for 1- ρ
Plain residual coefficients;For moment t ant k by city i to the state transition probability of city j, and
Step 3, every ant are according to pheromones planning path
3.1. according to the allowed of ant kkTable selects next city of ant k by wheel disc principle, and is added to taboo list
tabukIn;
3.2. repeat step 3.1 until ant k taboo list tabukIncluding n city;
3.3 repeat step 3.1 and step 3.2 until the taboo list of m ant is all comprising n city;
Step 4, execution Lin-Kernighan algorithms obtain path
Note T is current path, elementary path path between any two endpoint, in iterative process each time, Lin-Kernighan
Algorithm finds two groups of link sets, X={ x1,x2,...,xrAnd Y={ y1,y2,...,yr, ensureing to obtain as closed loop path
Under the premise of so that then the link for deleting X from current path T is added to the link of Y, obtain shorter path length;Two groups of collection
X and Y is closed to be made of elementary path respectively;Before iteration starts, link set X and Y are sky;
4.1:Input initial path T;
4.2:I=1 is set, t is randomly choosed1;
4.3:Select arbitrary elementary path x1=(t1,t2)∈T;
4.4:SelectionMake G1> 0;If it does not, executing step 4.12;
4.5:(i+1)→i;
4.6:Select xi=(t2i-1,t2i) ∈ T when, if meeting t2iWith t1It is connected and for all s < i, xi≠ys, obtain road
Diameter T ', if the length of path T ' is less than the length of path T, T=T ' executes step 4.2;
4.7:SelectionWhen, it is necessary to meet Gi> 0 and for all s≤i, ys≠xiAnd there are xi+1Condition, such as
There is y at this time in fruiti, execute step 4.5;
4.8:If there is y2New selection executes step 4.7 then enabling i=2;
4.9:If there is x2New selection executes step 4.6 then enabling i=2;
4.10:If there is y1New selection executes step 4.4 then enabling i=1;
4.11:If there is x1New selection executes step 4.3 then enabling i=1;
4.12:If there is t1New selection, then executing step 4.2;
4.13:Export the path of Lin-Kernighan algorithms;
Step 5, according to the routing update pheromones of step 3 and step 4
Using Ant-Cycle modelsPheromone update is carried out, by step 3
The path that obtained m paths and step 4 obtain, according to following formulaMeter
The pheromones between city i and city j are calculated, the pheromones between all cities are updated;
Step 6 executes step 3,4 and 5 until meeting end condition repeatedly.
2. according to claim 1 a kind of based on ant group algorithm and Lin-Kernighan algorithm Traveling Salesman Problems
Hybrid Algorithm, it is characterised in that:The value of n in step 2 is that 100, m values are 70, and the value of iterations 1000, α is
The value that 1.0, β value is 2.0, ρ is 0.5, initialization information element pijAll values be 1.0, m ant initial position with
Machine is distributed in some city in n city and is added to the taboo list tabu of ant kkIn.
3. according to claim 2 a kind of based on ant group algorithm and Lin-Kernighan algorithm Traveling Salesman Problems
Hybrid Algorithm, it is characterised in that:Step 6 is specifically:Taboo list is emptied first, then under conditions of step 5 fresh information element,
M ant initial position is randomly dispersed in some city in n city, then cycle executes step 3, step 4, step 5
Until cycle-index is 1000 times in total, when after circulation terminates, optimal path is exported.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810355140 | 2018-04-19 | ||
CN2018103551409 | 2018-04-19 |
Publications (1)
Publication Number | Publication Date |
---|---|
CN108764570A true CN108764570A (en) | 2018-11-06 |
Family
ID=64002849
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810522528.3A Pending CN108764570A (en) | 2018-04-19 | 2018-05-28 | A kind of Hybrid Algorithm based on ant group algorithm Yu Lin-Kernighan algorithm Traveling Salesman Problems |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108764570A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109945881A (en) * | 2019-03-01 | 2019-06-28 | 北京航空航天大学 | A kind of method for planning path for mobile robot of ant group algorithm |
CN113850423A (en) * | 2021-09-15 | 2021-12-28 | 河南工业大学 | Shortest path planning method based on improved ant colony algorithm |
-
2018
- 2018-05-28 CN CN201810522528.3A patent/CN108764570A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109945881A (en) * | 2019-03-01 | 2019-06-28 | 北京航空航天大学 | A kind of method for planning path for mobile robot of ant group algorithm |
CN113850423A (en) * | 2021-09-15 | 2021-12-28 | 河南工业大学 | Shortest path planning method based on improved ant colony algorithm |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Wang et al. | Multi-offspring genetic algorithm and its application to the traveling salesman problem | |
CN102413029B (en) | Method for partitioning communities in complex dynamic network by virtue of multi-objective local search based on decomposition | |
Yao et al. | RDAM: A reinforcement learning based dynamic attribute matrix representation for virtual network embedding | |
CN103678436B (en) | Information processing system and information processing method | |
CN109102124B (en) | Dynamic multi-target multi-path induction method and system based on decomposition and storage medium | |
CN110263938A (en) | Method and apparatus for generating information | |
Hindi et al. | Genetic algorithm applied to the graph coloring problem | |
CN106022531A (en) | Searching method of shortest path passing by necessary peak points | |
CN106991295B (en) | A kind of protein network module method for digging based on multiple-objection optimization | |
Wang et al. | Speciation of two desert poplar species triggered by Pleistocene climatic oscillations | |
CN106228265A (en) | Based on Modified particle swarm optimization always drag phase transport project dispatching algorithm | |
CN109117981A (en) | Single linking sources prediction technique of digraph based on sampling | |
CN108764570A (en) | A kind of Hybrid Algorithm based on ant group algorithm Yu Lin-Kernighan algorithm Traveling Salesman Problems | |
CN107885503A (en) | A kind of iteration based on performance of program analysis compiles optimization method | |
CN107092977A (en) | A kind of solution algorithm of the multiple target with time window isomery vehicle Location-Routing Problem | |
Tang et al. | An adaptive discrete particle swarm optimization for influence maximization based on network community structure | |
Agarwal et al. | Code coverage using intelligent water drop (IWD) | |
Kumar | Efficient hierarchical hybrids parallel genetic algorithm for shortest path routing | |
Ko et al. | Monstor: an inductive approach for estimating and maximizing influence over unseen networks | |
CN104318306A (en) | Non-negative matrix factorization and evolutionary algorithm optimized parameter based self-adaption overlapping community detection method | |
Mukhopadhyay et al. | Modified Hamiltonian chain: a graph theoretic approach to group technology | |
CN108509651B (en) | The distributed approximation searching method with secret protection based on semantic consistency | |
CN116227311A (en) | Improved Henry gas solubility optimization method based on differential evolution | |
CN102768735A (en) | Network community partitioning method based on immune clone multi-objective optimization | |
Shi et al. | Solving the test task scheduling problem with a genetic algorithm based on the scheme choice rule |
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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20181106 |
|
RJ01 | Rejection of invention patent application after publication |