Skip to content

Bug: Island-based evolution not distributing programs across islands #391

@eilamt

Description

@eilamt

Description

When using island-based evolution with num_islands > 1, all evolved programs are placed in Island 0 instead of being distributed across the configured islands. This effectively disables the island-based evolution feature.

Steps to Reproduce

  1. Run the function_minimization example exactly as documented:
cd examples/function_minimization
python ../../openevolve-run.py initial_program.py evaluator.py --config config.yaml

After completion, check the checkpoint metadata:

cat openevolve_output/checkpoints/checkpoint_10/metadata.json | python -c "import json,sys; d=json.load(sys.stdin); print('Island generations:', d['island_generations']); print('Island sizes:', [len(i) for i in d['islands']])"

Expected Behavior
With num_islands: 3 configured, programs should be distributed across all 3 islands with roughly equal generations per island.

Actual Behavior
All programs go to Island 0. Islands 1 and 2 remain empty:

"island_generations": [10, 0, 0]
"islands": [[...11 programs...], [], []]
"island_best_programs": ["...", null, null]

Root Cause Analysis
In openevolve/process_parallel.py, the iteration worker determines a target island using round-robin (next_island()), but when the child program is added to the database via database.add(), no target_island parameter is passed. The database.add() method then defaults to using the parent's island, which is always Island 0 since:

The initial program is seeded to Island 0
When sampling from an empty island, sample_from_island() falls back to sampling from any available program (which is in Island 0)
Children inherit their parent's island
This creates a feedback loop where all programs end up in Island 0.

Environment
OpenEvolve version: latest main branch (commit ad9c9c1)
Python: 3.11
OS: macOS
Additional Context
This bug affects all examples that use num_islands > 1. Tested with both function_minimization (3 islands) and a custom graph coloring example (5 islands) - same behavior observed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions