Skip to content

Commit 4347577

Browse files
committed
Remove debugging. Fix unit test. Change default for cut_change_threshold
1 parent 8655d98 commit 4347577

4 files changed

Lines changed: 5 additions & 5 deletions

File tree

cpp/include/cuopt/linear_programming/mip/solver_settings.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ class mip_solver_settings_t {
9595
i_t knapsack_cuts = -1;
9696
i_t strong_chvatal_gomory_cuts = -1;
9797
i_t reduced_cost_strengthening = -1;
98-
f_t cut_change_threshold = 1e-3;
98+
f_t cut_change_threshold = -1.0;
9999
f_t cut_min_orthogonality = 0.5;
100100
i_t mip_batch_pdlp_strong_branching = 0;
101101
i_t num_gpus = 1;

cpp/src/branch_and_bound/branch_and_bound.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2143,7 +2143,7 @@ mip_status_t branch_and_bound_t<i_t, f_t>::solve(mip_solution_t<i_t, f_t>& solut
21432143
i_t num_cuts = cut_pool.get_best_cuts(cuts_to_add, cut_rhs, cut_types);
21442144
if (num_cuts == 0) { break; }
21452145
cut_info.record_cut_types(cut_types);
2146-
#if 1
2146+
#ifdef PRINT_CUT_POOL_TYPES
21472147
cut_pool.print_cutpool_types();
21482148
print_cut_types("In LP ", cut_types, settings_);
21492149
printf("Cut pool size: %d\n", cut_pool.pool_size());
@@ -2343,7 +2343,7 @@ mip_status_t branch_and_bound_t<i_t, f_t>::solve(mip_solution_t<i_t, f_t>& solut
23432343
f_t change_in_objective = root_objective_ - last_objective;
23442344
const f_t factor = settings_.cut_change_threshold;
23452345
const f_t min_objective = 1e-3;
2346-
if (0 &&
2346+
if (factor > 0.0 &&
23472347
change_in_objective <= factor * std::max(min_objective, std::abs(root_relax_objective))) {
23482348
settings_.log.printf(
23492349
"Change in objective %.16e is less than 1e-3 of root relax objective %.16e\n",

cpp/src/math_optimization/solver_settings.cu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ solver_settings_t<i_t, f_t>::solver_settings_t() : pdlp_settings(), mip_settings
7474
{CUOPT_MIP_RELATIVE_GAP, &mip_settings.tolerances.relative_mip_gap, f_t(0.0), f_t(1e-1), f_t(1e-4)},
7575
{CUOPT_PRIMAL_INFEASIBLE_TOLERANCE, &pdlp_settings.tolerances.primal_infeasible_tolerance, f_t(0.0), f_t(1e-1), std::max(f_t(1e-10), std::numeric_limits<f_t>::epsilon())},
7676
{CUOPT_DUAL_INFEASIBLE_TOLERANCE, &pdlp_settings.tolerances.dual_infeasible_tolerance, f_t(0.0), f_t(1e-1), std::max(f_t(1e-10), std::numeric_limits<f_t>::epsilon())},
77-
{CUOPT_MIP_CUT_CHANGE_THRESHOLD, &mip_settings.cut_change_threshold, f_t(0.0), std::numeric_limits<f_t>::infinity(), f_t(1e-3)},
77+
{CUOPT_MIP_CUT_CHANGE_THRESHOLD, &mip_settings.cut_change_threshold, f_t(-1.0), std::numeric_limits<f_t>::infinity(), f_t(-1.0)},
7878
{CUOPT_MIP_CUT_MIN_ORTHOGONALITY, &mip_settings.cut_min_orthogonality, f_t(0.0), f_t(1.0), f_t(0.5)}
7979
};
8080

cpp/tests/mip/cuts_test.cu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ TEST(cuts, test_cuts_1)
9393
// Expected objective value from documentation example is approximately -28
9494
EXPECT_NEAR(-28, obj_val, 1e-3);
9595

96-
EXPECT_EQ(solution.get_num_nodes(), 0);
96+
EXPECT_LE(solution.get_num_nodes(), 2);
9797
}
9898

9999
// Problem data for the mixed integer linear programming problem

0 commit comments

Comments
 (0)