Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Genetic programming
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Methods== ===Program representation=== [[Image:Genetic Program Tree.png|frame|A function represented as a [[tree structure]] ]] {{Main | genetic representation}} GP evolves computer programs, traditionally represented in memory as [[tree (data structure)|tree structure]]s.<ref name="sover1985">Nichael L. Cramer [http://www.sover.net/~nichael/nlc-publications/icga85/index.html "A Representation for the Adaptive Generation of Simple Sequential Programs"] {{Webarchive|url=https://web.archive.org/web/20051204112804/http://www.sover.net/~nichael/nlc-publications/icga85/index.html |date=2005-12-04 }}.</ref> Trees can be easily evaluated in a recursive manner. Every internal node has an operator function and every terminal node has an operand, making mathematical expressions easy to evolve and evaluate. Thus traditionally GP favors the use of [[programming language]]s that naturally embody tree structures (for example, [[Lisp (programming language)|Lisp]]; other [[Functional programming|functional programming languages]] are also suitable). Non-tree representations have been suggested and successfully implemented, such as [[linear genetic programming]] which perhaps suits the more traditional [[imperative languages]].<ref>Genetic Programming: An Introduction, Wolfgang Banzhaf, Peter Nordin, Robert E. Keller, Frank D. Francone, Morgan Kaufmann, 1999. ISBN 978-1558605107</ref><ref>Garnett Wilson and Wolfgang Banzhaf. [http://www.cs.mun.ca/~banzhaf/papers/eurogp08_clgp.pdf "A Comparison of Cartesian Genetic Programming and Linear Genetic Programming"]</ref> The commercial GP software ''Discipulus'' uses automatic induction of binary machine code ("AIM")<ref>([[Peter Nordin]], 1997, Banzhaf et al., 1998, Section 11.6.2-11.6.3)</ref> to achieve better performance. ''ΞΌGP''<ref>{{cite web|url=http://ugp3.sourceforge.net/|title=ΞΌGP (MicroGP)|author=Giovanni Squillero}}</ref> uses [[directed multigraph]]s to generate programs that fully exploit the syntax of a given [[assembly language]]. [[Multi expression programming]] uses [[Three-address code]] for encoding solutions. Other program representations on which significant research and development have been conducted include programs for stack-based virtual machines,<ref>{{Cite web|url=http://gpbib.cs.ucl.ac.uk/gp-html/ieee94_perkis.html|title=Stack-Based Genetic Programming|website=gpbib.cs.ucl.ac.uk|language=en|access-date=2021-05-20}}</ref><ref name="Spector 7β40">{{Cite journal|last1=Spector|first1=Lee|last2=Robinson|first2=Alan|date=2002-03-01|title=Genetic Programming and Autoconstructive Evolution with the Push Programming Language|journal=Genetic Programming and Evolvable Machines|language=en|volume=3|issue=1|pages=7β40|doi=10.1023/A:1014538503543|s2cid=5584377|issn=1389-2576}}</ref><ref>{{Cite book|last1=Spector|first1=Lee|last2=Klein|first2=Jon|last3=Keijzer|first3=Maarten|title=Proceedings of the 7th annual conference on Genetic and evolutionary computation |chapter=The Push3 execution stack and the evolution of control |date=2005-06-25|publisher=ACM|pages=1689β1696|doi=10.1145/1068009.1068292|isbn=978-1595930101|citeseerx=10.1.1.153.384|s2cid=11954638}}</ref> and sequences of integers that are mapped to arbitrary programming languages via grammars.<ref>{{Cite book|title=Lecture Notes in Computer Science|last1=Ryan|first1=Conor|last2=Collins|first2=JJ|last3=Neill|first3=Michael O|date=1998|publisher=Springer Berlin Heidelberg|isbn=9783540643609|location=Berlin, Heidelberg|pages=83β96|doi = 10.1007/bfb0055930|citeseerx = 10.1.1.38.7697}}</ref><ref>{{Cite journal|last1=O'Neill|first1=M.|last2=Ryan|first2=C.|s2cid=10391383|date=2001|title=Grammatical evolution|journal=IEEE Transactions on Evolutionary Computation|language=en-US|volume=5|issue=4|pages=349β358|doi=10.1109/4235.942529|issn=1089-778X}}</ref> [[Cartesian genetic programming]] is another form of GP, which uses a graph representation instead of the usual tree based representation to encode computer programs. Most representations have structurally noneffective code ([[intron]]s). Such non-coding genes may seem to be useless because they have no effect on the performance of any one individual. However, they alter the probabilities of generating different offspring under the variation operators, and thus alter the individual's [[variational properties]]. Experiments seem to show faster convergence when using program representations that allow such non-coding genes, compared to program representations that do not have any non-coding genes.<ref>Julian F. Miller. [https://www.springer.com/cda/content/document/cda_downloaddocument/9783642173097-c2.pdf "Cartesian Genetic Programming"] {{Webarchive|url=https://web.archive.org/web/20150924123354/http://www.springer.com/cda/content/document/cda_downloaddocument/9783642173097-c2.pdf |archive-url=https://web.archive.org/web/20150924123354/http://www.springer.com/cda/content/document/cda_downloaddocument/9783642173097-c2.pdf |archive-date=2015-09-24 |url-status=live |date=2015-09-24 }}. p. 19.</ref><ref> Janet Clegg; James Alfred Walker; Julian Francis Miller. [http://www.cs.bham.ac.uk/~wbl/biblio/gecco2007/docs/p1580.pdf A New Crossover Technique for Cartesian Genetic Programming"]. 2007.</ref> Instantiations may have both trees with introns and those without; the latter are called canonical trees. Special canonical crossover operators are introduced that maintain the canonical structure of parents in their children. ===Initialisation=== The methods for creation of the initial population include:<ref>{{cite journal |last1=Walker |first1=Matthew |title=Introduction to Genetic Programming |journal=Massey University |date=2001}}</ref> * '''Grow''' creates the individuals sequentially. Every GP tree is created starting from the root, creating functional nodes with children as well as terminal nodes up to a certain depth. * '''Full''' is similar to the ''Grow''. The difference is that all brunches in a tree are of same predetermined depth. * '''Ramped half-and-half''' creates a populations consisting of <math>md-1</math> parts and a maximum depth of <math>md</math> for its trees. The first part has a maximum depth of 2, second of 3 and so on up to the <math>md-1</math>-th part with maximum depth <math>md</math>. Half of every part is created by ''Grow'', while the other part is created by ''Full''. ===Selection=== Selection is a process whereby certain individuals are selected from the current generation that would serve as parents for the next generation. The individuals are selected probabilistically such that the better performing individuals have a higher chance of getting selected.<ref name="field guide" /> The most commonly used selection method in GP is [[tournament selection]], although other methods such as [[fitness proportionate selection]], lexicase selection,<ref>{{Cite book|last=Spector|first=Lee|title=Proceedings of the 14th annual conference companion on Genetic and evolutionary computation |chapter=Assessment of problem modality by differential performance of lexicase selection in genetic programming |url=https://dl.acm.org/citation.cfm?id=2330846|pages=401β408|language=en-US|publisher=ACM|doi=10.1145/2330784.2330846|year=2012|isbn=9781450311786|series=Gecco '12|s2cid=3258264}}</ref> and others have been demonstrated to perform better for many GP problems. Elitism, which involves seeding the next generation with the best individual (or best ''n'' individuals) from the current generation, is a technique sometimes employed to avoid regression. ===Crossover=== [[File:Genetic_programming_subtree_crossover.gif|thumb|Genetic programming subtree crossover]] In Genetic Programming two fit individuals are chosen from the population to be parents for one or two children. In tree genetic programming, these parents are represented as inverted lisp like trees, with their root nodes at the top. In subtree crossover in each parent a subtree is randomly chosen. (Highlighted with yellow in the animation.) In the root donating parent (in the animation on the left) the chosen subtree is removed and replaced with a copy of the randomly chosen subtree from the other parent, to give a new child tree. Sometimes two child crossover is used, in which case the removed subtree (in the animation on the left) is not simply deleted but is copied to a copy of the second parent (here on the right) replacing (in the copy) its randomly chosen subtree. Thus this type of subtree crossover takes two fit trees and generates two child trees. The tree-based approach in Genetic Programming also shares structural and procedural similarities with earlier knowledge-based and topology-oriented crossover methods. Specifically, analogous crossover and homologous crossover, both implemented in robot trajectory planning, exhibit a resemblance to subtree operations in tree GP. These crossover mechanisms were described in the context of heuristic optimisation strategies in robotics.<ref>Davidor, Y. (1991). Genetic Algorithms and Robotics: A Heuristic Strategy for Optimization. World Scientific Series in Robotics and Intelligent Systems: Volume 1.</ref> ===Replication=== Some individuals selected according to fitness criteria do not participate in crossover, but are copied into the next generation, akin to asexual reproduction in the natural world. They may be further subject to mutation. ===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. Similarly there are many types of linear genetic programming mutation, each of which tries to ensure the mutated child is still syntactically correct.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)