cuOpt Numerical Optimization — CLI
Solve LP, MILP, and QP problems from MPS files via cuopt_cli. The same command, options, and MPS workflow apply across all three; QP uses the standard MPS quadratic-objective extension.
Confirm problem type and formulation (variables, objective, constraints, variable types) before coding.
This skill is CLI only (MPS input).
Basic usage
# Solve LP or MILP from MPS file
cuopt_cli problem.mps
# With options
cuopt_cli problem.mps --time-limit 120 --mip-relative-tolerance 0.01
Common options
cuopt_cli --help
# Time limit (seconds)
cuopt_cli problem.mps --time-limit 120
# MIP gap tolerance (stop when within X% of optimal)
cuopt_cli problem.mps --mip-relative-tolerance 0.001
# MIP absolute tolerance
cuopt_cli problem.mps --mip-absolute-tolerance 0.0001
# Presolve, iteration limit, method
cuopt_cli problem.mps --presolve --iteration-limit 10000 --method 1
MPS format (required sections, in order)
- NAME — problem name
- ROWS — N (objective), L/G/E (constraints)
- COLUMNS — variable names, row names, coefficients
- RHS — right-hand side values
- BOUNDS (optional) — LO, UP, FX, BV, LI, UI
- ENDATA
Integer variables: use 'MARKER' 'INTORG' before and 'MARKER' 'INTEND' after the integer columns.
QP via CLI (beta)
Quadratic objectives extend the standard MPS workflow — same cuopt_cli command, same options. Check cuopt_cli --help for QP-specific flags and the repo docs at docs/cuopt/source/cuopt-cli/ for the quadratic-objective MPS format.
QP rules:
- MINIMIZE only. For maximization, negate the objective coefficients (and Q entries) in the MPS file.
- Continuous variables only — do not mix integer markers with quadratic objectives.
Troubleshooting
- Failed to parse MPS — Check ENDATA, section order (NAME, ROWS, COLUMNS, RHS, [BOUNDS], ENDATA), integer markers.
- Infeasible — Check constraint directions (L/G/E) and RHS values.
Examples
- assets/README.md — Build/run for sample MPS files
- lp_simple — Minimal LP (PROD_X, PROD_Y, two constraints)
- lp_production — Production planning: chairs + tables, wood/labor
- milp_facility — Facility location with binary open/close
Getting the CLI
CLI is included with the Python package (cuopt). Install via pip or conda; then run cuopt_cli --help to verify.
1---2name: nvidia-cuopt-numerical-optimization-api-cli3description: LP, MILP, and QP (beta) with cuOpt — CLI only (MPS files, cuopt_cli).4 Use when the user is solving LP, MILP, or QP from MPS via command line.5license: Apache-2.0 AND CC-BY-4.06metadata:7 version: 26.08.008 author: NVIDIA9---101112# cuOpt Numerical Optimization — CLI1314Solve LP, MILP, and QP problems from MPS files via `cuopt_cli`. The same command, options, and MPS workflow apply across all three; QP uses the standard MPS quadratic-objective extension.1516Confirm problem type and formulation (variables, objective, constraints, variable types) before coding.1718This skill is **CLI only** (MPS input).1920## Basic usage2122```bash23# Solve LP or MILP from MPS file24cuopt_cli problem.mps2526# With options27cuopt_cli problem.mps --time-limit 120 --mip-relative-tolerance 0.0128```2930## Common options3132```bash33cuopt_cli --help3435# Time limit (seconds)36cuopt_cli problem.mps --time-limit 1203738# MIP gap tolerance (stop when within X% of optimal)39cuopt_cli problem.mps --mip-relative-tolerance 0.0014041# MIP absolute tolerance42cuopt_cli problem.mps --mip-absolute-tolerance 0.00014344# Presolve, iteration limit, method45cuopt_cli problem.mps --presolve --iteration-limit 10000 --method 146```4748## MPS format (required sections, in order)49501. **NAME** — problem name512. **ROWS** — N (objective), L/G/E (constraints)523. **COLUMNS** — variable names, row names, coefficients534. **RHS** — right-hand side values545. **BOUNDS** (optional) — LO, UP, FX, BV, LI, UI556. **ENDATA**5657Integer variables: use `'MARKER' 'INTORG'` before and `'MARKER' 'INTEND'` after the integer columns.5859## QP via CLI (beta)6061Quadratic objectives extend the standard MPS workflow — same `cuopt_cli` command, same options. Check `cuopt_cli --help` for QP-specific flags and the repo docs at `docs/cuopt/source/cuopt-cli/` for the quadratic-objective MPS format.6263**QP rules:**64- **MINIMIZE only.** For maximization, negate the objective coefficients (and Q entries) in the MPS file.65- **Continuous variables only** — do not mix integer markers with quadratic objectives.6667## Troubleshooting6869- **Failed to parse MPS** — Check ENDATA, section order (NAME, ROWS, COLUMNS, RHS, [BOUNDS], ENDATA), integer markers.70- **Infeasible** — Check constraint directions (L/G/E) and RHS values.7172## Examples7374- [assets/README.md](assets/README.md) — Build/run for sample MPS files75- [lp_simple](assets/lp_simple/) — Minimal LP (PROD_X, PROD_Y, two constraints)76- [lp_production](assets/lp_production/) — Production planning: chairs + tables, wood/labor77- [milp_facility](assets/milp_facility/) — Facility location with binary open/close7879## Getting the CLI8081CLI is included with the Python package (`cuopt`). Install via pip or conda; then run `cuopt_cli --help` to verify.