Swarm intelligence algorithm with parallel and cooperative optimization function
By dividing particles into multiple subpopulations and adopting a collaborative search mechanism, the problem of large-scale calculation and slow speed in large-scale solution space is solved, and more efficient search strategies and computing efficiency are achieved.
Patent Information
- Application Number
- CN202411590930.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-08
- Publication Date
- 2025-02-18
AI Technical Summary
When dealing with large-scale solution space, group intelligence algorithms have large calculations, slow speed, and difficult to effectively find satisfactory results.
A population intelligence optimization algorithm combined with parallel algorithm is proposed. By dividing particles into multiple subpopulations and adopting a collaborative search mechanism, it strengthens information exchange between individuals to achieve a more efficient search strategy.
It significantly improves the computational efficiency of the algorithm, and can find the global optimal solution in a large-scale solution space in a short time, reducing the computational effort and time-consuming.
Smart Images

Figure BDA0005125571660000041 
Figure BDA0005125571660000091 
Figure FDA0005125571650000011
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of solving and applying optimization problems, and specifically relates to a heuristic search method based on swarm intelligence optimization. Background Art
[0002] Swarm intelligence algorithm is a type of optimization method based on group behavior patterns. Its core idea is to search for the optimal solution to the problem by simulating the information exchange and interaction between individuals in the population. Compared with traditional optimization methods, swarm intelligence algorithm has strong parallelism. In addition, by sharing information between individuals in the swarm intelligence algorithm and historical information in the search space, it can better guide the direction of the next search. This information exchange enables the swarm intelligence algorithm to effectively use the useful information that has been obtained during the search process, thereby improving the efficiency of the search.
[0003] The most typical problem handled by swarm intelligence algorithms is the optimization problem. With the improvement of algorithms and the expansion of application fields, swarm intelligence algorithms play an increasingly important role in solving practical problems in engineering design, traffic planning, and finance. However, as the problem-solving space gradually increases, the execution of swarm intelligence algorithms has large computational complexity, slow speed, and sometimes even fails to obtain satisfactory results. To this end, the present invention combines swarm intelligence optimization algorithms with parallel algorithms to propose a swarm intelligence optimization algorithm with parallel computing capabilities. At the same time, a collaborative search mechanism is designed to strengthen information exchange between individuals to achieve a more efficient search strategy. Summary of the invention
[0004] In view of the defects of large amount of calculation and slow execution of swarm intelligence algorithm, the purpose of the present invention is to provide a swarm intelligence algorithm with parallel and collaborative optimization functions to improve the calculation efficiency of the algorithm.
[0005] In order to achieve the above object, the present invention provides the following technical solutions:
[0006] S101: Generate m particles by random sampling in the feasible domain of the problem to be solved;
[0007] S102: Number the particles generated in S101 in natural number order, and finally get the particles numbered c i (i=1, 2, ..., m) particle sequence;
[0008] Preferably, the particles are numbered in natural number order, which can facilitate the positioning of the particles in the subsequent search process, thereby facilitating and simplifying the writing of programs.
[0009] S103: Divide the particles into n sub-populations according to the numbering sequence determined in S102, and the sub-populations are numbered G in sequence.i (i=1, 2, ..., n);
[0010] Preferably, the total population is divided into n sub-populations, which can realize the transition from serial search to parallel search, and reduce the amount of calculation while keeping the population size unchanged.
[0011] S104: Adoption Set the number in S103 to G n The number of particles contained in the sub-population of S103 is calculated according to the formula Settings, where Int() and Mod() represent integer and remainder operations respectively;
[0012] Preferably, when the subpopulation number n takes any integer value in the interval [1, m], the above rounding and remainder operations can ensure that the number of particles in the subpopulation is an integer, thereby achieving a more flexible setting of the value of the subpopulation number n.
[0013] S105: Perform an optimal search in the sub-population, update the position of the particles in the sub-population, and record the number of the current best particle in the sub-population;
[0014] S106: Repeat step S105 until all n sub-populations have completed the optimal search, and finally obtain a sequence b that records the current best particle number of the sub-population i (i=1, 2, ..., n).
[0015] Preferably, by calculating the search direction and the search step length, the current best particle in the sub-population described in S105 can be found. The specific steps include:
[0016] S201: Mark the current particle to be moved in the population as a central particle, and mark other particles in the population as guide particles;
[0017] S202: Calculate the objective function value g corresponding to the central particle and the objective function value f corresponding to the guide particle, and determine the search direction of the central particle according to the sign function sgn(gf);
[0018] Preferably, using the sign function described in S202 can ensure that the search direction of the central particle always points to the search area containing a better solution.
[0019] S203: Calculate the position vector difference s between the center particle and the guide particle, and multiply it by the adaptive intensity factor Get the search step length of the central particle in each dimension;
[0020] Preferably, the effect of the adaptive intensity factor λ described in S203 is reflected in: the larger the value of the numerator term |gf|, the greater the difference between the guide particle and the central particle. At this time, a larger intensity factor λ will be obtained, so that the central particle can perform optimal search along the search direction with a larger amplitude.
[0021] S204: Calculate the change in the center particle position vector: Δ=sgn(gf)·λ·s;
[0022] S205: Add the Δ described in S204 to the original position vector of the central particle to obtain the updated new position of the central particle.
[0023] S206: If the new position of the central particle described in S205 is better than its original position, the central particle is moved to the new position; otherwise, the central particle remains at its original position.
[0024] S207: Select the next particle in the population as the central particle, and repeat steps S202 to S206 until all particles in the population are processed.
[0025] Preferably, optimizing the current best particle of the sub-population can improve the overall search efficiency of the swarm intelligence algorithm. The specific steps include:
[0026] S301: Sequence b described in S106 i The particles corresponding to (i=1, 2, ..., n) form a search population, which is recorded as a collaborative search population;
[0027] S302: According to the steps described in S201 to S207, the particles in the collaborative search population are searched for optimization, and the current best particle in the collaborative search population is found and recorded as the current global best particle;
[0028] S303: Calculate the objective function value corresponding to the current global best particle described in S302;
[0029] S304: Check the termination condition of the algorithm search: if the maximum number of iterations is reached, or the current optimal solution meets the accuracy requirements, stop the calculation and output the result; otherwise, go to S105 to enter the next round of iterative search. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] The present invention will be further described below with reference to the accompanying drawings and embodiments, in which:
[0031] Figure 1 This is a visualization diagram of test function 1;
[0032] Figure 2 It is a flow chart for the implementation of the present invention;
[0033] Figure 3 Flowchart for searching for optimal results within a subpopulation;
[0034] Figure 4 Implementation flowchart for collaborative optimization search; DETAILED DESCRIPTION
[0035] The present invention will be further described below in conjunction with the accompanying drawings and specific embodiments.
[0036] To solve the problem Figure 1 Taking the minimization function value problem of the test function 1 shown as an example, the implementation process of the algorithm is introduced in detail. The mathematical expression of the test function 1 is:
[0037]
[0038] The test function is a multimodal function characterized by the presence of multiple local minima and a global minimum in its solution space. The global minimum of the function is located near the boundary of the solution space and has a very sharp and narrow valley. Therefore, the optimization algorithm faces great challenges in searching and converging to the global optimal solution.
[0039] To this end, the present invention provides a swarm intelligence optimization method with parallel and collaborative optimization functions, and the specific implementation steps are as follows:
[0040] First, the parameters are set as follows: the total number of search particles m = 100, the number of sub-populations n = 10, and the maximum number of algorithm iterations k max =100, and let k=1.
[0041] S101: Generate m=100 particles in the feasible domain [0, π] of the test function 1 by random sampling;
[0042] S102: Number the particles generated in S101 in natural number order, and finally get the particles numbered c i (i=1, 2, ..., 100) particle sequence;
[0043] Preferably, in the subsequent optimization process, the position of the particle can be found by searching the number corresponding to the particle, which facilitates and simplifies the programming.
[0044] S103: Divide the search particles into n=10 sub-populations according to the numbering sequence determined in S102, and number the sub-populations in sequence as G i (i=1, 2, ..., n).
[0045] Preferably, the total population is divided into 10 sub-populations, which can realize the transition from serial search to parallel search. Under the premise of keeping the population size m=100 unchanged, the amount of calculation can be reduced to about 1 / 10 of the amount of calculation of the ungrouped search.
[0046] S104: Adoption Set the number in S103 to G 10 The number of particles contained in the subpopulation. In this embodiment, m is 100 and n is 10, so the number G is calculated. 10 The number of particles in the sub-population is 10; the number of particles in the remaining sub-populations is calculated according to the formula Set, calculate the number of search particles in the remaining sub-populations to be 10. Here, Int() and Mod() represent integer and remainder operations respectively;
[0047] Preferably, when the number of subpopulations n takes any integer value in the interval [1, m], the above rounding and remainder operations can ensure that the number of particles in the subpopulation is an integer, thereby achieving a more flexible setting of the value of the number of subpopulations n. For example, in this embodiment, if the number of subpopulations n takes 9, the number G can be calculated. 10 The number of particles in the sub-population is 12, and the number of particles in the remaining sub-populations is 11. The number of particles in all sub-populations is an integer, which ensures the normal execution of the subsequent search program.
[0048] S105: Perform an optimal search within the sub-population, update the position of the particles within the sub-population, and record the number of the current optimal particle of the sub-population.
[0049] S106: Repeat step S105 until all n=10 sub-populations have completed the optimal search, and finally obtain a sequence b that records the current best particle number of the sub-population. i (i=1, 2, ..., 10).
[0050] Preferably, by calculating the search direction and the search step length, the optimal search for all particles in the sub-population can be achieved. The specific calculation steps of the search direction and the search step length are as follows:
[0051] S201: Mark the current particle to be moved in the population as a central particle, and mark other particles in the population as guide particles.
[0052] S202: Calculate the objective function value g corresponding to the central particle and the objective function value f corresponding to the guide particle, and determine the search direction of the central particle according to the sign function sgn(gf);
[0053] Specifically, this embodiment is an optimization problem for calculating the minimum value. If the objective function value g corresponding to the center particle is less than the objective function value f corresponding to the guide particle, it means that the center particle is better than the guide particle. At this time, the sign function sgn(gf)=-1, and the center particle will move in the direction away from the guide particle. On the contrary, the sign function sgn(gf)=1, and the center particle will move in the direction toward the guide particle. In particular, if the objective function value g corresponding to the center particle is equal to the objective function value f corresponding to the guide particle, then sgn(gf)=0, and the position of the center particle will remain unchanged.
[0054] Preferably, using the sign function described in S202 can ensure that the search direction of the central particle always points to the search area containing a better solution.
[0055] S203: Calculate the position vector difference s between the center particle and the guide particle, and multiply it by the adaptive intensity factor Get the search step length of the central particle in each dimension;
[0056] Furthermore, in order to more clearly illustrate the calculation process of the adaptive intensity factor λ, the coordinates of the central particle (0, 0), the coordinates of the guide particle 1 (0, 2.8) and the coordinates of the guide particle 2 (2.4, 0.7) are taken as examples for calculation. In this example, the objective function value g=0 corresponding to the central particle, and the objective function values corresponding to the guide particle 1 and the guide particle 2 are f1=-0.1525 and f2=-0.3861, respectively. According to the formula described in S203, the adaptive intensity factors λ1=0.5 and λ2=0.6 are obtained, respectively. In this example, since the difference between the guide particle 2 and the central particle is greater, a relatively larger adaptive intensity factor is obtained.
[0057] Preferably, the effect of the adaptive intensity factor described in S203 is reflected in: the larger the value of the numerator term |gf|, the greater the difference between the guide particle and the central particle. At this time, a larger intensity factor λ will be obtained, so that the central particle can perform optimal search along the search direction with a larger amplitude.
[0058] S204: Calculate the change in the center particle position vector: Δ=sgn(gf)·λ·s;.
[0059] S205: Add the position change Δ described in S204 to the original position of the central particle to obtain the new position of the central particle.
[0060] S206: If the new position of the central particle described in S205 is better than its original position, the central particle is moved to the new position; otherwise, the central particle remains at its original position.
[0061] S207: Select the next particle in the sub-population as the central particle, and repeat steps S202 to S206 until all particles in the sub-population are processed.
[0062] Preferably, optimizing the current best particle of the sub-population can improve the overall search efficiency of the swarm intelligence algorithm. The specific steps include:
[0063] S301: Sequence b described in S106 i The particles corresponding to (i=1, 2, ..., 10) form a search population, which is recorded as a collaborative search population;
[0064] S302: According to the steps described in S201 to S207, the particles in the collaborative search population are searched for optimization, and the current best particle in the collaborative search population is found and recorded as the current global best particle;
[0065] S303: Calculate the objective function value corresponding to the current global best particle described in S302;
[0066] S304: Check the termination condition of the algorithm search: if the maximum number of iterations 100 is reached, stop the calculation and output the result; otherwise, go to S105 to enter the next round of iterative search.
[0067] Through the swarm intelligence algorithm with parallel and collaborative optimization functions, the global optimal solution of test function 1 was successfully searched: -1.8013, and the global optimal particle position was obtained as: (2.20, 1.57).
[0068] The effect of the present invention can be further illustrated by the following comparative experiments:
[0069] 10 groups of representative standard test functions were selected for testing, and the test functions were from the standard test function library: http: / / www.sfu.ca / ~ssurjano / optimization.html. In order to more clearly illustrate the effect of the present invention, the test results of the method of the present invention and the non-clustering version of the method of the present invention were compared. During the test, the non-clustering version of the method of the present invention can be obtained by simply taking the number of subpopulations n=1. The experiment used Matlab programming language, and the computer configuration was: Intel Core i5-7200U CPU, 16Gb memory. In order to make a more objective comparison, all results were taken as the average of 10 consecutive tests.
[0070] The parameters are set as follows:
[0071] The method of the present invention (grouping): the total number of search particles m = 100, the number of sub-populations n = 10, and the maximum number of algorithm iterations k max=100; the method of the present invention (without grouping): the total number of search particles m = 100, the number of sub-populations n = 1, and the maximum number of algorithm iterations k max = 100. The experimental results are shown in Table 1.
[0072] From the experimental results in Table 1, it can be seen that the method of the present invention successfully searched for the global optimal solution of all 10 groups of test functions within 100 iterations. In addition, compared with the calculation results without grouping, it can be seen that the method of the present invention significantly reduces the calculation time while achieving similar accuracy.
[0073] The description of the above disclosed embodiments enables relevant personnel in this field to apply the present application. The innovative points of the present application have been reflected in the above embodiments. Without violating the scope of the present application, the present application can be used to solve or realize other embodiments.
[0074] Table 1 Comparison of test results of the method of the present invention and the method of the present invention without grouping
[0075]
Claims
1. A swarm intelligence algorithm with parallel and collaborative optimization functions, characterized in that: The method steps include: S101: Generate m particles by random sampling in the feasible domain of the problem to be solved; S102: Number the particles generated in S101 in natural number order, and finally get the particles numbered c i (i=1, 2, ..., m) particle sequence; S103: Divide the particles into n sub-populations according to the numbering sequence determined in S102, and the sub-populations are numbered G in sequence. i (i=1, 2, ..., n); S104: Adoption Set the number in S103 to G n The number of particles contained in the sub-population of S103 is calculated according to the formula Settings, where Int() and Mod() represent integer and remainder operations respectively; S105: Perform an optimal search in the sub-population, update the position of the particles in the sub-population, and record the number of the current best particle in the sub-population; S106: Repeat step S105 until all n sub-populations have completed the optimal search, and finally obtain a sequence b that records the current best particle number of the sub-population i (i=1, 2, ..., n).
2. A swarm intelligence algorithm with parallel and collaborative optimization functions according to claim 1, characterized in that: The optimization search in S105 needs to calculate the search direction and the search step length, and the steps include: S201: Mark the current particle to be moved in the population as a central particle, and mark other particles in the population as guide particles; S202: Calculate the objective function value g corresponding to the central particle and the objective function value f corresponding to the guide particle, and determine the search direction of the central particle according to the sign function sgn(gf); S203: Calculate the position vector difference s between the center particle and the guide particle, and multiply it by the adaptive intensity factor Get the search step length of the central particle in each dimension; S204: Calculate the change in the center particle position vector: Δ=sgn(gf)·λ·s; S205: Add the Δ described in S204 to the original position vector of the central particle to obtain the updated new position of the central particle; S206: If the new position of the central particle in S205 is better than its original position, the central particle is moved to the new position; otherwise, the central particle remains at its original position; S207: Select the next particle in the population as the central particle, and repeat steps S202 to S206 until all particles in the population are processed.
3. The swarm intelligence algorithm with parallel and collaborative optimization functions according to claim 1, characterized in that: From the sequence b described in S106 i (i=1, 2, ..., n) corresponding particles form a collaborative search population, and find the current best particle in the collaborative search population according to the steps of claim 2, the steps comprising: S301: Sequence b described in S106 i The particles corresponding to (i=1, 2, ..., n) form a search population, which is recorded as a collaborative search population; S302: According to the steps described in S201 to S207, the particles in the collaborative search population are searched for optimization, and the current best particle in the collaborative search population is found and recorded as the current global best particle; S303: Calculate the objective function value corresponding to the current global best particle described in S302; S304: Check the termination condition of the algorithm search: if the maximum number of iterations is reached, or the current optimal solution meets the accuracy requirements, stop the calculation and output the result; otherwise, go to S105 to enter the next round of iterative search.