Solvers Module API

The solvers module provides a unified interface to multiple optimization solvers, enabling you to switch between different solvers with a single line of code.

Overview

The solvers module implements a solver-agnostic optimization interface through three main components:

        graph TD
    A[LXOptimizer] --> B[LXSolverInterface]
    B --> C[LXORToolsSolver]
    B --> D[LXGurobiSolver]
    B --> E[LXCPLEXSolver]
    B --> F[LXGLPKSolver]
    B --> G[LXCPSATSolver]
    H[LXSolverCapability] --> B
    I[LXSolverFeature] --> H

    style A fill:#e1f5ff
    style B fill:#fff4e1
    style C fill:#e1ffe1
    style D fill:#e1ffe1
    style E fill:#e1ffe1
    style F fill:#e1ffe1
    style G fill:#e1ffe1
    style H fill:#ffe1e1
    style I fill:#f0e1ff
    

Components

Optimizer

lumix.solvers.base.LXOptimizer

Main optimizer with full generic support.

The LXOptimizer class provides the high-level interface for solving optimization models with configurable solver selection and options.

Solver Interface

lumix.solvers.base.LXSolverInterface

Abstract base class for all solver interfaces.

The LXSolverInterface abstract base class defines the contract that all solver implementations must follow.

Solver Implementations

lumix.solvers.ortools_solver.LXORToolsSolver

OR-Tools solver implementation for LumiX.

lumix.solvers.gurobi_solver.LXGurobiSolver

Gurobi solver implementation for LumiX.

lumix.solvers.cplex_solver.LXCPLEXSolver

CPLEX solver implementation for LumiX.

lumix.solvers.glpk_solver.LXGLPKSolver

GLPK (GNU Linear Programming Kit) solver implementation for LumiX.

lumix.solvers.cpsat_solver.LXCPSATSolver

OR-Tools CP-SAT (Constraint Programming - Satisfiability) solver implementation for LumiX.

Solver implementations for different optimization engines:

Capability Management

lumix.solvers.capabilities.LXSolverCapability

Describes a solver's capabilities.

lumix.solvers.capabilities.LXSolverFeature

Solver features/capabilities (bit flags for combinations).

Capability detection and feature flags:

Pre-defined Capabilities

lumix.solvers.capabilities.ORTOOLS_CAPABILITIES

Describes a solver's capabilities.

lumix.solvers.capabilities.GUROBI_CAPABILITIES

Describes a solver's capabilities.

lumix.solvers.capabilities.CPLEX_CAPABILITIES

Describes a solver's capabilities.

lumix.solvers.capabilities.GLPK_CAPABILITIES

Describes a solver's capabilities.

lumix.solvers.capabilities.CPSAT_CAPABILITIES

Describes a solver's capabilities.

Pre-configured capability objects for each supported solver.

Detailed API Reference

Optimizer

Base solver interface for LumiX.

class lumix.solvers.base.LXSolverInterface(capability)[source]

Bases: ABC, Generic[TModel]

Abstract base class for all solver interfaces.

Provides: - Unified API across solvers (OR-Tools, Gurobi, CPLEX) - Capability detection - Automatic linearization when needed - Type-safe solution mapping

Parameters:

capability (LXSolverCapability)

__init__(capability)[source]

Initialize solver interface.

Parameters:

capability (LXSolverCapability) – Solver capability description

abstract build_model(model)[source]

Build solver-specific model from LumiX model.

Parameters:

model (LXModel[TypeVar(TModel)]) – OPtiXNG model

Return type:

Any

Returns:

Solver-specific model object

abstract solve(model, time_limit=None, gap_tolerance=None, **solver_params)[source]

Solve the optimization model.

Parameters:
  • model (LXModel[TypeVar(TModel)]) – LumiX model

  • time_limit (Optional[float]) – Time limit in seconds

  • gap_tolerance (Optional[float]) – MIP gap tolerance

  • **solver_params (Any) – Additional solver-specific parameters

Return type:

LXSolution[TypeVar(TModel)]

Returns:

Solution object

abstract get_solver_model()[source]

Get underlying solver model for advanced usage.

Return type:

Any

Returns:

Solver-specific model object

