linearization-techniques

linearization-techniques is a skill for Claude Code, Codex from hajibabaie/combinatorial-optimization-skills. It costs 128 tokens per session (13,250 once invoked), scanned A, original, MIT.

A guide to rewriting nonlinear or logical expressions as mixed-integer linear constraints. It covers products, absolute values, minimums and maximums, piecewise rules, implications, and fractional objectives.

In plain words
What is it for?
Use it to linearize variable products, if-then rules, absolute values, piecewise functions, and ratios. It explains when an exact rewrite is possible, when only an approximation is available, and how to choose valid variable bounds.
Why use it?
It helps make a model solvable by a mixed-integer linear programming solver while preserving the intended decisions. It also helps avoid weak or numerically unstable big-M values.

Skill for Claude CodeCodex

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

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.

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

Made for: Claude Code, Codex.

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 linearization-techniques

README.md
[![agentmods](https://agentmods.dev/badge/skills/hajibabaie/combinatorial-optimization-skills/linearization-techniques.svg)](https://agentmods.dev/skills/hajibabaie/combinatorial-optimization-skills/linearization-techniques)
Your own site
<a href="https://agentmods.dev/skills/hajibabaie/combinatorial-optimization-skills/linearization-techniques"><img src="https://agentmods.dev/badge/skills/hajibabaie/combinatorial-optimization-skills/linearization-techniques.svg" alt="Measured on agentmods" height="20"></a>
Per session 128 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 13,250 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00128 $0.13250
Opus 5 $0.00064 $0.06625
Sonnet 5 $0.00026 $0.02650
Haiku 4.5 $0.00013 $0.01325

Measured 4d ago against content hash 55194e7d4431, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

linearization-techniques 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 4d 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/linearization-techniques/SKILL.md · 859 lines

How it starts

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

Linearization Techniques

You are an expert in reformulating nonlinear and logical model constructs as mixed-integer linear programs. This skill covers exact linearization of variable products, absolute values, min/max terms, piecewise-linear functions, logical implications, and fractional objectives, plus the discipline of choosing tight big-M constants. Use the framework below to classify each nonlinear term, pick the sharpest valid reformulation, and verify the result.

Initial Assessment

Establish these facts before proposing any reformulation:

  • Inventory the nonlinear terms. List every product, absolute value, min/max, ratio, piecewise function, and if-then condition. The right technique differs per term type.
  • Variable domains in each product. Binary times binary and binary times continuous have exact linearizations. Continuous times continuous does not — only relaxations (McCormick) or piecewise approximations. Confirm which case you are in before promising exactness.
  • Finite bounds. Almost every technique here needs finite lower/upper bounds on the continuous variables involved. Ask where bounds come from: physical limits, capacity data, or bound-propagation. If a variable is genuinely unbounded, fix that first.
  • Convex use or nonconvex use. A term like |w| or max(w1, w2) needs no binaries when the optimization direction already pushes it the right way (epigraph use). It needs binaries when used in the opposite direction. Identify the direction before adding integer variables.
  • Where the term sits. Objective-only nonlinearity sometimes allows lighter treatment (epigraph, Dinkelbach) than nonlinearity inside constraints.
  • Solver and license. Gurobi, CPLEX, and SCIP accept indicator constraints, SOS sets, and native PWL/general constraints; a pure-LP or open-source pipeline may force manual big-M. Gurobi can also solve bilinear models directly with Params.NonConvex = 2 — sometimes the honest answer is "do not hand-linearize."
  • Problem size after reformulation. Linearizing all products in a quadratic model with n² binaries creates O(n⁴) variables. Estimate the blow-up; pick a compact scheme (e.g. Kaufman–Broeckx) if the full one will not fit in memory.
  • Accuracy requirement. Piecewise-linear approximation of a smooth function trades breakpoint count against error. Get a tolerance before choosing the grid.
  • Numerical scale. Note the ratio between the largest and smallest constraint coefficients you are about to create. Big-M values that push this ratio past ~1e6 will cause solver trouble; plan bound tightening up front.

Read the full file on GitHub · 859 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. 4d ago First seen · 859 lines · 128 tokens per session scan A 55194e7d4431

Subscribe to this mod's changes

linearization-techniques is a skill published in the GitHub repository hajibabaie/combinatorial-optimization-skills (7 stars, last pushed 2mo ago), licensed MIT. It adds 128 tokens to every session and 13,250 once invoked, about $0.0006 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

iso-24495-3

Sector-specific Plain Language standard for science and technical writing (ISO 24495-3:2026). Applied during software documentation, architecture specs, and technical analysis.

GaZmagik/iso-24495 · 40 tokens

using-cesiumjs-skills

Use when starting any conversation involving CesiumJS development - provides orientation on available domain skills and how they activate.

CesiumGS/cesiumjs-skills · 29 tokens

peekaboo

Provides runtime observation and interaction for native macOS interfaces through accessibility state and screenshots. Use when the task depends on visible or interactive state in a running SwiftUI/AppKit app: what is rendered, focused, selected, enabled, reachable through menus/windows/dialogs, or experienced across a…

johnkozaris/jko-claude-plugins · 104 tokens

seam-probe

This skill should be used when testing or debugging an embedded-runtime boundary exposed through a dynamically loaded C-ABI library or Unix-domain socket, including requests to inspect exports, exercise FFI callbacks, send framed messages, reproduce seam crashes or hangs, fuzz a boundary, or correlate probe output…

johnkozaris/jko-claude-plugins · 82 tokens

electron-playwright-validator

This skill should be used when a user asks to launch, inspect, automate, test, validate, or debug an Electron desktop UI through Playwright/CDP, including blank renderers, runtime import failures, accessibility snapshots, layout defects, click-through flows, or post-change checks. Not for native macOS or mobile apps…

johnkozaris/jko-claude-plugins · 90 tokens

mobile-flows-maestro

This skill should be used when Maestro is explicitly requested or already present and the task is to author, run, or debug iOS/Android Maestro flows; use Maestro MCP; or handle Maestro selectors, system UI, permissions, Keychain, JavaScript, waits, device state, flakiness, or CI. Evidence includes a .maestro directory…

johnkozaris/jko-claude-plugins · 102 tokens