# Genetic Algorithms & Genetic Programming

[**What is the difference?**](https://stackoverflow.com/questions/3819977/what-are-the-differences-between-genetic-algorithms-and-genetic-programming) **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.**<br>

**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. - peterjwest**<br>

![](https://lh4.googleusercontent.com/yPOIDc7UzG8oMQ4p5QiO4igfI0BToXt2GhQBRz2hVflRVFNw9dw88RP5qsXF3ZM5O7f_ytYT9ZGXXjqmeq5Et1UGi8jFZ2qPEfQsauYfrF1U0Qan2qSRThXNdvki2ZSG59BpWsK8)

**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.**

**johnIdol**<br>

![](https://lh3.googleusercontent.com/ueNhmSzZnl2VlTs44mnsdqeEckZvZ87jMhGY1bRAX8uuj9EW_m5BbXKpR70o1hv-yKX1z5_NGA4rHWzvkbPi2YtQSzTPvAqbPNRObNtPjHoWvnf9z_HYoYTG27iy0iAB6_Lnc5hi)
