Skip to content

Commit

Permalink
Fix gap contribution bug
Browse files Browse the repository at this point in the history
  • Loading branch information
tbittar committed Nov 22, 2023
1 parent c0c7cef commit 15517c1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/cpp/benders/benders_by_batch/BendersByBatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,8 @@ void BendersByBatch::GetSubproblemCut(
subproblem_data.var_name_and_subgradient); // dual pi_s
auto subpb_cost_under_approx = GetAlpha_i()[ProblemToId(name)];
*batch_subproblems_costs_contribution_in_gap_per_proc +=
subproblem_data.subproblem_cost - subpb_cost_under_approx;
std::max(subproblem_data.subproblem_cost - subpb_cost_under_approx,
static_cast<double>(0));
double cut_value_at_x_cut = subproblem_data.subproblem_cost;
for (const auto &[candidate_name, x_cut_candidate_value] : _data.x_cut) {
auto subgradient_at_name =
Expand Down

0 comments on commit 15517c1

Please sign in to comment.