class lumix.solvers.base.LXOptimizer(orm=None)[source]

Bases: Generic[TModel]

Main optimizer with full generic support.

Provides high-level interface to: - Select solver - Configure rational conversion - Enable sensitivity analysis - Solve models

Examples

optimizer = LXOptimizer[Product](orm_context)

.use_solver(“gurobi”) .enable_sensitivity() .enable_rational_conversion()

solution = optimizer.solve(model)

Parameters:

orm (LXORMContext[TModel] | None)

__init__(orm=None)[source]

Initialize optimizer.

Parameters:

orm (Optional[LXORMContext[TypeVar(TModel)]]) – Optional ORM context for data access

use_solver(name, **kwargs)[source]

Set solver with literal type checking.

Parameters:

name (Literal['ortools', 'gurobi', 'cplex', 'cpsat', 'glpk']) – Solver name (“ortools”, “gurobi”, “cplex”, “cpsat”, “glpk”)

Return type:

Self

Returns:

Self for chaining

enable_rational_conversion(max_denom=10000)[source]

Enable float-to-rational conversion.

Parameters:

max_denom (int) – Maximum denominator for rational approximation

Return type:

Self

Returns:

Self for chaining

enable_linearization(big_m=1000000.0, pwl_segments=20, pwl_method='sos2', prefer_sos2=True, adaptive_breakpoints=True, mccormick_tighten_bounds=True, **kwargs)[source]

Enable automatic linearization for nonlinear terms.

Mirrors enable_rational_conversion() API pattern for consistency.

When enabled, the optimizer will automatically:

  • Detect nonlinear terms in the model

  • Check if solver lacks native support

  • Apply appropriate linearization techniques:

    • Binary × Binary: AND logic

    • Binary × Continuous: Big-M method

    • Continuous × Continuous: McCormick envelopes

    • Piecewise-linear approximations for exp, log, sin, cos, etc.

Parameters:
  • big_m (float) – Big-M constant for conditional constraints (default: 1e6)

  • pwl_segments (int) – Number of segments for piecewise-linear approximations (default: 20)

  • pwl_method (Literal['sos2', 'incremental', 'logarithmic']) – Method for PWL (“sos2”, “incremental”, “logarithmic”)

  • prefer_sos2 (bool) – Use SOS2 formulation when solver supports it (default: True)

  • adaptive_breakpoints (bool) – Use adaptive breakpoint generation for PWL (default: True)

  • mccormick_tighten_bounds (bool) – Apply bound tightening for McCormick envelopes (default: True)

  • **kwargs (Any) – Additional linearization configuration options

Return type:

Self

Returns:

Self for chaining

Example:

optimizer = (
    LXOptimizer[Product]()
    .use_solver("ortools")
    .enable_linearization(
        big_m=1e5,
        pwl_segments=30,
        adaptive_breakpoints=True
    )
)

solution = optimizer.solve(model)
enable_sensitivity()[source]

Enable sensitivity analysis.

Return type:

Self

Returns:

Self for chaining

solve(model, **solver_params)[source]

Solve with full type safety.

Parameters:
  • model (LXModel[TypeVar(TModel)]) – LXModel to solve

  • **solver_params (Any) – Solver-specific parameters

Return type:

LXSolution[TypeVar(TModel)]

Returns:

Type-safe solution

Raises:

Solver Interface

Base solver interface for LumiX.

class lumix.solvers.base.LXSolverInterface(capability)[source]

Bases: ABC, Generic[TModel]

Abstract base class for all solver interfaces.

Provides: - Unified API across solvers (OR-Tools, Gurobi, CPLEX) - Capability detection - Automatic linearization when needed - Type-safe solution mapping

Parameters:

capability (LXSolverCapability)

__init__(capability)[source]

Initialize solver interface.

Parameters:

capability (LXSolverCapability) – Solver capability description

abstract build_model(model)[source]

Build solver-specific model from LumiX model.

Parameters:

model (LXModel[TypeVar(TModel)]) – OPtiXNG model

Return type:

Any

Returns:

Solver-specific model object

abstract solve(model, time_limit=None, gap_tolerance=None, **solver_params)[source]

Solve the optimization model.

