@@ -34,7 +34,8 @@ static papilo::PostsolveStorage<double> post_solve_storage_;
34
34
static bool maximize_ = false ;
35
35
36
36
template <typename i_t , typename f_t >
37
- papilo::Problem<f_t > build_papilo_problem (const optimization_problem_t <i_t , f_t >& op_problem)
37
+ papilo::Problem<f_t > build_papilo_problem (const optimization_problem_t <i_t , f_t >& op_problem,
38
+ problem_category_t category)
38
39
{
39
40
// Build papilo problem from optimization problem
40
41
papilo::ProblemBuilder<f_t > builder;
@@ -167,7 +168,10 @@ papilo::Problem<f_t> build_papilo_problem(const optimization_problem_t<i_t, f_t>
167
168
168
169
if (h_entries.size ()) {
169
170
auto constexpr const sorted_entries = true ;
170
- auto csr_storage = papilo::SparseStorage<f_t >(h_entries, num_rows, num_cols, sorted_entries);
171
+ // MIP reductions like clique merging and substituition require more fillin
172
+ const double spare_ratio = category == problem_category_t ::MIP ? 4.0 : 2.0 ;
173
+ const int min_inter_row_space = category == problem_category_t ::MIP ? 30 : 4 ;
174
+ auto csr_storage = papilo::SparseStorage<f_t >(h_entries, num_rows, num_cols, sorted_entries, spare_ratio, min_inter_row_space);
171
175
problem.setConstraintMatrix (csr_storage, h_constr_lb, h_constr_ub, h_row_flags);
172
176
173
177
papilo::ConstraintMatrix<f_t >& matrix = problem.getConstraintMatrix ();
@@ -308,10 +312,6 @@ void set_presolve_methods(papilo::Presolve<f_t>& presolver, problem_category_t c
308
312
{
309
313
using uptr = std::unique_ptr<papilo::PresolveMethod<f_t >>;
310
314
311
- // cuopt custom presolvers
312
- if (category == problem_category_t ::MIP)
313
- presolver.addPresolveMethod (uptr (new cuopt::linear_programming::detail::GF2Presolve<f_t >()));
314
-
315
315
// fast presolvers
316
316
presolver.addPresolveMethod (uptr (new papilo::SingletonCols<f_t >()));
317
317
presolver.addPresolveMethod (uptr (new papilo::CoefficientStrengthening<f_t >()));
@@ -336,6 +336,24 @@ void set_presolve_methods(papilo::Presolve<f_t>& presolver, problem_category_t c
336
336
presolver.addPresolveMethod (uptr (new papilo::SimpleSubstitution<f_t >()));
337
337
presolver.addPresolveMethod (uptr (new papilo::Sparsify<f_t >()));
338
338
presolver.addPresolveMethod (uptr (new papilo::Substitution<f_t >()));
339
+
340
+
341
+ if (category == problem_category_t ::MIP) {
342
+ // cuOpt custom GF2 presolver
343
+ presolver.addPresolveMethod (uptr (new cuopt::linear_programming::detail::GF2Presolve<f_t >()));
344
+
345
+ // clique merging presolver that is part of development branch of papilo
346
+ const int max_edges_parallel = 1000000 ;
347
+ const int max_edges_sequential = 100000 ;
348
+ const int max_clique_size = 100 ;
349
+ const int max_greedy_calls = 20000 ;
350
+ // const int max_calls = 50; // FIXME:: make this change once the papilo PR is merged
351
+ papilo::CliqueMerging<f_t > clique_merging;
352
+ clique_merging.setEnabled (true ); // This is currently disabled in the papilo presolver
353
+ clique_merging.setParameters (max_edges_parallel, max_edges_sequential, max_clique_size, max_greedy_calls /* , max_calls */ );
354
+ presolver.addPresolveMethod (
355
+ uptr (new papilo::CliqueMerging<f_t >(std::move (clique_merging))));
356
+ }
339
357
}
340
358
341
359
template <typename i_t , typename f_t >
@@ -360,7 +378,7 @@ std::pair<optimization_problem_t<i_t, f_t>, bool> third_party_presolve_t<i_t, f_
360
378
double time_limit,
361
379
i_t num_cpu_threads)
362
380
{
363
- papilo::Problem<f_t > papilo_problem = build_papilo_problem (op_problem);
381
+ papilo::Problem<f_t > papilo_problem = build_papilo_problem (op_problem, category );
364
382
365
383
CUOPT_LOG_INFO (" Unpresolved problem:: %d constraints, %d variables, %d nonzeros" ,
366
384
papilo_problem.getNRows (),
0 commit comments