Google OR-Tools v9.12
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
operations_research::sat::SharedLsSolutionRepository Class Reference

#include <synchronization.h>

Inheritance diagram for operations_research::sat::SharedLsSolutionRepository:
operations_research::sat::SharedSolutionRepository< int64_t >

Public Member Functions

 SharedLsSolutionRepository ()
 
void AddSolution (std::vector< int64_t > solution, int num_violations)
 
- Public Member Functions inherited from operations_research::sat::SharedSolutionRepository< int64_t >
 SharedSolutionRepository (int num_solutions_to_keep, absl::string_view name="")
 
int NumSolutions () const
 
std::shared_ptr< const Solution > GetSolution (int index) const
 Returns the solution i where i must be smaller than NumSolutions().
 
int64_t GetBestRank () const
 
std::vector< std::shared_ptr< const Solution > > GetBestNSolutions (int n) const
 
int64_t GetVariableValueInSolution (int var_index, int solution_index) const
 
std::shared_ptr< const Solution > GetRandomBiasedSolution (absl::BitGenRef random) const
 Returns a random solution biased towards good solutions.
 
std::shared_ptr< const Solution > Add (Solution solution)
 
void Synchronize ()
 
std::vector< std::string > TableLineStats () const
 

Additional Inherited Members

- Protected Member Functions inherited from operations_research::sat::SharedSolutionRepository< int64_t >
int64_t num_added_ ABSL_GUARDED_BY (mutex_)=0
 
int64_t num_queried_ ABSL_GUARDED_BY (mutex_)=0
 
int64_t num_synchronization_ ABSL_GUARDED_BY (mutex_)=0
 
std::vector< int > tmp_indices_ ABSL_GUARDED_BY (mutex_)
 
std::vector< std::shared_ptr< Solution > > solutions_ ABSL_GUARDED_BY (mutex_)
 
std::vector< std::shared_ptr< Solution > > new_solutions_ ABSL_GUARDED_BY (mutex_)
 
- Protected Attributes inherited from operations_research::sat::SharedSolutionRepository< int64_t >
const std::string name_
 
const int num_solutions_to_keep_
 
absl::Mutex mutex_
 

Detailed Description

Set of best solution from the feasibility jump workers.

We store (solution, num_violated_constraints), so we have a list of solutions that violate as little constraints as possible. This can be used to set the phase during SAT search.

Todo
(user): We could also use it after first solution to orient a SAT search towards better solutions. But then it is a bit trickier to rank solutions compared to the old ones.

Definition at line 177 of file synchronization.h.

Constructor & Destructor Documentation

◆ SharedLsSolutionRepository()

operations_research::sat::SharedLsSolutionRepository::SharedLsSolutionRepository ( )
inline

Definition at line 179 of file synchronization.h.

Member Function Documentation

◆ AddSolution()

void operations_research::sat::SharedLsSolutionRepository::AddSolution ( std::vector< int64_t > solution,
int num_violations )
inline

Definition at line 182 of file synchronization.h.


The documentation for this class was generated from the following file: