Skip to main content

Cuopt Mip Algorithm Discovery

v26.12.00New

Install this skill

No account required. Pick your tool, then copy.

Run in your terminal. It detects your AI tool.

npx @skills-hub-ai/cli install skills-cuopt-mip-algorithm-discovery

What this does: Run an autonomous research loop to find the best cuOpt solve strategy for MIP instances from the same family, improving feasible solution quality and reducing optimality gaps.

Or get the file:
Browse all CLI commands →
Manual setup by platform

Claude Code

~/.claude/skills/skills-cuopt-mip-algorithm-discovery/SKILL.md

Setup guide →

Signing

SignedSLSA L2
Signed by
skills-hub.ai distributor
Method
Distributor-signed by skills-hub.aiSigned with the skills-hub.ai Ed25519 distributor key over this exact slug, version and content. Check it with `npx @skills-hub-ai/cli verify`.
Key
skills-hub-ed25519-2026-11
Signed
0Save

Instructions

cuOpt MIP algorithm discovery

Purpose

Reformulating a MIP model, tuning solver settings, adding custom algorithms, or orchestrating several solves can substantially improve feasible solution quality and reduce optimality gaps. This skill guides you through an autonomous iterative process to find the best solve strategy for a given set of instances.

Prerequisites

A working cuOpt Python installation with a compatible NVIDIA GPU. Use additional Python libraries, including GPU libraries such as CuPy or Numba, when useful.

Inputs

The user should provide:

  1. A set of development instances (MPS, LP, or QPS files) for evaluation and tuning, all from the same family of instances: the same optimization model with different data.
  2. A per-instance time limit.
  3. A time budget: the total duration of the research loop.
  4. A hardware allocation for each experiment: the GPU to use and the CPU thread limit.
  5. (Optional) A primary metric of interest: optimality gap (default), primal objective improvement, dual bound improvement, or time to best objective.
  6. (Optional) A set of held-out instances to assess how well the best solve strategy generalizes.
  7. (Optional) Additional context, such as a description of the problem or how the instances were generated.

Outputs

The main outputs of the research loop are:

  1. A Python script called solve.py that solves instances from the same family of instances using the best solve strategy found. Run it with:
 export CUDA_VISIBLE_DEVICES=$GPU_ID
 python solve.py --instance-path "$INSTANCE_PATH" --output-dir "$RUN_OUTPUT_DIR" --time-limit "$TIME_LIMIT" --num-cpu-threads "$NUM_CPU_THREADS"
  1. An experiments directory containing experiment artifacts and a concise summary.md beside solve.py describing the research loop and the best solve strategy found. Report the time used versus allocated, the number of distinct candidates evaluated on the full development set, and why the search ended. Include the ⚠️ dual bound warning explicitly, explaining where the final bound comes from and why it is valid.
  2. A dashboard.html copied from assets/dashboard.html into the working directory beside instances/ and experiments/ for the user to track progress.

The scripts/solve.py script provides the reference implementation and is structured as follows:

def solve(model, time_limit, num_cpu_threads=-1):
    """🔥 Editable: any solve strategy, returning results in the original model's terms."""
    ...
    return status, names, values, objective_value, dual_bound, incumbents_log

def run(instance_path, output_dir, time_limit, num_cpu_threads=-1, save_solution=True):
    # ❄️ Frozen: load the instance, call solve, validate, and save outputs. Do not modify.
    ...

Modify only solve. Define any helpers and imports inside it. You may mutate model, but return results in the original model's terms.

  • status: Return Optimal or FeasibleFound with a solution, Infeasible when proven, or the applicable cuOpt termination reason.
  • names, values: For a returned solution, provide aligned 1-D NumPy arrays covering every original variable exactly once.
  • objective_value, dual_bound: Report both on the original objective scale.
  • incumbents_log: Record each incumbent improvement from any source as (elapsed_seconds, objective_value, dual_bound). Measure elapsed time from the start of solve across all stages and restarts.