Parameters:
  • model (LXModel[TypeVar(TModel)]) – LumiX model

  • time_limit (Optional[float]) – Time limit in seconds

  • gap_tolerance (Optional[float]) – MIP gap tolerance

  • **solver_params (Any) – Additional solver-specific parameters

Return type:

LXSolution[TypeVar(TModel)]

Returns:

Solution object

abstract get_solver_model()[source]

Get underlying solver model for advanced usage.

Return type:

Any

Returns:

Solver-specific model object

class lumix.solvers.base.LXOptimizer(orm=None)[source]

Bases: Generic[TModel]

Main optimizer with full generic support.

Provides high-level interface to: - Select solver - Configure rational conversion - Enable sensitivity analysis - Solve models

Examples

optimizer = LXOptimizer[Product](orm_context)

.use_solver(“gurobi”) .enable_sensitivity() .enable_rational_conversion()

solution = optimizer.solve(model)

Parameters:

orm (LXORMContext[TModel] | None)

__init__(orm=None)[source]

Initialize optimizer.

Parameters:

orm (Optional[LXORMContext[TypeVar(TModel)]]) – Optional ORM context for data access

use_solver(name, **kwargs)[source]

Set solver with literal type checking.

Parameters:

name (Literal['ortools', 'gurobi', 'cplex', 'cpsat', 'glpk']) – Solver name (“ortools”, “gurobi”, “cplex”, “cpsat”, “glpk”)

Return type:

Self

Returns:

Self for chaining

enable_rational_conversion(max_denom=10000)[source]

Enable float-to-rational conversion.

Parameters:

max_denom (int) – Maximum denominator for rational approximation

Return type:

Self

Returns:

Self for chaining

enable_linearization(big_m=1000000.0, pwl_segments=20, pwl_method='sos2', prefer_sos2=True, adaptive_breakpoints=True, mccormick_tighten_bounds=True, **kwargs)[source]

Enable automatic linearization for nonlinear terms.

Mirrors enable_rational_conversion() API pattern for consistency.

When enabled, the optimizer will automatically:

  • Detect nonlinear terms in the model

  • Check if solver lacks native support

  • Apply appropriate linearization techniques:

    • Binary × Binary: AND logic

    • Binary × Continuous: Big-M method

    • Continuous × Continuous: McCormick envelopes

    • Piecewise-linear approximations for exp, log, sin, cos, etc.

Parameters:
  • big_m (float) – Big-M constant for conditional constraints (default: 1e6)

  • pwl_segments (int) – Number of segments for piecewise-linear approximations (default: 20)

  • pwl_method (Literal['sos2', 'incremental', 'logarithmic']) – Method for PWL (“sos2”, “incremental”, “logarithmic”)

  • prefer_sos2 (bool) – Use SOS2 formulation when solver supports it (default: True)

  • adaptive_breakpoints (bool) – Use adaptive breakpoint generation for PWL (default: True)

  • mccormick_tighten_bounds (bool) – Apply bound tightening for McCormick envelopes (default: True)

  • **kwargs (Any) – Additional linearization configuration options

Return type:

Self

Returns:

Self for chaining

Example:

optimizer = (
    LXOptimizer[Product]()
    .use_solver("ortools")
    .enable_linearization(
        big_m=1e5,
        pwl_segments=30,
        adaptive_breakpoints=True
    )
)

solution = optimizer.solve(model)
enable_sensitivity()[source]

Enable sensitivity analysis.

Return type:

Self

Returns:

Self for chaining

solve(model, **solver_params)[source]

Solve with full type safety.

Parameters:
  • model (LXModel[TypeVar(TModel)]) – LXModel to solve

  • **solver_params (Any) – Solver-specific parameters

Return type:

LXSolution[TypeVar(TModel)]

Returns:

Type-safe solution

Raises:

OR-Tools Solver

OR-Tools solver implementation.

class lumix.solvers.ortools_solver.LXORToolsSolver[source]

Bases: LXSolverInterface

OR-Tools solver implementation for LumiX.

Supports: - Linear Programming (LP) - Mixed-Integer Programming (MIP) - Binary variables - Single and indexed variable families - Single and indexed constraint families - Multi-model expressions

