Genetic programming helpers & strategies (tree based & multi-expression programming)
npm install @thi.ng/gp
!npm downloads

> [!NOTE]
> This is one of 214 standalone projects, maintained as part
> of the @thi.ng/umbrella monorepo
> and anti-framework.
>
> 🚀 Please help me to work full-time on these projects by sponsoring me on
> GitHub. Thank you! ❤️
- About
- Status
- Related packages
- Blog posts
- Installation
- Dependencies
- Usage examples
- API
- Authors
- License
Genetic programming helpers & strategies (tree based & multi-expression programming).
This package does not (yet) provide a complete GP framework and is
largely focused on the following operations:
- General GP setup configuration
- Genotype / chromosome / AST generation
- Phenotype / chromosome translation
- Offspring generation
- Crossover (single-point, uniform)
- Mutation
Does not specifically deal with:
- Population management
- AST evaluation
- Fitness computation
References:
- Evolutionary failures (blog post)
- Multi Expression Programming (Oltean, Dumitrescu)
ALPHA - bleeding edge / work-in-progress
Search or submit any issues for this package
- @thi.ng/defmulti - Dynamic, extensible multiple dispatch via user supplied dispatch function.
- @thi.ng/pointfree - Pointfree functional composition / Forth style stack execution engine
- @thi.ng/sexpr - Extensible S-Expression parser & runtime infrastructure
- @thi.ng/shader-ast - DSL to define shader code in TypeScript and cross-compile to GLSL, JS and other targets
- @thi.ng/zipper - Functional tree editing, manipulation & navigation
- Evolutionary failures (Part 1)
``bash`
yarn add @thi.ng/gp
ESM import:
`ts`
import * as gp from "@thi.ng/gp";
Browser ESM import:
`html`
For Node.js REPL:
`js`
const gp = await import("@thi.ng/gp");
Package sizes (brotli'd, pre-treeshake): ESM: 1.28 KB
- @thi.ng/api
- @thi.ng/errors
- @thi.ng/math
- @thi.ng/random
- @thi.ng/transducers
- @thi.ng/zipper
Note: @thi.ng/api is in _most_ cases a type-only import (not used at runtime)
One project in this repo's
/examples
directory is using this package:
| Screenshot | Description | Live demo | Source |
|:----------------------------------------------------------------------------------------------------------------------|:---------------------------------------------------------|:-----------------------------------------------------|:----------------------------------------------------------------------------------|
|
| Evolutionary shader generation using genetic programming | Demo | Source |
TODO
If this project contributes to an academic publication, please cite it as:
`bibtex``
@misc{thing-gp,
title = "@thi.ng/gp",
author = "Karsten Schmidt",
note = "https://thi.ng/gp",
year = 2019
}
© 2019 - 2026 Karsten Schmidt // Apache License 2.0