run rejects solutions that fail scripts/check_feasibility.py.

The script scripts/evaluate.py uses scripts/check_modifications.py to verify that only solve was modified. It then runs the candidate program on the development instances and aggregates the results into a metrics.csv file and a report.json file. The structure of the output is as follows:

.
├── solve.py # best experiment's `solve.py` program
├── check_feasibility.py
├── dashboard.html
├── summary.md
├── instances/
│   ├── instance_001.mps
│   ├── instance_002.mps
│   └── ...
└── experiments/
    ├── experiment_001/
    │   ├── solve.py
    │   ├── check_feasibility.py
    │   ├── metrics.csv
    │   ├── report.json
    │   └── artifacts/
    │       ├── instance_001/
    │       │   ├── metrics.json
    │       │   ├── solution.npz # skipped with --no-save-solution
    │       │   ├── incumbents.csv
    │       │   ├── stdout.log
    │       │   └── stderr.log
    │       └── ...
    └── ...

You are free to add other utility scripts or files that help track experiments and their results.

Available Scripts

ScriptPurposeArguments
solve.pySolve and validate one instance.Required: --instance-path, --output-dir, --time-limit. Optional: --num-cpu-threads, --no-save-solution.
evaluate.pyCheck the candidate, evaluate the instance set, and aggregate metrics.Required: --experiment-dir, --instances-dir, --time-limit, --experiment-name, --experiment-description. Optional: --baseline-dir, --num-cpu-threads, --no-save-solution.
check_modifications.pyCheck that only the candidate's solve function changed.--code-path; also called by evaluate.py.
check_feasibility.pyCheck a solution against the original instance.Python helper imported by solve.py; no command-line interface.

Metrics

The harness computes classic and symmetric scores for gaps (objective versus dual bound) and improvements (candidate versus baseline). Classic scores divide the difference by the magnitude of the objective for gaps or the baseline for improvements. Symmetric scores divide by the sum of both magnitudes.

During research, monitor symmetric gap and improvement scores throughout the run. Rank candidates by the user's primary metric (default: symmetric optimality gap), using the symmetric variant for gaps and improvements.

When reporting to the user, use classic gap and improvement scores in progress updates and the final summary. A near-zero denominator can turn a small change into a huge or infinite percentage. With an objective and dual bound of opposite signs, the classic gap can grow even as the absolute gap shrinks. If either compared value is near zero or their signs differ, report that metric’s symmetric score and label it as symmetric.

Each field below is the mean of the per-instance scores in metrics.csv, with equal weight for every development instance.

Field for rankingGoalPer-instance score
average_symmetric_optimality_gapMinimizeGap between the returned objective and its dual bound. Proven infeasibility scores 0. An unsolved instance, a missing finite bound, or a time-limit overrun scores infinity.
average_symmetric_objective_improvementMaximizeSigned improvement in the primal objective relative to that instance's baseline.
average_symmetric_dual_bound_improvementMaximizeSigned improvement in the dual bound relative to that instance's baseline.
average_time_to_bestMinimizeSeconds until the run first reached its returned objective, or until it proved infeasibility. An unsolved instance or a time-limit overrun scores the full per-instance time limit.

When average_symmetric_optimality_gap is infinite, compare the number of instances with finite gaps and inspect the remaining failures.

Instructions

Setup with the user

Before running anything, settle the inputs and send the user a dedicated message:

  1. Inputs. Restate the inputs, with defaults for optional ones, and ask only for what is missing. Without held-out instances, ask whether to reserve some development instances or proceed without a validated generalization claim.
  2. ⚠️ Dual bounds are not verified. The harness checks feasibility, not dual bounds, so a wrong gap or a false Optimal can go undetected. The user must review the final solve to confirm its bound is valid.
  3. Budget. Estimate how many full experiments fit: GPUs × usable budget ÷ (development instances × per-instance time limit). Below about 16, warn that the search will be shallow.
  4. Monitoring. Copy dashboard.html into the working directory, serve it (e.g., python -m http.server), and share its URL. Say they can message you during the run to steer the search.

