A C++ Framework for Optimization
Loading...
Searching...
No Matches
BigMFreeSeparation.h
1//
2// Created by Henri on 21/01/2026.
3//
4
5#ifndef IDOL_CCG_BIGMFREESEPARATION_H
6#define IDOL_CCG_BIGMFREESEPARATION_H
7#include "idol/general/optimizers/OptimizerFactory.h"
8#include "idol/mixed-integer/modeling/models/KKT.h"
9#include "idol/robust/optimizers/column-and-constraint-generation/separation/Separation.h"
10
11namespace idol::Robust::CCG {
12 class BigMFreeSeparation;
13}
14
15namespace idol {
16 static double overestimate(const AffExpr<Var>& t_expr,
17 const std::function<double(const Var&)>& t_get_var_lb,
18 const std::function<double(const Var&)>& t_get_var_ub);
19 static double underestimate(const AffExpr<Var>& t_expr,
20 const std::function<double(const Var&)>& t_get_var_lb,
21 const std::function<double(const Var&)>& t_get_var_ub);
22}
23
25 std::unique_ptr<OptimizerFactory> m_single_level_optimizer;
26 std::optional<bool> m_with_zero_one_uncertainty_set;
27 double m_M = 1;
28 double m_kappa = 0;
29 std::vector<Var> m_slack_for_constraints;
30 std::optional<Var> m_slack_for_objective;
31
33 void compute_kappa(const Model& t_separation_model, const Bilevel::Description& t_separation_bilevel_description);
34public:
35 BigMFreeSeparation() = default;
36
37 void operator()() override;
38 [[nodiscard]] Separation* clone() const override { return new BigMFreeSeparation(*this); }
39
40 BigMFreeSeparation& with_single_level_optimizer(const OptimizerFactory& t_optimizer);
41
42 BigMFreeSeparation& with_binary_uncertainty_set(bool t_value);
43
44 std::pair<idol::Model, idol::Bilevel::Description> build_separation_problem() override;
45
47 const BigMFreeSeparation& m_parent;
48 public:
49 BoundProvider(const BigMFreeSeparation& t_parent);
50
51 double get_var_lb(const Var& t_var) override;
52 double get_var_ub(const Var& t_var) override;
53 double get_ctr_dual_lb(const Ctr &t_ctr) override;
54 double get_ctr_dual_ub(const Ctr &t_ctr) override;
55 double get_ctr_slack_lb(const Ctr &t_ctr) override;
56 double get_ctr_slack_ub(const Ctr &t_ctr) override;
57 double get_var_lb_dual_ub(const Var &t_var) override;
58 double get_var_ub_dual_lb(const Var &t_var) override;
59 [[nodiscard]] BoundProvider *clone() const override { return new BoundProvider(*this); }
60 };
61};
62
63#endif //IDOL_CCG_BIGMFREESEPARATION_H