Skip to content

Commit

Permalink
implement add_aggregation_constraint
Browse files Browse the repository at this point in the history
  • Loading branch information
hlefebvr committed Oct 31, 2023
1 parent e7a2440 commit f8f5f80
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
15 changes: 11 additions & 4 deletions lib/src/optimizers/column-generation/DantzigWolfeFormulation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,11 +251,18 @@ const idol::Model &idol::DantzigWolfe::Formulation::get_model(const idol::Ctr &t
return sub_problem_id == MasterId ? m_master : m_sub_problems[sub_problem_id];
}

void
idol::DantzigWolfe::Formulation::add_aggregation_constraint(unsigned int t_sub_problem_id,
double t_lower_multiplicity,
double t_upper_multiplicity) {
void idol::DantzigWolfe::Formulation::add_aggregation_constraint(unsigned int t_sub_problem_id,
double t_lower_multiplicity,
double t_upper_multiplicity) {

auto& env = m_master.env();

Ctr lower(env, GreaterOrEqual, t_lower_multiplicity);
m_master.add(lower);
m_generation_patterns[t_sub_problem_id].linear().set(lower, 1);

Ctr upper(env, LessOrEqual, t_upper_multiplicity);
m_master.add(upper);
m_generation_patterns[t_sub_problem_id].linear().set(upper, 1);

}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ void idol::DantzigWolfe::Relaxation::add_aggregation_constraints(Formulation &t_
for (unsigned int i = 0, n = t_dantzig_wolfe_formulation.n_sub_problems() ; i < n ; ++i) {
const auto& spec = get_sub_problem_spec(i);
t_dantzig_wolfe_formulation.add_aggregation_constraint(i, spec.lower_multiplicity(), spec.upper_multiplicity());

}

}
Expand Down

0 comments on commit f8f5f80

Please sign in to comment.