Skip to content

Commit

Permalink
add reduced cost for test with knapsack
Browse files Browse the repository at this point in the history
  • Loading branch information
hlefebvr committed Nov 25, 2024
1 parent 9032465 commit 7d97952
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ void idol::Optimizers::BranchAndBound<NodeInfoT>::solve(TreeNode& t_node,
const double lb = relaxation.get_var_lb(var);
const double ub = relaxation.get_var_ub(var);
if (lb > ub + Tolerance::Integer) {
std::cout << "Inconsistent bounds for variable " << var << ": " << lb << " > " << ub << std::endl;
std::cerr << "Inconsistent bounds for variable " << var << ": " << lb << " > " << ub << std::endl;
}
}

Expand Down
2 changes: 2 additions & 0 deletions tests/mixed-integer/branch-and-bound/knapsack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "idol/mixed-integer/optimizers/wrappers/Gurobi/Gurobi.h"
#include "idol/mixed-integer/optimizers/wrappers/HiGHS/HiGHS.h"
#include "idol/mixed-integer/optimizers/wrappers/Osi/Osi.h"
#include "idol/mixed-integer/optimizers/callbacks/ReducedCostFixing.h"

using namespace Catch::literals;
using namespace idol;
Expand Down Expand Up @@ -75,6 +76,7 @@ TEMPLATE_LIST_TEST_CASE("Solve Knapsack Problem instances with different node se
.with_node_optimizer(OPTIMIZER::ContinuousRelaxation())
.with_branching_rule(BranchingRuleT())
.with_node_selection_rule(NodeSelectionRuleT())
.add_callback(ReducedCostFixing())
.with_subtree_depth(subtree_depth)
);

Expand Down

0 comments on commit 7d97952

Please sign in to comment.