Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
131 commits
Select commit Hold shift + click to select a range
3cc5a5c
Implement papilo presolve interface
rg20 Jul 18, 2025
5338bab
Fix handling of constraint bounds
rg20 Jul 18, 2025
c211549
Add Papilo to cmake
hlinsen Jul 24, 2025
a427180
Merge branch 'branch-25.08' of github.com:NVIDIA/cuopt into papilo_pr…
hlinsen Jul 24, 2025
733afad
Fix compile errors
hlinsen Jul 24, 2025
ca13c64
Fix link error
hlinsen Jul 24, 2025
3c5f963
Add presolve to LP
hlinsen Jul 25, 2025
61bf436
Add presolve setting
hlinsen Jul 25, 2025
e1eb264
Remove macro
hlinsen Jul 25, 2025
194318b
Fix option
hlinsen Jul 25, 2025
a58f659
Add papilo to conda env
hlinsen Jul 25, 2025
1de199b
Remove papilo from conda
hlinsen Jul 29, 2025
b62dda7
Fix build
hlinsen Jul 29, 2025
daf09e8
Handle infeasible presolve.
hlinsen Jul 29, 2025
00b22a8
Add tolerances from settings
hlinsen Jul 29, 2025
168e7e9
Fix mip after postsolve changes
hlinsen Jul 29, 2025
72d9ed1
Fix style
hlinsen Jul 29, 2025
4af8c08
Merge branch 'branch-25.08' of github.com:NVIDIA/cuopt into papilo_pr…
hlinsen Jul 29, 2025
f34cb0f
Add boost dependency
hlinsen Jul 29, 2025
7425f0a
Re add dependencies
hlinsen Jul 29, 2025
51fc7f6
Fix compile error
hlinsen Jul 29, 2025
4f1164e
Remove gmp from dependencies
hlinsen Jul 29, 2025
234694c
Use https link
hlinsen Jul 29, 2025
f86b6b7
Update third party license
hlinsen Jul 29, 2025
1276d69
Add boost and tbb to host env
hlinsen Jul 29, 2025
cfdfa56
Update recipe.yaml
rgsl888prabhu Jul 29, 2025
f1e637c
Set row and col flags
hlinsen Jul 29, 2025
202ac9f
Disable test build for papilo
hlinsen Jul 29, 2025
58285b7
Merge branch 'papilo_presolve' of github.com:hlinsen/cuopt into papil…
hlinsen Jul 29, 2025
d3cfccc
dd doc for CUOPT_PRESOLVE, add missing params to lp-milp-c-api.rst
tmckayus Jul 29, 2025
34413ff
Set to zero inf bounds for papilo
hlinsen Jul 29, 2025
b0a8c5d
Merge branch 'papilo_presolve' of github.com:hlinsen/cuopt into papil…
hlinsen Jul 30, 2025
eace2b8
Fix merge conflicts
hlinsen Jul 30, 2025
5dc9e95
Remove tbb find package
hlinsen Jul 30, 2025
9829d2d
Merge branch 'branch-25.08' of github.com:NVIDIA/cuopt into papilo_pr…
hlinsen Jul 30, 2025
d6063b8
Find tbb and link it for python layer symbol issue
hlinsen Jul 30, 2025
d7718c9
Fix reduction to empty papilo model.
hlinsen Jul 30, 2025
004fed1
tbb fix
rgsl888prabhu Jul 30, 2025
69649f6
boost
rgsl888prabhu Jul 30, 2025
13f30f4
fix style
rgsl888prabhu Jul 30, 2025
b3685a4
Disable presolve where it does not make sense
hlinsen Jul 30, 2025
4ad2495
revert file read write access
rgsl888prabhu Jul 30, 2025
e44987a
Disable singleton stuffing as postsolve is broken with it
hlinsen Jul 30, 2025
a0bbf16
Disable presolve for maximization problem, when callbacks, warm start…
hlinsen Jul 31, 2025
f81db36
Fix warm starts
hlinsen Jul 31, 2025
b62fd84
Merge branch 'branch-25.08' of github.com:NVIDIA/cuopt into papilo_pr…
hlinsen Jul 31, 2025
28df0d4
Merge branch 'papilo_presolve' of github.com:hlinsen/cuopt into papil…
hlinsen Jul 31, 2025
cb8abca
Revert cmake papilo path
hlinsen Jul 31, 2025
f6df7ee
revert changes
rgsl888prabhu Jul 31, 2025
2f1fec8
Skip postsolve steps if presolve not running
hlinsen Jul 31, 2025
472fac4
Fix mip cpp unit tests
hlinsen Jul 31, 2025
1132ac2
Merge branch 'branch-25.08' of github.com:NVIDIA/cuopt into papilo_pr…
hlinsen Jul 31, 2025
2bf7363
update deps
rgsl888prabhu Jul 31, 2025
a50c9a3
Merge branch 'papilo_presolve' of github.com:hlinsen/cuopt into papil…
rgsl888prabhu Jul 31, 2025
64bc65b
Enable more methods and fill dual with nans
hlinsen Jul 31, 2025
35177db
update
rgsl888prabhu Jul 31, 2025
dca96eb
fix pyproject
rgsl888prabhu Jul 31, 2025
22b7936
fix
rgsl888prabhu Jul 31, 2025
5eadd98
style fix
rgsl888prabhu Jul 31, 2025
85c15c7
fix issues
rgsl888prabhu Jul 31, 2025
fac68d3
Disable lp by default
hlinsen Jul 31, 2025
bc173cf
Merge branch 'papilo_presolve' of github.com:hlinsen/cuopt into papil…
hlinsen Jul 31, 2025
0742c32
Reproduced papilo hang
hlinsen Jul 31, 2025
65d10a5
Remove dead code
hlinsen Jul 31, 2025
32414f4
Disable papilo logs
hlinsen Jul 31, 2025
e981151
Update mps bench script
hlinsen Jul 31, 2025
0f0aae8
Add tbb to python cmake
hlinsen Jul 31, 2025
e3023a9
add permissive
rgsl888prabhu Jul 31, 2025
18ab83a
Fix empty solution fed to postsolve
hlinsen Jul 31, 2025
6f51d95
Merge branch 'papilo_presolve' of github.com:hlinsen/cuopt into papil…
hlinsen Aug 1, 2025
a2b124d
Disable presolve by default for LP in server
hlinsen Aug 1, 2025
b13e513
Merge branch 'branch-25.08' of github.com:NVIDIA/cuopt into papilo_pr…
hlinsen Aug 1, 2025
7a3e7b2
Disable presolve by default for LP in server
hlinsen Aug 1, 2025
f8811da
Set empty csr matrix to copy a problem reduced to 0
hlinsen Aug 1, 2025
31cdbfe
remove find tbb
rgsl888prabhu Aug 1, 2025
aa2d17c
Merge branch 'papilo_presolve' of github.com:hlinsen/cuopt into papil…
rgsl888prabhu Aug 1, 2025
8ad3280
Try to build tbb and boost
rgsl888prabhu Aug 1, 2025
e60be55
Add find tbb back
rgsl888prabhu Aug 1, 2025
ff09166
comment install boost and tbb
rgsl888prabhu Aug 1, 2025
a60e51e
Fix var types check
hlinsen Aug 1, 2025
216e388
Merge branch 'branch-25.08' of github.com:NVIDIA/cuopt into papilo_pr…
hlinsen Aug 1, 2025
b6b6468
Merge branch 'papilo_presolve' of github.com:hlinsen/cuopt into papil…
hlinsen Aug 1, 2025
31e1349
Remove output flag option
hlinsen Aug 1, 2025
328491a
Merge branch 'papilo_presolve' of github.com:hlinsen/cuopt into papil…
hlinsen Aug 1, 2025
82e3ac7
Fix var types check
hlinsen Aug 1, 2025
3ab49f5
Try adding hwloc
hlinsen Aug 1, 2025
c2ba139
Try disabling tbb
hlinsen Aug 1, 2025
7db7224
changes
rgsl888prabhu Aug 4, 2025
2f5c529
changes
rgsl888prabhu Aug 4, 2025
9deb323
Merge branch 'papilo_presolve' of github.com:hlinsen/cuopt into papil…
rgsl888prabhu Aug 4, 2025
aeb5027
Fix merge conflicts
hlinsen Aug 5, 2025
8badba9
Address review comments
rgsl888prabhu Aug 5, 2025
9855c1e
changes
rgsl888prabhu Aug 7, 2025
52379a3
Move papilo to private
hlinsen Aug 7, 2025
ec717a8
Make papilo a system include
hlinsen Aug 8, 2025
20d0125
Merge branch 'branch-25.08' of github.com:NVIDIA/cuopt into papilo_pr…
hlinsen Aug 8, 2025
082a95a
Fix merge conflicts
hlinsen Aug 8, 2025
d0c9426
Disable test build for papilo
hlinsen Aug 8, 2025
ca8b11d
Do not build papilo binaries
hlinsen Aug 8, 2025
480ae87
Disable in main cmake
hlinsen Aug 8, 2025
b9e8492
Disable papilo bin build
hlinsen Aug 8, 2025
efe1922
Disable papilo bin build
hlinsen Aug 8, 2025
f968f61
fix warning
hlinsen Aug 8, 2025
1c29822
Disable lusol and quadmath
hlinsen Aug 8, 2025
25e3883
Compiles
hlinsen Aug 8, 2025
d42cd20
Revert to compile install
hlinsen Aug 11, 2025
cd3c497
Merge branch 'branch-25.10' of github.com:NVIDIA/cuopt into papilo_pr…
hlinsen Aug 11, 2025
7b59fe3
Fix style
hlinsen Aug 11, 2025
cd89386
Revert to compile install
hlinsen Aug 11, 2025
3044d15
Fix build
hlinsen Aug 11, 2025
39196f6
Move again to .cpp
hlinsen Aug 11, 2025
168da19
Fix cpp tests
hlinsen Aug 11, 2025
0f29fe5
Install quadmath
hlinsen Aug 11, 2025
0045358
Only fetch for x86_64
hlinsen Aug 11, 2025
7d353f2
Only pull for rocky linux
hlinsen Aug 11, 2025
3d507dc
Remove Tbb
hlinsen Aug 11, 2025
6c6d5e6
Use bash for install
hlinsen Aug 11, 2025
ebf4b15
Fix cpp tests
hlinsen Aug 12, 2025
401f375
Re-add logging option for get_solution
hlinsen Aug 12, 2025
bdf0964
Review comments
hlinsen Aug 12, 2025
350e64d
Merge branch 'branch-25.10' of github.com:NVIDIA/cuopt into papilo_pr…
hlinsen Aug 12, 2025
37855d7
Review comments
hlinsen Aug 12, 2025
de00644
Remove dead code
hlinsen Aug 12, 2025
02f0384
Remove tbb
hlinsen Aug 12, 2025
98569de
Update doc
hlinsen Aug 12, 2025
5a1469c
Update logs
hlinsen Aug 12, 2025
faf0200
Remove boost build from docker file
hlinsen Aug 12, 2025
b490069
Remove print
hlinsen Aug 12, 2025
acae869
Move papilo to private
hlinsen Aug 13, 2025
c953377
Update FAQ
hlinsen Aug 13, 2025
69a5d2b
Mention root node explicitely
hlinsen Aug 13, 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
9 changes: 4 additions & 5 deletions benchmarks/linear_programming/cuopt/run_mip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ int main(int argc, char* argv[])

