CN111832831A - Method for solving problem of travel trader based on improved and acoustic search optimization ant colony algorithm - Google Patents

Method for solving problem of travel trader based on improved and acoustic search optimization ant colony algorithm Download PDF

Info

Publication number
CN111832831A
CN111832831A CN202010704280.XA CN202010704280A CN111832831A CN 111832831 A CN111832831 A CN 111832831A CN 202010704280 A CN202010704280 A CN 202010704280A CN 111832831 A CN111832831 A CN 111832831A
Authority
CN
China
Prior art keywords
solution
solution vector
city
harmony
algorithm
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.)
Granted
Application number
CN202010704280.XA
Other languages
Chinese (zh)
Other versions
CN111832831B (en
Inventor
杨嘉琛
汤强昌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tianjin University
Original Assignee
Tianjin University
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Tianjin University filed Critical Tianjin University
Priority to CN202010704280.XA priority Critical patent/CN111832831B/en
Publication of CN111832831A publication Critical patent/CN111832831A/en
Application granted granted Critical
Publication of CN111832831B publication Critical patent/CN111832831B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION 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/00Administration; Management
    • G06Q10/04Forecasting or optimisation specially adapted for administrative or management purposes, e.g. linear programming or "cutting stock problem"
    • G06Q10/047Optimisation of routes or paths, e.g. travelling salesman problem
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/004Artificial life, i.e. computing arrangements simulating life
    • G06N3/006Artificial 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]

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Human Resources & Organizations (AREA)
  • Economics (AREA)
  • General Physics & Mathematics (AREA)
  • Strategic Management (AREA)
  • Artificial Intelligence (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Biophysics (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Development Economics (AREA)
  • General Health & Medical Sciences (AREA)
  • Evolutionary Computation (AREA)
  • Biomedical Technology (AREA)
  • Health & Medical Sciences (AREA)
  • Game Theory and Decision Science (AREA)
  • Computational Linguistics (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Marketing (AREA)
  • Operations Research (AREA)
  • Quality & Reliability (AREA)
  • Tourism & Hospitality (AREA)
  • General Business, Economics & Management (AREA)
  • Life Sciences & Earth Sciences (AREA)

Abstract

The invention relates to an ant colony algorithm optimization traveler problem solving method based on improvement and acoustic search, which comprises the following steps: (1) carrying out urban decimal coding, carrying out harmonic algorithm solution vector setting, and constructing a target function; (2) initializing ant colony parameters; (3) initializing ant positions; (4) selecting the next city and updating the local pheromone concentration; (5) repeating the step (4) until the current ants have visited all cities; (6) sentinel strategies; (7) repeating the steps (3) to (6) until all ants finish visiting all cities; (8) updating the memory bank, calculating the average value L of all harmony objective function values in the memory bankAAnd constructing a solution vector library; (9) a new chorus note is generated using an improved chorus algorithm.

Description

Method for solving problem of travel trader based on improved and acoustic search optimization ant colony algorithm
Technical Field
The invention relates to an ant colony algorithm traveler problem solving method based on improvement and acoustic search optimization.
Background
The traveler problem is an NP-complete problem. For a given city number N and the coordinates of each city, the shortest path from any city to each city is solved, each city is visited, the same city cannot be visited repeatedly, and finally the shortest path is returned to the starting city. Since all feasible solutions to the problem are full permutations of all cities, as the number of cities increases, the number of solutions can be geometrically exploded. Since the traveler problem has wide applications in many fields such as logistics distribution, vehicle scheduling problem, integrated circuit design, etc., many scholars have conducted much research on the traveler problem for this purpose.
The ant colony algorithm is used as a new intelligent algorithm for problem research of travelers, attracts attention of extensive researchers due to the characteristics of distributed computation, positive feedback of information and strong robustness, can find an optimal solution or a sub-optimal solution for a small-scale data set, and has the problems of low solving speed and easy falling into local optimization along with the expansion of problem scale. The harmony algorithm is a newly-published heuristic global optimization algorithm, is a new combined problem optimization algorithm, and has the advantages of simple concept, few parameters, easiness in implementation and the like. But since the use of harmony algorithms directly to solve the traveler problem produces a large number of invalid solutions, it is necessary to improve it. By using the improved harmony algorithm and the ant colony algorithm to run in parallel, the convergence speed of the ant colony algorithm can be accelerated and the possibility of obtaining the optimal solution by the ant colony algorithm can be improved under the condition of not increasing the complexity of the ant colony algorithm.
Disclosure of Invention
The invention provides an ant colony algorithm optimization traveler problem solving method based on improvement and acoustic search, wherein sentinel strategies are introduced into an ant colony algorithm to accelerate algorithm convergence. The better solution of each circulation of the ant colony algorithm is added into a memory bank of the harmony algorithm, and the harmony algorithm is utilized to optimize the harmony in the bank so as to continuously optimize the quality of the harmony in the memory bank. When the ant colony algorithm cannot find a solution better than the current optimal solution, pheromone is updated by dynamically selecting the solution in the memory base, so that the diversity of algorithm search is enlarged, and the capability of the algorithm for searching the optimal solution is improved. By adopting the method, the convergence speed of the ant colony algorithm and the possibility of obtaining the optimal solution are effectively improved. The technical scheme of the invention is as follows:
an ant colony algorithm traveler problem solving method based on improvement and acoustic search optimization comprises the following steps:
(1) the decimal coding of city, the setting of harmony algorithm solution vector, and the construction of target function
Step 1: coding cities using decimal digits, e.g. S ═ C1,C2,...,Ck...,CN),CkRepresenting the city number at the kth position in the solution sequence; k is in the range of [1, N ]]Wherein N is the total number of cities;
step 2: using the edges of any two different cities as solution vectors in the harmony algorithm, and using T ═ C1_C2,C2_C3,...,CN-1_CN,CN_C1) Representing a single harmony, C1_C2The method comprises the steps that a first city and a second city jointly form a solution vector, in the same way, the first city in the solution vector is defined as a starting city, the second city in the solution vector is defined as a target city, and the value of the solution vector is the Euclidean distance between the two cities;
and 3, step 3: use of
Figure BDA0002594076910000021
Constructing an ant colony algorithm objective function, where | Cri-Cr(i+1)L represents the Euclidean distance between the city at the ith position of the solution sequence r and the city at the (i + 1) th position;
and 4, step 4: use of
Figure BDA0002594076910000022
Constructing an objective function of harmony algorithm, wherein | Xi kL represents the length of the ith solution vector in the solution sequence k;
(2) initializing ant colony parameters, and harmony algorithm-related parameters
Initializing ant colony algorithm parameters: constructing a city distance matrix D according to the city coordinates, and using etaij=1/DijCalculating heuristic information between cities, wherein DijExpressed as Euclidean distance between cities i and j, use
Figure BDA0002594076910000023
For initializing pheromone concentrations, where N is the number of cities, LNNLength obtained by solving the problem of the traveling salesman by using a nearest neighbor method; setting other parameters including maximum number of cycles T of algorithmmaxCity number N, antsNumber m, probability of a priori knowledge q0The value is 0.9, the value of a heuristic information factor beta is 5, the value of an pheromone expectation factor alpha is 2, and the value of an pheromone volatilization coefficient rho is 0.1;
initializing harmony algorithm parameters: initializing the memory bank with the size of M, the value of the memory bank is equal to the number M of ants, the value probability HMCR of the memory bank is 0.85, the harmony adjustment probability PAR is 0.8, and randomly generating M solution sequences to initialize the harmony in the memory bank;
(3) initializing ant positions: randomly selecting a city from [1, N ] as an ant starting city;
(4) the next city is selected and local pheromone concentration is updated as follows
Step 1: selecting the next city by adopting the following formula;
Figure BDA0002594076910000024
Figure BDA0002594076910000025
step 2: local pheromone concentration updating is performed by adopting the following formula:
τij=(1-ρ)τij+ρτ0
among them, allowedkRandomly generating numbers between (0,1) for the set of remaining accessible cities of the kth ant;
(5) repeating the step (4) until the current ants have visited all cities;
(6) and (3) sentinel strategy, once ants find a path better than the current optimal solution, dynamically gaining the path pheromone, simultaneously reducing the number of the current acting ants by one, and otherwise, turning to the step (7), wherein the more optimal solution found by the ants is defined as StempThe gain is obtained by adopting the following formula:
Figure BDA0002594076910000031
wherein f (S)Gbest) And f (S)temp) Respectively representing objective function values of the current optimal solution and the more optimal solution;
(7) repeating the steps (3) to (6) until all ants finish visiting all cities;
(8) updating the memory bank, calculating the average value L of all harmony objective function values in the memory bankAAnd constructing a solution vector library in the following way:
step 1: calculating the average value of solution objective function values generated in one cycle of the ant colony algorithm and recording the average value as Lave
Step 2: sorting the solutions generated by all ants, and selecting the value of the objective function to be less than LaveAdding the solution into a memory base of a harmony algorithm, and recording the adding quantity as k;
and 3, step 3: deleting the worst k harmony sounds in the memory bank, and calculating the average value of all harmony objective function values in the memory bank as LA
And 4, step 4: constructing a solution vector library; defining the solution vector library as a collection of all sum solution vectors in the memory library, i.e.
Figure BDA0002594076910000032
Wherein Xj kRepresenting the jth solution vector, V, in the kth harmonickA set of solution vectors representing the kth harmony, U representing a solution vector library;
(9) generating a new sum note X using an improved sum note algorithmNewThe method is as follows:
step 1: defining an optional solution vector set as a solution vector set formed by an unselected city and a target city of a current solution vector, initializing the optional solution vector set as a solution vector set formed by any city, and taking the solution vector frequency L as 0 from a solution vector library;
step 2: generating a random number between (0,1) as R1If R is satisfied1<HMCR, then take out a solution vector from the intersection of solution vector library and optional solution vector set, and correspondingly execute L ═ L +1 operation, if the intersection is empty or does not satisfy R1<HMCR ofRandomly selecting a solution vector from the selectable solution vector set; the solution vector is taken from the solution vector library in the following way:
if the solution vector is selected for the first time, selecting according to a formula (2), otherwise, selecting the next solution vector according to a formula (3) as follows:
Figure BDA0002594076910000033
Figure BDA0002594076910000034
pi_j(k_i)=λi_j·μi_j(4)
Figure BDA0002594076910000035
wherein mui_jDenotes the inverse, λ, of the value of the solution vector i _ ji_jRepresenting the ratio of the number of occurrences of the solution vector i _ j in the solution vector library to the total number of occurrences of all solution vectors starting with i, ci_jRepresenting the number of times the solution vector i _ j appears in the solution vector library; pi_j(k _ i) represents the probability, χ, that the current solution vector k _ i selects the next solution vector i _ ji_jRepresenting the solution vector i _ j, y obtained when the solution vector is selected for the first timei_jRepresenting a solution vector i _ j obtained when the solution vector is not selected for the first time, wherein the i _ j belongs to an allowed solution vector set;
and 3, step 3: updating the optional solution vector set;
and 4, step 4: repeating the step 2 and the step 3 until the number of the current harmony solution vectors is N, if the number satisfies
Figure BDA0002594076910000041
Then to the generated harmony XNewUsing tabu search to process to obtain new harmony and reassign value as XNewOtherwise, no operation is carried out;
(10) if the new harmony objective function value is less than LAThen X will beNewAdding the data into a memory bank, deleting the worst harmony sound of the memory bank,Updating the solution vector library and LAOtherwise, not processing;
(11) repeating the steps (9) and (10) until M new harmony sounds are generated, wherein M is the size of the memory bank;
(12) dynamically selecting a solution and updating pheromone, and the method comprises the following steps:
step 1: comparing the current cycle optimal solution with the global optimal solution, if the current cycle optimal solution is better, updating by using the current cycle optimal solution, turning to the 4 th step, and if not, executing the 2 nd step;
step 2: comparing the global optimal solution with all solutions in the memory library, judging that a plurality of solutions in the memory library are superior to the current global optimal solution, if so, turning to the step 3, otherwise, directly updating by using the optimal solution in the memory library, and turning to the step 4;
and 3, step 3: selecting a solution with the minimum similarity to the global optimal solution from a plurality of solutions which are better than the global optimal solution for updating, and defining the similarity as the ratio of the number of superposed path segments between the solutions to the total city number;
and 4, step 4: pheromone updates were performed using the following formula:
Figure BDA0002594076910000042
wherein, f (S)update) Representing a solution objective function value selected from a memory library;
(13) repeating the steps (3) to (12) until the algorithm reaches the maximum iteration number;
(14) and outputting the optimal solution.
Drawings
FIG. 1 is a block diagram of a method
FIG. 2 is a flow chart of improved harmony algorithm to generate new harmony
TABLE 1 improved harmony algorithm solution vector value matrix for the solution vector selection step
TABLE 2 Devector degree matrix for the improved harmony algorithm solution vector selection step
Figure BDA0002594076910000051
TABLE 1
Figure BDA0002594076910000052
TABLE 2
Detailed Description
FIG. 1 is a block diagram of the proposed method, where Y, N represents yes and no, respectively, C represents the number of visited cities, N is the total number of cities, f (S) represents the objective function value of a single ant discovery solutionxbest、fIbest、fminRepresenting the optimal solution of the memory bank, the optimal solution of the circulation in the ant colony algorithm and the objective function value of the overall optimal solution, A representing the number of ants, m representing the number in the ants, T representing the current circulation frequency of the ant colony algorithm, and T representing the number of the circulation in the ant colony algorithmmaxThe maximum cycle number of the ant colony algorithm, t the cycle number of the harmony algorithm, M the memory bank size of the harmony algorithm, and f (X)New) The magnitude of the objective function value representing the new sum.
FIG. 2 modified harmony algorithm generates a new harmony flow diagram, where R1The number is a randomly generated number between (0,1), HMCR is a memory bank value probability, L represents the number of times a vector is taken from a solution vector bank, N is the number of solution vectors, i represents the number of current solution vectors, PAR is a harmony adjustment probability, and Y, N represents yes and no, respectively.
An ant colony algorithm optimization traveler problem solving method based on improvement and acoustic search, the method comprising the following steps:
1. carrying out urban decimal coding, carrying out harmonic algorithm solution vector setting, and constructing a target function;
step 1: coding all cities using decimal digits, e.g. S ═ C1,C2,...,Ck...,CN),CkRepresenting the city number at the kth position in the solution sequence. k is in the range of [1, N ]]Where N is the number of cities, for example, an effective TSP decoding sequence code for solving 10 cities may be {5,2,3,4,1,10,6,7,8,9 }.
Step 2: using edges of any two different cities as in harmony algorithmSolution vector, using T ═ C for single harmony1_C2,C2_C3,...,CN-1_CN,CN_C1) Is shown by C1_C2The method comprises the steps of representing that a first city and a second city jointly form a solution vector, defining the first city in the solution vector as a starting city, defining the last city in the solution vector as a target city, and defining the value of the solution vector as the Euclidean distance between the two cities. For example, an effective TSP and vocoded code for solving 10 cities may be {5_2,2_3,3_4,4_1,1_10,10_6,6_7,7_8,8_9,9_5}, where 5_2 represents a solution vector formed by city number 5 and city number 2.
And 3, step 3: use of
Figure BDA0002594076910000061
Constructing an ant colony algorithm objective function, where | Cri-Cr(i+1)And | represents the Euclidean distance between the city of the ith position of the solution sequence r and the city of the (i + 1) th position.
And 4, step 4: use of
Figure BDA0002594076910000062
Constructing an objective function of harmony algorithm, wherein | Xi kAnd | represents the length of the ith solution vector in the solution sequence k, and N represents the total number of cities.
2. Initializing ant colony parameters and harmony algorithm related parameters;
initializing ant colony algorithm parameters: constructing a city distance matrix D according to the city coordinates, setting eta ij as heuristic information between the city i and the city j, and using etaij=1/DijInitializing heuristic information between cities, wherein DijExpressed as the euclidean distance between cities i and j. Use of
Figure BDA0002594076910000063
For initializing pheromone concentrations, where N is the number of cities, LNNTo make the nearest neighbor heuristic derived length. Setting other parameters of the algorithm, wherein the parameters comprise the maximum cycle number T of the algorithmmaxThe number of cities N, the number of ants m,probability of a priori knowledge q0The value is 0.9, the value of a heuristic information factor beta is 5, the value of an pheromone expectation factor alpha is 2, and the value of an pheromone volatilization coefficient rho is 0.1;
initializing harmony algorithm parameters: the initialized memory bank has a size M, and the value is equal to the number M of ants. The HMCR (memory bank value probability) is 0.85 and the PAR (harmony adjustment probability) is 0.8. And (5) running the solution sequence obtained m times by adopting a nearest neighbor algorithm to initialize the harmony in the memory bank.
3. Initializing ant positions: and randomly selecting a city from [1, N ] as the starting city of the ant, wherein the total number of the N cities is N.
4. Selecting the next city and updating the local pheromone concentration;
step 1: the following formula is used to select the next city.
Figure BDA0002594076910000064
Figure BDA0002594076910000065
Step 2: the local pheromone concentration update is performed using the following formula.
τij=(1-ρ)τij+ρτ0
Among them, allowedkFor the set of accessible cities remaining for the kth ant, N is the total number of cities. Tau isijIs the concentration of pheromones between city i and city j. Alpha is an pheromone expectation factor with a value of 2, beta is a heuristic information factor with a value of 5. q is a randomly generated number between (0,1), q0The prior probability is taken to be 0.9. Tau is0To initialize pheromone concentration, ρ is the volatility coefficient, and the value is 0.1.
5. Repeating the step 4 until the current ants have visited all cities;
6. sentinel strategy, once ants find a path better than the current optimal solution, the path pheromone is subjected to dynamic micro-gain, and meanwhile, the current active ants are subjected to dynamic micro-gainThe number is reduced by one, otherwise go to step 7, in which the more optimal solution found by the ant is defined as Stemp. The gain is obtained by adopting the following formula:
Figure BDA0002594076910000071
wherein, f (S)Gbest) And f (S)temp) Respectively representing the objective function values of the current optimal solution and the more optimal solution, and N representing the number of cities.
7. Repeating the steps 3 to 6 until all ants finish visiting all cities;
8. updating memory bank, calculating bank solution average value LAAnd constructing a solution vector library. The method is as follows:
step 1: and sorting the solutions generated by all ants, selecting a solution with the objective function of the harmony algorithm smaller than the average value, adding the solution into a memory library of the harmony algorithm, and recording the adding quantity as k.
Step 2: deleting the worst k harmony waves in the memory bank, and calculating the average value of the memory bank solution and recording the average value as LA
And 3, step 3: constructing a solution vector library; defining the solution vector library as a collection of all sum solution vectors in the memory library, i.e.
Figure BDA0002594076910000072
Wherein Xj kRepresenting the jth solution vector, V, in the kth harmonickA set of solution vectors representing the kth harmonic, and U represents a solution vector library.
9. Generating a new sum note X using an improved sum note algorithmNew. The method is as follows:
step 1: defining an optional solution vector set as a solution vector set formed by unselected cities and a target city of the current solution vector, initializing the optional solution vector set as a solution vector set formed by any city, and taking the solution vector frequency L as 0 from a solution vector library.
Step 2: generating a random number between (0,1) as R1If R is satisfied1<Memory bank value probability HMCR, thenTaking out a solution vector from the intersection of the solution vector library and the optional solution vector set, correspondingly executing the operation of L +1, and if the intersection is empty or not meeting the R1<HMCR, then randomly selects a solution vector from the set of selectable solution vectors. The solution vector is taken from the solution vector library in the following way:
if the solution vector is selected for the first time, selecting according to a formula (2), otherwise, selecting the next solution vector according to a formula (3) as follows:
Figure BDA0002594076910000073
Figure BDA0002594076910000074
pi_j(k_i)=λi_j·μi_j(4)
Figure BDA0002594076910000081
where i, j represent two different cities, μi_jDenotes the inverse, λ, of the value of the solution vector i _ ji_jRepresenting the ratio of the number of occurrences of the solution vector i _ j in the solution vector library to the total number of occurrences of all solution vectors starting with i, ci_jRepresenting the number of times the solution vector i _ j appears in the solution vector library. Pi_j(k _ i) represents the probability that the current solution vector k _ i selects the next solution vector i _ j, i _ j ∈ allowed represents the set of selectable solution vectors, and N represents the number of cities. The following description of γ is made in conjunction with tables 1 and 2i_j、χi_j、Pi_j(k _ i) and λi_jThe calculation method of (1) and (5) includes that a memory base for solving 5 city TSPs exists, the memory base contains five harmony sound, and the harmony solution sequences are {1_2,2_3,3_4,4_5,5_1}, {1_4,4_2,2_5,5_3,3_1}, {1_5,5_2,2_4,4_3,3_1},
{5_4,4_1,1_2,2_3,3_5}, {4_3,3_1,1_2,2_5,5_4 }. The corresponding value of the solution vector is shown in table 1, for example, the value of the 2_4 solution vector is 2. Table 2 shows the number of times each solution vector appears in the solution vector library, since the method is used to solve the symmetric traveling salesman problemThe solution vectors 1_2 and 2_1 are considered to be the same vector at the number of calculations. Assuming that the current solution vector is 3_2, it is calculated according to equation (5) as shown in Table 2
Figure BDA0002594076910000082
From Table 1, it can be seen that2_41/2, therefore, P is known from equation (4)2_4(3_2) ═ 0.1, for the same reason P2_5(3_2)=0.3,P2_1(3_2) ═ 3/40, the next solution vector is selected to be 2_5 according to equation (3). For the first time, formula (2) is used, and the values of the solution vectors recorded in table 1 are
Figure BDA0002594076910000083
TABLE 2 values reported are Ci_jThe values in Table 1 and Table 2 and the formula (2) can be used
Figure BDA0002594076910000084
The value is at most 3, so the solution vector 5_2 or 2_5 is selected as the first solution vector.
And 3, step 3: and updating the optional solution vector set. Taking the 5-city TSP problem as an example, assuming that the currently selected solution vector is 1_5, the set of selectable solution vectors is a set of solution vectors formed by cities other than cities 1 and 5 and city 5. I.e., {5_2,5_3,5_4 }.
And 4, step 4: repeating the step 2 and the step 3 until the number of the current harmony solution vectors is N, if the number satisfies
Figure BDA0002594076910000085
(harmony adjusted probability), then on the generated harmony XNewUsing tabu search to process to obtain new harmony and reassign value as XNewOtherwise, no operation is performed.
10. If the new harmony objective function value is less than LAThen X will beNewAdding into memory bank, deleting worst sum sound of memory bank, updating solution vector bank and LAOtherwise, not processing;
11. repeating the steps 9 and 10 until M new harmony voices are generated, wherein M is the size of the memory bank;
12. dynamically selecting a solution and performing pheromone updating. The method is as follows:
step 1: and comparing the current cycle optimal solution with the global optimal solution, if the current cycle optimal solution is better, updating by using the current cycle optimal solution, turning to the 4 th step, and if not, executing the 2 nd step.
Step 2: and comparing the global optimal solution with all solutions in the memory library, judging that a plurality of solutions in the memory library are superior to the current global optimal solution, if so, turning to the step 3, otherwise, directly updating by using the optimal solution in the memory library, and turning to the step 4.
And 3, step 3: and selecting a solution with the minimum similarity to the global optimal solution from a plurality of solutions which are better than the global optimal solution for updating, wherein for better describing the concept of similarity, for example, for solving 5 urban TSP problems, assuming that the ant colony algorithm global optimal solution sequence is {1,3,2,5,4}, the memory base and the acoustic solution are {2_5,5_1,1_3,3_4,4_2}, so that the global optimal solution is converted into the harmonic solution sequence is {1_3,3_2,2_5,5_4,4_1}, and the similarity is defined as the ratio of the number of solution vector repetitions between harmonics to the total number, namely the repeated solution vectors are 1_3 and 2_5, so that the similarity between the two solutions is 2/5.
And 4, step 4: pheromone updates are performed using the following formula.
Figure BDA0002594076910000091
Wherein, f (S)Ibest) Scalar value, f (S), representing the iteratively optimal solutionGbest) Representing the global optimal solution objective function value, f (S)update) Expressing the solution objective function value selected from the memory library, wherein rho is the global volatility coefficient and takes the value of 0.1, tau0To initialize pheromone concentration.
13. Repeating the steps 3 to 12 until the algorithm reaches the maximum iteration number;
14. and outputting the optimal solution.

Claims (1)

1. An ant colony algorithm traveler problem solving method based on improvement and acoustic search optimization comprises the following steps:
(1) the decimal coding of city, the setting of harmony algorithm solution vector, and the construction of target function
Step 1: coding cities using decimal digits, e.g. S ═ C1,C2,...,Ck...,CN),CkRepresenting the city number at the kth position in the solution sequence; k is in the range of [1, N ]]Wherein N is the total number of cities;
step 2: adopting edges of any two different cities as solution vectors in harmony algorithm, and using the solution vectors
T=(C1_C2,C2_C3,...,CN-1_CN,CN_C1) Representing a single harmony, C1_C2The method comprises the steps that a first city and a second city jointly form a solution vector, in the same way, the first city in the solution vector is defined as a starting city, the second city in the solution vector is defined as a target city, and the value of the solution vector is the Euclidean distance between the two cities;
and 3, step 3: use of
Figure FDA0002594076900000011
Constructing an ant colony algorithm objective function, where | Cri-Cr(i+1)L represents the Euclidean distance between the city at the ith position of the solution sequence r and the city at the (i + 1) th position;
and 4, step 4: use of
Figure FDA0002594076900000012
Constructing an objective function of harmony algorithm, wherein | Xi kL represents the length of the ith solution vector in the solution sequence k;
(2) initializing ant colony parameters, and harmony algorithm-related parameters
Initializing ant colony algorithm parameters: constructing a city distance matrix D according to the city coordinates, and using etaij=1/DijCalculating heuristic information between cities, wherein DijExpressed as Euclidean distance between cities i and j, use
Figure FDA0002594076900000013
For initializing pheromone concentrations, where N is the number of cities, LNNLength obtained by solving the problem of the traveling salesman by using a nearest neighbor method; setting other parameters including maximum number of cycles T of algorithmmaxCity number N, ant number m, priori knowledge probability q0The value is 0.9, the value of a heuristic information factor beta is 5, the value of an pheromone expectation factor alpha is 2, and the value of an pheromone volatilization coefficient rho is 0.1;
initializing harmony algorithm parameters: initializing the memory bank with the size of M, the value of the memory bank is equal to the number M of ants, the value probability HMCR of the memory bank is 0.85, the harmony adjustment probability PAR is 0.8, and randomly generating M solution sequences to initialize the harmony in the memory bank;
(3) initializing ant positions: randomly selecting a city from [1, N ] as an ant starting city;
(4) the next city is selected and local pheromone concentration is updated as follows
Step 1: selecting the next city by adopting the following formula;
Figure FDA0002594076900000014
Figure FDA0002594076900000015
step 2: local pheromone concentration updating is performed by adopting the following formula:
τij=(1-ρ)τij+ρτ0
among them, allowedkRandomly generating numbers between (0,1) for the set of remaining accessible cities of the kth ant;
(5) repeating the step (4) until the current ants have visited all cities;
(6) sentinel strategy, once ants find a path better than the current optimal solution, the path pheromone is dynamically gained slightly, meanwhile, the current number of the ants is reduced by one, otherwise, the operation goes to step (7), wherein the ants are definedThe more excellent solution found by the ants is marked as StempThe gain is obtained by adopting the following formula:
Figure FDA0002594076900000021
wherein f (S)Gbest) And f (S)temp) Respectively representing objective function values of the current optimal solution and the more optimal solution;
(7) repeating the steps (3) to (6) until all ants finish visiting all cities;
(8) updating the memory bank, calculating the average value L of all harmony objective function values in the memory bankAAnd constructing a solution vector library in the following way:
step 1: calculating the average value of solution objective function values generated in one cycle of the ant colony algorithm and recording the average value as Lave
Step 2: sorting the solutions generated by all ants, and selecting the value of the objective function to be less than LaveAdding the solution into a memory base of a harmony algorithm, and recording the adding quantity as k;
and 3, step 3: deleting the worst k harmony sounds in the memory bank, and calculating the average value of all harmony objective function values in the memory bank as LA
And 4, step 4: constructing a solution vector library; defining the solution vector library as a collection of all sum solution vectors in the memory library, i.e.
Figure FDA0002594076900000022
Wherein Xj kRepresenting the jth solution vector, V, in the kth harmonickA set of solution vectors representing the kth harmony, U representing a solution vector library;
(9) generating a new sum note X using an improved sum note algorithmNewThe method is as follows:
step 1: defining an optional solution vector set as a solution vector set formed by an unselected city and a target city of a current solution vector, initializing the optional solution vector set as a solution vector set formed by any city, and taking the solution vector frequency L as 0 from a solution vector library;
step 2: generating a random number between (0,1) as R1If R is satisfied1<HMCR, then take out a solution vector from the intersection of solution vector library and optional solution vector set, and correspondingly execute L ═ L +1 operation, if the intersection is empty or does not satisfy R1<HMCR, then choose a solution vector from the optional solution vector set at random; the solution vector is taken from the solution vector library in the following way:
if the solution vector is selected for the first time, selecting according to a formula (2), otherwise, selecting the next solution vector according to a formula (3) as follows:
Figure FDA0002594076900000023
Figure FDA0002594076900000024
pi_j(k_i)=λi_j·μi_j(4)
Figure FDA0002594076900000025
wherein mui_jDenotes the inverse, λ, of the value of the solution vector i _ ji_jRepresenting the ratio of the number of occurrences of the solution vector i _ j in the solution vector library to the total number of occurrences of all solution vectors starting with i, ci_jRepresenting the number of times the solution vector i _ j appears in the solution vector library; pi_j(k _ i) represents the probability, χ, that the current solution vector k _ i selects the next solution vector i _ ji_jRepresenting the solution vector i _ j, y obtained when the solution vector is selected for the first timei_jRepresenting a solution vector i _ j obtained when the solution vector is not selected for the first time, wherein the i _ j belongs to an allowed solution vector set;
and 3, step 3: updating the optional solution vector set;
and 4, step 4: repeating the step 2 and the step 3 until the number of the current harmony solution vectors is N, if the number satisfies
Figure FDA0002594076900000031
Then pairGenerated harmony XNewUsing tabu search to process to obtain new harmony and reassign value as XNewOtherwise, no operation is carried out;
(10) if the new harmony objective function value is less than LAThen X will beNewAdding into memory bank, deleting worst sum sound of memory bank, updating solution vector bank and LAOtherwise, not processing;
(11) repeating the steps (9) and (10) until M new harmony sounds are generated, wherein M is the size of the memory bank;
(12) dynamically selecting a solution and updating pheromone, and the method comprises the following steps:
step 1: comparing the current cycle optimal solution with the global optimal solution, if the current cycle optimal solution is better, updating by using the current cycle optimal solution, turning to the 4 th step, and if not, executing the 2 nd step;
step 2: comparing the global optimal solution with all solutions in the memory library, judging that a plurality of solutions in the memory library are superior to the current global optimal solution, if so, turning to the step 3, otherwise, directly updating by using the optimal solution in the memory library, and turning to the step 4;
and 3, step 3: selecting a solution with the minimum similarity to the global optimal solution from a plurality of solutions which are better than the global optimal solution for updating, and defining the similarity as the ratio of the number of superposed path segments between the solutions to the total city number;
and 4, step 4: pheromone updates were performed using the following formula:
Figure FDA0002594076900000032
wherein, f (S)update) Representing a solution objective function value selected from a memory library;
(13) repeating the steps (3) to (12) until the algorithm reaches the maximum iteration number;
(14) and outputting the optimal solution.
CN202010704280.XA 2020-07-21 2020-07-21 Method for solving problem of travel trader based on improved and acoustic search optimization ant colony algorithm Active CN111832831B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010704280.XA CN111832831B (en) 2020-07-21 2020-07-21 Method for solving problem of travel trader based on improved and acoustic search optimization ant colony algorithm

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010704280.XA CN111832831B (en) 2020-07-21 2020-07-21 Method for solving problem of travel trader based on improved and acoustic search optimization ant colony algorithm

