Population Methods#

Population-based optimizers maintain multiple candidate solutions that evolve together. They are excellent for complex, multi-modal optimization landscapes.

These methods are inspired by natural processes like evolution and swarm behavior, using populations of solutions that interact and improve over generations.

Particle Swarm Optimization#

Particles “fly” through the search space, influenced by their own best position and the swarm’s best position.

from hyperactive.opt.gfo import ParticleSwarmOptimizer

optimizer = ParticleSwarmOptimizer(
    search_space=search_space,
    n_iter=5,
    experiment=objective,
)

Genetic Algorithm#

Evolves a population using selection, crossover, and mutation inspired by biology.

from hyperactive.opt.gfo import GeneticAlgorithm

optimizer = GeneticAlgorithm(
    search_space=search_space,
    n_iter=5,
    experiment=objective,
)

Evolution Strategy#

Similar to genetic algorithms but focused on real-valued optimization.

Differential Evolution#

Uses vector differences to guide mutation. Excellent for continuous optimization.

Parallel Tempering#

Runs multiple chains at different “temperatures” and exchanges information between them.

Spiral Optimization#

Particles spiral toward the best solution found so far.

When to Use Population Methods#

Population-based optimizers are best suited for:

  • Multi-modal landscapes: Problems with many local optima

  • Complex interactions: When parameters interact in non-obvious ways

  • Robustness: When you need reliable solutions across different runs

  • Exploration: When thorough coverage of the search space is important

Consider using model-based methods if:

  • Evaluations are very expensive (population methods need many evaluations)

  • You want to leverage information from previous evaluations more efficiently