TODO: Future improvements: - Quadratic objective support (if OR-Tools adds support) - SOS1/SOS2 constraints (native OR-Tools support available) - Indicator constraints (native OR-Tools support available) - Warm start from previous solution - Sensitivity analysis (dual values, reduced costs) - Parallel solving with threads parameter - Advanced solver parameters passthrough - Solution pool for MIP problems - Custom branching priorities - Lazy constraint callbacks (if OR-Tools adds support)

__init__()[source]

Initialize OR-Tools solver.

Return type:

None

build_model(model)[source]

Build OR-Tools native model from LXModel.

Parameters:

model (LXModel) – LumiX model to build

Return type:

Solver

Returns:

OR-Tools Solver instance

Raises:

ValueError – If model contains unsupported features

solve(model, time_limit=None, gap_tolerance=None, enable_sensitivity=False, **solver_params)[source]

Solve optimization model with OR-Tools.

Parameters:
  • model (LXModel) – LumiX model to solve

  • time_limit (Optional[float]) – Time limit in seconds (None = no limit)

  • gap_tolerance (Optional[float]) – MIP gap tolerance (None = solver default)

  • **solver_params (Any) – Additional solver-specific parameters

  • enable_sensitivity (bool)

  • **solver_params

Return type:

LXSolution

Returns:

Solution object with results

TODO: Add support for additional parameters:
  • threads: Number of parallel threads

  • presolve: Enable/disable presolve

  • log_level: Logging verbosity

  • solution_pool_size: Number of solutions to keep (MIP)

get_solver_model()[source]

Get underlying OR-Tools solver for advanced usage.

Return type:

Solver

Returns:

OR-Tools Solver instance

Raises:

RuntimeError – If model hasn’t been built yet

Examples

# Access OR-Tools solver for advanced features solver = ortools_solver.get_solver_model() solver.EnableOutput() # Enable solver output solver.SetNumThreads(4) # Set thread count

Gurobi Solver

Gurobi solver implementation for LumiX.

class lumix.solvers.gurobi_solver.LXGurobiSolver[source]

Bases: LXSolverInterface

Gurobi solver implementation for LumiX.

Supports: - Linear Programming (LP) - Mixed-Integer Programming (MIP) - Binary variables - Single and indexed variable families - Single and indexed constraint families - Multi-model expressions

TODO: Future improvements: - Quadratic objective support (when library adds support) - SOCP support (when library adds support) - Warm start from previous solution - Sensitivity analysis (dual values, reduced costs) - Solution pool for MIP problems - Lazy constraint callbacks - User cut callbacks - IIS computation for infeasible models - Conflict refinement

__init__()[source]

Initialize Gurobi solver.

Return type:

None

build_model(model)[source]

Build Gurobi native model from LXModel.

Parameters:

model – LumiX model to build

Returns:

Gurobi Model instance

Raises:

ValueError – If model contains unsupported features

solve(model, time_limit=None, gap_tolerance=None, enable_sensitivity=False, **solver_params)[source]

Solve optimization model with Gurobi.

Parameters:
  • model (LXModel) – LumiX model to solve

  • time_limit (Optional[float]) – Time limit in seconds (None = no limit)

  • gap_tolerance (Optional[float]) – MIP gap tolerance (None = solver default, typically 0.0001)

  • **solver_params (Any) – Additional Gurobi-specific parameters Examples: - Threads: Number of parallel threads (int) - MIPFocus: MIP focus (1=feasibility, 2=optimality, 3=bound) - Presolve: Presolve level (-1=auto, 0=off, 1=conservative, 2=aggressive) - Method: Algorithm for continuous models (-1=auto, 0=primal, 1=dual, 2=barrier) - LogToConsole: Show solver output (0=off, 1=on)

  • enable_sensitivity (bool)

  • **solver_params

Return type:

LXSolution

Returns:

Solution object with results

TODO: Add support for additional features:
  • Warm start from previous solution

  • Solution pool for MIP

  • Callback functions

get_solver_model()[source]

Get underlying Gurobi model for advanced usage.

Returns:

Gurobi Model instance

Raises:

RuntimeError – If model hasn’t been built yet

Examples