Publications (2)

Publication Number Publication Date
CN111832831A true CN111832831A (en) 2020-10-27
CN111832831B CN111832831B (en) 2022-03-15

Family

ID=72923824

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010704280.XA Active CN111832831B (en) 2020-07-21 2020-07-21 Method for solving problem of travel trader based on improved and acoustic search optimization ant colony algorithm

Country Status (1)

Country Link
CN (1) CN111832831B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102915355A (en) * 2012-10-11 2013-02-06 李英明 Multiprocessor task scheduling method based on harmony search and simulated annealing
CN108460485A (en) * 2018-03-05 2018-08-28 重庆邮电大学 A kind of traveling salesman problem method for solving based on improvement ant group algorithm
CN108564163A (en) * 2018-03-27 2018-09-21 华南理工大学 A kind of improvement ant group algorithm solving multiple target multiple traveling salesmen problem

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102915355A (en) * 2012-10-11 2013-02-06 李英明 Multiprocessor task scheduling method based on harmony search and simulated annealing
CN108460485A (en) * 2018-03-05 2018-08-28 重庆邮电大学 A kind of traveling salesman problem method for solving based on improvement ant group algorithm
CN108564163A (en) * 2018-03-27 2018-09-21 华南理工大学 A kind of improvement ant group algorithm solving multiple target multiple traveling salesmen problem

