Genetic programming: Difference between revisions

Content deleted Content added
Line 59:
 
===Mutation===
[[File:Genetic programming mutation.gif|thumb|Animation of creating genetic programing child by mutating parent removing subtree and replacing with random code]]
There are many types of mutation in genetic programming. They start from a fit syntactically correct parent and aim to randomly create a syntactically correct child. In the animation
a subtree is randomly chosen (highlighted by yellow). It is removed and replaced by a randomly generated subtree.
 
Other mutation operators select a leaf (external node) of the tree and replace it with a randomly chosen leaf. Another mutation is to select at random a function (internal node) and replace it with another function with the same arity (number of inputs). Hoist mutation randomly chooses a subtree and replaces it with a subtree within itself. Thus hoist mutation is guaranteed to make the child smaller. Leaf and same arity function replacement ensure the child is the same size as the parent. Whereas subtree mutation (in the animation) may, depending upon the function and terminal sets, have a bias to either increase or decrease the tree size. Other subtree based mutations try to carefully control the size of the replacement subtree and thus the size of the child tree.
[[File:Genetic programming mutation.gif|thumb|Animation of creating genetic programing child by mutating parent removing subtree and replacing with random code]]
 
Similarly there are many types of linear genetic programming mutation, each of which tries to ensure the mutated child is still syntactically correct.