User:Pginty13/sandbox/Linear genetic programming

From Wikipedia, the free encyclopedia

Linear genetic programming (LGP) is a subcategory of genetic programming (GP). Genetic programming is computerized testing and combination of a randomly generated population of computer programs to find a solution to a problem. In LGP, programs are executed in a linear fashion rather than the tree data structure of traditional GP. Linear genetic programs can be written in an imperative programming language such as C rather than a functional programming language like LISP.

Genetic Programming[edit]

Genetic programming applies Darwin's principle of natural selection to computer programs, running many combinations of randomly generated programs to get the best result possible (and hopefully solving the problem). LGP compares different programs based on a measure called fitness. Fitness represents how close a program is to solving the problem that the algorithm was intended to solve. Very unfit programs are discarded, while relatively fit programs are modified to find fitter ones (see Variation Operations) until eventually a solution is found.

LGP vs. Traditional GP[edit]

Typical genetic programming involves computer programs represented in memory as tree structures. In LGP, however, computer programs are represented as sequences of instructions. This representation of programs lends itself to writing program code in common imperative programming languages like C or Java. Traditional GP program structure, in contrast, lends itself to functional programming languages like LISP.[1] Because of the high level of thinking involved with functional programming combined with the popularity of imperative programming, LGP is open to a wider range of programmers than traditional tree-based GP.

Instructions in LGP[edit]

In LGP, the set of operations that can be performed on an individual (program) is composed of arithmetic operations, conditional branches, and function calls. These operations are what LGPs use to attempt to solve the problem.

Instructions are either executed on two variables (operand variables), or on one variable and one integer constant. Below is a table illustrating the types of instructions in LGP.[2]

(**)

Each instruction in LGP is kept in memory as a four-dimensional vector. This vector holds the instruction identifier (instruction type), the indexes of variables to be executed on, and optionally a constant value.

For example; consider the code segment (**).[2] This instruction would be represented as the vector (id(+),i,j,c). The first vector component represents the operation, the second and third represent the indexes of variables to be used, and the fourth component represents a constant c.

Introns[edit]

An intron is a part of a program that has no influence on the output. These exist due to the random nature of genetic programming – certain randomly generated instructions will have no effect at all on data inputs. The following is an example of an intron inside a program.[2]

       v[0] = v[0] + 1;
       v[0] = v[0] – 1;

Notice that this code segment will not have any effect on v[0], the variable that is supposed to be changed by the command.

Introns cause a problem in genetic programming because they waste a lot of time by forcing the computer to execute statements that do not affect the output. A major advantage to linear genetic programming over tree-based programming is that program structure allows for efficient removal of introns before they are executed countless times. This speeds up runtimes of LGPs significantly as compared to tree-based GPs.

A good estimate of runtime acceleration by intron removal is given by the following equation.[2] (**) For example, if 40% of code is introns, your program will be about 67% faster if introns are removed at runtime. This is a significant time saver when dealing with a very large and complex LGP.

Variation Operations[edit]

A very important aspect of any genetic program is the methods it uses to vary the programs it is working with. Most GPs use a combination of some or all of the following variation operations[2]:

• Reproduction – Copy a program without any changes.

• Recombination – Exchange substructures between two programs.

• Mutation – Exchange a segment of code inside a program at a random position.

These basic operations allow programs to mutate and eventually become improved versions of themselves.

Uses and Applications[edit]

In the 1990s, when genetic programming was beginning to gain popularity, GPs were often only used to solve simple tasks due to high computational intensity. With the recent massive gains in computer speeds and memory, however, GPs have been able to produce outstanding results in areas such as quantum computing, electronic design, and game playing.[3]

As GPs in general and LGPs in particular continue to advance technologically, the possibilities for applications of this coding technique advance significantly as well. Computer programs that program themselves is a very powerful technology with an exciting future.

References[edit]

[3] [4] [2] [5] [1] [6]

  1. ^ a b Dillon, L. "Functional vs. Imperative Programs". Michigan State University. {{cite web}}: |access-date= requires |url= (help); Missing or empty |url= (help)
  2. ^ a b c d e f Banzhaf, Wolfgang; Brameier, Markus (2007). Linear Genetic Programming. Springer. {{cite book}}: |access-date= requires |url= (help)
  3. ^ a b Genetic Programming Inc. http://www.genetic-programming.com/humancompetitive.html. Retrieved 16 November 2014. {{cite web}}: Missing or empty |title= (help)
  4. ^ Abraham, Ajith; Ramos, Vitorino. "Web Usage Mining Using Artificial Ant Colony Clustering and Genetic Programming". {{cite journal}}: |access-date= requires |url= (help); Cite journal requires |journal= (help)
  5. ^ Banzhaf, Wolfgang; Garnett, Wilson. "A Comparison of Cartesian Genetic Programming and Linear Genetic Programming". {{cite web}}: |access-date= requires |url= (help); Missing or empty |url= (help)
  6. ^ "Genetic Programming". Retrieved 14 November 2014.