Skip to content

Commit

Permalink
fixes case with only one sub-problem
Browse files Browse the repository at this point in the history
  • Loading branch information
hlefebvr committed Nov 6, 2023
1 parent b30719e commit c4d149d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/src/optimizers/dantzig-wolfe/Formulation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,16 @@ unsigned int idol::DantzigWolfe::Formulation::compute_n_sub_problems(const Model

const unsigned int sub_problem_id = ctr.get(m_decomposition_by_ctr);

if (sub_problem_id == MasterId) {
continue;
}

if (!n_sub_problems.has_value()) {
n_sub_problems = sub_problem_id;
continue;
}

if (sub_problem_id != MasterId && sub_problem_id >= n_sub_problems.value()) {
if (sub_problem_id >= n_sub_problems.value()) {
n_sub_problems = sub_problem_id;
}

Expand Down

0 comments on commit c4d149d

Please sign in to comment.