14 #ifndef OR_TOOLS_SAT_LB_TREE_SEARCH_H_
15 #define OR_TOOLS_SAT_LB_TREE_SEARCH_H_
25 #include "absl/strings/string_view.h"
26 #include "absl/time/time.h"
34 #include "ortools/sat/sat_parameters.pb.h"
63 const std::function<
void()>& feasible_solution_observer);
69 Node(
Literal l, IntegerValue lb)
70 :
literal(l), true_objective(lb), false_objective(lb) {}
73 IntegerValue MinObjective()
const {
74 return std::min(true_objective, false_objective);
78 void UpdateObjective(IntegerValue v) {
79 true_objective =
std::max(true_objective, v);
80 false_objective =
std::max(false_objective, v);
82 void UpdateTrueObjective(IntegerValue v) {
83 true_objective =
std::max(true_objective, v);
85 void UpdateFalseObjective(IntegerValue v) {
86 false_objective =
std::max(false_objective, v);
93 IntegerValue true_objective;
94 IntegerValue false_objective;
101 bool is_deleted =
false;
106 void DebugDisplayTree(
NodeIndex root)
const;
110 void UpdateObjectiveFromParent(
int level);
114 void UpdateParentObjective(
int level);
121 void MarkAsDeletedNodeAndUnreachableSubtree(Node& node);
122 void MarkSubtreeAsDeleted(
NodeIndex root);
126 void AppendNewNodeToCurrentBranch(
Literal decision);
133 std::vector<Literal> ExtractDecisions(
int base_level,
134 const std::vector<Literal>& conflict);
137 std::string SmallProgressString()
const;
150 IntegerVariable objective_var_;
151 const SatParameters& parameters_;
158 IntegerValue current_objective_lb_;
161 int num_nodes_in_tree_ = 0;
165 std::vector<NodeIndex> current_branch_;
170 int64_t num_rc_detected_ = 0;
174 int64_t num_decisions_taken_ = 0;
177 int num_full_restarts_ = 0;
178 int64_t num_decisions_taken_at_last_restart_ = 0;
179 int64_t num_decisions_taken_at_last_level_zero_ = 0;
182 int64_t num_back_to_root_node_ = 0;
185 absl::Time last_logging_time_;
A simple class to enforce both an elapsed time limit and a deterministic time limit in the same threa...
LbTreeSearch(Model *model)
SatSolver::Status Search(const std::function< void()> &feasible_solution_observer)
Class that owns everything related to a particular optimization model.
Collection of objects used to extend the Constraint Solver library.