Skip to content

Conversation

@francastagna
Copy link
Collaborator

@francastagna francastagna commented Oct 30, 2025

PR Summary

Add (μ,λ) Evolutionary Algorithm and tests


(μ,λ) EA Pseudocode

image

Main Changes

  • EMConfig

    • Add MuLambdaEA to EMConfig.Algorithm.
    • Add muLambdaOffspringSize (λ) for (μ,λ) EA.
  • Main wiring

    • Wire MuLambdaEvolutionaryAlgorithm for all problem types (GraphQL, RPC, Web, REST).
  • New algorithm

    • MuLambdaEvolutionaryAlgorithm.kt
      • For each generation: generate exactly λ offspring by mutating parents (distribute as ⌊λ/μ⌋ plus remainder), then select the best μ from offspring only.
      • Lifecycle hooks: beginGeneration/endGeneration and beginStep/endStep for each offspring.

Tests

  • MuLambdaEvolutionaryAlgorithmTest.kt
    • Finds Optimum (testMuLambdaEAFindsOptimum).
    • Edge cases:
      • xoverProbability=0.0, fixedRateMutation=1.0 → 0 crossovers, λ mutations, µ size preserved. (testNoCrossoverWhenProbabilityZero_MuLambdaEA)
      • fixedRateMutation=0.0, xoverProbability=1.0 → 0 mutations, µ size preserved. (testNoMutationWhenProbabilityZero_MuLambdaEA)
    • One-iteration properties (testNextGenerationIsTheBestMuFromOffspringOnly):
      • Final population size equals µ.
      • Final population equals top-µ by score from offspring only.
      • With fixedRateMutation=1.0 and λ divisible by µ → mutations = λ.

@francastagna francastagna marked this pull request as ready for review October 30, 2025 16:03
@francastagna francastagna changed the title MuLambda Evolutionary Algorithm MuLambda EA Oct 30, 2025
@francastagna francastagna requested a review from arcuri82 October 30, 2025 16:36
@arcuri82
Copy link
Collaborator

@francastagna hi. this PR has conflicts that need to be resolved before review

1 similar comment
@arcuri82
Copy link
Collaborator

@francastagna hi. this PR has conflicts that need to be resolved before review

@arcuri82 arcuri82 merged commit 06173f6 into master Nov 3, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants