OR-Tools  8.1
cp_model_solver.cc File Reference

Go to the source code of this file.

Classes

struct  SolutionObservers
 

Namespaces

 operations_research
 The vehicle routing library lets one model and solve generic vehicle routing problems ranging from the Traveling Salesman Problem to more complex problems such as the Capacitated Vehicle Routing Problem with Time Windows.
 
 operations_research::sat
 

Functions

 ABSL_FLAG (std::string, cp_model_dump_prefix, "/tmp/", "Prefix filename for all dumped files")
 
 ABSL_FLAG (bool, cp_model_dump_models, false, "DEBUG ONLY. When set to true, SolveCpModel() will dump its model " "protos (original model, presolved model, mapping model) in text " "format to 'FLAGS_cp_model_dump_prefix'{model|presolved_model|" "mapping_model}.pbtxt.")
 
 ABSL_FLAG (bool, cp_model_dump_lns, false, "DEBUG ONLY. When set to true, solve will dump all " "lns models proto in text format to " "'FLAGS_cp_model_dump_prefix'lns_xxx.pbtxt.")
 
 ABSL_FLAG (bool, cp_model_dump_response, false, "DEBUG ONLY. If true, the final response of each solve will be " "dumped to 'FLAGS_cp_model_dump_prefix'response.pbtxt")
 
 ABSL_FLAG (std::string, cp_model_params, "", "This is interpreted as a text SatParameters proto. The " "specified fields will override the normal ones for all solves.")
 
 ABSL_FLAG (std::string, drat_output, "", "If non-empty, a proof in DRAT format will be written to this file. " "This will only be used for pure-SAT problems.")
 
 ABSL_FLAG (bool, drat_check, false, "If true, a proof in DRAT format will be stored in memory and " "checked if the problem is UNSAT. This will only be used for " "pure-SAT problems.")
 
 ABSL_FLAG (double, max_drat_time_in_seconds, std::numeric_limits< double >::infinity(), "Maximum time in seconds to check the DRAT proof. This will only " "be used is the drat_check flag is enabled.")
 
 ABSL_FLAG (bool, cp_model_check_intermediate_solutions, false, "When true, all intermediate solutions found by the solver will be " "checked. This can be expensive, therefore it is off by default.")
 
std::string CpModelStats (const CpModelProto &model)
 Returns a string with some statistics on the given CpModelProto. More...
 
std::string CpSolverResponseStats (const CpSolverResponse &response, bool has_objective=true)
 Returns a string with some statistics on the solver response. More...
 
std::function< void(Model *)> NewFeasibleSolutionObserver (const std::function< void(const CpSolverResponse &response)> &observer)
 Creates a solution observer with the model with model.Add(NewFeasibleSolutionObserver([](response){...}));. More...
 
std::function< SatParameters(Model *)> NewSatParameters (const std::string &params)
 Creates parameters for the solver, which you can add to the model with. More...
 
std::function< SatParameters(Model *)> NewSatParameters (const sat::SatParameters &parameters)
 
CpSolverResponse SolveCpModel (const CpModelProto &model_proto, Model *model)
 Solves the given CpModelProto. More...
 
CpSolverResponse Solve (const CpModelProto &model_proto)
 Solves the given CpModelProto and returns an instance of CpSolverResponse. More...
 
CpSolverResponse SolveWithParameters (const CpModelProto &model_proto, const SatParameters &params)
 Solves the given CpModelProto with the given parameters. More...
 
CpSolverResponse SolveWithParameters (const CpModelProto &model_proto, const std::string &params)
 Solves the given CpModelProto with the given sat parameters as string in JSon format, and returns an instance of CpSolverResponse. More...
 

Function Documentation

◆ ABSL_FLAG() [1/9]

ABSL_FLAG ( bool  ,
cp_model_check_intermediate_solutions  ,
false  ,
"When  true,
all intermediate solutions found by the solver will be " "checked. This can be  expensive,
therefore it is off by default."   
)

◆ ABSL_FLAG() [2/9]

ABSL_FLAG ( bool  ,
cp_model_dump_lns  ,
false  ,
"DEBUG ONLY. When set to  true,
solve will dump all " "lns models proto in text format to " " 'FLAGS_cp_model_dump_prefix 'lns_xxx.pbtxt."   
)

◆ ABSL_FLAG() [3/9]

ABSL_FLAG ( bool  ,
cp_model_dump_models  ,
false  ,
"DEBUG ONLY. When set to  true,
SolveCpModel() will dump its model " "protos(original model, presolved model, mapping model) in text " "format to 'FLAGS_cp_model_dump_prefix'{model|presolved_model|" "mapping_model}.pbtxt."   
)

◆ ABSL_FLAG() [4/9]

ABSL_FLAG ( bool  ,
cp_model_dump_response  ,
false  ,
"DEBUG ONLY. If  true,
the final response of each solve will be " "dumped to 'FLAGS_cp_model_dump_prefix 'response.pbtxt"   
)

◆ ABSL_FLAG() [5/9]

ABSL_FLAG ( bool  ,
drat_check  ,
false  ,
"If  true,
a proof in DRAT format will be stored in memory and " "checked if the problem is UNSAT. This will only be used for " "pure-SAT problems."   
)

◆ ABSL_FLAG() [6/9]

ABSL_FLAG ( double  ,
max_drat_time_in_seconds  ,
std::numeric_limits< double >  ::infinity(),
"Maximum time in seconds to check the DRAT proof. This will only " "be used is the drat_check flag is enabled."   
)

◆ ABSL_FLAG() [7/9]

ABSL_FLAG ( std::string  ,
cp_model_dump_prefix  ,
"/tmp/"  ,
"Prefix filename for all dumped files"   
)

◆ ABSL_FLAG() [8/9]

ABSL_FLAG ( std::string  ,
cp_model_params  ,
""  ,
"This is interpreted as a text SatParameters proto. The " "specified fields will override the normal ones for all solves."   
)

◆ ABSL_FLAG() [9/9]

ABSL_FLAG ( std::string  ,
drat_output  ,
""  ,
"If non-  empty,
a proof in DRAT format will be written to this file. " "This will only be used for pure-SAT problems."   
)

Variable Documentation

◆ bounds

SharedBoundsManager* bounds

Definition at line 2104 of file cp_model_solver.cc.

◆ incomplete_solutions

SharedIncompleteSolutionManager* incomplete_solutions

Definition at line 2108 of file cp_model_solver.cc.

◆ lp_solutions

SharedLPSolutionRepository* lp_solutions

Definition at line 2107 of file cp_model_solver.cc.

◆ model_proto

CpModelProto const* model_proto

Definition at line 2101 of file cp_model_solver.cc.

◆ relaxation_solutions

SharedRelaxationSolutionRepository* relaxation_solutions

Definition at line 2106 of file cp_model_solver.cc.

◆ response

SharedResponseManager* response

Definition at line 2105 of file cp_model_solver.cc.

◆ time_limit

SharedTimeLimit* time_limit

Definition at line 2103 of file cp_model_solver.cc.

◆ wall_timer

WallTimer* wall_timer

Definition at line 2102 of file cp_model_solver.cc.