FeiLiu36/EoH
Evolution of Heuristics
What it solves
Designing heuristics manually is tedious and requires deep intuition and experience. EoH automates this process by leveraging large language models (LLMs) and evolutionary computation (EC) to generate, evaluate, and evolve heuristics for complex search and optimization tasks.
How it works
EoH combines a population-based evolutionary framework with LLM-driven code generation. Users define a problem by subclassing BaseProblem and providing a template_program (the skeleton of the heuristic), a task_description, and an evaluate_program (which returns a fitness score). The LLM, configured via LLMConfig (remote API or local server), produces new candidate heuristics through evolutionary operators (e1, e2, m1, m2). These are evaluated and the best ones survive and reproduce, iterating over generations. EoH supports three template styles: single function, multi-function, and class-based definitions, automatically detecting the type.
Who it’s for
Researchers and practitioners in optimization, operations research, and AI who need to design high-performing heuristics or algorithms without manual trial-and-error. It is also useful for anyone exploring automatic algorithm design using LLMs.
Highlights
- Accepted at ICML 2024 (Oral, top 1.5%)
- Set 51 new best-known solutions on large-scale CVRP benchmarks (CVRPLib competition)
- Achieved a new world record (score 2.63594) for the circle packing problem with 26 circles
- Outperforms FunSearch with significantly fewer LLM queries on online bin packing
- Lightweight and user-friendly (Python >= 3.10, minimal dependencies)
- Includes 33 example tasks covering TSP, bin packing, evolutionary algorithms, neural networks, and more
- Supports remote (OpenAI-compatible) and local LLMs
Related
- Project
- Project
- Project
- Project