4

A while back I recall reading a magazine article (in Wired I believe) about applying Darwinian evolution to programs to create better programs. Essentially multiple mutations of a program would be spawned, and the one that performed the best would be selected for the next round of mutations.

Unforunately I can't make the subject sound nearly as interesting as is sounded in the article, but I can't find the article.

Since this sounds like just the coolest thing ever to me, I was wondering what mutations one could have inside of a program

manlio
  • 18,345
  • 14
  • 76
  • 126
John Moffitt
  • 5,730
  • 7
  • 30
  • 39
  • This is really subjective; you might get some good answers on [Programmers SE](http://programmers.stackexchange.com) though. – Pops Oct 07 '10 at 15:48
  • 3
    I removed the `darwin` tag as it means an Apple related platform on SO, not the scientist. – Péter Török Oct 07 '10 at 15:50
  • Are you talking about genetic algorithms? – aperkins Oct 07 '10 at 15:51
  • 1
    I know that this has been used successfully for developing hardware through simulation. Personally I think the hardest part wouldn't be the mutations, it would be picking good environmental constraints and selective pressures. – Tesserex Oct 07 '10 at 15:52
  • @Torgamus - How is it subjective? He's not asking whether it's worth doing or anything, just what you can do. – AaronM Oct 07 '10 at 15:53
  • I'm not realy sure what I'm talking about actually. I've been googling it for the last hour or so, first trying to find the original article and then anything related to something similar to this at all and I couldn't find anything. – John Moffitt Oct 07 '10 at 15:55
  • @Tesserex: In my very limited experience (I did precisely one similar project), the problem was coming up with a representation that encoded all possible values and avoided impossible ones, along with the scoring. In other words, what you said. – David Thornley Oct 07 '10 at 16:17

5 Answers5

4

Yes. It is called Genetic Programming, where a master program that writes programs itself. And the programs it writes can evolve to a certain criterion.

E.g. 8 queen could be solved by GP.

Yin Zhu
  • 16,980
  • 13
  • 75
  • 117
2

I think you're referring to Genetic Algorithms. I want to work on this topic for my dissertation. I can't stop reading about it :-)

Nobody
  • 4,731
  • 7
  • 36
  • 65
1

Found this article/paper - is this what you're referring to?. Also found this PDF. Quite an interesting topic

What it sounds like is that you could use self-modifying code that reproduces the program itself based on self-monitoring optimizations. This would currently point at interpreted-language programs.

slashmais
  • 7,069
  • 9
  • 54
  • 80
0

As said before it's called Genetic Programming (GP).

The interesting thing is that GP is a systematic, domain-independent method for getting computers to solve problems automatically starting from a high-level statement of what needs to be done.

Using ideas from natural evolution, GP starts from a population of random computer programs and progressively refines them through processes of mutation and crossover (recombination), until solutions emerge.

All this without the user having to know or specify the form or structure of solutions in advance.

GP has generated a plethora of human-competitive results and applications, including novel scientific discoveries and patentable inventions (see also What are good examples of genetic algorithms/genetic programming solutions?).

I was wondering what mutations one could have inside of a program

There are many genetic operators (not only mutation) and many implementations. The fundamental property they are required to have is closure (they must mantain the structural integrity of the genetic program).

In general mutation replaces a symbol of the program with a compatible terminal / function choosen from a group of available symbols. Crossover operator mixes the information of two or more programs.

Probably the best free introduction to the subject is A Field Guide to Genetic Programming

Some nice links are:

Community
  • 1
  • 1
manlio
  • 18,345
  • 14
  • 76
  • 126
0

I read an article on Coding Horror about something like that the other day: Go That Way, Really Fast. Basically, the idea I got from it was that software should constantly be improved which means constantly pushing out new versions/releases. This seems to match the idea of evolution in that your software is always improving into something better.

Anthony
  • 9,451
  • 9
  • 45
  • 72
  • New releases of software aren't evolution (in the darwinian sense). (casual) Software is planned - evolution isn't. Software can change radically within one release - evolution is very slow. –  Oct 07 '10 at 16:27
  • After reading the other posted articles, I got that sense. I've never heard of Genetic Programming before. – Anthony Oct 07 '10 at 17:55