std::string out_dir;
std::string result_file;
int batch_num;
int batch_num = -1;

bool heuristics_only = program.get<std::string>("--heuristics-only")[0] == 't';
int num_cpu_threads = program.get<int>("--num-cpu-threads");
Expand Down Expand Up @@ -392,8 +392,7 @@ int main(int argc, char* argv[])
for (int i = 0; i < n_gpus; ++i) {
gpu_queue.push(i);
}
int tests_ran = 0;
int n_instances_solved = 0;
int tests_ran = 0;
std::vector<std::string> paths;
if (run_selected) {
for (const auto& instance : instances) {
Expand Down Expand Up @@ -421,11 +420,11 @@ int main(int argc, char* argv[])

bool static_dispatch = false;
if (static_dispatch) {
for (int i = 0; i < paths.size(); ++i) {
for (size_t i = 0; i < paths.size(); ++i) {
// TODO implement
}
} else {
for (int i = 0; i < paths.size(); ++i) {
for (size_t i = 0; i < paths.size(); ++i) {
task_queue.push(paths[i]);
}
while (!task_queue.empty()) {
Expand Down
31 changes: 24 additions & 7 deletions benchmarks/linear_programming/run_mps_files.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
# --mip-heuristics-only : Run mip heuristics only
# --write-log-file : Write log file
# --num-cpu-threads : Number of CPU threads to use
# --presolve : Enable presolve (default: true for MIP problems, false for LP problems)
# --batch-num : Batch number. This allows to split the work across multiple batches uniformly when resources are limited.
# --n-batches : Number of batches
# --log-to-console : Log to console
Expand Down Expand Up @@ -74,6 +75,7 @@ Optional Arguments:
--mip-heuristics-only Run mip heuristics only
--write-log-file Write log file
--num-cpu-threads Number of CPU threads to use
--presolve Enable presolve (default: true for MIP problems, false for LP problems)
--batch-num Batch number
--n-batches Number of batches
--log-to-console Log to console
Expand Down Expand Up @@ -107,47 +109,62 @@ fi
while [[ $# -gt 0 ]]; do
case $1 in
--path)
echo "MPS_DIR: $2"
MPS_DIR="$2"
shift 2
;;
--ngpus)
echo "GPU_COUNT: $2"
GPU_COUNT="$2"
shift 2
;;
--time-limit)
echo "TIME_LIMIT: $2"
TIME_LIMIT="$2"
shift 2
;;
--output-dir)
echo "OUTPUT_DIR: $2"
OUTPUT_DIR="$2"
shift 2
;;
--relaxation)
echo "Running relaxation"
echo "RELAXATION: true"
RELAXATION=true
shift
;;
--mip-heuristics-only)
echo "MIP_HEURISTICS_ONLY: true"
MIP_HEURISTICS_ONLY=true
shift
;;
--write-log-file)
WRITE_LOG_FILE="$2"
shift 2
echo "WRITE_LOG_FILE: true"
WRITE_LOG_FILE=true
shift
;;
--num-cpu-threads)
echo "NUM_CPU_THREADS: $2"
NUM_CPU_THREADS="$2"
shift 2
;;
--presolve)
echo "PRESOLVE: $2"
PRESOLVE="$2"
shift 2
;;
--batch-num)
echo "BATCH_NUM: $2"
BATCH_NUM="$2"
shift 2
;;
--n-batches)
echo "N_BATCHES: $2"
N_BATCHES="$2"
shift 2
;;
--log-to-console)
echo "LOG_TO_CONSOLE: $2"
LOG_TO_CONSOLE="$2"
shift 2
;;
Expand All @@ -173,6 +190,7 @@ RELAXATION=${RELAXATION:-false}
MIP_HEURISTICS_ONLY=${MIP_HEURISTICS_ONLY:-false}
WRITE_LOG_FILE=${WRITE_LOG_FILE:-false}
NUM_CPU_THREADS=${NUM_CPU_THREADS:-1}
PRESOLVE=${PRESOLVE:-true}
BATCH_NUM=${BATCH_NUM:-0}
N_BATCHES=${N_BATCHES:-1}
LOG_TO_CONSOLE=${LOG_TO_CONSOLE:-true}
Expand Down Expand Up @@ -261,9 +279,8 @@ worker() {
if [ "$RELAXATION" = true ]; then
args="$args --relaxation"
fi
if [ "$LOG_TO_CONSOLE" = true ]; then
args="$args --log-to-console $LOG_TO_CONSOLE"
fi
args="$args --log-to-console $LOG_TO_CONSOLE"
args="$args --presolve $PRESOLVE"

CUDA_VISIBLE_DEVICES=$gpu_id cuopt_cli "$mps_file" --time-limit $TIME_LIMIT $args
done
Expand All @@ -277,4 +294,4 @@ done
wait

# Remove the index file
rm -f "$INDEX_FILE"
rm -f "$INDEX_FILE"
3 changes: 3 additions & 0 deletions ci/build_wheel_libcuopt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ source rapids-init-pip
package_name="libcuopt"
package_dir="python/libcuopt"

# Install Boost
bash ci/utils/install_boost.sh

export SKBUILD_CMAKE_ARGS="-DCUOPT_BUILD_WHEELS=ON;-DDISABLE_DEPRECATION_WARNING=ON"

# For pull requests we are enabling assert mode.
Expand Down
40 changes: 40 additions & 0 deletions ci/utils/install_boost.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/bash

# SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

set -euo pipefail

# Install Boost
if [ -f /etc/os-release ]; then
. /etc/os-release
if [[ "$ID" == "rocky" ]]; then
echo "Detected Rocky Linux. Installing Boost via dnf..."
dnf install -y boost-devel
if [[ "$(uname -m)" == "x86_64" ]]; then
dnf install -y gcc-toolset-14-libquadmath-devel
fi
elif [[ "$ID" == "ubuntu" ]]; then
echo "Detected Ubuntu. Installing Boost via apt..."
apt-get update
apt-get install -y libboost-dev
else
echo "Unknown OS: $ID. Please install Boost development libraries manually."
exit 1
fi
else
echo "/etc/os-release not found. Cannot determine OS. Please install Boost development libraries manually."
exit 1
fi
1 change: 1 addition & 0 deletions conda/environments/all_cuda-128_arch-aarch64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ channels:
- rapidsai-nightly
- conda-forge
dependencies:
- boost
- breathe
- c-compiler
- ccache
Expand Down
1 change: 1 addition & 0 deletions conda/environments/all_cuda-128_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ channels:
- rapidsai-nightly
- conda-forge
dependencies:
- boost
- breathe
- c-compiler
- ccache
Expand Down
9 changes: 9 additions & 0 deletions conda/recipes/libcuopt/recipe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ cache:

requirements:
build:
- boost
- ${{ compiler("c") }}
- ${{ compiler("cxx") }}
- ${{ compiler("cuda") }} =${{ cuda_version }}
Expand All @@ -68,6 +69,7 @@ cache:
- libcurand-dev
- libcusparse-dev
- cuda-cudart-dev
- boost

outputs:
- package:
Expand Down Expand Up @@ -126,6 +128,7 @@ outputs:
- ${{ stdlib("c") }}
host:
- ${{ pin_subpackage("libmps-parser", exact=True) }}
- boost
- cuda-version =${{ cuda_version }}
- rapids-logger =0.1
- librmm =${{ dep_minor_version }}
Expand All @@ -135,6 +138,7 @@ outputs:
run:
- ${{ pin_compatible("cuda-version", upper_bound="x", lower_bound="x") }}
- ${{ pin_subpackage("libmps-parser", exact=True) }}
- boost
- librmm =${{ dep_minor_version }}
- cuda-nvrtc
ignore_run_exports:
Expand All @@ -146,6 +150,8 @@ outputs:
- libcurand
- libcusparse
- librmm
- libboost
- libboost_iostreams
tests:
- package_contents:
files:
Expand Down Expand Up @@ -173,6 +179,7 @@ outputs:
host:
- ${{ pin_subpackage("libcuopt", exact=True) }}
- ${{ pin_subpackage("libmps-parser", exact=True) }}
- boost
- gmock ${{ gtest_version }}
- gtest ${{ gtest_version }}
- cuda-cudart-dev
Expand All @@ -192,6 +199,8 @@ outputs:
- libcurand
- libcusparse
- librmm
- libboost
- libboost_iostreams
about:
homepage: ${{ load_from_file("python/cuopt/pyproject.toml").project.urls.Homepage }}
license: ${{ load_from_file("python/cuopt/pyproject.toml").project.license.text }}
Expand Down
29 changes: 28 additions & 1 deletion cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.

cmake_minimum_required(VERSION 3.26.4 FATAL_ERROR)
cmake_minimum_required(VERSION 3.30.4 FATAL_ERROR)

# Add our custom Find modules to the module path
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/thirdparty")

include(GNUInstallDirs)

Expand Down Expand Up @@ -157,6 +160,21 @@ else()
find_package(RMM REQUIRED)
find_package(RAFT REQUIRED)
endif()

FetchContent_Declare(
papilo
GIT_REPOSITORY "https://github.com/scipopt/papilo.git"
GIT_TAG "v2.4.3"
SYSTEM
)

set(BUILD_TESTING OFF CACHE BOOL "Disable test build for papilo")
set(TBB OFF CACHE BOOL "Disable TBB")
set(PAPILO_NO_BINARIES ON)
option(LUSOL "Disable LUSOL" OFF)

FetchContent_MakeAvailable(papilo)

include(${rapids-cmake-dir}/cpm/rapids_logger.cmake)
# generate logging macros
rapids_cpm_rapids_logger(BUILD_EXPORT_SET cuopt-exports INSTALL_EXPORT_SET cuopt-exports)
Expand Down Expand Up @@ -204,6 +222,9 @@ target_link_options(cuopt PRIVATE "${CUOPT_BINARY_DIR}/fatbin.ld")
add_library(cuopt::cuopt ALIAS cuopt)
# ##################################################################################################
# - include paths ---------------------------------------------------------------------------------

target_include_directories(cuopt SYSTEM PRIVATE "${papilo_SOURCE_DIR}/src" "${papilo_BINARY_DIR}")

target_include_directories(cuopt
PRIVATE
"${CMAKE_CURRENT_SOURCE_DIR}/../thirdparty"
Expand All @@ -212,6 +233,7 @@ target_include_directories(cuopt
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>"
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/libmps_parser/include>"
INTERFACE
"$<INSTALL_INTERFACE:include>"
)

Expand Down Expand Up @@ -242,6 +264,7 @@ target_link_libraries(cuopt
${CUOPT_PRIVATE_CUDA_LIBS}
)


# ##################################################################################################
# - generate tests --------------------------------------------------------------------------------
if(BUILD_TESTS)
Expand Down Expand Up @@ -357,6 +380,8 @@ target_link_libraries(cuopt_cli
PUBLIC
cuopt
OpenMP::OpenMP_CXX
PRIVATE
papilo-core
)
set_property(TARGET cuopt_cli PROPERTY INSTALL_RPATH "$ORIGIN/../${lib_dir}")

Expand All @@ -377,6 +402,8 @@ if(BUILD_BENCHMARKS)
PUBLIC
cuopt
OpenMP::OpenMP_CXX
PRIVATE
papilo-core
)
endif()

Expand Down
8 changes: 5 additions & 3 deletions cpp/cuopt_cli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,6 @@ int run_single_file(const std::string& file_path,
(op_problem.get_problem_category() == cuopt::linear_programming::problem_category_t::MIP ||
op_problem.get_problem_category() == cuopt::linear_programming::problem_category_t::IP);

bool sol_found = false;
double obj_val = std::numeric_limits<double>::infinity();

auto initial_solution =
initial_solution_file.empty()
? std::vector<double>()
Expand Down Expand Up @@ -197,6 +194,11 @@ int main(int argc, char* argv[])
.default_value(false)
.implicit_value(true);

program.add_argument("--presolve")
.help("enable/disable presolve (default: true for MIP problems, false for LP problems)")
.default_value(true)
.implicit_value(true);

std::map<std::string, std::string> arg_name_to_param_name;
{
// Add all solver settings as arguments
Expand Down
2 changes: 2 additions & 0 deletions cpp/include/cuopt/linear_programming/constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,15 @@
#define CUOPT_LOG_FILE "log_file"
#define CUOPT_LOG_TO_CONSOLE "log_to_console"
#define CUOPT_CROSSOVER "crossover"
#define CUOPT_PRESOLVE "presolve"
#define CUOPT_MIP_ABSOLUTE_TOLERANCE "mip_absolute_tolerance"
#define CUOPT_MIP_RELATIVE_TOLERANCE "mip_relative_tolerance"
#define CUOPT_MIP_INTEGRALITY_TOLERANCE "mip_integrality_tolerance"
#define CUOPT_MIP_ABSOLUTE_GAP "mip_absolute_gap"
#define CUOPT_MIP_RELATIVE_GAP "mip_relative_gap"
#define CUOPT_MIP_HEURISTICS_ONLY "mip_heuristics_only"
#define CUOPT_MIP_SCALING "mip_scaling"
#define CUOPT_MIP_PRESOLVE "mip_presolve"
Copy link
Contributor

Choose a reason for hiding this comment

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

I see this declared here, but I don't see it used anywhere else. Should it be removed, or is it supposed to be used elsewhere? did we settle on just one CUOPT_PRESOLVE?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it should be removed.

#define CUOPT_SOLUTION_FILE "solution_file"
#define CUOPT_NUM_CPU_THREADS "num_cpu_threads"
#define CUOPT_USER_PROBLEM_FILE "user_problem_file"
Expand Down
Loading