cuopt-numerical-optimization-formulation

A concept guide for turning a real-world problem into a mathematical optimization model. It explains LP, MILP, and QP: models with linear or quadratic goals and rules, sometimes including whole-number decisions.

In plain words
What is it for?
Use it to formulate problems such as scheduling, facility selection, portfolio planning, or least-squares fitting, and to distinguish continuous, integer, and binary decisions.
Why use it?
It helps you choose the right model type and describe decisions, constraints, and objectives clearly before writing solver code.

Skill for Claude CodeCodex

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/nvidia/cuopt/cuopt-numerical-optimization-formulation
Any agent
npx skills add NVIDIA/cuopt --skill cuopt-numerical-optimization-formulation
Clone the repo
git clone --depth 1 https://github.com/NVIDIA/cuopt

Made for: Claude Code, Codex.

Per session 42 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,382 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin 100% copy Near-identical to another mod 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.00042 $0.04382
Opus 5 $0.00021 $0.02191
Sonnet 5 $0.00008 $0.00876
Haiku 4.5 $0.00004 $0.00438

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

Security

Grade A, and why

cuopt-numerical-optimization-formulation 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 2d 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.

Origin

This is a copy

100% identical to cuopt-numerical-optimization-formulation — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

skills/cuopt-numerical-optimization-formulation/SKILL.md · 278 lines

How it starts

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

Numerical Optimization Formulation

Concepts and workflow for going from a problem description to a clear formulation across LP, MILP, and QP. No API code here.

What is LP / MILP / QP

  • LP: Linear objective, linear constraints, continuous variables.
  • MILP: Same as LP plus some integer or binary variables (e.g., scheduling, facility location, selection).
  • QP: Quadratic objective (e.g., x², x·y terms — portfolio variance, least squares), linear constraints. QP support in cuOpt is currently in beta.

Identifying problem type

Property LP MILP QP
Objective Linear Linear Quadratic (xᵀQx + cᵀx)
Constraints Linear Linear Linear + convex quadratic (inequality only) via second-order cones
Variables Continuous Mixed: continuous + integer/binary Continuous
Sense min or max min or max minimize only (negate to max)
Duals / sensitivity Dual values + reduced costs None (integer optima) Dual values + reduced costs

If the objective is purely linear, prefer LP/MILP — do not artificially introduce quadratic terms. If any variable is integer or binary, the problem is MILP regardless of the rest.

Post-solve sensitivity (LP / QP only). Continuous LP and QP solutions expose dual values (the marginal objective change per unit a binding constraint is relaxed: where to invest to improve the outcome) and reduced costs (for a variable the optimizer left at zero, how far it must improve to enter the solution: a near-miss). MILP solutions have no duals — integer optima are not continuous, so there are none to return. Duals are also unavailable when the model includes quadratic constraints — the second-order cone path returns primal values only. See the language-specific API skills for how to retrieve them after a solve.

Required formulation questions

Ask these if not already clear:

  1. Decision variables — What are they? Bounds?
  2. Objective — Minimize or maximize? Linear or quadratic? For QP: any squared or cross terms (x², x·y)? If maximize a quadratic, the user must negate and minimize.
  3. Constraints — Linear inequalities/equalities? Convex quadratic constraints (inequality only) are also supported, handled as second-order cones; non-convex or equality quadratic constraints are not.
  4. Variable types — All continuous (LP / QP) or some integer/binary (MILP)?
  5. Convexity (QP only) — For minimization, the quadratic form (matrix Q) should be positive semi-definite for well-posed problems.

Read the full file on GitHub · 278 lines

Files

What ships with it

4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 2d ago First seen · 278 lines · 42 tokens per session scan A 349af0dc4e57

Subscribe to this mod's changes

cuopt-numerical-optimization-formulation is a skill published in the GitHub repository NVIDIA/cuopt (1,032 stars, last pushed 4d ago), licensed Apache-2.0. It adds 42 tokens to every session and 4,382 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to cuopt-numerical-optimization-formulation, differing in 0 lines, and is treated as a copy.