feat(algorithms): add SimulatedAnnealing single-objective local search

Classic Kirkpatrick et al. 1983 SA: hill climber that also accepts
worse moves with probability `exp(-Δ/T)` where T anneals geometrically
from `initial_temperature` to `final_temperature` over the iteration
count.

Single-objective only. Generic over decision type — works on real
vectors, bool vectors, permutations, anything. Tracks the best-seen
incumbent across the run (not just the last accepted move) so the
result reflects the actual best ever visited, not where the random
walk happened to end.

Tests cover: convergence on Sphere1D under reasonable hyperparameters,
deterministic reruns, panic on multi-objective, panic on
non-positive temperatures.
This commit is contained in:
2026-05-05 09:51:10 -06:00
parent a93d0df858
commit 35fbf622f2
3 changed files with 250 additions and 1 deletions
+2 -1
View File
@@ -24,5 +24,6 @@ pub use crate::operators::{
pub use crate::algorithms::{
DifferentialEvolution, DifferentialEvolutionConfig, HillClimber, HillClimberConfig,
Moead, MoeadConfig, Nsga2, Nsga2Config, Nsga3, Nsga3Config, Paes, PaesConfig,
RandomSearch, RandomSearchConfig, Spea2, Spea2Config,
RandomSearch, RandomSearchConfig, SimulatedAnnealing, SimulatedAnnealingConfig,
Spea2, Spea2Config,
};