Examples
Three optimization tasks. In each one we wrote only a scoring function and let EasyEvolve improve the code. Every result below is measured on 50 test cases the run never saw.
Results
| Task | Started from | Before | After | Change | Run cost | Run time |
|---|---|---|---|---|---|---|
| Route planningVisit 60 stops and return | Nearest neighbor | 6.37Avg. distance | 5.12Avg. distance | −19.1%shorter | $0.9986 iterations | — |
| Bin packing40 items, one box size | Next Fit | 22.8Avg. boxes | 18.3Avg. boxes | −18.0%fewer boxes, equal to First Fit Decreasing | $0.9982 iterations | 16 min |
| Shipping with rules3 box prices, food apart from cleaners | Tuned greedy rule | $24.92Avg. cost / order | $24.66Avg. cost / order | −1.5%cheaper on 28/50, never worse | $0.4434 iterations | 7 min |
Averages over 50 unseen cases; all answers were valid in every run. Run cost is what the EasyEvolve service charged for that run. Route run time was not recorded. One run per task, so treat these as examples, not benchmarks.
See the difference
The same input, solved by the starting code and by the code EasyEvolve returned.
24.5% shorter. Same 60 stops in both panels. Every route visits each stop once and returns to the start.
Full experiment →Why EasyEvolve
| Aspect | Tuning by hand | With EasyEvolve |
|---|---|---|
| What you write | The algorithm | A scoring function (about 20 lines) |
| Who tries ideas | You, one at a time | EasyEvolve, dozens per run |
| What it costs | Engineering hours | A budget you set ($0.45–$1 here) |
| Wrong answers | Caught by your tests | Scored zero by your evaluator |
| What you get | Your code | A plain Python file you keep |
Start with a score
Two standard-library evaluators you can copy. Keep correctness in the score you optimize.
Correctness: a sorting function
Score the share of test cases passed. Five cases are a demonstration, not a proof.
"""Implement solve(values: list[int]) -> sorted list[int]."""
import importlib.util
def evaluate(candidate_path: str) -> dict:
spec = importlib.util.spec_from_file_location("candidate", candidate_path)
module = importlib.util.module_from_spec(spec)
spec.loader.exec_module(module)
cases = [[], [1], [3, 1, 2], [5, -1, 5, 0], list(range(30, 0, -1))]
passed = sum(module.solve(x.copy()) == sorted(x) for x in cases)
return {"score": passed / len(cases)}Speed: a faster Fibonacci
Return zero for any wrong answer, then reward lower run time. Timing varies; use repeated samples.
"""Implement fibonacci(n: int) -> int for n >= 0."""
import importlib.util
import time
def evaluate(candidate_path: str) -> dict:
spec = importlib.util.spec_from_file_location("candidate", candidate_path)
module = importlib.util.module_from_spec(spec)
spec.loader.exec_module(module)
for n, expected in [(0, 0), (1, 1), (10, 55), (20, 6765)]:
if module.fibonacci(n) != expected:
return {"score": 0.0}
start = time.perf_counter()
for _ in range(200):
if module.fibonacci(20) != 6765:
return {"score": 0.0}
elapsed = time.perf_counter() - start
return {"score": 1.0 / (elapsed + 0.001)}