Research loop

First, read the system clock, record the start time and deadline and evaluate the unmodified solve.py with evaluate.py on the entire development set to establish a baseline.

Then propose and test new candidates. Each full experiment evaluates one candidate solve.py on the entire development set. Use all available resources: run experiments in parallel, one per allocated GPU, launching a new candidate whenever a GPU is free, unless it depends on a running experiment's result. Number experiment directories in launch order so the user can follow progress in the directories and on the dashboard.

Experimental procedure

For each full experiment:

  1. Form a hypothesis. State what you will change, what evidence motivates it, and what result would support it. If the dual bound comes from anything other than a single cuOpt solve of the original model, explain why it is valid.
  2. Run the experiment. Save the candidate solve.py in a new experiment directory and run evaluate.py on the full development set. Supply --experiment-name (≤80 characters) and --experiment-description (≤1,000 characters describing the change and hypothesis). Omit --baseline-dir for the baseline and point it to the baseline experiment for later runs. If the run fails before meaningful optimization begins, record the cause, fix it and rerun in the same directory.
  3. Check the prediction. Compare the candidate with the baseline and, for a refinement, with the candidate it builds on. Use per-instance results and logs to explain the aggregate result. Record whether the evidence supports, contradicts, or leaves the hypothesis unresolved.
  4. Choose the next experiment. Use what you learned to decide whether to refine the candidate, test a different hypothesis, or rerun a comparison. Record the reason in a sentence.

Implementation constraints

Pass the allocated CPU thread count to evaluate.py via --num-cpu-threads, including for the baseline. All workers and library thread pools share that allocation. Concurrent experiments must have separate CPU allocations.

Pass --no-save-solution to evaluate.py or solve.py when you do not need to analyze solution.npz, to avoid filling the disk.
Keep each candidate focused on the experiment. Remove unused code and inactive branches.

The strategy must generalize across the family of instances. Do not hard-code instance identifiers, known solutions, or instance-specific constants. Derive structural assumptions from the input and validate them before use. Keep each run of solve self-contained. Never pass state between runs through files.

The per-instance time limit covers everything inside solve. Any overrun counts as unsolved, including time spent waiting for cuOpt to return. The baseline reserves three seconds for overruns. You may adjust or remove that margin.

When changing model dimensions, build a fresh DataModel with the complete transformed data. Resizing a loaded model in place can leave stale RHS/row-type metadata and cause validation errors or NoTermination.

Use the preinstalled cuOpt for every LP or MIP solve, including auxiliary solves and diagnostics. Do not use any other LP or MIP solvers, even through scipy.

Keep mip_absolute_gap and mip_relative_gap at their cuOpt defaults in every cuOpt solve. Return Optimal only when the original objective and a valid dual bound satisfy cuOpt's gap criterion. Leave mip_heuristics_only unset.

The harness cannot validate the dual bound. Every reported bound must be valid for the original model. If it comes from anything other than a single cuOpt solve of that model, explain why it is valid.

Search space

Within the implementation constraints, you may use any strategy inside solve, including reformulating, restricting, relaxing or decomposing the model; cuOpt settings (presolve, cuts, branching, heuristics, etc.); custom heuristic or exact algorithms, including your own dual bounds; warm starts; and multiple cuOpt solves, staged or concurrent, with any split of the time limit. Use the model structure, solver logs, cuOpt source code and prior results to choose what to test. If cuOpt’s search underperforms, first test settings targeting the observed bottleneck (e.g., sub-MIP fixing rates and budgets, competing heuristics, presolve effort, or cut passes), including their interactions, before building a replacement.

Exploration and exploitation. Test substantially different approaches before spending many experiments refining one. When an approach improves the user's primary metric, use the results to choose which changes are worth refining.

Plateaus. Track optimality gap, primal objective improvement and dual bound improvement alongside the user's primary metric. If successive refinements move the primary metric only within observed run-to-run variation, inspect the per-instance results to identify what still limits progress. Test a substantially different approach to that limitation.

