23-year Chinese Academy of Sciences Area 1 Algorithm | Kepler Optimization Algorithm Principle and Utilization (Matlab/Python)

Testing in CEC2017

Insert image description here

The author of this article will introduce an optimization algorithm published in the journal "Knowledge-Based Systems" of the Chinese Academy of Sciences Region 1 in 2023 - Kepler optimization algorithm (KOA) [1]

Insert image description here

In terms of algorithm performance, it was tested on CEC2014, CEC2017, CEC2020 and CEC2022 with a number of optimization algorithms such as pelican, slime mold, gray wolf and whale, and all showed its amazing performance. Therefore, everyone who is interested should learn the ingenuity of this algorithm with the author, and the MATLAB and Python implementation of the algorithm are also given at the end of the article. Applying such new algorithms with better performance to some engineering problems can also improve the innovation of the article to a certain extent.

Insert image description here

00 Catalog

1 Principle of Kepler Optimization Algorithm (KOA)

2 Code directory

3 Algorithm performance

4 Source code acquisition

01 Principle of Kepler Optimization Algorithm (KOA)

Insert image description here

Picture source document[1]

KOA is a physics-based optimizer (which means there will be more formulas...the author lists the core formulas here to help you understand). It is a new optimization algorithm inspired by Kepler's laws of planetary motion. The sun (optimal solution) and the planets rotating around it in elliptical orbits (candidate solutions) constitute the search space. At different times, the planets will be at different positions in the orbit. This strategy effectively performs exploration and development ( as follows). The attraction between the sun and the planet, the rotation speed and other factors also jointly determine the proximity of the planet to the sun. To fit the algorithm, the term "time" would be more appropriate to the term iteration.

Insert image description here

Picture source document[1]

1.1 Initialization

The population initialization of KOA is the same as other algorithms. Each planet will be placed at a random position in the orbit, and the formula is xi=lb+rand*(ub-lb). In addition, KOA has two new parameters that need to be initialized, namely orbital eccentricity e and orbital period T, which are calculated:

Insert image description here

Among them, rand is a random value and r is a random number from a normal distribution. ei is related to the gravity mentioned later and can give KOA a certain degree of randomness. T is related to the length of the semi-major axis of the elliptical orbit, and the length of the semi-major axis will gradually decrease over time, and the corresponding solution will also move toward a promising area where the global optimal solution may be found.

1.2 Celestial body speed

The speed of celestial bodies is affected by the gravitational pull of the sun. When a planet is close to the sun, its speed increases and when it moves farther away, its speed decreases. If a planet is close to the sun, then the sun's gravitational pull will be quite strong, and the planet will try to increase its speed to avoid being pulled toward the sun. However, if an object moves away from the Sun, it slows down because the Sun's gravity is weak. The relationship can be expressed by the following equation:

Insert image description here

The meaning of the specific parameters will not be explained in detail here, but it can be seen that this formula converts between exploration and development based on the distance from the optimal solution.

1.3 Jump out of local optimum

In the solar system, most celestial bodies revolve around the sun counterclockwise, and they all rotate around their own axes; however, there are also some celestial bodies that revolve around the sun clockwise. The algorithm exploits this behavior to escape the local optimal region, that is, by using the flag F (i.e., F in 1.2), changing the search direction so that the agent can accurately scan the search space.

1.4 Update celestial body positions

Celestial bodies revolve around the sun in their own elliptical orbits. During the rotation process, the object moves closer to the sun for a certain period of time and then moves away from the sun. KOA simulates this behavior through two main phases: exploration and exploitation phases. KOA explores planets farther from the sun to find new solutions, while using solutions closer to the sun more accurately as it searches for new places near the best solutions. Figure 4 shows the exploration and development areas around the sun.

Insert image description here

Picture source document[1]

The position of the planet is updated using:
Insert image description here

As the planet moves away from the Sun, the planet's velocity will represent the KOA's exploration operator. However, this speed is affected by the Sun's gravity, which helps the current planet slightly exploit the region near the optimal solution. At the same time, as the planet approaches the sun, its speed increases dramatically, allowing it to escape the sun's gravity. In this case, if the best solution so far (called the sun) is a local minimum, then the velocity represents local optimal avoidance, and the gravity of the sun represents the utilization operator to help the KOA attack the best solution so far to Find a better solution.

Among them, the sun controls the planets to move around it in an elliptical form through gravity, following the law of universal gravitation, whose definition is:

Insert image description here

1.5 Update distance from the sun

To further improve the exploration and development of planets, the algorithm mimics the typical behavior of the distance between the sun and the planet. When the planet is close to the sun, KOA will focus on optimizing the development operator; when the planet is far from the sun, KOA will optimize the exploration operator. The conversion of the rules will depend on the adjustment parameter h, which gradually changes over time. h is as follows:

Insert image description here

Picture source document[1]

When h is set to a high value, emphasis is placed on the exploration operator, causing the distance between the planet and the sun to expand. In contrast, when h assumes a low value, development tends to enable focused exploration near the best solution obtained so far.

The mathematical model of this principle is described as follows:

Insert image description here

1.6 Elite Retention

This step is equivalent to a greedy strategy. If the fitness is better after the location is updated, it will be retained.
Insert image description here

1.7 Algorithm process
Insert image description here

1.8 Algorithm Utilization

In fact, there were documents in 2015 and 22 that mixed Kepler into optimization algorithms to improve performance, but these algorithms only used Kepler's first law, in the following form:

It is highly simplified by focusing the search by multiplying the sun's position by a uniformly distributed pseudo-random number or by adding a distance component between the sun's position and the planet. In KOA, it is a complete optimization framework that can more effectively utilize and explore space. In its celestial body position update, there are strategies that can jump out of the local optimum and effectively convert between exploration and development. This can be considered to be introduced into other algorithms to improve performance.Insert image description here

02 Code directory

Insert image description here

The code includes MATLAB, Python and KOA algorithm source documents. Considering that many students have obtained the code, the MATLAB code part has garbled characters (MATLAB version problem). You can change the MATLAB version to 2020 and above, or use garbled characters to solve the txt file in the folder. That’s it.

The code has been re-annotated by the author, making the code cleaner and more readable.

Part of the code: (MATLAB and Python)

Insert image description here

03 Algorithm performance

Use standard test functions to initially test its optimization performance

In MATLAB, test the CEC2017 function. The results of executing the program are as follows:

Insert image description here

In Python, test the CEC2005 function. The results of executing the program are as follows:

Insert image description here

04 Source code acquisition

Just reply to KOA in the background of GZH ( KAU's cloud experimental platform )

references

[1] Abdel-Basset, M. et al. Kepler optimization algorithm: A new metaheuristic algorithm inspired by Kepler’s laws of planetary motion. Knowl. Based Syst. 268, 110454 (2023).

Another note: If anyone has optimization problems to be solved (in any field), you can send them to me, and I will selectively update articles that use optimization algorithms to solve these problems.

If this article is helpful or inspiring to you, you can click Like/Reading (ง •̀_•́)ง (you don’t have to click) in the lower right corner. Your encouragement is the motivation for me to persevere! If you have customization needs, you can send a private message to the author.

Guess you like

Origin blog.csdn.net/sfejojno/article/details/135374295