We are independent & ad-supported. We may earn a commission for purchases made through our links.

Advertiser Disclosure

Our website is an independent, advertising-supported platform. We provide our content free of charge to our readers, and to keep it that way, we rely on revenue generated through advertisements and affiliate partnerships. This means that when you click on certain links on our site and make a purchase, we may earn a commission. Learn more.

How We Make Money

We sustain our operations through affiliate commissions and advertising. If you click on an affiliate link and make a purchase, we may receive a commission from the merchant at no additional cost to you. We also display advertisements on our website, which help generate revenue to support our work and keep our content free for readers. Our editorial team operates independently from our advertising and affiliate partnerships to ensure that our content remains unbiased and focused on providing you with the best information and recommendations based on thorough research and honest evaluations. To remain transparent, we’ve provided a list of our current affiliate partners here.

What Is Genetic Programming?

By N. Kalu
Updated May 16, 2024
Our promise to you
EasyTechJunkie is dedicated to creating trustworthy, high-quality content that always prioritizes transparency, integrity, and inclusivity above all else. Our ensure that our content creation and review process includes rigorous fact-checking, evidence-based, and continual updates to ensure accuracy and reliability.

Our Promise to you

Founded in 2002, our company has been a trusted resource for readers seeking informative and engaging content. Our dedication to quality remains unwavering—and will never change. We follow a strict editorial policy, ensuring that our content is authored by highly qualified professionals and edited by subject matter experts. This guarantees that everything we publish is objective, accurate, and trustworthy.

Over the years, we've refined our approach to cover a wide range of topics, providing readers with reliable and practical advice to enhance their knowledge and skills. That's why millions of readers turn to us each year. Join us in celebrating the joy of learning, guided by standards you can trust.

Editorial Standards

At EasyTechJunkie, we are committed to creating content that you can trust. Our editorial process is designed to ensure that every piece of content we publish is accurate, reliable, and informative.

Our team of experienced writers and editors follows a strict set of guidelines to ensure the highest quality content. We conduct thorough research, fact-check all information, and rely on credible sources to back up our claims. Our content is reviewed by subject matter experts to ensure accuracy and clarity.

We believe in transparency and maintain editorial independence from our advertisers. Our team does not receive direct compensation from advertisers, allowing us to create unbiased content that prioritizes your interests.

Genetic programming is the process of using one computer program to write another computer program using evolutionary algorithm-based methodology. This process is often compared to linear programming, in which the programmer writes specific instructions for the computer to carry out. LISP and Scheme are the most common programming languages for this type of work due to their high level functionality and flexibility. As a result of its conceptual similarity to biological evolution, genetic programming is often cited as an example of bio-inspired computing.

Genetic programs (GPs) work by generating and running thousands of programs and chooses the most effective to use. For example, a GP might be used to create a program to draw a sketch of a photograph. The first thing that the GP would do is create a set of programs that use various computer drawing functions in random combinations. Then the GP would run each of these programs in order, outputting the results of each to image files.

The next step for the GP is selecting the best of those programs from the set. This process is generally the most difficult part of genetic programming. In the case of the drawing program, the GP would use image comparison software to determine which of the random drawings was most similar to the image the software was attempting to draw. Of the randomly generated programs, the GP would select the top several and discard the rest. The selection process is known as fitness evaluation, and is generally considered to be the most difficult part of genetic programming.

Once the top few programs have been selected, the GP will use them as the basis of a new batch of programs. Each new batch is called a generation. The two ways of creating the new generation are mutation and crossover. Mutation works by taking one of the existing programs and making random changes to it, hopefully for the better. Crossover, also called breeding, works by taking two of the top programs and combining elements of them to create new programs.

After creating a new batch of programs, the GP repeats the process of running and evaluating them, and then repeats the selection, elimination, and generation processes. GPs will frequently run hundreds of generations before finding a single program with a satisfactory result. Despite this limitation, genetic programming is a common way to solve some types of difficult computing problems, including robotic engineering and artificial intelligence problems.

EasyTechJunkie is dedicated to providing accurate and trustworthy information. We carefully select reputable sources and employ a rigorous fact-checking process to maintain the highest standards. To learn more about our commitment to accuracy, read our editorial process.

Discussion Comments

By anon330743 — On Apr 18, 2013

@hamje32: To avoid random events such as the one you are talking about, each proposed solution is generally run several times to reduce the impact of one off lucky coincidences. Some randomness is usually introduced in the selection process as well, so that better programs only tend to be selected more often, but worse programs may be selected every now and then anyway. This is to reduce premature stagnation (where a local optimum is reached, and the fitness stagnates around that optimum).

By miriam98 — On Nov 18, 2011

@hamje32 - I don’t think that the genetic programming example given in the article is meant to be as completely random as you think. The way I understand it, the program draws a sketch using random functions.

That much is true. If the sketch is good, then the program is deemed good. I would think at that point, the program would try to figure out, so to speak, what it did correctly to draw that picture the right way.

The program would “learn” in other words, and subsequent drawing operations would not be so random. That’s how I take it. Genetic programming is supposed to constantly be feeding itself information about how to learn.

By hamje32 — On Nov 17, 2011

Perhaps I don’t understand it completely, but the randomness of the genetic programming model would be misleading. What if a program accidentally won a game of tic-tac-toe?

Does that mean we treat that program as “good” simply because it randomly won the game, and then move it up the evolutionary computing chain? Anyway, it does appear to work so I guess that I will have to just chalk it up to my own ignorance.

I just wish that the genetic programming model could be expanded to perform larger tasks, like write my own programs at the software company where I work.

EasyTechJunkie, in your inbox

Our latest articles, guides, and more, delivered daily.

EasyTechJunkie, in your inbox

Our latest articles, guides, and more, delivered daily.