Non-Patent Citations (5)

* Cited by examiner, † Cited by third party
Title
HO-YOENG YUN 等: "Advanced Harmony Search with Ant Colony Optimization", 《JOURNAL OF APPLIED MATHEMATICS》 *
张辉 等: "基于改进蚁群算法的旅行商问题", 《2007中国控制与决策学术年会论文集》 *
曾毅 等: "基于混合和声搜索算法求解旅行商问题", 《华东交通大学学报》 *
王玉婷 等: "基于和声搜索和模拟退火的混合算法解决TSP问题", 《计算机应用与软件》 *
魏林 等: "和声蚁群耦合算法求解整数规划的应用研究", 《计算机工程与应》 *

Also Published As

Publication number Publication date
CN111832831B (en) 2022-03-15

Similar Documents

Publication Publication Date Title
Yuan et al. A hybrid harmony search algorithm for the flexible job shop scheduling problem
Ergezer et al. Oppositional biogeography-based optimization
Casillas et al. Genetic feature selection in a fuzzy rule-based classification system learning process for high-dimensional problems
Hong et al. Simultaneously applying multiple mutation operators in genetic algorithms
CN112346839A (en) Associated task scheduling method based on evolutionary algorithm
Al-Behadili et al. Hybrid ant colony optimization and iterated local search for rules-based classification
Da Silva et al. A hybrid memetic approach for fully automated multi-objective web service composition
Hu et al. : Channel Pruning via Class-Aware Trace Ratio Optimization
Segura et al. A novel diversity-based evolutionary algorithm for the traveling salesman problem
CN111340303A (en) Route planning method for travelers based on novel mixed frog-leaping algorithm
Alharbi A hybrid genetic algorithm with tabu search for optimization of the traveling thief problem
Fiscko et al. Efficient solutions for targeted control of multi-agent mdps
CN111832831B (en) Method for solving problem of travel trader based on improved and acoustic search optimization ant colony algorithm
Kumar Efficient hierarchical hybrids parallel genetic algorithm for shortest path routing
Ordóñez et al. Genetic Approach for Optimizing Ensembles of Classifiers.
Duan et al. Express uav swarm path planning with vnd enhanced memetic algorithm
Zahedi et al. OptABC: An Optimal Hyperparameter Tuning Approach for Machine Learning Algorithms
Song et al. An improved differential evolution algorithm with local search for capacitated vehicle routing problem
Chen et al. Deep reinforcement learning with model-based acceleration for hyperparameter optimization
Sun et al. Novel degree constrained minimum spanning tree algorithm based on an improved multicolony ant algorithm
Sun et al. A multi-objective memetic algorithm for automatic adversarial attack optimization design
Diao et al. A harmony search based approach to hybrid fuzzy-rough rule induction
Ye et al. Weight-Specific-Decoder Attention Model to Solve Multiobjective Combinatorial Optimization Problems
Ali et al. Differential evolution algorithm for multiple inter-dependent components traveling thief problem
Gutjahr Ant colony optimization: recent developments in theoretical analysis

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
GR01 Patent grant
GR01 Patent grant