Ascension

December 28, 2019 · View on GitHub

A metaheuristic optimization framework. See the project homepage for an overview and notable results (please note that many of the described features had to be omitted from the 2.0 release).

How to use the framework

Copy a problem definition module (PDM) from the problems into the project folder, rename it to problem.pas, then compile (I recommend using Lazarus IDE) and run Ascension. Algorithm parameters are specified in the Config.ini file. Several files are created during the optimization process:

FileDescription
XX_StatusStatus file containing the data about the optimization process (XX is the abbreviated algorithm name)
XX_BestThe best solution found during the optimization.
RunsInformation about the results of multiple optimization runs
Runs_BestThe best solution found during multiple optimization runs

Included PDMs

FileProblem
Problem_2DHP.pasHydrophobic-polar protein folding model
Problem_3DNQ.pas3D N queens
Problem_BinTexGen.pasBinary texture generation
Problem_Chess_Covering.pasQueen (non)domination, knights covering
Problem_NQ.pasN queens
Problem_No_Subsquares.pasMaximal density subsquare-free arrangements
Problem_Peaceable_Queens.pasPeaceable queens
Problem_Still_Life.pasMaximal density still life

See the description section inside of each file for more details.

How to create a PDM

You can specify your own problem by creating a problem.pas file that supplies the types and routines required by each metaheuristic (full list can be found in interface.inc). See Problem_NQ.pas from the problems folder for an example of a complete PDM. If you don't need a certain algorithm, the corresponding definitions can be effectively omitted by placing a {$I DummyXX.inc} line at the end of the file.

Config parameters

Global Parameters

ParameterDescription
AlgorithmOptimization algorithm
⇢"SA"Simulated Annealing
⇢"GA"Genetic Algorithm
⇢"LS"Local Search
⇢"TS"Tabu Search
⇢"CTS"Cooperative Tabu Search
NRunsNumber of independent algorithm runs
ScoreToReachThe desired value of the score function, can be used by stopping criteria
ParameterDescription
ModeLocal search mode.
⇢"First"Pick the first improving move from a move list
⇢"Best"Pick the best move from a move list
⇢"Chain"Sort all moves by score, then try to sequentially apply all improving moves in order from best to worst
StatusItersInterval between saving the data about optimization process to a status file, nothing is saved if set to zero
ParameterDescription
IterationsTotal number of iterations
PopSizePopulation size (cooperative variant only)
StatusItersInterval between saving the data about optimization process to a status file, nothing is saved if set to zero

Simulated Annealing

ParameterDescription
IterationsTotal number of iterations
T0Initial temperature, used if T0Mode is "Manual"
TfinFinal temperature, used if TfinEBased is No
dEmaxMaximal change of energy, used if T0Mode is "EBased"
dEminMinimal change of energy, used if TfinEBased is Yes
T0ModeInitial temperature selection
⇢"Manual"Determined by T0
⇢"EBased"Calculated based on dEmax
⇢"AutoLow"Automatic selection, lower temperature mode
⇢"AutoHigh"Automatic selection, higher temperature mode
TfinEBasedFinal temperature selection
⇢NoDetermined by Tfin
⇢YesCalculated based on dEmin
AcceptanceAcceptance function
⇢"Exp"Exp(-xp)
⇢"Power"1 / (1 + xp)
⇢"Tsallis"(1 - (1 - p) x)1 / (1 - p)
⇢"Threshold"(1 - Sign(x - 1)) / 2
⇢"Barker"1 / (1 + Exp(x))
AcceptancePAcceptance function parameter
ScheduleCooling schedule type
⇢"Zero"T = 0
⇢"Log"T ~ 1 / (C + Ln(1 + t / L))
⇢"Power"T ~ (1 + t / L)p
⇢"Exp"T ~ Exp(-(t / L)p)
SchedulePCooling schedule parameter
NReheatNumber of reheating stages, no reheating if set to 1
FastReheatDetermines the duration of reheating stages
⇢NoEach reheating stage takes the same number of iterations
⇢YesLater reheating stages take less iterations
SmoothingThe amount of smoothing applied when calculating statistics for the status file
StatusItersInterval between saving the data about optimization process to a status file, nothing is saved if set to zero.

Genetic Algorithm

See the algorithm page for a detailed description of selection, replacement and acceptance parameters.

ParameterDescription
PopulationSizeNumber of individuals in the population
SelectionMethod of selecting individuals for reproduction
SelectionPSelection parameter
ReplacementMethod of selecting which individual to replace
ReplacementPReplacement parameter
AcceptanceCriterion for determining whether the solution picked by Replacement method actually gets replaced
StopCriterionCriterion for stopping the algorithm
⇢"MaxGens"Maximal number of generations is reached
⇢"MaxNFE"Maximal number of function evaluations is reached
⇢"Score"ScoreToReach is reached
StatusGensInterval in generations between saving the data about optimization process to a status file, nothing is saved if set to zero
SaveGensInterval in generations between saving the population, nothing is saved if set to zero

Acknowledgements

This project has been supported by the following patrons via Patreon:

  • Brian Bucklew
  • Anton Shepelev
  • Adam Hill
  • John Metcalf
  • Tomoyuki Naito