cuOpt nondeterminism. The same candidate can produce different results on identical inputs. When an apparent gain could change what you pursue or select, rerun the contenders under comparable load, typically once or twice. Concurrent solves contend for CPU memory bandwidth, so a result depends on what else was running.

Budget

Use the full time budget and complete as many full experiments as possible. Stop iterating early only if one candidate proves optimality on every development instance within the per-instance time limit.

You may also spend time on other work as needed (analyzing logs or solutions, profiling, testing ideas on small or synthetic instances etc.).

Evaluation is usually the bottleneck. Plan launches around observed evaluation times and available GPUs. Estimates of implementation time are unreliable, so implement promising strategies even when they seem time-consuming to code.

Reserve time for cleanup, a final evaluation on the full development set, and reporting.

Selection

Rank eligible candidates by the primary metric, robustness and code quality. Judge robustness by how consistently a candidate returns valid results within the time limit and how well its gains hold up across reruns and development instances. Average all runs per configuration, including failures. Check whether one large gain masks regressions elsewhere. Prefer simpler candidates when performance is comparable.

Reserve time for cleanup and validation. Remove unused code and test whether questionable rules or special cases can be dropped. Update the solve docstring to describe the final solve strategy. Re-evaluate the final solve.py on the full development set. Keep the baseline if none improves on it.

If held-out instances are available, finalize the candidate first, then evaluate it and the baseline on those instances without further tuning.

This skill doesn’t include stateful context yet, instructions only. Learn about stateful skills.

Security

Loading security scan...

Reviews (0)

Browse all →
web-performance-auditorAI-powered web performance auditor for frontend and web developers. Use it to audit a website or web app, diagnose poor Core Web Vitals (LCP, CLS, INP) and low Lighthouse scores, review JavaScript bundle size, code splitting, lazy loading, image and font loading, hydration, React rendering, Next.js/Nuxt patterns, network waterfalls, third-party scripts, and caching. Produces a prioritized, senior-engineer performance audit with a score and concrete fixes.14 installsdeepstream-devNVIDIA DeepStream SDK development with Python pyservicemaker API. Use when building video analytics pipelines, GStreamer-based video processing, TensorRT inference integration, object detection/tracking, or Kafka/message broker integration.1 installsi4h-catheter-navigationOverview of `workflows/catheter_navigation/` (fluorosim DRR, XPBD physics, vasculature digital twin). Use when the user asks what the catheter navigation workflow is, what's supported, or where to start.0 installsomniverse-content-servicesOmniverse Content Services, also discoverable as Omniverse Content Workspace or USD Content Workspace. Use for USD content collaboration as well as content access. Guide USD workflows on existing infrastructure, USD content versioning, 3D creation pipelines, and data access across distributed and scale-out compute. Use for manufacturing, automotive, factory and digital-twin workflows, architecture and construction, media and 3D content, robotics, fleet simulation, and physical AI content delivery. Discover requirements and route to ovstorage, ovpackage, ovlive, usd-content-workspace, and usd-caches experts.0 installsdoca-rmaxDOCA Rivermax (doca_rmax) receive streams for timing-precise media over IP (SMPTE ST 2110 video / audio, market data, scientific feeds) on a target BlueField DPU (DOCA Rivermax apps run only there), once the Rivermax libraries and license are installed; getting them is doca-setup / doca-public-knowledge-map territory. Trigger on "ST 2110 receive isn't getting frames", "sub-microsecond jitter on my media receiver", "NOT_SUPPORTED from doca_rmax_init", "no recv events after stream start", or "license check failing on a media receiver", even without naming Rivermax. Covers doca_rmax_in_stream sessions, the SDK + license precondition check, doca_rmax_get_*_supported capability queries, pairing with doca-eth queues and doca-flow steering, and DOCA_ERROR_* from Rivermax calls. Refuse and route elsewhere for programming the underlying queue (doca-eth), steering rules (doca-flow), PTP / clock sync (doca-firefly), or best-effort packet I/O.0 installstao-train-segformerSegFormer for semantic segmentation. Lightweight transformer-based architecture with hierarchical feature extraction, efficient for real-time segmentation tasks. Use when training, evaluating, exporting, quantizing, or running inference for a TAO SegFormer model. Trigger phrases include "train SegFormer", "semantic segmentation", "lightweight transformer segmenter", "real-time semantic segmentation".0 installs

