← Back to CoursesEvolutionary Programming

Neuroanatomy Explorer

Drag to rotate · scroll to zoom · click regions to explore

View
Loading 3D model…

Click a region
to explore it

Memory Deck

Flip each card and rate whether you knew it. Your score is saved.

Term
Definition

Deck complete — score saved.

Match the Pairs

Match each term to its definition. Finish the board to earn your score.

All matched — score saved.

Concept Constellation

Every key idea in this course, mapped as an explorable 3D constellation. Drag to rotate, scroll to zoom, click a node.

Click a node to read its definition.

Genetic Programming and Program Synthesis

Manual: General · Subject: Evolutionary Programming

Explore how evolution can search over programs, expressions, and symbolic structures.

Evolving Programs

What Is Genetic Programming?

Genetic programming evolves programs or symbolic expressions rather than fixed-length parameter vectors. Solutions are often represented as trees whose internal nodes are functions and whose leaves are variables or constants.

Tree Representation

A program tree can represent arithmetic expressions, logic rules, control flow fragments, or other compositional structures. Tree-based crossover and mutation allow programs to grow or change shape.

Genetic Programming Pseudocode

  1. 1

    Step 1: Generate random program trees.

  2. 2

    Step 2: Evaluate each tree on training cases.

  3. 3

    Step 3: Select parent trees based on fitness.

  4. 4

    Step 4: Apply subtree crossover and mutation.

  5. 5

    Step 5: Optionally limit tree size or depth.

  6. 6

    Step 6: Repeat until a stopping condition is met.

Program Evolution Operators

Subtree crossover

  • Swaps whole branches between trees
  • Can create large structural changes
  • May produce invalid programs if not controlled

Subtree mutation

  • Replaces a branch with a new randomly generated subtree
  • Introduces novel code fragments
  • Supports exploration

In genetic programming, what is often used to represent a candidate program?

What is subtree crossover?

Why is bloat control important in genetic programming?

💡

Symbolic Search

Genetic programming is a flexible tool for discovering formulas, rules, and interpretable structures.

Simple Example

A GP system might search for an expression approximating y=x2+3x+1y = x^2 + 3x + 1 by evolving combinations of operators like ++, −-, ×\times, and constants.

Name one technique used to limit GP tree growth.