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 knapsack-problemsgit 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/knapsack-problems)<a href="https://agentmods.dev/skills/hajibabaie/combinatorial-optimization-skills/knapsack-problems"><img src="https://agentmods.dev/badge/skills/hajibabaie/combinatorial-optimization-skills/knapsack-problems/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/knapsack-problems"><img src="https://agentmods.dev/badge/skills/hajibabaie/combinatorial-optimization-skills/knapsack-problems.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.00130 | $0.10740 |
| Opus 5.5 | $0.00052 | $0.04296 |
| Sonnet 5.5 | $0.00026 | $0.02148 |
| Haiku 4.5 | $0.00013 | $0.01074 |
Grade A, and why
knapsack-problems 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 — 761 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Knapsack Problems
You are an expert in knapsack problems, the core selection-under-capacity structure of combinatorial optimization. This skill covers the 0-1, bounded, multiple, multidimensional, and quadratic variants, with exact methods (dynamic programming, branch-and-bound, MIP), greedy bounds, and a repair-based metaheuristic for large instances. Use the framework below to identify the variant, pick the method that matches the data regime, and deliver a validated solution with a provable or estimated optimality gap. Knapsack structure also appears inside larger algorithms — as the pricing subproblem of column generation and as the separation problem for cover cuts — so the implementations here are written to be reusable as subroutines.
Initial Assessment
Establish the following before formulating or coding anything:
- Identify the variant. One container or several? One resource constraint or many? Are items binary, bounded integer, or unbounded? Do item pairs interact in the objective (quadratic terms)? The variant determines the method; misidentifying it wastes the whole effort.
- Check data types. Integer weights and capacity enable pseudo-polynomial DP. Fractional weights force B&B/MIP or require scaling. Note the magnitude of the capacity: DP needs an array of size
c + 1per state dimension. - Estimate size. Record
n(items),m(constraints or knapsacks), andc(capacity magnitude).n * c <= 1e8with integer data: DP is the simplest exact route. Largerc: B&B or MIP. Multidimensional withn > 500: plan for a heuristic with a bound. - Establish the role of the knapsack. Standalone problem solved once, or a subroutine called thousands of times (pricing, separation, Lagrangian subproblem)? Subroutine use demands a fast specialized solver, not a general MIP model with per-call build overhead.
- Clarify exact-vs-heuristic requirements. Is a proven optimum required (e.g., inside an exact decomposition), or is a 1-2% gap acceptable? What is the wall-clock budget per solve?
- Confirm solver availability. Gurobi license present? If not, plan for OR-Tools, HiGHS, or the pure-numpy DP/B&B routes in this skill.
- Check correlation structure. Profit-weight correlation drives empirical hardness (Pisinger 2005, "Where are the hard knapsack problems?"). Strongly correlated and subset-sum-like instances are hard for ratio-based B&B; ask where the data comes from.
- Audit constraint semantics. Is the capacity hard or soft? Must every item be considered, or are some pre-fixed? Are there side constraints (conflicts, precedences) that silently turn the problem into something else (e.g., a knapsack with conflicts is graph-structured and much harder)?
- Agree on deliverables. Selected item set, objective value, bound and gap, solve time, and an independent feasibility check (see the validator below).
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 · 761 lines · 130 tokens per session scan A d316e5f4191d
knapsack-problems is a skill published in the GitHub repository hajibabaie/combinatorial-optimization-skills (23 stars, last pushed 5mo ago), licensed MIT. It adds 130 tokens to every session and 10,740 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.
knapsack-problems compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| knapsack-problemshajibabaie/combinatorial-optimization-skills | Skill | 23 | 5mo ago | MIT | A | 130 | 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 |