benders-decomposition

benders-decomposition is a skill for Claude Code from hajibabaie/combinatorial-optimization-skills. It costs 151 tokens per session (12,715 once invoked), scanned A, original, MIT.

A method for splitting a mixed-integer linear program—a model with continuous and whole-number decisions—into a master problem and smaller subproblems. It repeatedly exchanges mathematical constraints between them until it finds a solution.

In plain words
What is it for?
Use it for structured mixed-integer models, two-stage decisions under uncertainty, and implementations using iterative loops or solver callbacks.
Why use it?
It can make structured large problems easier to solve when fixing the whole-number decisions leaves a simpler continuous problem.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the combinatorial-optimization plugin — 76 skills shipped together

Good fit Use it for structured mixed-integer models, two-stage decisions under uncertainty, and implementations using iterative loops or solver callbacks.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/hajibabaie/combinatorial-optimization-skills/benders-decomposition
Install

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.

Any agent
npx skills add hajibabaie/combinatorial-optimization-skills --skill benders-decomposition
Clone the repo
git clone --depth 1 https://github.com/hajibabaie/combinatorial-optimization-skills

Made for: Claude Code.

Or install combinatorial-optimization, the plugin that ships this one along with the rest of its 76 skills.

Wrote 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.

agentmods badge for benders-decomposition

README.md
[![agentmods](https://agentmods.dev/badge/skills/hajibabaie/combinatorial-optimization-skills/benders-decomposition/github.svg)](https://agentmods.dev/skills/hajibabaie/combinatorial-optimization-skills/benders-decomposition)
Your own site
<a href="https://agentmods.dev/skills/hajibabaie/combinatorial-optimization-skills/benders-decomposition"><img src="https://agentmods.dev/badge/skills/hajibabaie/combinatorial-optimization-skills/benders-decomposition/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.

agentmods 80×15 button for benders-decomposition

Your own site · 80×15
<a href="https://agentmods.dev/skills/hajibabaie/combinatorial-optimization-skills/benders-decomposition"><img src="https://agentmods.dev/badge/skills/hajibabaie/combinatorial-optimization-skills/benders-decomposition.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 151 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 12,715 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00151 $0.12715
Opus 5 $0.00076 $0.06358
Sonnet 5 $0.00030 $0.02543
Haiku 4.5 $0.00015 $0.01272

Measured 10d ago against content hash d5948a9124e9, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

benders-decomposition 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 10d 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.

skills/benders-decomposition/SKILL.md · 724 lines

How it starts

The opening of the file, as written. The whole thing — 724 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Benders Decomposition

You are an expert in exact decomposition methods for mixed-integer optimization, specifically Benders decomposition in its classic (iterative master/subproblem loop) and modern (branch-and-Benders-cut via lazy-constraint callbacks) forms, including the L-shaped method for two-stage stochastic programs. This skill covers the master–subproblem split, the derivation of optimality and feasibility cuts from LP duality, complete gurobipy implementations of both execution modes, and the acceleration techniques (Pareto-optimal cuts, stabilization, cut aggregation) that decide whether Benders converges in 20 iterations or 2,000. Use the framework below to verify the problem has the right structure, derive the cuts on paper, implement against the reusable loop or the callback pattern, and validate against the monolithic model.

Initial Assessment

Before decomposing anything, establish the following. Each answer changes the design.

  • Identify the complicating variables. Which variables, once fixed, leave an easy remaining problem? Benders needs a clean split: integer/design variables y in the master, continuous recourse variables x in the subproblem. If no such split exists, Benders is the wrong tool.
  • Subproblem class. Is the subproblem an LP for every fixed y? Classic Benders cuts come from LP duals. If the subproblem keeps integer variables, you need logic-based Benders or integer L-shaped cuts (see Advanced Techniques) — a different, weaker machinery.
  • Subproblem separability. Does the subproblem split into independent blocks (per scenario, per customer, per period)? Separability is the main source of speedup and enables multi-cut formulations and parallel subproblem solves.
  • Feasibility structure. Can the subproblem be infeasible for some master solutions? If yes, you need feasibility cuts (dual extreme rays / Farkas certificates). Check first whether a small master-side constraint (e.g., total capacity ≥ total demand) or penalized slack variables can give relatively complete recourse and remove feasibility cuts entirely.
  • Why decompose at all? Estimate the extensive (monolithic) model size: variables = |y| + |x|·(blocks), constraints likewise. Modern solvers handle millions of nonzeros; decompose only when the monolith is too large, too slow, or the subproblem has special structure (closed-form duals, network structure) the solver cannot exploit.
  • Execution mode. Classic loop (sequence of master MIPs) for prototyping, analysis, and cheap masters; branch-and-Benders-cut (one search tree, lazy cuts) for production runs where re-solving the master MIP from scratch each iteration is wasteful.
  • Bound on the recourse term. What is a valid lower bound for eta (minimization)? Without one the first master solve is unbounded. Nonnegative recourse costs give eta ≥ 0; per-block bounds (e.g., cheapest assignment per customer) are tighter and free.
  • Solver and license. gurobipy available? Callbacks, FarkasDual/UnbdRay, and lazy constraints are needed. With open-source solvers, SCIP supports Benders plugins; HiGHS supports only the classic loop.
  • Scale and budget. Number of scenarios/blocks, master integer variables, target gap, wall-clock budget. These set single-cut vs multi-cut, stabilization needs, and whether subproblems must be parallelized.
  • Validation baseline. Build the monolithic model on small instances first. Every Benders implementation must reproduce its optimum exactly before you trust it at scale.

Read the full file on GitHub · 724 lines

Changes

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.

  1. 10d ago First seen · 724 lines · 151 tokens per session scan A d5948a9124e9

Subscribe to this mod's changes

benders-decomposition is a skill published in the GitHub repository hajibabaie/combinatorial-optimization-skills (7 stars, last pushed 2mo ago), licensed MIT. It adds 151 tokens to every session and 12,715 once invoked, about $0.0008 per session on Opus 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.

Related

Other skills, from other repositories

learn-from-fix

Capture Elixir/Ecto/LiveView lessons and Hex API rules. Use after corrections or when asked to document learning, record a lesson, prevent a fixed mistake, or remember package guidance with --library.

oliver-kriska/claude-elixir-phoenix · 46 tokens

phx-deps-audit

Audit Hex deps for supply-chain security risk — bidi chars, compile-time exec, maintainer changes, typosquats, CVEs. Use after mix deps.update, when checking if a package upgrade is safe, or reviewing mix.lock PR diffs.

oliver-kriska/claude-elixir-phoenix · 58 tokens

promote

Generate X/Twitter release promotion posts with ASCII tables and CodeSnap rendering. Use when writing release posts, promotion tweets, plugin announcements, or preparing social media content for new versions.

oliver-kriska/claude-elixir-phoenix · 39 tokens

release

CONTRIBUTOR TOOL - Cut a plugin release: bump plugin.json version, finalize CHANGELOG, update README if needed, gate on make ci, commit, tag vX.Y.Z, and create the GitHub release. Use when shipping a new plugin version. NOT distributed.

oliver-kriska/claude-elixir-phoenix · 60 tokens

session-deep-dive

Deep qualitative analysis of high-signal sessions. Spawns subagents with v2 template, synthesizes patterns, compares against known findings. Use after /session-scan.

oliver-kriska/claude-elixir-phoenix · 40 tokens

catchup

Summarize and review what changed while you were away. Use after a weekend, vacation, or flight to check missed PRs, git commits, Linear tickets, and meetings — one prioritized brief, not a firehose.

oliver-kriska/claude-elixir-phoenix · 48 tokens