Table of Contents
Fetching ...

CGP++ : A Modern C++ Implementation of Cartesian Genetic Programming

Roman Kalkreuth, Thomas Baeck

TL;DR

CGP++ presents the first version of a modern, object-oriented, generic C++ implementation of Cartesian Genetic Programming to address limitations of the original C reference and other implementations. It introduces a reusable architecture with advanced genetic variation, benchmarking interfaces, hyperparameter configuration, checkpointing, and concurrent evaluation, all guided by a design philosophy focused on interpretability and reproducibility. The work compares CGP++ to existing toolkits, discusses implementation challenges, and outlines future directions, including concurrency and vectorization, as well as expansion toward a general GP toolkit (GP++). Overall, CGP++ aims to broaden CGP applicability, facilitate experimentation, and provide a robust foundation for integrating new CGP techniques and problem domains.

Abstract

The reference implementation of Cartesian Genetic Programming (CGP) was written in the C programming language. C inherently follows a procedural programming paradigm, which entails challenges in providing a reusable and scalable implementation model for complex structures and methods. Moreover, due to the limiting factors of C, the reference implementation of CGP does not provide a generic framework and is therefore restricted to a set of predefined evaluation types. Besides the reference implementation, we also observe that other existing implementations are limited with respect to the features provided. In this work, we therefore propose the first version of a modern C++ implementation of CGP that pursues object-oriented design and generic programming paradigm to provide an efficient implementation model that can facilitate the discovery of new problem domains and the implementation of complex advanced methods that have been proposed for CGP over time. With the proposal of our new implementation, we aim to generally promote interpretability, accessibility and reproducibility in the field of CGP.

CGP++ : A Modern C++ Implementation of Cartesian Genetic Programming

TL;DR

CGP++ presents the first version of a modern, object-oriented, generic C++ implementation of Cartesian Genetic Programming to address limitations of the original C reference and other implementations. It introduces a reusable architecture with advanced genetic variation, benchmarking interfaces, hyperparameter configuration, checkpointing, and concurrent evaluation, all guided by a design philosophy focused on interpretability and reproducibility. The work compares CGP++ to existing toolkits, discusses implementation challenges, and outlines future directions, including concurrency and vectorization, as well as expansion toward a general GP toolkit (GP++). Overall, CGP++ aims to broaden CGP applicability, facilitate experimentation, and provide a robust foundation for integrating new CGP techniques and problem domains.

Abstract

The reference implementation of Cartesian Genetic Programming (CGP) was written in the C programming language. C inherently follows a procedural programming paradigm, which entails challenges in providing a reusable and scalable implementation model for complex structures and methods. Moreover, due to the limiting factors of C, the reference implementation of CGP does not provide a generic framework and is therefore restricted to a set of predefined evaluation types. Besides the reference implementation, we also observe that other existing implementations are limited with respect to the features provided. In this work, we therefore propose the first version of a modern C++ implementation of CGP that pursues object-oriented design and generic programming paradigm to provide an efficient implementation model that can facilitate the discovery of new problem domains and the implementation of complex advanced methods that have been proposed for CGP over time. With the proposal of our new implementation, we aim to generally promote interpretability, accessibility and reproducibility in the field of CGP.
Paper Structure (36 sections, 6 figures, 2 tables, 1 algorithm)

This paper contains 36 sections, 6 figures, 2 tables, 1 algorithm.

Figures (6)

  • Figure 1: Example of a parse tree as used in conventional GP. A parse tree can be considered a composition of elements taken from the function set $\mathcal{F}$ and terminal set $\mathcal{T}$. The decoding of the parse tree in the example leads to the symbolic expression $\Psi$.
  • Figure 2: Illustration of the decoding procedure of the CGP genotype to the corresponding phenotype. The identifiers IP1 and IP2 refer to the two input nodes with node index $0$ and $1$. The identifier OP stands for the output node of the graph.
  • Figure 3: Illustration of the high-level architecture of CGP++ which uses abstraction and inheritance to facilitates reusability and flexibility for further extensions. Smart pointers are used to provide safe and efficient access to elements across the framework.
  • Figure 4: Overview of CGP++'s top-level workflow, addressing the execution of run instances as well as the main workflow that is executed within an instance.
  • Figure 5: Illustration of the architecture for concurrent evaluation. In this example, the thread pool is simplified with two threads to give a structured overview. However, in general, CGP++ is capable of instantiating and executing more than two threads.
  • ...and 1 more figures

Theorems & Definitions (3)

  • Definition 2.1: Genetic Program
  • Definition 2.2: Genetic Programming
  • Definition 2.3: Cartesian Genetic Program