2.4 Graphs in Evolutionary Computation
2.4.1 Cartesian Genetic Programming
CGP is a graph-based EA with a wide variety of applications. In this section, we describe the basic approach and a number of extensions to CGP that have been proposed. For more detail and an up-to-date survey on the status of CGP, refer to [158].
The main principle (from our graph-based perspective) of CGP is that an individual is represented by a graph with a fixed and ordered set of nodes [157]; a node may only be the source of edges that target nodes with an earlier position in the ordering. Each node represents a function that is applied to its inputs (given by its outgoing edges). In many modern works, this is a total ordering where one can imagine nodes arranged in a line with connections allowed only to the left. However, earlier works [154, 157] often used a partial ordering where one can imagine nodes arranged in a 2-dimensional grid, again with connections only allowed to the left. For our discussion, we use the former notion, as this is more prevalent in modern CGP usage e.g. [165, 226, 245]. In CGP publications such as [154, 157], this is often implemented via an encoding where solutions are linear sequences of integers that are decoded into DAGs. We give a typical genotype/phenotype mapping in CGP in Figure 2.17. The most commonly used mutations take two forms; they can either re-label a node with a different function, or they can redirect edges while respecting the given ordering. A number of other mutation operators have been proposed in the literature which have various benefits and costs [76, 77]. The current advice is to use CGP with mutations only, rather than with crossover [155, 243], alongside the 1 + λ EA. This approach1 sees a single individual survive in each generation which is then copied and mutated to generate λ children. However, a number of works have explored the use of crossover in CGP, including uniform crossover [154], arithmetic crossover on a vector representation [41], and subgraph crossover [112]. Empirical comparison [106] shows that crossover operators do not always aid performance and that CGP with mutation only can sometimes be the best performing approach.
Figure 2.17 highlights that a node (in this case, the AND node) may be the input of no other node in the graph, and therefore contribute nothing to the output. These inactive nodes can build substructures which can effectively undergo random walks, allowing a property referred to as neutral drift to occur, which is believed to allow CGP to escape local optima by exposing the search algorithm to new neighbourhoods [244, 251, 266]. The claim that this process always aids performance has been contested [43]. There is evidence suggesting that the performance of CGP can be further accelerated by increasing the amount of redundant
Node 1 Node 2 Node 3 Output
Genotype: 0 0 1 1 0 2 0 1 0 2
Phenotype:
i0 OR NOR AND o0
Figure 2.17: The genotype-phenotype mapping of a simple CGP individual consisting of 1 input, 3 nodes and 1 output and arity 2. Each node is represented by 3 genes; the first 2 describe the indices of the node’s inputs (starting at index 0 for the individual’s input i0) and the third describing the node’s function. Function
indices 0, 1 and 2 correspond to AND, OR and NOR respectively. The final gene describes the index of the node used by the individual’s output o0.
material present [156].
Many extensions to CGP exist in the literature. A modular variant of CGP named Em- bedded CGP has been proposed where modules (subgraphs) are automatically acquired and reused throughout the evolutionary process, often accelerating the search [253, 254]. Recur- rent CGP [241, 242] allows the existence of recurrent connections which can target any node in a graph, facilitating the induction of recursive solutions to problems such as generating the Fibonacci sequence or time-series forecasting. Self-modifying CGP [90] facilitates the in- clusion of nodes that can create and delete other nodes, thereby allowing a graph to develop to solve a class of problems, such as computing π or e to arbitrary precision [91].
Using a graphical structure, CGP has demonstrated its capability as a cross-domain op- timisation algorithm. Initially, it was proposed as a means to evolve circuits for Boolean functions [154], but this was generalised to the concepts described in [157]. A number of works have extended its application to search over approximate circuits by employing a multi- objective EA and exploring the tradeoff between accuracy, with respect to a target truth table, and cost, with respect to power consumption, circuit delay and size [165, 249, 250]. With the introduction of edge weights, CGP has been shown to effectively evolve ANNs [124, 126, 238]. By relaxing the requirement for a CGP individual to be feed-forward, it is possible to evolve
Recurrent Neural Networks (RNNs) capable of solving real-time problems [125, 245]. An interesting application can be found in [137], where a two-tiered version of CGP was used to evolve an abstract sequence of instructions with repetition of instructions occurring as a function of numerical parameters. Other application areas include (but are not limited to) convolutional neural network architecture design [226], multi-step forecasting [58], crypto- graphic circuit design [179, 180] and image processing [88, 89, 201].
To summarise, CGP is a graph-based EA that uses a direct2 encoding of graphs as a representation. Since its inception, it has spawned a broad field of research with many extensions both in terms of genetic operators and representation. The empirical observations of neutral drift in CGP and related theory have since spilt over into more general evolutionary research and should be a consideration in any discussion of neutral drift, e.g. [72]. Perhaps the most relevant observation in relation to our work is the generality shown by CGP, with a wide range of application areas unified by the common representation of solutions as graphs.