# Access Gurobi model for advanced features gurobi_model = solver.get_solver_model() gurobi_model.setParam(GRB.Param.OutputFlag, 1) # Enable output gurobi_model.setParam(GRB.Param.Threads, 4) # Set thread count

CPLEX Solver

CPLEX solver implementation for LumiX.

class lumix.solvers.cplex_solver.LXCPLEXSolver[source]

Bases: LXSolverInterface

CPLEX solver implementation for LumiX.

Supports: - Linear Programming (LP) - Mixed-Integer Programming (MIP) - Binary variables - Single and indexed variable families - Single and indexed constraint families - Multi-model expressions

TODO: Future improvements: - Quadratic objective support (when library adds support) - SOCP support (when library adds support) - Warm start from previous solution - Sensitivity analysis (dual values, reduced costs) - Solution pool for MIP problems - Lazy constraint callbacks - User cut callbacks - IIS computation for infeasible models - Conflict refinement - SOS1/SOS2 constraints - Indicator constraints - Piecewise linear functions

__init__()[source]

Initialize CPLEX solver.

Return type:

None

build_model(model)[source]

Build CPLEX native model from LXModel.

Parameters:

model (LXModel) – LumiX model to build

Return type:

None

Returns:

CPLEX Cplex instance

Raises:

ValueError – If model contains unsupported features

solve(model, time_limit=None, gap_tolerance=None, enable_sensitivity=False, **solver_params)[source]

Solve optimization model with CPLEX.

Parameters:
  • model (LXModel) – LumiX model to solve

  • time_limit (Optional[float]) – Time limit in seconds (None = no limit)

  • gap_tolerance (Optional[float]) – MIP gap tolerance (None = solver default, typically 0.0001)

  • **solver_params (Any) – Additional CPLEX-specific parameters Examples: - threads: Number of parallel threads (int) - mip_emphasis: MIP emphasis (0=balanced, 1=feasibility, 2=optimality, 3=bound, 4=hidden) - preprocessing_presolve: Presolve level (0=off, 1=on) - lpmethod: Algorithm for LP (0=auto, 1=primal, 2=dual, 3=network, 4=barrier) - output_clonelog: Show solver output (0=off, 1=on)

  • enable_sensitivity (bool)

  • **solver_params

Return type:

LXSolution

Returns:

Solution object with results

TODO: Add support for additional features:
  • Warm start from previous solution

  • Solution pool for MIP

  • Callback functions

get_solver_model()[source]

Get underlying CPLEX model for advanced usage.

Return type:

None

Returns:

CPLEX Cplex instance

Raises:

RuntimeError – If model hasn’t been built yet

Examples

# Access CPLEX model for advanced features cplex_model = solver.get_solver_model() cplex_model.parameters.threads.set(4) # Set thread count cplex_model.parameters.timelimit.set(300) # Set time limit

GLPK Solver

GLPK solver implementation for LumiX.

class lumix.solvers.glpk_solver.LXGLPKSolver[source]

Bases: LXSolverInterface

GLPK (GNU Linear Programming Kit) solver implementation for LumiX.

Supports: - Linear Programming (LP) - Mixed-Integer Linear Programming (MILP) - Binary and Integer variables - Single and indexed variable families - Single and indexed constraint families - Multi-model expressions - Sensitivity analysis (dual values, reduced costs)

TODO: Future improvements: - Warm start from previous solution (if GLPK adds support) - Advanced solver parameters passthrough - Interior point method options - Branch-and-cut callback support

__init__()[source]

Initialize GLPK solver.

Return type:

None

build_model(model)[source]

Build GLPK native model from LXModel.

Parameters:

model (LXModel) – LumiX model to build

Return type:

Any

Returns:

GLPK problem pointer

Raises:

ValueError – If model contains unsupported features

solve(model, time_limit=None, gap_tolerance=None, enable_sensitivity=False, **solver_params)[source]

Solve optimization model with GLPK.