More from skills

View source →
nvidia-appNVIDIA App MCP: drivers, games, laptops, overlay. Check drivers, manage and optimize games, configure laptop features.3 installstao-run-automlRun container-backed AutoML / hyperparameter optimization (HPO) for NVIDIA TAO networks using AutoMLRunner. Handles algorithm selection (bayesian, hyperband, asha, bohb, llm, hybrid, autoresearch), WandB experiment tracking, job execution on any TAO SDK platform, result interpretation, and per-rec custom evaluation hooks. Use when the user mentions TAO AutoML, hyperparameter optimization, HPO, automl, automl_settings, AutoMLRunner, tao_automl, bayesian search, hyperband, ASHA, LLM-guided search, autoresearch, or wants to tune train/evaluate/inference/distill/prune/quantize for a TAO network. Model actions use the resolved image; venv training requires an explicit request. Platform-agnostic — runs on any SDK (Brev, SLURM, Kubernetes, Docker). Do not use generic "keep improving" language alone to override a matching domain-specific DEFT workflow; attribute-labelled CLIP / SigLIP image-retrieval loops belong to tao-run-deft-pas unless HPO is explicit.1 installsnvidia-ontology-setupSet up or troubleshoot the Auto Ontology runtime. Use for Helm (the official install), Docker Compose, developer setup, and MCP connection to an existing deployment.1 installsnvidia-skill-finderUse for NVIDIA-related requests where an NVIDIA skill might help, even if the user did not ask for a skill. Trigger on NVIDIA products, hardware, software, SDKs, GPUs, Jetson/JetPack/L4T/BSP/SDK Manager/driver/flashing/setup, CUDA, NIM, NeMo, Omniverse/OpenUSD/SimReady, Isaac, RAPIDS/cuDF, cuPyNumeric, cuOpt, Dynamo, Holoscan, TensorRT, DeepStream, VSS, TAO, NGC/NVCF. Do not use for generic non-NVIDIA route, optimize, deploy, AI, video, data, or infrastructure tasks.1 installsrunai-diagnose-failed-workloadUse to diagnose failed, crashed, stopped, OOMKilled, CrashLoopBackOff, ImagePullBackOff, init, mount, node, or policy-terminated Run:ai workloads. Investigate one workload's failure; use other skills for workload health summaries, cluster health, scheduling-only Pending, or inference latency without a confirmed failure.1 installscdf-event-video-generationRun the CDF Orchestration Event Video Generation DAG on Kubernetes or OSMO - image-to-video anomaly generation, auto-labeling, and anomaly dataset generation. Select for requests about event video generation, anomaly video generation, image-to-video synthesis, Cosmos3 image2video, anomaly dataset creation, safety/surveillance SDG, or generating person-falling, person-climbing, person-running, fighting, smoking/vaping, fire/smoke, or shoplifting video clips from a seed image. Covers both event_video_generation_dag_k8s and the external-endpoints-only event_video_generation_dag_osmo. Runs environment setup first when controller readiness is unknown. Not for person-crop clothing/attribute augmentation (that is cdf-image-attribute-augmentation) and not for video style transfer.1 installs

More Build skills

