Skip to content
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
1cf9cbb
Enable green context
hlinsen Oct 6, 2025
04aa7bc
update to docs
rgsl888prabhu Oct 6, 2025
74409aa
fix style
rgsl888prabhu Oct 6, 2025
381f7bf
Update introduction.rst
chris-maes Oct 6, 2025
abcd486
Update lp-features.rst
chris-maes Oct 6, 2025
23a2046
Update lp-milp-settings.rst
chris-maes Oct 6, 2025
da63ef2
Update lp-milp-settings.rst
chris-maes Oct 6, 2025
a4d1f2b
Update lp-features.rst
chris-maes Oct 6, 2025
82cbb2a
Update lp-features.rst
chris-maes Oct 6, 2025
84acac3
Update lp-milp-settings.rst
chris-maes Oct 6, 2025
54f4d4f
fix style
rgsl888prabhu Oct 6, 2025
ceb8658
Disable explicit cuda driver calls
hlinsen Oct 6, 2025
2be9dbe
Add missing file
hlinsen Oct 6, 2025
7c52303
add tests
rgsl888prabhu Oct 6, 2025
cf398c5
Remove unused var
hlinsen Oct 6, 2025
0b73872
Use logger
hlinsen Oct 6, 2025
692afab
Add detail namespace
hlinsen Oct 6, 2025
ef11801
Remove driver dependencies
hlinsen Oct 6, 2025
640f132
skip pytest for varrier
rgsl888prabhu Oct 6, 2025
368e6ca
Merge branch 'branch-25.10' of github.com:nvidia/cuopt into barrier_d…
rgsl888prabhu Oct 7, 2025
05a7798
Merge branch 'branch-25.10' into barrier_doc_and_tests
rgsl888prabhu Oct 7, 2025
fb31450
Update device_sparse_matrix.cuh
rgsl888prabhu Oct 7, 2025
f143904
Update test_python_API.py
rgsl888prabhu Oct 7, 2025
d715f3a
Update test_lp.py
rgsl888prabhu Oct 7, 2025
5b66f3d
Update data_model_wrapper.pyx
rgsl888prabhu Oct 7, 2025
67cbfc2
update
rgsl888prabhu Oct 7, 2025
f72ff01
fix
rgsl888prabhu Oct 7, 2025
e92295a
Merge branch 'barrier_doc_and_tests' of github.com:rgsl888prabhu/cuop…
rgsl888prabhu Oct 7, 2025
8a60946
Merge branch 'branch-25.10' into barrier_doc_and_tests
rgsl888prabhu Oct 7, 2025
cec6a7f
Merge branch 'branch-25.10' into barrier_doc_and_tests
rgsl888prabhu Oct 7, 2025
0d1a2ae
Fix post-solve crash on physicansched6-2
chris-maes Oct 7, 2025
eb140d1
Fix style
chris-maes Oct 7, 2025
08cbac2
Fix UMA on problems where row nz greater than number of rows
chris-maes Oct 8, 2025
e2449a9
Fix undefined reference due to realloc of colors from emplace_back
chris-maes Oct 8, 2025
a6b5e3e
Merge branch 'post_solve_fix_25_10' of github.com:chris-maes/cuopt in…
rgsl888prabhu Oct 8, 2025
f13d140
Merge branch 'branch-25.10' into barrier_doc_and_tests
rgsl888prabhu Oct 8, 2025
98cc2ac
testing
rgsl888prabhu Oct 8, 2025
0b97621
Merge branch 'barrier_doc_and_tests' of github.com:rgsl888prabhu/cuop…
rgsl888prabhu Oct 8, 2025
373a59b
Add 3.10 filter
rgsl888prabhu Oct 8, 2025
ffca33f
test
rgsl888prabhu Oct 8, 2025
cd979cf
enable few options on OMP
rgsl888prabhu Oct 8, 2025
eb67876
revert testing changes
rgsl888prabhu Oct 9, 2025
6c4b021
update
rgsl888prabhu Oct 9, 2025
6bede5b
Merge branch 'branch-25.10' into barrier_doc_and_tests
rgsl888prabhu Oct 9, 2025
66a6b7a
Merge branch 'barrier_doc_and_tests' of github.com:rgsl888prabhu/cuop…
rgsl888prabhu Oct 9, 2025
93b0243
add doc for CUOPT_BARRIER_DUAL_INITIAL_POINT
rgsl888prabhu Oct 9, 2025
93d013a
add test for CUOPT_BARRIER_DUAL_INITIAL_POINT
rgsl888prabhu Oct 9, 2025
668ded7
fix style
rgsl888prabhu Oct 9, 2025
f50b7b1
Update lp-milp-settings.rst
chris-maes Oct 9, 2025
5d56842
style
rgsl888prabhu Oct 9, 2025
b6a7ad5
add nvjit link to list
rgsl888prabhu Oct 9, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cpp/src/dual_simplex/device_sparse_matrix.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ class device_csc_matrix_t {

// Inclusive cumulative sum to have the corresponding column for each entry
rmm::device_buffer d_temp_storage;
size_t temp_storage_bytes;
size_t temp_storage_bytes = 0;
cub::DeviceScan::InclusiveSum(
nullptr, temp_storage_bytes, col_index.data(), col_index.data(), col_index.size(), stream);
d_temp_storage.resize(temp_storage_bytes, stream);
Expand Down
26 changes: 26 additions & 0 deletions docs/cuopt/source/cuopt-c/lp-milp/lp-milp-c-api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ You may use the following functions to determine the number of bytes used to rep
.. doxygenfunction:: cuOptGetIntSize
.. doxygenfunction:: cuOptGetFloatSize

Version Information
-------------------

You may use the following function to get the version of the cuOpt library

.. doxygenfunction:: cuOptGetVersion

Status Codes
------------

Expand All @@ -25,6 +32,9 @@ Every function in the C API returns a status code that indicates success or fail
.. doxygendefine:: CUOPT_INVALID_ARGUMENT
.. doxygendefine:: CUOPT_MPS_FILE_ERROR
.. doxygendefine:: CUOPT_MPS_PARSE_ERROR
.. doxygendefine:: CUOPT_VALIDATION_ERROR
.. doxygendefine:: CUOPT_OUT_OF_MEMORY
.. doxygendefine:: CUOPT_RUNTIME_ERROR

Optimization Problem
--------------------
Expand Down Expand Up @@ -156,9 +166,21 @@ These constants are used as parameter names in the :c:func:`cuOptSetParameter`,
.. doxygendefine:: CUOPT_MIP_ABSOLUTE_TOLERANCE
.. doxygendefine:: CUOPT_MIP_RELATIVE_TOLERANCE
.. doxygendefine:: CUOPT_MIP_INTEGRALITY_TOLERANCE
.. doxygendefine:: CUOPT_MIP_ABSOLUTE_GAP
.. doxygendefine:: CUOPT_MIP_RELATIVE_GAP
.. doxygendefine:: CUOPT_MIP_SCALING
.. doxygendefine:: CUOPT_MIP_HEURISTICS_ONLY
.. doxygendefine:: CUOPT_MIP_PRESOLVE
.. doxygendefine:: CUOPT_PRESOLVE
.. doxygendefine:: CUOPT_LOG_TO_CONSOLE
.. doxygendefine:: CUOPT_CROSSOVER
.. doxygendefine:: CUOPT_FOLDING
.. doxygendefine:: CUOPT_AUGMENTED
.. doxygendefine:: CUOPT_DUALIZE
.. doxygendefine:: CUOPT_ORDERING
.. doxygendefine:: CUOPT_ELIMINATE_DENSE_COLUMNS
.. doxygendefine:: CUOPT_CUDSS_DETERMINISTIC
.. doxygendefine:: CUOPT_DUAL_POSTSOLVE
.. doxygendefine:: CUOPT_SOLUTION_FILE
.. doxygendefine:: CUOPT_NUM_CPU_THREADS
.. doxygendefine:: CUOPT_USER_PROBLEM_FILE
Expand Down Expand Up @@ -186,6 +208,7 @@ These constants are used to configure `CUOPT_METHOD` via :c:func:`cuOptSetIntege
.. doxygendefine:: CUOPT_METHOD_CONCURRENT
.. doxygendefine:: CUOPT_METHOD_PDLP
.. doxygendefine:: CUOPT_METHOD_DUAL_SIMPLEX
.. doxygendefine:: CUOPT_METHOD_BARRIER


Solving an LP or MIP
Expand All @@ -206,12 +229,15 @@ The output of a solve is a `cuOptSolution` object.
The following functions may be used to access information from a `cuOptSolution`

.. doxygenfunction:: cuOptGetTerminationStatus
.. doxygenfunction:: cuOptGetErrorStatus
.. doxygenfunction:: cuOptGetErrorString
.. doxygenfunction:: cuOptGetPrimalSolution
.. doxygenfunction:: cuOptGetObjectiveValue
.. doxygenfunction:: cuOptGetSolveTime
.. doxygenfunction:: cuOptGetMIPGap
.. doxygenfunction:: cuOptGetSolutionBound
.. doxygenfunction:: cuOptGetDualSolution
.. doxygenfunction:: cuOptGetDualObjectiveValue
.. doxygenfunction:: cuOptGetReducedCosts

When you are finished with a `cuOptSolution` object you should destory it with
Expand Down
140 changes: 110 additions & 30 deletions docs/cuopt/source/cuopt-python/routing/routing-example.ipynb

Large diffs are not rendered by default.

11 changes: 9 additions & 2 deletions docs/cuopt/source/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,15 @@ This is a linear program.

How cuOpt Solves the Linear Programming Problem
------------------------------------------------
cuOpt includes an LP solver based on `PDLP <https://arxiv.org/abs/2106.04756>`__, a new First-Order Method (FOM) used to solve large-scale LPs. This solver implements gradient descent, enhanced by heuristics, and performing massively parallel operations efficiently by leveraging the latest NVIDIA GPUs.
cuOpt includes three LP solving methods:

In addition to PDLP, cuOpt includes a dual simplex solver that runs on the CPU. Both algorithms can be run concurrently on the GPU and CPU.
* **PDLP**: Based on `PDLP <https://arxiv.org/abs/2106.04756>`__, a First-Order Method (FOM) for solving large-scale LPs. This solver implements primal-dual hybrid gradient enhanced by heuristics. Sparse matrix-vector products are perfomed efficiently on NVIDIA GPUs.

* **Barrier (Interior-Point)**: A primal-dual interior-point method that uses GPU-accelerated sparse Cholesky and LDLT solves via cuDSS, and sparse matrix operations via cuSparse.

* **Dual Simplex**: A CPU-based dual simplex solver for small to medium-sized problems.

All three algorithms can be run concurrently on both GPU and CPU, with the fastest solution returned automatically.

Mixed Integer Linear Programming (MILP)
=========================================
Expand Down Expand Up @@ -121,6 +127,7 @@ cuOpt supports the following APIs:
- `AMPL <https://www.ampl.com/>`_
- `GAMS <https://www.gams.com/>`_
- `PuLP <https://pypi.org/project/PuLP/>`_
- `JuMP <https://github.com/jump-dev/cuOpt.jl>`_


==================================
Expand Down
9 changes: 6 additions & 3 deletions docs/cuopt/source/lp-features.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ The LP solver can be accessed in the following ways:
- AMPL
- GAMS
- PuLP
- JuMP

- **C API**: A native C API that provides direct low-level access to cuOpt's LP capabilities, enabling integration into any application or system that can interface with C.

Expand Down Expand Up @@ -65,17 +66,19 @@ Users can control how the solver will operate by specifying the PDLP solver mode
Method
------

**Concurrent**: The default method for solving linear programs. When concurrent is selected, cuOpt runs two algorithms at the same time: PDLP on the GPU and dual simplex on the CPU. A solution is returned from the algorithm that finishes first.
**Concurrent**: The default method for solving linear programs. When concurrent is selected, cuOpt runs three algorithms in parallel: PDLP on the GPU, barrier (interior-point) on the GPU, and dual simplex on the CPU. A solution is returned from the algorithm that finishes first.

**PDLP**: Primal-Dual Hybrid Gradient for Linear Program is an algorithm for solving large-scale linear programming problems on the GPU. PDLP does not attempt to any matrix factorizations during the course of the solve. Select this method if your LP is so large that factorization will not fit into memory. By default PDLP solves to low relative tolerance and the solutions it returns do not lie at a vertex of the feasible region. Enable crossover to obtain a highly accurate basic solution from a PDLP solution.
**PDLP**: Primal-Dual Hybrid Gradient for Linear Program is an algorithm for solving large-scale linear programming problems on the GPU. PDLP does not attempt any matrix factorizations during the course of the solve. Select this method if your LP is so large that factorization will not fit into memory. By default PDLP solves to low relative tolerance and the solutions it returns do not lie at a vertex of the feasible region. Enable crossover to obtain a highly accurate basic solution from a PDLP solution.

**Barrier**: The barrier method (also known as interior-point method) solves linear programs using a primal-dual predictor-corrector algorithm. This method uses GPU-accelerated sparse Cholesky and sparse LDLT solves via cuDSS, and GPU-accelerated sparse matrix-vector and matrix-matrix operations via cuSparse. Barrier is particularly effective for large-scale problems and can automatically apply techniques like folding, dualization, and dense column elimination to improve performance. This method solves the linear systems at each iteration using the augmented system or the normal equations (ADAT). Enable crossover to obtain a highly accurate basic solution from a barrier solution.

**Dual Simplex**: Dual simplex is the simplex method applied to the dual of the linear program. Dual simplex requires the basis factorization of linear program fit into memory. Select this method if your LP is small to medium sized, or if you require a high-quality basic solution.


Crossover
---------

Crossover allows you to obtain a high-quality basic solution from the results of a PDLP solve. More details can be found :ref:`here <crossover>`.
Crossover allows you to obtain a high-quality basic solution from the results of a PDLP or barrier solve. When enabled, crossover converts these solutions to a vertex solution (basic solution) with high accuracy. More details can be found :ref:`here <crossover>`.


Presolve
Expand Down
83 changes: 77 additions & 6 deletions docs/cuopt/source/lp-milp-settings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -78,20 +78,19 @@ We now describe the parameter settings used to control cuOpt's Linear Programmin
Method
^^^^^^

``CUOPT_METHOD`` controls the method to solve the linear programming problem. Three methods are available:
``CUOPT_METHOD`` controls the method to solve the linear programming problem. Four methods are available:

* ``Concurrent``: Use both PDLP and dual simplex in parallel.
* ``Concurrent``: Use PDLP, dual simplex, and barrier in parallel (default).
* ``PDLP``: Use the PDLP method.
* ``Dual Simplex``: Use the dual simplex method.
* ``Barrier``: Use the barrier (interior-point) method.

Note: The default method is ``Concurrent``.

C API users should use the constants defined in :ref:`method-constants` for this parameter.

Server Thin client users should use the :class:`cuopt_sh_client.SolverMethod` for this parameter.



PDLP Solver Mode
^^^^^^^^^^^^^^^^

Expand Down Expand Up @@ -146,9 +145,9 @@ Note: the default value is false.
Crossover
^^^^^^^^^

``CUOPT_CROSSOVER`` controls whether PDLP should crossover to a basic solution after a optimal solution is found.
``CUOPT_CROSSOVER`` controls whether PDLP or barrier should crossover to a basic solution after an optimal solution is found.
Changing this value has a significant impact on accuracy and runtime.
By default the solutions provided by PDLP are low accuracy and may have many variables that lie
By default the solutions provided by PDLP and barrier do not lie at a vertex and thus may have many variables that lie
between their bounds. Enabling crossover allows the user to obtain a high-quality basic solution
that lies at a vertex of the feasible region. If n is the number of variables, and m is the number of
constraints, n - m variables will be on their bounds in a basic solution.
Expand Down Expand Up @@ -180,6 +179,78 @@ Per Constraint Residual

Note: the default value is false.

Barrier Solver Settings
^^^^^^^^^^^^^^^^^^^^^^^^

The following settings control the behavior of the barrier (interior-point) method:

Folding
"""""""

``CUOPT_FOLDING`` controls whether to fold the linear program. Folding can reduce problem size by exploiting symmetry in the problem.

* ``-1``: Automatic (default) - cuOpt decides whether to fold based on problem characteristics
* ``0``: Disable folding
* ``1``: Force folding to run

Note: the default value is ``-1`` (automatic).

Dualize
"""""""

``CUOPT_DUALIZE`` controls whether to dualize the linear program in presolve. Dualizing can improve solve time for problems, with inequality constraints, where there are more constraints than variables.

* ``-1``: Automatic (default) - cuOpt decides whether to dualize based on problem characteristics
* ``0``: Don't attempt to dualize
* ``1``: Force dualize

Note: the default value is ``-1`` (automatic).

Ordering
""""""""

``CUOPT_ORDERING`` controls the ordering algorithm used by cuDSS for sparse factorizations. The ordering can significantly impact solver run time.

* ``-1``: Automatic (default) - cuOpt selects the best ordering
* ``0``: cuDSS default ordering
* ``1``: AMD (Approximate Minimum Degree) ordering

Note: the default value is ``-1`` (automatic).

Augmented System
""""""""""""""""

``CUOPT_AUGMENTED`` controls which linear system to solve in the barrier method.

* ``-1``: Automatic (default) - cuOpt selects the best linear system to solve
* ``0``: Solve the ADAT system (normal equations)
* ``1``: Solve the augmented system

Note: the default value is ``-1`` (automatic). The augmented system may be more stable for some problems, while ADAT may be faster for others.

Eliminate Dense Columns
""""""""""""""""""""""""

``CUOPT_ELIMINATE_DENSE_COLUMNS`` controls whether to eliminate dense columns from the constraint matrix before solving. Eliminating dense columns can improve performance by reducing fill-in during factorization.
However, extra solves must be performed at each iteration.

* ``true``: Eliminate dense columns (default)
* ``false``: Don't eliminate dense columns

This setting only has an effect when the ADAT (normal equation) system is solved.

Note: the default value is ``true``.

cuDSS Deterministic Mode
"""""""""""""""""""""""""

``CUOPT_CUDSS_DETERMINISTIC`` controls whether cuDSS operates in deterministic mode. Deterministic mode ensures reproducible results across runs but may be slower.

* ``true``: Use deterministic mode
* ``false``: Use non-deterministic mode (default)

Note: the default value is ``false``. Enable deterministic mode if reproducibility is more important than performance.

Absolute Primal Tolerance
^^^^^^^^^^^^^^^^^^^^^^^^^

Expand Down
1 change: 1 addition & 0 deletions docs/cuopt/source/milp-features.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ The MILP solver can be accessed in the following ways:
- AMPL
- GAMS
- PuLP
- JuMP

- **C API**: A native C API that provides direct low-level access to cuOpt's MILP solver, enabling integration into any application or system that can interface with C.

Expand Down
1 change: 1 addition & 0 deletions docs/cuopt/source/system-requirements.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ Dependencies are installed automatically when using the pip and Conda installati
- CUDA 12.2 with Driver 535.86.10+
- CUDA 12.5 with Driver 555.42.06+
- CUDA 12.9 with Driver 570.42.01+
- CUDA 13.0 with Driver 580.65.06+

.. dropdown:: Recommended Requirements for Best Performance

Expand Down
7 changes: 7 additions & 0 deletions docs/cuopt/source/thirdparty_modeling_languages/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,10 @@ PuLP Support

PuLP can be used with near zero code changes: simply switch to cuOpt as a solver to solve linear and mixed-integer programming problems.
Please refer to the `PuLP documentation <https://pypi.org/project/PuLP/>`_ for more information. Also, see the example notebook in the `cuopt-examples <https://github.com/NVIDIA/cuopt-examples>`_ repository.

--------------------------
JuMP Support
--------------------------

JuMP can be used with near zero code changes: simply switch to cuOpt as a solver to solve linear and mixed-integer programming problems.
Please refer to the `JuMP documentation <https://github.com/jump-dev/cuOpt.jl>`_ for more information.
107 changes: 106 additions & 1 deletion python/cuopt/cuopt/tests/linear_programming/test_python_API.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,20 @@
sense,
)
from cuopt.linear_programming.solver.solver_parameters import (
CUOPT_AUGMENTED,
CUOPT_CUDSS_DETERMINISTIC,
CUOPT_DUALIZE,
CUOPT_ELIMINATE_DENSE_COLUMNS,
CUOPT_FOLDING,
CUOPT_INFEASIBILITY_DETECTION,
CUOPT_METHOD,
CUOPT_ORDERING,
CUOPT_PDLP_SOLVER_MODE,
)
from cuopt.linear_programming.solver_settings import PDLPSolverMode
from cuopt.linear_programming.solver_settings import (
PDLPSolverMode,
SolverMethod,
)

RAPIDS_DATASET_ROOT_DIR = os.getenv("RAPIDS_DATASET_ROOT_DIR")
if RAPIDS_DATASET_ROOT_DIR is None:
Expand Down Expand Up @@ -449,3 +459,98 @@ def test_problem_update():
prob.updateObjective(constant=5, sense=MINIMIZE)
prob.solve()
assert prob.ObjValue == pytest.approx(5)


def test_barrier_solver():
"""
Test the barrier solver with different configurations.

Problem:
maximize 5*xs + 20*xl
subject to 1*xs + 3*xl <= 200
3*xs + 2*xl <= 160
xs, xl >= 0

Expected Solution:
Optimal objective: 1333.33
xs = 0, xl = 66.67 (corner solution where constraint 1 is binding)
"""
prob = Problem("Barrier Test")

# Add variables
xs = prob.addVariable(lb=0, vtype=VType.CONTINUOUS, name="xs")
xl = prob.addVariable(lb=0, vtype=VType.CONTINUOUS, name="xl")

# Add constraints
prob.addConstraint(xs + 3 * xl <= 200, name="constraint1")
prob.addConstraint(3 * xs + 2 * xl <= 160, name="constraint2")

# Set objective: maximize 5*xs + 20 * xl
prob.setObjective(5 * xs + 20 * xl, sense=MAXIMIZE)

# Test 1: Default barrier settings
settings = SolverSettings()
settings.set_parameter(CUOPT_METHOD, SolverMethod.Barrier)
settings.set_parameter("time_limit", 10)

prob.solve(settings)

assert prob.solved
assert prob.Status.name == "Optimal"
assert prob.ObjValue == pytest.approx(1333.33, rel=0.01)
assert xs.Value == pytest.approx(0.0, abs=1e-4)
assert xl.Value == pytest.approx(66.67, rel=0.01)

# Test 2: Barrier with forced settings
settings_forced = SolverSettings()
settings_forced.set_parameter(CUOPT_METHOD, SolverMethod.Barrier)
settings_forced.set_parameter(CUOPT_FOLDING, 1) # Force folding
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This problem can't be used to test folding. As it can't be folded.

Copy link
Collaborator Author

@rgsl888prabhu rgsl888prabhu Oct 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chris-maes This test is more towards testing whether API workflow works and there are no gaps. but I am happy to make changes to this test to use other bigger problems, can you please suggest a mps file that I can use to test this ?

settings_forced.set_parameter(CUOPT_DUALIZE, 1) # Force dualize
settings_forced.set_parameter(CUOPT_ORDERING, 1) # AMD ordering
settings_forced.set_parameter(CUOPT_AUGMENTED, 1) # Augmented system
settings_forced.set_parameter(CUOPT_ELIMINATE_DENSE_COLUMNS, True)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't believe this problem can be used to test dense column elimination. Any column with fewer than 100 nonzeros is not considered.

Copy link
Collaborator Author

@rgsl888prabhu rgsl888prabhu Oct 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chris-maes This test is more towards testing whether API workflow works and there are no gaps. but I am happy to make changes to this test to use other bigger problems, can you please suggest a mps file that I can use to test this ?

settings_forced.set_parameter(CUOPT_CUDSS_DETERMINISTIC, True)
settings_forced.set_parameter("time_limit", 10)

prob.solve(settings_forced)

assert prob.solved
assert prob.Status.name == "Optimal"
assert prob.ObjValue == pytest.approx(1333.33, rel=0.01)

# Test 3: Barrier with features disabled
settings_disabled = SolverSettings()
settings_disabled.set_parameter(CUOPT_METHOD, SolverMethod.Barrier)
settings_disabled.set_parameter(CUOPT_FOLDING, 0) # No folding
settings_disabled.set_parameter(CUOPT_DUALIZE, 0) # No dualization
settings_disabled.set_parameter(CUOPT_ORDERING, 0) # cuDSS default
settings_disabled.set_parameter(CUOPT_AUGMENTED, 0) # ADAT system
settings_disabled.set_parameter(CUOPT_ELIMINATE_DENSE_COLUMNS, False)
settings_disabled.set_parameter(CUOPT_CUDSS_DETERMINISTIC, False)
settings_disabled.set_parameter("time_limit", 10)

prob.solve(settings_disabled)

assert prob.solved
assert prob.Status.name == "Optimal"
assert prob.ObjValue == pytest.approx(1333.33, rel=0.01)

# Test 4: Barrier with automatic settings (default -1 values)
settings_auto = SolverSettings()
settings_auto.set_parameter(CUOPT_METHOD, SolverMethod.Barrier)
settings_auto.set_parameter(CUOPT_FOLDING, -1) # Automatic
settings_auto.set_parameter(CUOPT_DUALIZE, -1) # Automatic
settings_auto.set_parameter(CUOPT_ORDERING, -1) # Automatic
settings_auto.set_parameter(CUOPT_AUGMENTED, -1) # Automatic
settings_auto.set_parameter("time_limit", 10)

prob.solve(settings_auto)

assert prob.solved
assert prob.Status.name == "Optimal"
assert prob.ObjValue == pytest.approx(1333.33, rel=0.01)

# Verify constraint slacks are non-negative
for c in prob.getConstraints():
# For <= constraints with optimal solution, slack should be >= 0
assert c.Slack >= -1e-6 # Allow small numerical tolerance
Loading
Loading