Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add hajibabaie/combinatorial-optimization-skills --skill local-search-and-neighborhoodsgit clone --depth 1 https://github.com/hajibabaie/combinatorial-optimization-skillsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/hajibabaie/combinatorial-optimization-skills/local-search-and-neighborhoods)<a href="https://agentmods.dev/skills/hajibabaie/combinatorial-optimization-skills/local-search-and-neighborhoods"><img src="https://agentmods.dev/badge/skills/hajibabaie/combinatorial-optimization-skills/local-search-and-neighborhoods/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/hajibabaie/combinatorial-optimization-skills/local-search-and-neighborhoods"><img src="https://agentmods.dev/badge/skills/hajibabaie/combinatorial-optimization-skills/local-search-and-neighborhoods.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00134 | $0.11628 |
| Opus 5.5 | $0.00054 | $0.04651 |
| Sonnet 5.5 | $0.00027 | $0.02326 |
| Haiku 4.5 | $0.00013 | $0.01163 |
Grade A, and why
local-search-and-neighborhoods scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 892 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Local Search and Neighborhoods
You are an expert in neighborhood-based search for combinatorial optimization. This skill covers neighborhood design (swap, insertion, 2-opt, Or-opt, exchange), constant- and linear-time delta evaluation, first- vs best-improvement pivoting, neighborhood scanning order, move data structures, and the limits of plain hill climbing. Use the framework below to build descent engines that are correct (deltas audited against full recomputation) and fast (no full objective evaluation inside the move loop), and that drop in unchanged as the inner loop of simulated annealing, tabu search, and iterated local search.
Initial Assessment
Establish these facts before proposing a neighborhood or writing any move code:
- Representation. Permutation (tour, schedule), binary vector (selection), integer assignment array, or partition into sets (routes, machine loads)? The move catalog and the delta formulas depend entirely on this. See solution-encodings-style criteria: every move must map feasible representations to feasible representations, or you must plan a penalty scheme.
- Objective structure. Additive over solution elements (sum of edge lengths, sum of assignment costs, linear penalties)? Additive objectives almost always admit O(1) or O(n) deltas. Max-type / critical-path objectives (flow-shop or job-shop makespan) do not; plan for an acceleration scheme (Taillard heads/tails, critical-path filtering) instead of a true delta.
- Hard vs soft constraints. Decide per constraint: keep moves feasibility-preserving, or relax the constraint into the objective and evaluate the penalty change inside the delta. Mixing the two without a plan is the most common source of wrong deltas.
- Instance size. n ≤ 500: any O(n²) neighborhood with full sweeps is fine in plain Python. n in 10³–10⁴: you need candidate lists, don't-look bits, or vectorized move scoring. n above 10⁴: you also need O(1) position queries and careful apply costs (segment reversal is O(n) per move).
- Evaluation cost. Time one full objective evaluation and one delta evaluation early. If the delta is not at least ~n times cheaper than the full evaluation, the neighborhood implementation is wrong or the objective does not decompose.
- Role of the local search. Standalone descent, multistart, or inner loop of a metaheuristic? The wrapper changes the acceptance logic; the move/delta code should not change at all. Keep them in separate functions from day one.
- Quality target. 2-opt local optima on random Euclidean TSP sit roughly 5% above optimal from good starts (Johnson & McGeoch 1997, "The traveling salesman problem: a case study in local optimization"). If the target is tighter, plan a metaheuristic wrapper or a richer neighborhood, not more sweeps.
- Data format. Full distance matrix (O(n²) memory) vs coordinates plus k-nearest neighbors via a KD-tree? At n = 20,000, a float64 matrix is 3.2 GB — candidate lists are not optional there.
- Determinism. Seed every random scan order and tie-break (
np.random.default_rng) so descents are reproducible run to run. - Validation plan. An independent objective recompute and a delta audit (compare each claimed delta against a from-scratch evaluation on random moves) must exist before any performance tuning.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 3mo ago First seen · 892 lines · 134 tokens per session scan A 92e0f96e486f
local-search-and-neighborhoods is a skill published in the GitHub repository hajibabaie/combinatorial-optimization-skills (23 stars, last pushed 5mo ago), licensed MIT. It adds 134 tokens to every session and 11,628 once invoked, about $0.0005 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
local-search-and-neighborhoods compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| local-search-and-neighborhoodshajibabaie/combinatorial-optimization-skills | Skill | 23 | 5mo ago | MIT | A | 134 | Claude Code |
| top-designwondelai/skills | Skill | 2.9k | 4d ago | MIT | A | 113 | Claude Code, Codex |
| design-everyday-thingswondelai/skills | Skill | 2.9k | 4d ago | MIT | A | 132 | Claude Code |
| traction-eoswondelai/skills | Skill | 2.9k | 4d ago | MIT | A | 147 | Claude Code, Codex |
| create-appwondelai/skills | Skill | 2.9k | 4d ago | MIT | A | 217 | Claude Code |
| improve-appwondelai/skills | Skill | 2.9k | 4d ago | MIT | A | 236 | Claude Code |
| cold-start-problemwondelai/skills | Skill | 2.9k | 4d ago | MIT | A | 168 | Claude Code |