Mathematical Optimization Foundations
Turn an allocation question into an explicit model and a defensible solution claim. Separate a good candidate, a feasible candidate, and a certified optimum.
When to Use
Trigger: constrained allocation, linear programming, convex optimization, integer programming, scheduling and assignment under capacity, solver choice, infeasible or unbounded models, duality certificates, optimality gaps, multi-objective tradeoffs, or robust/stochastic optimization.
Examples: allocate a fixed capacity across products; schedule GPU jobs under a GPU cap; find which constraints make a MILP infeasible; check an LLM-drafted model; verify an LP primal/dual witness.
Use decision theory to choose preferences or utilities, planning/search for action sequences with preconditions and effects (this skill owns resource-constrained scheduling), and theory of constraints to identify where improvement should focus. This skill owns the mathematical allocation after those choices. Ordinary prioritization without a quantitative constrained model need not activate it.
Quick Reference
Workflow
- Define decision variables, their domains and units, objective direction, resource constraints, and input provenance. Record which coefficients are estimates. Do not silently replace a disputed objective with a convenient proxy.
- Use formulation-and-methods.md to distinguish continuous from indivisible choices and choose LP, convex QP/conic, MILP, or explicitly nonconvex methods. Check formulation fidelity before solver choice, then pick the solver with solver-selection.md; scheduling goes to scheduling-cp-sat.md.
- Identify the evidence needed for the claim: feasible point, global bound, certificate, or heuristic result. For duality, numerical tolerances, and termination status, use certificates-and-status.md.
- When coefficients are uncertain, use uncertainty-and-sensitivity.md. Distinguish scenario performance from a probabilistic or worst-case guarantee.
- Return the optimization contract with candidate, constraint residuals, bounds/gap, method and termination status, and sensitivity. If no feasible candidate was found, distinguish search failure from proven model infeasibility and diagnose with infeasibility-diagnosis.md.
Exact LP Certificate Helper
Run python3 scripts/check_lp_certificate.py input.json (or - for standard input) to check supplied primal/dual witnesses for the canonical pair max c^T x, Ax <= b, x >= 0 / min b^T y, A^T y >= c, y >= 0 in exact rational arithmetic. It performs no optimization. Schema, parser limits, output fields, exit codes, and a worked answer: certificates-and-status.md.
Exit code 0 does not mean the witness is valid: a failed witness exits 0 with optimal: false. Read optimal, or pass --strict to exit 1 unless it is true. Invalid input exits 2.
It certifies only the submitted continuous LP. It does not certify model fidelity, a MILP optimum, or a floating-point solver result, and a failed witness does not prove infeasibility or unboundedness.
Completion Criteria
- Variables/domains, units, objective, and constraints match the stated problem.
- The global/local/heuristic claim has appropriate evidence and disclosed assumptions.
- Numerical feasibility, integrality, bounds, and stopping status are reported separately.
- Sensitivity includes important uncertain coefficients or a stated limitation.
- Any proposed external action stays within the user's existing authorization.
- Use dated primary material for mathematical guarantees and vendor documentation for current solver semantics. Check solver status and conventions before interpreting its bounds; do not promote a heuristic or sample result into a global guarantee.
Navigation and Evidence
The helper's tests establish its arithmetic and input behavior. They do not establish live routing or improved optimization decisions by an agent.