Skip to content
Skills Library
Data & analytics · Building & coding

cuopt-numerical-optimization-api

/cuopt-numerical-optimization-api

LP, MILP, and QP (beta) with cuOpt — Python, C, and CLI. Use when the user is solving LP, MILP, or QP with any cuOpt interface.

Repository
cuopt ↗
Licence
Apache-2.0
Last repository change
27.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
52
Scripts
10
HTML comments
0
URLs in SKILL.md
1
Deprecation

No signals detected. Repository changed on 27.10.2026, without references to retired models or APIs.

Licence

Apache-2.0, otwarta: można używać i zmieniać, z zachowaniem licencji i informacji o zmianach.

What to check before installing
  • 10 scripts in this package. Review them before installing, as Claude may execute them.

Scripts: assets/python/least_squares/model.py, assets/python/lp_basic/model.py, assets/python/lp_duals/model.py, assets/python/lp_warmstart/model.py, assets/python/maximization_workaround/model.py, assets/python/milp_basic/incumbent_callback.py, assets/python/milp_basic/model.py, assets/python/milp_production_planning/model.py, assets/python/mps_solver/model.py, assets/python/portfolio/model.py

What it does and when to use it

LP, MILP, and QP (beta) with cuOpt — Python, C, and CLI. Use when the user is solving LP, MILP, or QP with any cuOpt interface.

Original author description

LP, MILP, and QP (beta) with cuOpt — Python, C, and CLI. Use when the user is solving LP, MILP, or QP with any cuOpt interface.

How it works

  1. Interface Selection
  2. Choosing LP vs MILP vs QP
  3. Integer vs Continuous from Wording
  4. QP Rules (all interfaces)
  5. Dual Values
  6. Common Issues (all interfaces)
  7. Solver Settings (concepts)
Original SKILL.md headings · 88 lines, 703 words
SKILL.md preview
---
name: cuopt-numerical-optimization-api
version: "26.12.00"
description: LP, MILP, and QP (beta) with cuOpt — Python, C, and CLI. Use when the user is solving LP, MILP, or QP with any cuOpt interface.
license: Apache-2.0
metadata:
  author: NVIDIA cuOpt Team
  tags:
    - cuopt
    - linear-programming
    - milp
    - qp
    - python
    - c-api
    - cli
---



# cuOpt Numerical Optimization API

Model and solve LP, MILP, and QP problems using NVIDIA cuOpt's GPU-accelerated solver.

## Interface Selection

Choose the reference for the user's interface:

| Interface | When to use | Reference |
|-----------|-------------|-----------|
| **Python** | User is writing Python code | [references/python_api.md](references/python_api.md) |
| **C / C++** | User is embedding in a C/C++ application | [references/c_api.md](references/c_api.md) |
| **CLI** | User is solving from MPS files on the command line | [references/cli_api.md](references/cli_api.md) |

If the interface is not yet clear, ask before writing any code.

