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 double m_M = 1;
27 double m_kappa = 0;
28 std::vector<Var> m_slack_for_constraints;
29 std::optional<Var> m_slack_for_objective;
30
32 void compute_kappa(const Model& t_separation_model, const Bilevel::Description& t_separation_bilevel_description);
33public:
34 BigMFreeSeparation() = default;
35
36 void operator()() override;
37 [[nodiscard]] Separation* clone() const override { return new BigMFreeSeparation(*this); }
38
39 BigMFreeSeparation& with_single_level_optimizer(const OptimizerFactory& t_optimizer);
40
41 std::pair<idol::Model, idol::Bilevel::Description> build_separation_problem() override;
42
44 const BigMFreeSeparation& m_parent;
45 public:
46 BoundProvider(const BigMFreeSeparation& t_parent);
47
48 double get_var_lb(const Var& t_var) override;
49 double get_var_ub(const Var& t_var) override;
50 double get_ctr_dual_lb(const Ctr &t_ctr) override;
51 double get_ctr_dual_ub(const Ctr &t_ctr) override;
52 double get_ctr_slack_lb(const Ctr &t_ctr) override;
53 double get_ctr_slack_ub(const Ctr &t_ctr) override;
54 double get_var_lb_dual_ub(const Var &t_var) override;
55 double get_var_ub_dual_lb(const Var &t_var) override;
56 [[nodiscard]] BoundProvider *clone() const override { return new BoundProvider(*this); }
57 };
58};
59
60#endif //IDOL_CCG_BIGMFREESEPARATION_H