Page 25 - 49A Field Guide to Genetic Programming
P. 25
2.2 Initialising the Population 11
ROOT
Branches
...
Component Component Component
1 2 N
Figure 2.2: Multi-component program representation.
value returned by the last argument. However, fortunately, it is now ex-
tremely common in GP applications for all functions to have a fixed number
of arguments. If this is the case, then, the brackets in prefix-notation ex-
pressions are redundant, and trees can efficiently be represented as simple
linear sequences. In effect, the function’s name gives its arity and from the
arities the brackets can be inferred. For example, the expression (max (+ x
x) (+ x (* 3 y))) could be written unambiguously as the sequence max
+ x x + x * 3 y.
The choice of whether to use such a linear representation or an explicit
tree representation is typically guided by questions of convenience, efficiency,
the genetic operations being used (some may be more easily or more effi-
ciently implemented in one representation), and other data one may wish
to collect during runs. (It is sometimes useful to attach additional infor-
mation to nodes, which may be easier to implement if they are explicitly
represented).
These tree representations are the most common in GP, e.g., numer-
ous high-quality, freely available GP implementations use them (see the
resources in Appendix A, page 148, for more information) and so does also
the simple GP system described in Appendix B. However, there are other
important representations, some of which are discussed in Chapter 7.
2.2 Initialising the Population
Like in other evolutionary algorithms, in GP the individuals in the initial
population are typically randomly generated. There are a number of dif-
ferent approaches to generating this random initial population. Here we