Genetic Algorithms & Genetic Programming
Genetic algorithms and genetic programming are easy to confuse, because both evolve an answer instead of fitting one. The short version is that GA evolves parameters and GP evolves programs or expressions. The page first shows what the two share, in peterjwest's words, and then what separates them, in johnIdol's.
The evolutionary idea also shows up elsewhere in the book. The same notes are in Learning Classifier Systems, ML Systems, and NEURO EVOLUTION (GA/GP based).
The question itself comes from the Stack Overflow thread What is the difference?, and the first answer starts with what the two have in common. Genetic programming and genetic algorithms are very similar. They are both used to evolve the answer to a problem, by comparing the fitness of each candidate in a population of potential candidates over many generations. Each generation, new candidates are found by randomly changing (mutation) or swapping parts (crossover) of other candidates. The least 'fit' candidates are removed from the population. That answer is by peterjwest, and the figure below draws the same loop.

Once the shared loop is clear, the difference is what a single individual is. Genetic algorithms (GA) are search algorithms that mimic the process of natural evolution, where each individual is a candidate solution: individuals are generally "raw data" (in whatever encoding format has been defined). Genetic programming (GP) is considered a special case of GA, where each individual is a computer program (not just "raw data"). GP explore the algorithmic search space and evolve computer programs to perform a defined task. That distinction is johnIdol's answer in the same thread, and the second figure shows GP sitting inside GA.

Last updated
Was this helpful?