Parameters:
  • model (LXModel) – LumiX model to solve

  • time_limit (Optional[float]) – Time limit in seconds (None = no limit)

  • gap_tolerance (Optional[float]) – MIP gap tolerance (None = solver default)

  • enable_sensitivity (bool) – Enable sensitivity analysis

  • **solver_params (Any) – Additional GLPK-specific parameters Examples: - msg_lev: Message level (glpk.GLP_MSG_OFF, GLP_MSG_ERR, GLP_MSG_ON, GLP_MSG_ALL) - presolve: Enable presolve (True/False) - method: LP method (glpk.GLP_PRIMAL, GLP_DUAL, GLP_DUALP)

Return type:

LXSolution

Returns:

Solution object with results

get_solver_model()[source]

Get underlying GLPK model for advanced usage.

Return type:

Any

Returns:

GLPK problem pointer

Raises:

RuntimeError – If model hasn’t been built yet

Examples

# Access GLPK model for advanced features glpk_model = solver.get_solver_model() glpk.glp_set_obj_name(glpk_model, “MyObjective”)

CP-SAT Solver

OR-Tools CP-SAT solver implementation for LumiX.

class lumix.solvers.cpsat_solver.LXCPSATSolver(enable_rational_conversion=False, rational_max_denom=10000, scale_objective=True, scaling_factor=1000)[source]

Bases: LXSolverInterface

OR-Tools CP-SAT (Constraint Programming - Satisfiability) solver implementation for LumiX.

CP-SAT is a constraint programming solver optimized for: - Scheduling problems - Routing problems (TSP, VRP) - Combinatorial optimization - Integer and boolean decision problems

IMPORTANT: CP-SAT only supports INTEGER and BINARY variables (no continuous variables). Float coefficients are automatically converted to integers using rational approximation.

Supports: - Integer variables (bounded or unbounded) - Binary (boolean) variables - Linear constraints (≤, ≥, ==) - Single and indexed variable families - Multi-model expressions - Automatic float-to-rational conversion

TODO: Future CP-SAT-specific features: - AllDifferent constraints for scheduling - Circuit constraints for routing/TSP - Table constraints for allowed combinations - Interval variables for scheduling - NoOverlap constraints for resource scheduling - Cumulative constraints for resource capacity - Boolean logic constraints (OR, AND, XOR, implications) - Solution pool for multiple optimal solutions - Warm start via solution hints - Custom search strategies - Symmetry breaking

Parameters:
  • enable_rational_conversion (bool)

  • rational_max_denom (int)

  • scale_objective (bool)

  • scaling_factor (int)

__init__(enable_rational_conversion=False, rational_max_denom=10000, scale_objective=True, scaling_factor=1000)[source]

Initialize CP-SAT solver.

Parameters:
  • enable_rational_conversion (bool) – Enable rational conversion and auto-scaling for continuous variables

  • rational_max_denom (int) – Maximum denominator for float-to-rational conversion

  • scale_objective (bool) – Whether to scale objective coefficients to integers

  • scaling_factor (int) – Scaling factor for continuous variables (default: 1000) Higher values = more precision but risk integer overflow

Return type:

None

build_model(model)[source]

Build CP-SAT native model from LXModel.

Parameters:

model (LXModel) – LumiX model to build

Return type:

CpModel

Returns:

CP-SAT CpModel instance

Raises:

ValueError – If model contains continuous variables or unsupported features

solve(model, time_limit=None, gap_tolerance=None, **solver_params)[source]

Solve optimization model with CP-SAT.

Parameters:
  • model (LXModel) – LumiX model to solve

  • time_limit (Optional[float]) – Time limit in seconds (None = no limit)

  • gap_tolerance (Optional[float]) – Relative optimality gap tolerance (None = 0.0001)

  • **solver_params (Any) – Additional CP-SAT parameters Examples: - num_search_workers: Number of parallel workers (default: auto) - log_search_progress: Enable search logging (default: False) - max_time_in_seconds: Alternative to time_limit - cp_model_presolve: Enable presolve (default: True) - linearization_level: Linearization aggressiveness (0-2) - cp_model_probing_level: Probing level (0-2)

Return type:

LXSolution

Returns:

Solution object with results

TODO: Add support for additional features:
  • Solution hints (warm start)

  • Solution callbacks

  • Assumption-based solving

  • Multiple solutions enumeration

get_solver_model()[source]

Get underlying CP-SAT model for advanced usage.

