18 using PresentGeneratorsList = std::list<std::pair<Var, const PrimalPoint&>>;
23 std::vector<Model> m_sub_problems;
24 std::vector<GenerationPattern<Var>> m_generation_patterns;
25 std::vector<GeneratorPool<Var>> m_pools;
26 std::vector<PresentGeneratorsList> m_present_generators;
28 Map<Var, Ctr> m_soft_branching_lower_bound_constraints;
29 Map<Var, Ctr> m_soft_branching_upper_bound_constraints;
31 unsigned int compute_n_sub_problems(
const Model& t_original_formulation);
32 void set_decomposition_by_var(
const Model& t_original_formulation);
33 void initialize_sub_problems(
unsigned int t_n_sub_problems);
34 void initialize_generation_patterns(
unsigned int t_n_sub_problems);
35 void initialize_pools(
unsigned int t_n_sub_problems);
36 void initialize_present_generators(
unsigned int t_n_sub_problems);
37 void dispatch_variables(
const Model& t_original_formulation);
38 void dispatch_constraints(
const Model& t_original_formulation);
39 void dispatch_linking_constraint(
const Ctr& t_original_ctr,
const LinExpr<Var>& t_row, CtrType t_type,
double t_rhs);
40 std::pair<LinExpr<Var>, std::vector<LinExpr<Var>>> decompose_expression(
const LinExpr<Var> &t_linear);
41 void dispatch_objective_function(
const Model& t_original_formulation);
42 bool is_feasible(
const PrimalPoint& t_primal,
unsigned int t_sub_problem_id);
44 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);
45 LinExpr<Var> reformulate_sub_problem_variable(
const Var &t_var,
unsigned int t_sub_problem_id);
49 Model& master() {
return m_master; }
50 const Model& master()
const {
return m_master; }
55 auto present_generators(
unsigned int t_id)
const {
return ConstIteratorForward(m_present_generators[t_id]); }
57 Model& sub_problem(
unsigned int t_id) {
return m_sub_problems[t_id]; }
58 const Model& sub_problem(
unsigned int t_id)
const {
return m_sub_problems[t_id]; }
61 const Model& get_model(
const Var& t_var)
const;
64 const Model& get_model(
const Ctr& t_ctr)
const;
68 const GeneratorPool<Var>& column_pool(
unsigned int t_sub_problem_id)
const {
return m_pools[t_sub_problem_id]; }
70 unsigned int n_sub_problems()
const {
return m_sub_problems.size(); }
72 void add_aggregation_constraint(
unsigned int t_sub_problem_id,
double t_lower_multiplicity,
double t_upper_multiplicity);
74 AffExpr<Var> compute_sub_problem_objective(
unsigned int t_sub_problem_id,
const DualPoint& t_master_dual,
bool t_use_farkas =
false)
const;
76 void update_sub_problem_objective(
unsigned int t_sub_problem_id,
const DualPoint& t_master_dual,
bool t_use_farkas =
false);
78 void generate_column(
unsigned int t_sub_problem_id,
PrimalPoint t_generator);
80 double compute_reduced_cost(
unsigned int t_sub_problem_id,
const DualPoint& t_master_dual,
const PrimalPoint& t_generator);
84 double get_original_space_var_primal(
const Var& t_var,
const PrimalPoint& t_master_primal)
const;
86 void update_var_lb(
const Var& t_var,
double t_lb,
bool t_hard,
bool t_remove_infeasible_columns);
88 void update_var_ub(
const Var& t_var,
double t_ub,
bool t_hard,
bool t_remove_infeasible_columns);
90 void remove_column_if(
unsigned int t_sub_problem_id,
const std::function<
bool(
const Var &,
const PrimalPoint &)> &t_indicator_for_removal);
94 void update_var_obj(
const Var& t_var,
double t_obj);
96 void clean_up(
unsigned int t_sub_problem_id,
double t_ratio);
98 void add(
const Var& t_var,
double t_lb,
double t_ub, VarType t_type,
const LinExpr<Ctr>& t_column);
102 void remove(
const Var& t_var);
104 void remove(
const Ctr& t_ctr);
106 unsigned int get_n_present_generators()
const;
108 void load_columns_from_pool();
110 void add_sub_problem();