Skip to content

Repository files navigation

bb4-optimization

CI

📊 Build status for all bb4 projects

Heuristic search and optimization algorithms for continuous and discrete parameter spaces. Implement an Optimizee, pick a strategy (hill climbing, simulated annealing, genetic search, and others), and let Optimizer find a good solution — used by bb4-puzzles, bb4-games, and bb4-simulations. Algorithms largely follow Michalewicz and Fogel's How to Solve It: Modern Heuristics.

Using it

implementation 'com.barrybecker4:bb4-optimization:2.0.0'

See the releases page or Maven Central for newer versions.

What's inside

  • Optimizer — facade that runs a chosen strategy against an Optimizee (optional logging, listeners, evaluation budget)
  • Optimizee / AbsoluteOptimizee — interface (and absolute-fitness adapter) for the thing being optimized; fitness is minimized (0 is best)
  • BudgetedOptimizee — wraps an optimizee with a hard evaluation limit
  • DiscreteStateSpace — marker for discrete problems used with state-space search
  • OptimizationStrategyType — hill climbing, global sampling / global hill climbing, simulated annealing, genetic search (including concurrent), state-space search, and brute force
  • parameter — typed parameters (DoubleParameter, IntegerParameter, BooleanParameter, …), arrays (NumericParameterArray, PermutedParameterArray, VariableLengthIntSet), sampling, distance metrics, and optional redistribution functions
  • viewer / OptimizerEvalApp — Swing UI that visualizes strategies on demo problems (./gradlew run)

Building from source

See the Building bb4 Projects wiki.

License

MIT — see LICENSE.

Releases

Packages

Used by

Contributors

Languages