Rastrigin Function
Conquering the "Devil's Function" via a Hybrid of Discrete and Continuous Mathematics
Rastrigin Function
Global Minimum: $f(x) = 0$ at $x_i = 0$
1. Target Function and Its Landscape (Rastrigin Function)
When evaluating the performance of optimization algorithms, there are famous benchmark functions that plague researchers worldwide. One such function is the "Rastrigin function."
At first glance, it appears to be a simple quadratic function combined with a cosine wave. While the overall shape forms a funnel toward the center (where all variables are 0), its surface is lined with "countless false valleys (local minima)" caused by the cosine wave. Optimization algorithms must navigate these numerous traps to find the single "true valley" at the center.
2. Approach via Continuous Mathematics (Newton's Method and Homotopy)
(1) Attempt with Newton's Method
Initially, we transformed this into an extremum problem using partial derivatives and attempted to solve it using Newton's method. We used the "SPICE-oriented analysis method" developed in our laboratory to execute this.
As a result, when the initial value was set to the true solution (0), it naturally converged. However, giving it an initial value even slightly off-center caused it to fall into an adjacent false valley (local extremum), failing completely to reach the true solution. Due to the nature of continuous mathematics, which blindly follows the downward gradient (derivative), it cannot climb out to escape a valley once trapped.
(2) Attempt with the Homotopy Method
Next, to eliminate the dependency on initial values, we tried the homotopy method. Again, we used the SPICE-oriented analysis method as our implementation tool.
- Fixed-point Homotopy: Although the algorithm executed, it was eventually pulled into a local minimum and failed to reach the global optimum.
- Newton Homotopy: Due to the severe undulations of the function, a
Timestep too smallerror occurred during the calculation, preventing it from running completely.
Figure 2: Tracking the solution curve using fixed-point homotopy
3. Introduction of Discrete Mathematics (Monte Carlo & GA)
Concluding that solving this function using only continuous mathematics concepts is difficult, we decided to introduce concepts from "discrete mathematics," which do not rely on gradients or continuity. We developed and tested new programs (the Monte Carlo method and a Genetic Algorithm: GA) that probabilistically search the entire space.
As a result, we obtained very good results, successfully jumping over the traps of local minima and reaching the correct valley area where the true solution lies. However, while it reached the general vicinity of the correct answer, it lacked the pinpoint accuracy required to find the exact bottom of the valley down to the millimeter.
4. The Solution: A Hybrid Method
"Discrete mathematics excels at global search but struggles with fine-tuning." "Continuous mathematics is vulnerable to local minima but offers overwhelming precision."
Based on these characteristics, we fundamentally shifted our programming approach.
"First, use discrete mathematics (GA or Monte Carlo) to find a rough initial value, and then hand the baton over to continuous mathematics (Newton's method) to pinpoint the exact solution." This is our hybrid approach.
5. Execution Results
Using this method, we successfully found the true solution.
The discrete mathematical approach in the first half safely navigated numerous traps to land near the valley floor. From there, the continuous mathematical approach (Newton's method) took over, sliding straight down to the ultimate precision in just a few iterations.
Below is the execution log of the 5-variable Rastrigin function using our custom program.
=== Newton's Method Finished ===
Final Score (Fitness): 0.0000000000
x1 = -0.0000000
x2 = 0.0000000
x3 = 0.0000000
x4 = -0.0000000
x5 = -0.0000000
By deeply understanding the characteristics of each mathematical approach and combining them appropriately (GA + NEWTON), we succeeded in conquering the "devil's function," which was nearly impossible to solve using a single method.
6. Development of the New Solver "MAL-Seeker"
Through this experiment, it became clear that the approach fusing discrete and continuous mathematics is highly effective.
Until now, we have performed various analyses using SPICE control syntax and similar tools. However, to maximize the potential of this hybrid architecture, we are officially announcing the full-scale development of our original solver in C language, "MAL-Seeker".
As the new core engine of our Laboratory, it will further accelerate our future research.
7. Analysis Environment
- Analysis Engine: Custom Hybrid Solver (C Language)
- PC: MacBook
- OS: macOS Monterey 12.7.6
- CPU: 1.2GHz Dual-Core Intel Core m5
- Memory: 8GB