idol
A C++ Framework for Optimization
Loading...
Searching...
No Matches
ColumnGeneration.h
1//
2// Created by henri on 31.10.23.
3//
4
5#ifndef IDOL_COLUMNGENERATION_H
6#define IDOL_COLUMNGENERATION_H
7
8#include "Optimizers_DantzigWolfeDecomposition.h"
9
12 double m_best_bound_stop;
13
14 SolutionStatus m_status = Loaded;
15 SolutionReason m_reason = NotSpecified;
16 std::optional<PrimalPoint> m_master_primal_solution;
17 std::optional<DualPoint> m_last_master_solution;
18 std::vector<DantzigWolfe::SubProblem::PhaseId> m_sub_problems_phases;
19 double m_best_obj = -Inf;
20 double m_best_bound = +Inf;
21
22 const bool m_use_farkas_for_infeasibility;
23 unsigned int m_iteration_count = 0;
24 unsigned int m_n_generated_columns = 0;
25 bool m_solve_dual_master = false;
26 bool m_is_terminated = false;
27 bool m_current_iteration_is_using_farkas = false;
28
29 void initialize_sub_problem_phases();
30 void solve_dual_master();
31 bool gap_is_closed() const;
32 bool check_stopping_criterion();
33 void update_sub_problems();
34 void solve_sub_problems_in_parallel();
35 void analyze_sub_problems();
36 void enrich_master();
37 void pool_clean_up();
38
39 void log_init();
40 void log_master();
41 void log_sub_problems();
42 void log_end();
43public:
44 ColumnGeneration(DantzigWolfeDecomposition& t_parent, bool t_use_farkas_for_infeasibility, double t_best_bound_stop);
45
46 const DantzigWolfeDecomposition& parent() const { return m_parent; }
47
48 DantzigWolfeDecomposition& parent() { return m_parent; }
49
50 SolutionStatus status() const { return m_status; }
51
52 SolutionReason reason() const { return m_reason; }
53
54 double best_obj() const { return m_best_obj; }
55
56 double best_bound() const { return m_best_bound; }
57
58 const PrimalPoint& primal_solution() const { return m_master_primal_solution.value(); }
59
60 void set_best_bound_stop(double t_best_bound_stop) { m_best_bound_stop = t_best_bound_stop; }
61
62 void execute();
63};
64
65#endif //IDOL_COLUMNGENERATION_H