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"
123 const std::vector<Literal>& assumptions,
Model*
model);
167 const std::vector<IntegerVariable>& vars,
Model*
model);
175 const std::vector<IntegerVariable>& vars,
Model*
model);
187 const std::vector<BooleanOrIntegerVariable>& vars,
188 const std::vector<IntegerValue>& values,
Model*
model);
203 value_selection_heuristics,
240 incomplete_heuristics,
246 const std::vector<BooleanVariable>& bool_vars,
247 const std::vector<IntegerVariable>& int_vars,
Model*
model);
294 bool ImportFromSharedClasses();
297 void LogStatistics();
300 std::vector<BooleanVariable> bool_vars_;
301 std::vector<IntegerVariable> int_vars_;
310 const SatParameters parameters_;
317 int64_t num_literals_probed_ = 0;
318 int64_t num_bounds_shaved_ = 0;
319 int64_t num_bounds_tried_ = 0;
322 double active_limit_;
324 absl::flat_hash_set<BooleanVariable> probed_bool_vars_;
325 absl::flat_hash_set<LiteralIndex> probed_literals_;
327 absl::Time last_logging_time_;
328 int current_int_var_ = 0;
329 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)
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::vector< std::function< BooleanOrIntegerLiteral()> > CompleteHeuristics(const std::vector< std::function< BooleanOrIntegerLiteral()> > &incomplete_heuristics, const std::function< BooleanOrIntegerLiteral()> &completion_heuristic)
std::function< BooleanOrIntegerLiteral()> FirstUnassignedVarAtItsMinHeuristic(const std::vector< IntegerVariable > &vars, Model *model)
SatSolver::Status ResetAndSolveIntegerProblem(const std::vector< Literal > &assumptions, Model *model)
std::function< BooleanOrIntegerLiteral()> SequentialValueSelection(std::vector< std::function< IntegerLiteral(IntegerVariable)> > value_selection_heuristics, std::function< BooleanOrIntegerLiteral()> var_selection_heuristic, Model *model)
std::function< BooleanOrIntegerLiteral()> SequentialSearch(std::vector< std::function< BooleanOrIntegerLiteral()> > heuristics)
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)
IntegerLiteral SplitDomainUsingBestSolutionValue(IntegerVariable var, Model *model)
std::function< BooleanOrIntegerLiteral()> IntegerValueSelectionHeuristic(std::function< BooleanOrIntegerLiteral()> var_selection_heuristic, Model *model)
SatSolver::Status SolveIntegerProblem(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)
IntegerLiteral SplitAroundLpValue(IntegerVariable var, Model *model)
const BooleanVariable kNoBooleanVariable(-1)
bool LinearizedPartIsLarge(Model *model)
std::function< BooleanOrIntegerLiteral()> PseudoCost(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::vector< std::function< BooleanOrIntegerLiteral()> > decision_policies