23 #ifndef OR_TOOLS_SAT_INTEGER_SEARCH_H_
24 #define OR_TOOLS_SAT_INTEGER_SEARCH_H_
31 #include "absl/container/flat_hash_set.h"
32 #include "absl/time/time.h"
33 #include "ortools/sat/cp_model.pb.h"
42 #include "ortools/sat/sat_parameters.pb.h"
116 const std::vector<Literal>& assumptions,
Model*
model);
160 const std::vector<IntegerVariable>& vars,
Model*
model);
168 const std::vector<IntegerVariable>& vars,
Model*
model);
180 const std::vector<BooleanOrIntegerVariable>& vars,
181 const std::vector<IntegerValue>& values,
Model*
model);
196 value_selection_heuristics,
233 incomplete_heuristics,
239 const std::vector<BooleanVariable>& bool_vars,
240 const std::vector<IntegerVariable>& int_vars,
Model*
model);
272 const SatParameters& parameters_;
302 bool ImportFromSharedClasses();
305 void LogStatistics();
308 std::vector<BooleanVariable> bool_vars_;
309 std::vector<IntegerVariable> int_vars_;
318 const SatParameters parameters_;
325 int64_t num_literals_probed_ = 0;
326 int64_t num_bounds_shaved_ = 0;
327 int64_t num_bounds_tried_ = 0;
330 double active_limit_;
332 absl::flat_hash_set<BooleanVariable> probed_bool_vars_;
333 absl::flat_hash_set<LiteralIndex> probed_literals_;
335 absl::Time last_logging_time_;
336 int current_int_var_ = 0;
337 int current_bool_var_ = 0;
A simple class to enforce both an elapsed time limit and a deterministic time limit in the same threa...
SatSolver::Status Probe()
ContinuousProber(const CpModelProto &model_proto, Model *model)
SatSolver::Status SolveIntegerProblem()
IntegerSearchHelper(Model *model)
bool BeforeTakingDecision()
bool TakeDecision(Literal decision)
LiteralIndex GetDecision(const std::function< BooleanOrIntegerLiteral()> &f)
Class that owns everything related to a particular optimization model.
CpModelProto const * model_proto
std::function< BooleanOrIntegerLiteral()> FirstUnassignedVarAtItsMinHeuristic(const std::vector< IntegerVariable > &vars, Model *model)
SatSolver::Status ResetAndSolveIntegerProblem(const std::vector< Literal > &assumptions, Model *model)
const LiteralIndex kNoLiteralIndex(-1)
IntegerLiteral AtMinValue(IntegerVariable var, IntegerTrail *integer_trail)
IntegerLiteral GreaterOrEqualToMiddleValue(IntegerVariable var, IntegerTrail *integer_trail)
IntegerLiteral SplitAroundGivenValue(IntegerVariable var, IntegerValue value, Model *model)
std::function< BooleanOrIntegerLiteral()> UnassignedVarWithLowestMinAtItsMinHeuristic(const std::vector< IntegerVariable > &vars, Model *model)
SatSolver::Status SolveIntegerProblemWithLazyEncoding(Model *model)
std::function< bool()> SatSolverRestartPolicy(Model *model)
const IntegerVariable kNoIntegerVariable(-1)
std::function< BooleanOrIntegerLiteral()> FollowHint(const std::vector< BooleanOrIntegerVariable > &vars, const std::vector< IntegerValue > &values, Model *model)
std::function< bool()> RestartEveryKFailures(int k, SatSolver *solver)
std::function< BooleanOrIntegerLiteral()> SchedulingSearchHeuristic(Model *model)
IntegerLiteral ChooseBestObjectiveValue(IntegerVariable var, Model *model)
void ConfigureSearchHeuristics(Model *model)
std::vector< std::function< BooleanOrIntegerLiteral()> > CompleteHeuristics(const std::vector< std::function< BooleanOrIntegerLiteral()>> &incomplete_heuristics, const std::function< BooleanOrIntegerLiteral()> &completion_heuristic)
IntegerLiteral SplitDomainUsingBestSolutionValue(IntegerVariable var, Model *model)
std::function< BooleanOrIntegerLiteral()> IntegerValueSelectionHeuristic(std::function< BooleanOrIntegerLiteral()> var_selection_heuristic, Model *model)
std::function< BooleanOrIntegerLiteral()> SatSolverHeuristic(Model *model)
SatSolver::Status ContinuousProbing(const std::vector< BooleanVariable > &bool_vars, const std::vector< IntegerVariable > &int_vars, Model *model)
std::function< BooleanOrIntegerLiteral()> SequentialSearch(std::vector< std::function< BooleanOrIntegerLiteral()>> heuristics)
IntegerLiteral SplitAroundLpValue(IntegerVariable var, Model *model)
const BooleanVariable kNoBooleanVariable(-1)
bool LinearizedPartIsLarge(Model *model)
std::function< BooleanOrIntegerLiteral()> PseudoCost(Model *model)
std::function< BooleanOrIntegerLiteral()> SequentialValueSelection(std::vector< std::function< IntegerLiteral(IntegerVariable)>> value_selection_heuristics, std::function< BooleanOrIntegerLiteral()> var_selection_heuristic, Model *model)
Collection of objects used to extend the Constraint Solver library.
LiteralIndex boolean_literal_index
BooleanOrIntegerLiteral(LiteralIndex index)
BooleanOrIntegerLiteral()
IntegerLiteral integer_literal
BooleanOrIntegerLiteral(IntegerLiteral i_lit)
std::vector< std::function< bool()> > callbacks
std::vector< std::function< bool()> > restart_policies
std::function< BooleanOrIntegerLiteral()> hint_search
std::function< BooleanOrIntegerLiteral()> fixed_search
std::function< BooleanOrIntegerLiteral()> next_decision_override
std::function< BooleanOrIntegerLiteral()> user_search
std::vector< std::function< BooleanOrIntegerLiteral()> > decision_policies