18 using PresentGeneratorsList = std::list<std::pair<Var, const PrimalPoint&>>;
22 const Model& m_original_formulation;
24 std::vector<Model> m_sub_problems;
25 std::vector<GenerationPattern<Var>> m_generation_patterns;
26 std::vector<GeneratorPool<Var>> m_pools;
27 std::vector<PresentGeneratorsList> m_present_generators;
29 Map<Var, Ctr> m_soft_branching_lower_bound_constraints;
30 Map<Var, Ctr> m_soft_branching_upper_bound_constraints;
32 unsigned int compute_n_sub_problems(
const Model& t_original_formulation);
33 void set_decomposition_by_var(
const Model& t_original_formulation);
34 void initialize_sub_problems(
unsigned int t_n_sub_problems);
35 void initialize_generation_patterns(
unsigned int t_n_sub_problems);
36 void initialize_pools(
unsigned int t_n_sub_problems);
37 void initialize_present_generators(
unsigned int t_n_sub_problems);
38 void dispatch_variables(
const Model& t_original_formulation);
39 void dispatch_constraints(
const Model& t_original_formulation);
40 void dispatch_linking_constraint(
const Ctr& t_original_ctr,
const LinExpr<Var>& t_row, CtrType t_type,
double t_rhs);
41 std::pair<LinExpr<Var>, std::vector<LinExpr<Var>>> decompose_expression(
const LinExpr<Var> &t_linear);
42 void dispatch_objective_function(
const Model& t_original_formulation);
43 bool is_feasible(
const PrimalPoint& t_primal,
unsigned int t_sub_problem_id);
45 void apply_sub_problem_bound_on_master(
bool t_is_lb,
const idol::Var &t_var,
unsigned int t_sub_problem_id,
double t_value);
46 LinExpr<Var> reformulate_sub_problem_variable(
const Var &t_var,
unsigned int t_sub_problem_id);
50 Model& master() {
return m_master; }
51 const Model& master()
const {
return m_master; }
56 auto present_generators(
unsigned int t_id)
const {
return ConstIteratorForward(m_present_generators[t_id]); }
58 Model& sub_problem(
unsigned int t_id) {
return m_sub_problems[t_id]; }
59 const Model& sub_problem(
unsigned int t_id)
const {
return m_sub_problems[t_id]; }
62 const Model& get_model(
const Var& t_var)
const;
65 const Model& get_model(
const Ctr& t_ctr)
const;
69 const GeneratorPool<Var>& column_pool(
unsigned int t_sub_problem_id)
const {
return m_pools[t_sub_problem_id]; }
71 unsigned int n_sub_problems()
const {
return m_sub_problems.size(); }
73 void add_aggregation_constraint(
unsigned int t_sub_problem_id,
double t_lower_multiplicity,
double t_upper_multiplicity);
75 AffExpr<Var> compute_sub_problem_objective(
unsigned int t_sub_problem_id,
const DualPoint& t_master_dual,
bool t_use_farkas =
false)
const;
77 void update_sub_problem_objective(
unsigned int t_sub_problem_id,
const DualPoint& t_master_dual,
bool t_use_farkas =
false);
79 void generate_column(
unsigned int t_sub_problem_id, PrimalPoint t_generator);
81 double compute_reduced_cost(
unsigned int t_sub_problem_id,
const DualPoint& t_master_dual,
const PrimalPoint& t_generator);
85 double get_original_space_var_primal(
const Var& t_var,
const PrimalPoint& t_master_primal)
const;
87 void update_var_lb(
const Var& t_var,
double t_lb,
bool t_hard,
bool t_remove_infeasible_columns);
89 void update_var_ub(
const Var& t_var,
double t_ub,
bool t_hard,
bool t_remove_infeasible_columns);
91 void remove_column_if(
unsigned int t_sub_problem_id,
const std::function<
bool(
const Var &,
const PrimalPoint &)> &t_indicator_for_removal);
95 void update_var_obj(
const Var& t_var,
double t_obj);
97 void clean_up(
unsigned int t_sub_problem_id,
double t_ratio);
99 void add(
const Var& t_var,
double t_lb,
double t_ub, VarType t_type,
const LinExpr<Ctr>& t_column);
101 void add(
const Ctr& t_ctr, CtrType t_type,
const LinExpr<Var>& t_row,
double t_rhs);
103 void remove(
const Var& t_var);
105 void remove(
const Ctr& t_ctr);
107 unsigned int get_n_present_generators()
const;
109 void load_columns_from_pool();
111 void add_sub_problem();