Top-K
Always expand the single best program, with the next K as context. Pure greedy elitism.
Top-K is the simplest SkyDiscover search strategy: at every step it selects the single best program as the parent and the next K programs (ranks 2 through K+1) as inspirations, drawn from an uncapped keep-all archive sorted by combined score. There is no topology, no migration, and no adaptive selection — just deterministic greedy elitism applied to the full history of everything ever generated.
The method is a faithful port of SkyDiscover's `TopKDatabase` (UC Berkeley Sky Computing Lab). In Galapagos it decomposes into an `InMemoryPopulation` acting as the flat fitness-sorted leaderboard plus a fixed-rule `TopKPolicy` that does the rank-1-parent / rank-2-to-K+1-context selection. The reference store enforces no population cap, so Top-K effectively keeps all candidates and re-ranks them on every selection.
Because the selection rule is fixed and stateless, Top-K is a reliable, reproducible baseline. It is the natural first thing to run when you want to sanity-check a new task or evaluator before committing budget to an adaptive search strategy, and it makes a clean reference point for measuring whether more elaborate selection actually helps.
The six components this scaffold snaps together. Each block names its concrete implementation.
The set of candidate solutions in play — the gene pool the search evolves over.
Decides which genomes survive and reproduce — tournament, elitism, novelty, or your own policy.
Assembles the context handed to the model — parents, feedback, instructions, examples.
The LLM-driven variation operator — proposes new candidates by mutation and crossover.
Scores each candidate against the task — the fitness signal that drives selection.
SkyDiscover (UC Berkeley Sky Computing Lab) — topk search strategy