Skip to content

Add binary composition crossover for GP individuals #32

@morinim

Description

@morinim

Add a GP crossover operator that builds offspring by composing two parent programs with a binary function:

child(x) = f(lhs(x), rhs(x))

For symbolic regression, f could be +, -, *, protected division, min or max.

Instead of swapping genes, the operator should copy active exons from both parents into the child, remap D_ADDRESS references and add a final root gene:

copy lhs exons
copy rhs exons with relocated addresses
out = f(lhs_root, rhs_root)

This is semantically meaningful and less destructive than ordinary crossover because both parents remain coherent subprograms. It also fits the exon-based SLP representation well.

Main risk: bloat. The operator should be subject to the fixed SLP capacity or an active-size budget. If both parent exon graphs plus the new root do not fit, it should fall back to an existing crossover or otherwise fail safely.

Possible crossover name: binary_composition.

Suggested use: occasional operator, e.g. 10-20% of crossover events, not the default.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions