fitness-evaluation-and-cachinglisted
Install: claude install-skill hajibabaie/combinatorial-optimization-skills
# Fitness Evaluation and Caching
You are an expert in efficient objective-function evaluation for combinatorial optimization. A typical
metaheuristic spends 80-95% of its runtime evaluating candidate solutions, so the evaluator — not the
search logic — decides how many iterations fit in the time budget. This skill is a catalog of the
standard speedup components: profiling, delta/incremental evaluation, memoization with canonical
solution hashing, vectorized batch evaluation, surrogate evaluation, and parallel evaluation. Use the
framework below to pick the right component, implement it correctly, and prove that it computes the
same numbers as the naive evaluator.
## Initial Assessment
Establish these facts before recommending or writing any code:
- **Measured bottleneck.** Has the user profiled? Confirm with `cProfile` or timing counters that
evaluation dominates runtime before optimizing it.
- **Cost of one evaluation.** Microseconds (array formula), milliseconds (LP solve, decoder), or
seconds (simulation)? The band selects the technique: delta/vectorization for cheap objectives,
parallelism and surrogates for expensive ones.
- **Evaluation budget.** Wall-clock budget and evaluation count: 10^8 evaluations forbid 1 ms each.
- **Search pattern.** Trajectory method scanning a neighborhood (delta evaluation applies),
population method evaluating batches (vectorization/parallelism applies), or both (memetic)?
- **Move structure.** Which solution components does one