Return type:

CpModel

Returns:

CP-SAT CpModel instance

Raises:

RuntimeError – If model hasn’t been built yet

Examples

# Access CP-SAT model for advanced features cpsat_model = solver.get_solver_model() # Add custom CP-SAT constraints cpsat_model.AddAllDifferent([var1, var2, var3])

Capabilities

Solver capability detection and management.

class lumix.solvers.capabilities.LXSolverFeature(value)[source]

Bases: Flag

Solver features/capabilities (bit flags for combinations).

Basic:

LINEAR: Linear programming INTEGER: Integer variables BINARY: Binary variables MIXED_INTEGER: Mixed-integer programming (LP + INTEGER)

Advanced:

QUADRATIC_CONVEX: Convex quadratic programming QUADRATIC_NONCONVEX: Non-convex quadratic programming SOCP: Second-order cone programming SDP: Semidefinite programming

Special:

SOS1: Special Ordered Set type 1 SOS2: Special Ordered Set type 2 INDICATOR: Indicator constraints CARDINALITY: Cardinality constraints

Non-linear:

PWL: Piecewise-linear functions EXPONENTIAL_CONE: Exponential cone constraints LOG: Logarithmic constraints

Features:

LAZY_CONSTRAINTS: Lazy constraint callbacks USER_CUTS: User cut callbacks HEURISTICS: Custom heuristics IIS: Irreducible Inconsistent Subsystem CONFLICT_REFINEMENT: Conflict refinement

LINEAR = 1
INTEGER = 2
BINARY = 4
MIXED_INTEGER = 3
QUADRATIC_CONVEX = 4
QUADRATIC_NONCONVEX = 8
SOCP = 16
SDP = 32
SOS1 = 64
SOS2 = 128
INDICATOR = 256
CARDINALITY = 512
PWL = 1024
EXPONENTIAL_CONE = 2048
LOG = 4096
LAZY_CONSTRAINTS = 8192
USER_CUTS = 16384
HEURISTICS = 32768
IIS = 65536
CONFLICT_REFINEMENT = 131072
SENSITIVITY_ANALYSIS = 262144
class lumix.solvers.capabilities.LXSolverCapability(name, features, max_variables=2147483647, max_constraints=2147483647, supports_warmstart=False, supports_parallel=False, supports_callbacks=False)[source]

Bases: object

Describes a solver’s capabilities.

Used to: - Query what features a solver supports - Automatically select appropriate linearization methods - Provide meaningful errors when features are unavailable

Parameters:
name: str
features: LXSolverFeature
max_variables: int = 2147483647
max_constraints: int = 2147483647
supports_warmstart: bool = False
supports_parallel: bool = False
supports_callbacks: bool = False
has_feature(feature)[source]

Check if solver has a specific feature.

Parameters:

feature (LXSolverFeature) – Feature to check

Return type:

bool

Returns:

True if solver supports the feature

can_solve_quadratic()[source]

Check if solver can handle quadratic objectives.

Return type:

bool

can_solve_integer()[source]

Check if solver can handle integer variables.

Return type:

bool

can_use_sos2()[source]

Check if solver has native SOS2 support.

Return type:

bool

can_use_indicator()[source]

Check if solver has native indicator constraint support.

Return type:

bool

needs_linearization_for_bilinear()[source]

Check if solver needs linearization for bilinear products (x * y).

Return type:

bool

Returns:

True if solver lacks native quadratic support

needs_linearization_for_abs()[source]

Check if solver needs linearization for absolute value x.

Return type:

bool

Returns:

True if solver lacks native piecewise-linear support

needs_linearization_for_minmax()[source]

Check if solver needs linearization for min/max functions.

Return type:

bool

Returns:

True if solver lacks native piecewise-linear support

needs_linearization_for_nonlinear()[source]

Check if solver needs linearization for general nonlinear functions.

Return type:

bool

Returns:

True if solver lacks native exponential cone or PWL support

description()[source]

Get human-readable capability description.

Return type:

str

__init__(name, features, max_variables=2147483647, max_constraints=2147483647, supports_warmstart=False, supports_parallel=False, supports_callbacks=False)
Parameters:
Return type:

None