Termination condition

From Computer Science Wiki
Advanced programming[1]

Termination condition is an expression or a mathematical equation that consists of variables, constants, or operators that define movement. Such as in algorithms, when a termination condition is being used for analysis, the condition will terminate after specific set of time, after a specific event that has occurred, or when the condition is fulfilled. In relation to genetic algorithms, the algorithm will terminate when there is a maximum number of generations that have been produced, or there is a satisfied fitness level reached for the population. Termination is useful for genetic algorithms in determining when the algorithm will end.[2]

For example, in a genetic algorithm we keep a counter which keeps track of the generations for which there has been no improvement in the population. we set this counter to zero. Each time we don’t generate off-springs which are better than the individuals in the population, we increment the counter. [3]