LP, MILP, QP — concepts, problem-text parsing, and formulation patterns (parameters, constraints, decisions, objective). Concepts only; no API.
SkillScore78Maintained
Automatic
◆AI Engineer pack
Last verified 8/12/2026
What it changes
Passed 18 of 23 test cases with the skill, and 15 of 23 without it.
Without skill65%
With skill78%
Checks it passed that the model alone missed
The response states that dual values are unavailable for MILP models.
The response states that dual values are unavailable when quadratic constraints are present.
The response recommends comparing intermediate production costs against product selling prices.
3 fixed15 passed either way5 still failing0 broke
Pass-rate lift
+13 pp
Tokens
+156%
Agent turns
0%
Response time
-41%
Model gemini-3.6-flashMeasured 8/12/2026v118 of 23 cases passed with skill
Tokens, turns and time describe resource use, not a dollar price.
See it in action
One of 3 test cases the skill fixed. Same model, same prompt, with and without the skill.
1 of 3
Prompt
A financial engineer formulates a continuous optimization problem with a linear objective and a convex second-order cone constraint (quadratic inequality constraint). Will post-solve sensitivity analysis return dual values for the constraints?
What was checked, without and with the skill
Checked
Without skill
With skill
The response states that dual values are unavailable when quadratic constraints are present.
Missed
Passed
case-12 · gemini-3.6-flash · 8/12/2026 · answers are capped and redacted
What's inside
The instructions your model reads when the skill loads.
SKILL.md259 linessingle file
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:
Decision variables — What are they? Bounds?
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.
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.
Variable types — All continuous (LP / QP) or some integer/binary (MILP)?
Convexity (QP only) — For minimization, the quadratic form (matrix Q) should be positive semi-definite for well-posed problems.
Typical modeling elements
Continuous variables — production amounts, flow, allocations, portfolio weights.