Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
cp_model_solver_helpers.cc File Reference
#include "ortools/sat/cp_model_solver_helpers.h"
#include <algorithm>
#include <array>
#include <cmath>
#include <cstdint>
#include <cstdlib>
#include <memory>
#include <string>
#include <thread>
#include <tuple>
#include <utility>
#include <vector>
#include "ortools/base/logging.h"
#include "ortools/base/timer.h"
#include "ortools/base/helpers.h"
#include "ortools/base/options.h"
#include "absl/cleanup/cleanup.h"
#include "absl/container/flat_hash_set.h"
#include "absl/flags/flag.h"
#include "absl/log/check.h"
#include "absl/strings/escaping.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/string_view.h"
#include "absl/time/time.h"
#include "absl/types/span.h"
#include "google/protobuf/arena.h"
#include "ortools/base/strong_vector.h"
#include "ortools/graph/connected_components.h"
#include "ortools/port/proto_utils.h"
#include "ortools/sat/clause.h"
#include "ortools/sat/cp_model.pb.h"
#include "ortools/sat/cp_model_checker.h"
#include "ortools/sat/cp_model_loader.h"
#include "ortools/sat/cp_model_mapping.h"
#include "ortools/sat/cp_model_postsolve.h"
#include "ortools/sat/cp_model_search.h"
#include "ortools/sat/cp_model_utils.h"
#include "ortools/sat/cuts.h"
#include "ortools/sat/feasibility_pump.h"
#include "ortools/sat/implied_bounds.h"
#include "ortools/sat/integer.h"
#include "ortools/sat/integer_expr.h"
#include "ortools/sat/integer_search.h"
#include "ortools/sat/intervals.h"
#include "ortools/sat/lb_tree_search.h"
#include "ortools/sat/linear_constraint.h"
#include "ortools/sat/linear_programming_constraint.h"
#include "ortools/sat/linear_relaxation.h"
#include "ortools/sat/max_hs.h"
#include "ortools/sat/model.h"
#include "ortools/sat/optimization.h"
#include "ortools/sat/precedences.h"
#include "ortools/sat/probing.h"
#include "ortools/sat/sat_base.h"
#include "ortools/sat/sat_parameters.pb.h"
#include "ortools/sat/sat_solver.h"
#include "ortools/sat/synchronization.h"
#include "ortools/sat/util.h"
#include "ortools/sat/work_assignment.h"
#include "ortools/util/logging.h"
#include "ortools/base/version.h"
#include "ortools/util/sorted_interval_list.h"
#include "ortools/util/strong_integers.h"
#include "ortools/util/time_limit.h"

Go to the source code of this file.

Namespaces

namespace  operations_research
 In SWIG mode, we don't want anything besides these top-level includes.
 
namespace  operations_research::sat
 

Functions

 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}.pb.txt.")
 
 ABSL_FLAG (std::string, cp_model_dump_prefix, "/tmp/", "Prefix filename for all dumped files")
 
 ABSL_FLAG (bool, cp_model_dump_submodels, false, "DEBUG ONLY. When set to true, solve will dump all " "lns or objective_shaving submodels proto in text format to " "'FLAGS_cp_model_dump_prefix'xxx.pb.txt.")
 
 ABSL_FLAG (std::string, cp_model_load_debug_solution, "", "DEBUG ONLY. When this is set to a non-empty file name, " "we will interpret this as an internal solution which can be used for " "debugging. For instance we use it to identify wrong cuts/reasons.")
 
 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.")
 
void operations_research::sat::LoadDebugSolution (const CpModelProto &model_proto, Model *model)
 
void operations_research::sat::InitializeDebugSolution (const CpModelProto &model_proto, Model *model)
 
std::vector< int64_t > operations_research::sat::GetSolutionValues (const CpModelProto &model_proto, const Model &model)
 
IntegerVariable operations_research::sat::AddLPConstraints (bool objective_need_to_be_tight, const CpModelProto &model_proto, Model *m)
 Adds one LinearProgrammingConstraint per connected component of the model.
 
void operations_research::sat::RegisterVariableBoundsLevelZeroExport (const CpModelProto &, SharedBoundsManager *shared_bounds_manager, Model *model)
 
void operations_research::sat::RegisterVariableBoundsLevelZeroImport (const CpModelProto &model_proto, SharedBoundsManager *shared_bounds_manager, Model *model)
 
void operations_research::sat::RegisterObjectiveBestBoundExport (IntegerVariable objective_var, SharedResponseManager *shared_response_manager, Model *model)
 
void operations_research::sat::RegisterObjectiveBoundsImport (SharedResponseManager *shared_response_manager, Model *model)
 
void operations_research::sat::RegisterClausesExport (int id, SharedClausesManager *shared_clauses_manager, Model *model)
 Registers a callback that will export good clauses discovered during search.
 
int operations_research::sat::RegisterClausesLevelZeroImport (int id, SharedClausesManager *shared_clauses_manager, Model *model)
 
void operations_research::sat::LoadBaseModel (const CpModelProto &model_proto, Model *model)
 
void operations_research::sat::LoadFeasibilityPump (const CpModelProto &model_proto, Model *model)
 
void operations_research::sat::LoadCpModel (const CpModelProto &model_proto, Model *model)
 
void operations_research::sat::SolveLoadedCpModel (const CpModelProto &model_proto, Model *model)
 
void operations_research::sat::QuickSolveWithHint (const CpModelProto &model_proto, Model *model)
 
void operations_research::sat::MinimizeL1DistanceWithHint (const CpModelProto &model_proto, Model *model)
 
void operations_research::sat::PostsolveResponseWithFullSolver (int num_variables_in_original_model, CpModelProto mapping_proto, const std::vector< int > &postsolve_mapping, std::vector< int64_t > *solution)
 
void operations_research::sat::PostsolveResponseWrapper (const SatParameters &params, int num_variable_in_original_model, const CpModelProto &mapping_proto, const std::vector< int > &postsolve_mapping, std::vector< int64_t > *solution)
 
void operations_research::sat::AdaptGlobalParameters (const CpModelProto &model_proto, Model *model)
 

Function Documentation

◆ ABSL_FLAG() [1/5]

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/5]

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}.pb.txt."  )

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

◆ ABSL_FLAG() [3/5]

ABSL_FLAG ( bool ,
cp_model_dump_submodels ,
false ,
"DEBUG ONLY. When set to true,
solve will dump all " "lns or objective_shaving submodels proto in text format to " " 'FLAGS_cp_model_dump_prefix 'xxx.pb.txt."  )

◆ ABSL_FLAG() [4/5]

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

◆ ABSL_FLAG() [5/5]

ABSL_FLAG ( std::string ,
cp_model_load_debug_solution ,
"" ,
"DEBUG ONLY. When this is set to a non-empty file name,
" "we will interpret this as an internal solution which can be used for " "debugging. For instance we use it to identify wrong cuts/reasons."  )