Library tutorials & articles
An Introduction to Genetic Algorithms
- Overview
- How Does It Work?
- Mutation and Crossover
- Putting It All Together
Mutation and Crossover
As their names suggest, mutation and crossover are terms which derive from evolution. Firstly mutation, the theory is simple, in the same way that human beings and animals vary from generation to generation, random bits (genes!) are randomly altered from 1 to 0 and vice versa each time we loop back to the start (generation!). Imagine a group of 5 guesses (population!), guesses 1 to 5:
By randomly mutating the last 4 characters in guess3 to 1000 a slightly different guess is produced. This mutation is necessary to ensure that all the solutions do not become the same too quickly.
Crossover is like breeding animals or humans, in that two guesses are selected (parents!) to combine and form two different guesses (children!), imagine two guesses which are selected at random from our five above:
guess1 – 1, 9 - 00011001
guess4 – 3, 5 - 00110101
They are split in half and the bits after the split are swapped over to produce two different guesses:
0001 0101
0011 1001
Then stuck back together two make two new guesses:
guess1 – was 1,9 - 00011001 – now 00010101 = 1, 5
guess2 – was 3,5 – 00110101 – now 00111001 = 3, 9
Related articles
Related discussion
-
VS2005 app's won't run on another machine
by ted4444 (0 replies)
-
VB.NET: Hide and show table using radio buttons
by converter2009 (1 replies)
-
Convert C++ code to VB6
by mawcot (4 replies)
-
How to create a games like FIFA08
by mawcot (0 replies)
-
Binary Studio | software development outsourcing Ukraine
by shane124 (4 replies)
Can give to us about detail of GAs, and another important application of this algorithm especially in Robot?
This thread is for discussions of An Introduction to Genetic Algorithms.