cuOpt MIP C API Reference#

This section contains the cuOpt MIP C API reference. Functions for problem creation, solver settings, solving, and inspecting solutions are shared with convex optimization and documented in cuOpt Convex Optimization C API Reference.

Warm Start and MIP Start#

For LP problems solved with PDLP, see cuOpt Convex Optimization C API Reference for primal and dual warm start.

For MIP problems, one or more primal solution hints (MIP starts) may be provided:

cuopt_int_t cuOptAddMIPStart(
cuOptSolverSettings settings,
const cuopt_float_t *solution,
cuopt_int_t num_variables
)#

Add an initial solution (MIP start) for MIP solving.

This function can be called multiple times to add multiple MIP starts. The solver will use these as starting points for the MIP search.

Attention

Currently unsupported with presolve on.

Note

All pointer arguments (solution) refer to host memory.

Parameters:
  • settings[in] - The solver settings object.

  • solution[in] - A pointer to an array of type cuopt_float_t of size num_variables containing the solution values.

  • num_variables[in] - The number of variables (size of the solution array).

Returns:

A status code indicating success or failure.

MIP Solution Callbacks#

The following callback types and functions allow monitoring and injecting solutions during a MIP solve.

typedef void (*cuOptMIPGetSolutionCallback)(const cuopt_float_t *solution, const cuopt_float_t *objective_value, const cuopt_float_t *solution_bound, void *user_data)#

Type of callback for receiving incumbent MIP solutions with user context.

Note

All pointer arguments (solution, objective_value, solution_bound, user_data) refer to host memory and are only valid during the callback invocation. Do not pass device/GPU pointers. Copy any data you need to keep after the callback returns.

Param solution:

[in] - Pointer to incumbent solution values. The allocated array for solution pointer must be at least the number of variables in the original problem.

Param objective_value:

[in] - Pointer to incumbent objective value.

Param solution_bound:

[in] - Pointer to current solution (dual/user) bound.

Param user_data:

[in] - Pointer to user data.

typedef void (*cuOptMIPSetSolutionCallback)(cuopt_float_t *solution, cuopt_float_t *objective_value, const cuopt_float_t *solution_bound, void *user_data)#

Type of callback for injecting MIP solutions with user context.

Note

All pointer arguments (solution, objective_value, solution_bound, user_data) refer to host memory and are only valid during the callback invocation. Do not pass device/GPU pointers. Copy any data you need to keep after the callback returns.

Param solution:

[out] - Pointer to solution values to set. The allocated array for solution pointer must be at least the number of variables in the original problem.

Param objective_value:

[out] - Pointer to objective value to set.

Param solution_bound:

[in] - Pointer to current solution (dual/user) bound.

Param user_data:

[in] - Pointer to user data.

cuopt_int_t cuOptSetMIPGetSolutionCallback(
cuOptSolverSettings settings,
cuOptMIPGetSolutionCallback callback,
void *user_data
)#

Register a callback to receive incumbent MIP solutions.

Note

The callback arguments refer to host memory and are only valid during the callback invocation. Do not pass device/GPU pointers. Copy any data you need to keep after the callback returns.

Parameters:
  • settings[in] - The solver settings object.

  • callback[in] - Callback function to receive incumbent solutions.

  • user_data[in] - User-defined pointer passed through to the callback. It will be forwarded to cuOptMIPGetSolutionCallback when invoked.

Returns:

A status code indicating success or failure.

cuopt_int_t cuOptSetMIPSetSolutionCallback(
cuOptSolverSettings settings,
cuOptMIPSetSolutionCallback callback,
void *user_data
)#

Register a callback to inject MIP solutions.

Note

Registering a set-solution callback disables presolve.

Note

The callback arguments refer to host memory and are only valid during the callback invocation. Do not pass device/GPU pointers. Copy any data you need to keep after the callback returns.

Parameters:
  • settings[in] - The solver settings object.

  • callback[in] - Callback function to inject solutions.

  • user_data[in] - User-defined pointer passed through to the callback. It will be forwarded to cuOptMIPSetSolutionCallback when invoked.

Returns:

A status code indicating success or failure.

MIP Parameter Constants#

These constants configure MIP-specific solver behavior. Use them with cuOptSetParameter(), cuOptSetIntegerParameter(), or cuOptSetFloatParameter(). For shared parameters (time limit, logging, presolve, etc.), see Parameter Constants in the convex API reference.

CUOPT_NODE_LIMIT#
CUOPT_WORK_LIMIT#
CUOPT_RANDOM_SEED#
CUOPT_PRESOLVE_FILE#
CUOPT_MIP_ABSOLUTE_TOLERANCE#
CUOPT_MIP_RELATIVE_TOLERANCE#
CUOPT_MIP_INTEGRALITY_TOLERANCE#
CUOPT_MIP_ABSOLUTE_GAP#
CUOPT_MIP_RELATIVE_GAP#
CUOPT_MIP_SCALING#
CUOPT_MIP_HEURISTICS_ONLY#
CUOPT_MIP_PRESOLVE#
CUOPT_MIP_DETERMINISM_MODE#
CUOPT_MIP_SYMMETRY#
CUOPT_MIP_PROBING#
CUOPT_MIP_RELIABILITY_BRANCHING#
CUOPT_MIP_CUT_PASSES#
CUOPT_MIP_MIXED_INTEGER_ROUNDING_CUTS#
CUOPT_MIP_MIXED_INTEGER_GOMORY_CUTS#
CUOPT_MIP_KNAPSACK_CUTS#
CUOPT_MIP_FLOW_COVER_CUTS#
CUOPT_MIP_IMPLIED_BOUND_CUTS#
CUOPT_MIP_CLIQUE_CUTS#
CUOPT_MIP_STRONG_CHVATAL_GOMORY_CUTS#
CUOPT_MIP_REDUCED_COST_STRENGTHENING#
CUOPT_MIP_OBJECTIVE_STEP#
CUOPT_MIP_CUT_CHANGE_THRESHOLD#
CUOPT_MIP_CUT_MIN_ORTHOGONALITY#
CUOPT_MIP_BATCH_PDLP_STRONG_BRANCHING#
CUOPT_MIP_BATCH_PDLP_RELIABILITY_BRANCHING#
CUOPT_MIP_STRONG_BRANCHING_SIMPLEX_ITERATION_LIMIT#
CUOPT_MIP_SEMICONTINUOUS_BIG_M#

MIP Determinism Mode Constants#

These constants are used to configure CUOPT_MIP_DETERMINISM_MODE via cuOptSetIntegerParameter().

CUOPT_MODE_OPPORTUNISTIC#
CUOPT_MODE_DETERMINISTIC#