Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Methods for crossover in genetic algorithms

When reading about the crossover part of genetic algorithms, books and papers usually refer to methods of simply swapping out bits in the data of two selected candidates which are to reproduce.

I have yet to see actual code of an implemented genetic algorithm for actual industry applications, but I find it hard to imagine that it's enough to operate on simple data types.

I always imagined that the various stages of genetic algorithms would be performed on complex objects involving complex mathematical operations, as opposed to just swapping out some bits in single integers.

Even Wikipedia just lists these kinds of operations for crossover.

Am I missing something important or are these kinds of crossover methods really the only thing used?

like image 969
TravisG Avatar asked Dec 17 '22 08:12

TravisG


2 Answers

There are several things used... although the need for parallelity and several generations (and sometimes a big population) leads to using techniques that perform well...

Another point to keep in mind is that "swapping out some bits" when modeled correctly resembles a simple and rather accurate version of what happens naturally (recombination of genes, mutations)...

For a very simple and nicely written walkthrough see http://www.electricmonk.nl/log/2011/09/28/evolutionary-algorithm-evolving-hello-world/

For some more info see

  • http://www.codeproject.com/KB/recipes/btl_ga.aspx
  • http://www.codeproject.com/KB/recipes/genetics_dot_net.aspx
  • http://www.codeproject.com/KB/recipes/GeneticandAntAlgorithms.aspx
  • http://www.c-sharpcorner.com/UploadFile/mgold/GeneticAlgorithm12032005044205AM/GeneticAlgorithm.aspx
like image 121
Yahia Avatar answered Jan 17 '23 13:01

Yahia


I always imagined that the various stages of genetic algorithms would be performed on complex objects involving complex mathematical operations, as opposed to just swapping out some bits in single integers.

You probably think complex mathematical operations are used because you think the Genetic Algorithm has to modify a complex object. That's usually not how a Genetic Algorithm works.

So what does happen? Well, usually, the programmer (or scientist) will identify various parameters in a configuration, and then map those parameters to integers/floats. This does limit the directions in which the algorithm can explore, but that's the only realistic method of getting any results.

Let's look at evolving an antenna. You could perform complex simulation with an genetic algorithm rearranging copper molecules, but that would be very complex and take forever. Instead, you'd identify antenna "parameters". Most antenna's are built up out of certain lengths of wire, bent at certain places in order to maximize their coverage area. So you could identify a couple of parameters: number of starting wires, section lengths, angle of the bends. All those are easily represented as integer numbers, and are therefor easy for the Genetic Algorithm to manipulate. The resulting manipulations can be fed into an "Antenna simulator", to see how well it receives signals.

In short, when you say:

I find it hard to imagine that it's enough to operate on simple data types.

you must realize that simple data types can be mapped to much more intricate structures. The Genetic Algorithm doesn't have to know anything about these intricate structures. All it needs to know is how it can manipulate the parameters that build up the intricate structures. That is, after all, the way DNA works.

like image 44
Ferry Boender Avatar answered Jan 17 '23 13:01

Ferry Boender