# Genetic algorithms

The genetic algorithm is a method for solving both constrained and unconstrained optimization problems that is based on natural selection, the process that drives biological evolution. The genetic algorithm repeatedly modifies a population of individual solutions. At each step, the genetic algorithm selects individuals at random from the current population to be parents and uses them to produce the children for the next generation. Over successive generations, the population "evolves" toward an optimal solution. You can applyUse an idea, equation, principle, theory or law in relation to a given problem or issue. the genetic algorithm to solve a variety of optimization problems that are not well suited for standard optimization algorithms, including problems in which the objective function is discontinuous, nondifferentiable, stochastic, or highly nonlinear. The genetic algorithm can address problems of mixed integerA natural number, a negative of a natural number, or zero. programming, where some components are restricted to be integerA natural number, a negative of a natural number, or zero.-valued.^{[2]}

## Two videos to get you started

## UseApply knowledge or rules to put theory into practice. of genetic algorithms

- Click here for a fairly good list
- Click here for several good examples (scroll down)
- here are some short examples of GA

## The basic pattern of genetic algorithms

- A random set of solutions would be generated on the sample documents
- And tested against the human labelling
- Best fit solutions retained
- New generation created by mutating/crossing
- Algorithm repeated
- Until a good fit obtained

## Terms associated with genetic algorithms

### Initial population

Set of sub-optimal solutions which are provided as inputs to a genetic algorithm and from which an optimal solution evolves^{[3]}

### Fitness function

Fitness Function (also known as the Evaluation Function) evaluates how close a given solution is to the optimum solution of the desired problem. It determines how fit a solution is.

In genetic algorithms, each solution is generally represented as a string of binary numbers, known as a chromosome. We have to test these solutions and come up with the best set of solutions to solve a given problem. Each solution, therefore, needs to be awarded a score, to indicate how close it came to meeting the overall specification of the desired solution. This score is generated by applying the fitness function to the test, or results obtained from the tested solution.^{[4]}

### Selection

Selection rules select the individuals, called parents, that contribute to the population at the next generation.

### Crossover

Crossover rules combine two parents to form children for the next generation.

### Mutation

Mutation rules applyUse an idea, equation, principle, theory or law in relation to a given problem or issue. random changes to individual parents to form children.

## Helpful resources

- This article is a good place to get started
- a good game: https://andymakes.itch.io/combat-genetics
- a better game to help you understand genetic algorithms: https://david-birge-cotte.itch.io/evolution-sandbox

## Standards

- OutlineGive a brief account. the use of genetic algorithms.