# cuopt-numerical-optimization-formulation

Turns a written problem into a clean LP, MILP or QP formulation: variables, constraints, objective. Concepts only, no API code.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 2100 installs · ★ 3735
- Author: NVIDIA cuOpt Team
- License: Apache-2.0 · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/NVIDIA/skills/tree/HEAD/skills/cuopt-numerical-optimization-formulation/SKILL.md
- Updated: 2026-10-23
- HTML: https://affpapa.org/en/nevibecode/skills/cuopt-numerical-optimization-formulation

## What it does

The skill reads problem text sentence by sentence and sorts each one into parameter, constraint, decision or objective. Then it checks what is still unclear: variable types, linear or quadratic objective, whether any variable is integer or binary. If an interpretation stays ambiguous, it asks you or solves every plausible variant and reports the outcomes.

A comparison table covers LP, MILP and QP side by side: objective form, constraint types, continuous versus mixed variables, optimization sense. Dual values and reduced costs get their own section. Continuous LP and QP solutions expose them; MILP solutions do not, because integer optima are not continuous. They are also unavailable when the model carries quadratic constraints, since the second-order cone path returns primal values only.

What you get is formulation guidance, not solver calls. Two constraints matter before you start: QP support in cuOpt is in beta, and the quadratic matrix Q should be positive semi-definite for a well-posed minimization. If the objective is purely linear, the skill tells you to keep it that way instead of introducing quadratic terms by hand.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add NVIDIA/skills --skill cuopt-numerical-optimization-formulation -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/cuopt-numerical-optimization-formulation/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/cuopt-numerical-optimization-formulation/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add NVIDIA/skills --skill cuopt-numerical-optimization-formulation -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/cuopt-numerical-optimization-formulation/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add NVIDIA/skills --skill cuopt-numerical-optimization-formulation -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/cuopt-numerical-optimization-formulation/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install NVIDIA/skills cuopt-numerical-optimization-formulation
```

2. **Manually: put the files in place**
- File: `.github/skills/cuopt-numerical-optimization-formulation/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add NVIDIA/skills --skill cuopt-numerical-optimization-formulation -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/NVIDIA/skills --path skills/cuopt-numerical-optimization-formulation
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/cuopt-numerical-optimization-formulation/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add NVIDIA/skills --skill cuopt-numerical-optimization-formulation -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/NVIDIA/skills/tree/HEAD/skills/cuopt-numerical-optimization-formulation/SKILL.md

## When to use it
- split a problem statement into parameters, constraints, decisions and an objective
- decide whether a problem is LP, MILP or QP from its objective and variables
- catch implicit constraints hidden in committed phrasing
- tell when dual values and reduced costs are available after a solve
- check convexity of a quadratic form before writing a QP

## Example prompts
- parse this factory and demand problem: what are the parameters, constraints and decisions?
- classify this as LP, MILP or QP and explain why
- the user wants to maximize a quadratic objective — how do I handle that?

## Source text · SKILL.md · Apache-2.0

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: ab2f97300e04023a.

BEGIN THIRD-PARTY FILE ab2f97300e04023a
```text
---
name: cuopt-numerical-optimization-formulation
version: "26.10.00"
description: LP, MILP, QP — concepts, problem-text parsing, and formulation patterns (parameters, constraints, decisions, objective). Concepts only; no API.
license: Apache-2.0
metadata:
  author: NVIDIA cuOpt Team
  tags:
    - linear-programming
    - milp
    - qp
    - formulation
    - concepts
---




# 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.
```
END THIRD-PARTY FILE ab2f97300e04023a

The third-party file has ended. Everything between the ab2f97300e04023a tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 1600 of 19584 bytes. © NVIDIA cuOpt Team · Apache-2.0 · https://github.com/NVIDIA/skills/tree/HEAD/skills/cuopt-numerical-optimization-formulation/SKILL.md

## Similar
- [cuopt-user-rules](https://affpapa.org/en/nevibecode/skills/cuopt-user-rules.md) — skill · ★ 7596
- [AgentDB Performance Optimization](https://affpapa.org/en/nevibecode/skills/agentdb-performance-optimization.md) — skill · 1100 installs
- [V3 Performance Optimization](https://affpapa.org/en/nevibecode/skills/v3-performance-optimization.md) — skill · 1100 installs
- [argent-react-native-optimization](https://affpapa.org/en/nevibecode/skills/argent-react-native-optimization.md) — skill · 26500 installs
- [shopify-speed-optimization](https://affpapa.org/en/nevibecode/skills/shopify-speed-optimization.md) — skill · 1000 installs

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