Browse category →
senior-frontendShowcaseBuild and review React, Next.js, TypeScript or Tailwind frontends: components, scaffolding, performance and bundle size. Use whenever the user wants a new component or app, a page feels slow, the bundle is too big, or asks for a frontend code review.657 installsui-design-systemShowcaseUse when building a design system: tokens, component docs, responsive scales or developer handoff. Generates tokens with design_token_generator.py.562 installsfounder-consumerThe consumer panel. Spins up a swarm of buyer sub-agents (default 100, --quick for 20) trained on the user's target customer, each with a different income, age, buying behaviour and objection, shows every one the same pitch, and runs the business through 100 buyer scenarios to see who buys, who doesn't, and why. Tallies the answers into buy rates by segment, the reasons people pass in their own words, what would flip a no, and price answers for founder-pricing. Use when the user says "would people buy this", "test it on customers", "run the consumer panel", "simulate buyers", "who is my customer", or "validate demand".417 installsfrontend-designShowcaseGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.376 installssenior-backendShowcaseBuild and fix backend services: REST or GraphQL APIs, auth, microservices, PostgreSQL queries, migrations and load tests. Use whenever the user's API is slow or broken, needs login or auth added, a schema change, or a new endpoint or service scaffolded.270 installsself-improving-agentCurate what the agent has learned into durable project knowledge. Reviews Claude Code auto-memory (MEMORY.md and its topic files) for learnings worth keeping, promotes proven ones into CLAUDE.md or .claude/rules/, records a correction as a lesson that persists across sessions, prunes stale or duplicate entries, and turns a recurring fix into a reusable skill. Use whenever the user asks what you have learned or saved about the project, which memories should become permanent rules, to remember a lesson or stop repeating a mistake, or to clean up, audit or check memory health.187 installs

Frequently asked questions about cuopt-mip-algorithm-discovery

What does the cuopt-mip-algorithm-discovery skill do?

Run an autonomous research loop to find the best cuOpt solve strategy for MIP instances from the same family, improving feasible solution quality and reducing optimality gaps. It's a reusable SKILL.md instruction set that loads into your AI coding assistant on demand, no prompt engineering, no copy-pasting every session.

How do I install the cuopt-mip-algorithm-discovery skill?

Run `npx @skills-hub-ai/cli install skills-cuopt-mip-algorithm-discovery` from your terminal. The CLI writes the SKILL.md to the correct location for your AI tool (e.g. ~/.claude/skills/skills-cuopt-mip-algorithm-discovery/ for Claude Code or ~/.cursor/skills/ for Cursor with --target cursor) and adds it to your project's .skills.json lockfile.

Which AI tools does cuopt-mip-algorithm-discovery work with?

cuopt-mip-algorithm-discovery runs in Claude Code. It follows the open Agent Skills standard (SKILL.md), so the same skill works in every supported tool without modification.

Is the cuopt-mip-algorithm-discovery skill free?

Yes. Every skill on skills-hub.ai is free and open-source. There are no premium tiers, paywalls, or usage limits. You only pay for whatever AI assistant you're already using.

How do I use cuopt-mip-algorithm-discovery after installing it?

In Claude Code, type `/skills-cuopt-mip-algorithm-discovery` (or whatever slash command the skill registers) and the AI follows the skill's instructions immediately. You can also reference it by name in natural language, your AI loads the skill into context when relevant.

Can I share the cuopt-mip-algorithm-discovery skill with my team?

Yes. Commit your project's .skills.json lockfile and teammates run `npx @skills-hub-ai/cli install` (no args) to install every skill at the exact version you pinned. Organization-scoped installs work via skills-hub.ai organizations.

Badge for your README

Show that this skill is on Skills Hub. The badge links back to this page and shows the live install count.

Install on Skills Hub badge preview
Markdown
[![Install on Skills Hub](https://skills-hub.ai/api/badges/skill/skills-cuopt-mip-algorithm-discovery)](https://skills-hub.ai/skills/skills-cuopt-mip-algorithm-discovery)
HTML
<a href="https://skills-hub.ai/skills/skills-cuopt-mip-algorithm-discovery"><img src="https://skills-hub.ai/api/badges/skill/skills-cuopt-mip-algorithm-discovery" alt="Install on Skills Hub"></a>

More options in the badge docs.