idol
A C++ Framework for Optimization
Loading...
Searching...
No Matches
DantzigWolfeDecomposition.h
1//
2// Created by henri on 31.10.23.
3//
4
5#ifndef IDOL_DANTZIGWOLFEDECOMPOSITION_H
6#define IDOL_DANTZIGWOLFEDECOMPOSITION_H
7
8#include "idol/general/optimizers/OptimizerFactory.h"
9#include "idol/mixed-integer/modeling/annotations/Annotation.h"
10#include "SubProblem.h"
11#include "idol/general/utils/Map.h"
12#include "Formulation.h"
13#include "idol/mixed-integer/optimizers/dantzig-wolfe/infeasibility-strategies/DantzigWolfeInfeasibilityStrategy.h"
14#include "idol/mixed-integer/optimizers/dantzig-wolfe/stabilization/DualPriceSmoothingStabilization.h"
15#include "idol/mixed-integer/optimizers/dantzig-wolfe/logs/Factory.h"
16
17namespace idol {
18 class DantzigWolfeDecomposition;
19}
20
22 std::optional<Annotation<unsigned int>> m_decomposition;
23 std::unique_ptr<OptimizerFactory> m_master_optimizer_factory;
24 std::unique_ptr<DantzigWolfe::InfeasibilityStrategyFactory> m_infeasibility_strategy;
25 std::unique_ptr<DantzigWolfe::DualPriceSmoothingStabilization> m_dual_price_smoothing_stabilization;
26 std::unique_ptr<Logs::DantzigWolfe::Factory> m_logger_factory;
27 std::optional<unsigned int> m_max_parallel_sub_problems;
28 std::optional<bool> m_use_hard_branching;
29 std::optional<bool> m_use_infeasible_column_removal_when_branching;
30 std::optional<DantzigWolfe::SubProblem> m_default_sub_problem_spec;
31 Map<unsigned int, DantzigWolfe::SubProblem> m_sub_problem_specs;
32
33 [[nodiscard]] std::vector<DantzigWolfe::SubProblem> create_sub_problems_specifications(const DantzigWolfe::Formulation &t_dantzig_wolfe_formulation) const;
34 static void add_aggregation_constraints(DantzigWolfe::Formulation& t_dantzig_wolfe_formulation, const std::vector<DantzigWolfe::SubProblem>& t_sub_problem_specifications) ;
35public:
36 DantzigWolfeDecomposition() = default;
37
39
41
42 Optimizer *operator()(const Model &t_model) const override;
43
44 [[nodiscard]] DantzigWolfeDecomposition *clone() const override;
45
46 DantzigWolfeDecomposition& with_master_optimizer(const OptimizerFactory& t_optimizer_factory);
47
48 DantzigWolfeDecomposition& with_default_sub_problem_spec(DantzigWolfe::SubProblem t_sub_problem);
49
50 DantzigWolfeDecomposition& with_sub_problem_spec(unsigned int t_id, DantzigWolfe::SubProblem t_sub_problem);
51
52 DantzigWolfeDecomposition& with_infeasibility_strategy(const DantzigWolfe::InfeasibilityStrategyFactory& t_strategy);
53
54 DantzigWolfeDecomposition& with_hard_branching(bool t_value);
55
56 DantzigWolfeDecomposition& with_infeasible_columns_removal(bool t_value);
57
58 DantzigWolfeDecomposition& with_max_parallel_sub_problems(unsigned int t_n_sub_problems);
59
60 DantzigWolfeDecomposition& with_logger(const Logs::DantzigWolfe::Factory& t_logger);
61
62 DantzigWolfeDecomposition& with_dual_price_smoothing_stabilization(const DantzigWolfe::DualPriceSmoothingStabilization& t_stabilization);
63
64 [[nodiscard]] const DantzigWolfe::SubProblem& get_sub_problem_spec(unsigned int t_id) const;
65};
66
67#endif //IDOL_DANTZIGWOLFEDECOMPOSITION_H
DantzigWolfeDecomposition * clone() const override
Optimizer * operator()(const Model &t_model) const override