**Already using a modeling language?** cuOpt also works as a solver backend for third-party
modeling tools — **AMPL, GAMS / GAMSPy, PuLP, JuMP, Pyomo, and CVXPY** — with near-zero code
changes (point the model's solver at cuOpt). CVXPY additionally covers convex QP and, in beta,
QCQP / SOCP. Prefer this when the user already has a model in one of these tools rather than porting
it to the cuOpt API. See
[Third-Party Modeling Languages](https://docs.nvidia.com/cuopt/user-guide/latest/thirdparty_modeling_languages/index.html).

## Choosing LP vs MILP vs QP

**Decide from the objective and variables:**

| If the objective is... | And variables are... | Use |
|---|---|---|
| Linear (sum of `c_i * x_i`) | All continuous | **LP** |
| Linear | Some integer or binary | **MILP** |
| Has squared (`x*x`) or cross (`x*y`) terms | Continuous (integer QP not supported) | **QP** (beta) |

**Prefer LP when the problem allows it.** LP solves faster and has stronger optimality guarantees. Use MILP only when the problem logically requires whole numbers or yes/no decisions. Use QP only when the objective is genuinely quadratic (variance, squared error, kinetic energy).

- **Use LP** when every quantity can meaningfully be fractional: flows, proportions, rates, dollars, hours, tonnes of material, etc.
- **Use MILP** when the problem mentions **counts** of discrete entities, **yes/no** choices, or **either/or** decisions (e.g. open a facility or not, assign a person to a shift, number of trucks).
- **Use QP** when the objective minimizes variance, squared error, or any expression with `x*x` or `x*y` terms (portfolio optimization, least squares, regularized regression).

## Integer vs Continuous from Wording

| Problem wording / concept | Variable type | Examples |
|---------------------------|---------------|----------|
| **Discrete entities (counts)** | **INTEGER** | Workers, cars, trucks, machines, pilots, facilities, units to manufacture |
| **Yes/no or on/off** | **INTEGER** (binary, lb=0 ub=1) | Open a facility, run a machine, assign a person to a shift |
| **Amounts that can be fractional** | **CONTINUOUS** | Tonnes, litres, dollars, hours, kWh, proportion of capacity |
| **Rates or fractions** | **CONTINUOUS** | Utilization, percentage, share of budget |

**Rule of thumb:** "How many *things*" → INTEGER. "How much" → CONTINUOUS.

## QP Rules (all interfaces)

- **MINIMIZE only** — the solver rejects MAXIMIZE for quadratic objectives. To maximize `f(x)`, minimize `-f(x)` and negate the reported objective value.
- **Continuous variables only** — integer QP is not supported.
- **Q should be positive semi-definite** for a convex, well-posed problem.
- **Beta** — API may evolve; treat as production-capable for typical convex QP.

## Dual Values

Duals and reduced costs are available for **LP and QP only**:
- **MILP** — no duals (integer optima are not continuous).
- **Quadratic constraints** — duals unavailable even for LP/QP; all values return `NaN`.
- **PDLP warmstart** — LP only; MILP solves do not accept a PDLP warmstart.

## Common Issues (all interfaces)

| Problem | Likely cause | Fix |
|---------|-------------|-----|
| Infeasible | Conflicting constraints | Check constraint logic and bounds |
| Unbounded | Missing bounds | Add variable bounds |
| Slow solve | Large problem | Set time limit; increase gap tolerance |
| QP rejected with MAXIMIZE | QP only supports MINIMIZE | Negate the objective; negate the result |
| QP returns non-optimal | Q not PSD or badly scaled | Check Q is PSD; rescale variables |

## Solver Settings (concepts)

| Setting | Purpose |
|---------|---------|
| `time_limit` | Stop after N seconds |
| `mip_relative_gap` | Stop MILP when within X% of optimal |
| `mip_absolute_tolerance` | Absolute MIP gap stop |
| `log_to_console` | Enable solver logging |

Syntax varies by interface — see the interface reference file.
Files in this package (52)
  • BENCHMARK.md 5 KB
  • SKILL.md 5 KB
  • skill-card.md 4 KB
  • skill.oms.sig 16 KB
  • assets/c/README.md 2 KB
  • assets/c/lp_basic/README.md 1 KB
  • assets/c/lp_basic/lp_simple.c 4 KB
  • assets/c/lp_duals/README.md 1 KB
  • assets/c/lp_duals/lp_duals.c 4 KB
  • assets/c/lp_warmstart/README.md 1 KB
  • assets/c/milp_basic/README.md 1 KB
  • assets/c/milp_basic/milp_simple.c 3 KB
  • assets/c/milp_production_planning/README.md 1 KB
  • assets/c/milp_production_planning/milp_production.c 3 KB
  • assets/c/mps_solver/README.md 1 KB
  • assets/c/mps_solver/mps_solver.c 3 KB
  • assets/c/mps_solver/data/sample.mps 1 KB
  • assets/cli/README.md 1 KB
  • assets/cli/lp_production/README.md 1 KB
  • assets/cli/lp_production/production.mps 1 KB
  • assets/cli/lp_simple/README.md 1 KB
  • assets/cli/lp_simple/sample.mps 1 KB
  • assets/cli/milp_facility/README.md 1 KB
  • assets/cli/milp_facility/facility.mps 1 KB
  • assets/python/README.md 1 KB
  • assets/python/least_squares/README.md 1 KB
  • assets/python/least_squares/model.py 1 KB
  • assets/python/lp_basic/README.md 1 KB
  • assets/python/lp_basic/model.py 1 KB
  • assets/python/lp_duals/README.md 1 KB
  • assets/python/lp_duals/model.py 1 KB
  • assets/python/lp_warmstart/README.md 1 KB
  • assets/python/lp_warmstart/model.py 2 KB
  • assets/python/maximization_workaround/README.md 1 KB
  • assets/python/maximization_workaround/model.py 1 KB
  • assets/python/milp_basic/README.md 1 KB
  • assets/python/milp_basic/incumbent_callback.py 2 KB
  • assets/python/milp_basic/model.py 1 KB
  • assets/python/milp_production_planning/README.md 1 KB
  • assets/python/milp_production_planning/model.py 1 KB
  • assets/python/mps_solver/README.md 2 KB
  • assets/python/mps_solver/model.py 8 KB
  • assets/python/mps_solver/results.md 2 KB
  • assets/python/mps_solver/data/README.md 2 KB
  • assets/python/mps_solver/data/sample.mps 1 KB
  • assets/python/portfolio/README.md 1 KB
  • assets/python/portfolio/model.py 2 KB
  • evals/evals.json 14 KB
  • references/c_api.md 5 KB
  • references/cli_api.md 5 KB
  • references/python_api.md 5 KB
  • references/qp_examples.md 6 KB

Versions

The database has no other skills named cuopt-numerical-optimization-api.

Database snapshot: 13.11.2026 · package version 3962d95e2b36 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100cuopt-numerical-optimization-api-cli
    LP, MILP, and QP (beta) with cuOpt — CLI only (MPS files, cuopt_cli). Use when the user is solving LP, MILP, or QP from MPS via command line.
  • 100nvidia-cuopt-numerical-optimization-api-c
    LP, MILP, and QP (beta) with cuOpt — C API only. Use when the user is embedding LP, MILP, or QP in C/C++.
  • 100nvidia-cuopt-numerical-optimization-api-python
    Solve Linear Programming (LP), Mixed-Integer Linear Programming (MILP), and Quadratic Programming (QP, beta) with the Python API. Use when the user asks about optimization with linear or quadratic objectives, linear constraints, integer variables, scheduling, resource…
  • 100cuopt-debugging
    Troubleshoot cuOpt LP/MILP problems including errors, wrong results, infeasible solutions, performance issues, and status codes. Use when the user says something isn't working, gets unexpected results, or needs help diagnosing issues.
  • 100cuopt-routing-api-python
    Vehicle routing (VRP, TSP, PDP) with cuOpt — Python API only. Use when the user is building or solving routing in Python.
  • 100cuopt-server-api-python
    cuOpt REST server — start server, endpoints, Python/curl client examples. Use when the user is deploying or calling the REST API.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.