Gene expression programming (GEP) is an evolutionary technique for developing specific mathematical equations or functions. A chromosome encodes an expression tree rather than a fixed parameter vector: operators, constants, and inputs are placed in an order that defines how the resulting equation is evaluated. Fitness compares that equation’s output with a target, allowing selection and genetic variation to search for a better function. section 1.1.1 section 4.1.1
GEP is related to genetic programming (GP) and genetic algorithms (GAs), but its emphasis is mathematical expressions. GP can represent program logic or high-level functions; GEP represents an equation tree with a well-defined order of operations. This makes evolved candidates inspectable and potentially reusable as functions rather than opaque model approximations. section 1.1.1 section 4.1.1
A practical GEP setup defines the search space and evaluation loop:
- Create a primitive set of input variables, arithmetic operators, and ephemeral constants; include protected division when invalid numerical results must be contained. section 12.1 section 4.1.1
- Specify gene head length, chromosome gene count, and a linker for combining multiple genes into an individual. section 12.1
- Compile each individual into a callable function, run it over sample inputs, and return an error-based fitness such as mean absolute error. section 12.1
- Run evolutionary search with a population, generations, elites, mutation operators, and crossover operators; retain top candidates in a hall of fame. section 12.1
- Simplify and visualize the best expression tree to inspect the equation that evolution produced. section 12.1
Evolving a linear equation
Given samples from f(x1) = 6 × x1 + 22, a Geppy search uses addition, subtraction, multiplication, protected division, and random constants to evolve a matching function. With a population of 100 over 100 generations, the simplified best individual is reported as 6*x1 + 22. section 12.1
Trace how an ordered gene sequence becomes an uneven expression tree, an evaluable equation, and finally a fitness value. section 4.1.1
