Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
operations_research::bop::GuidedSatFirstSolutionGenerator Class Reference

#include <bop_fs.h>

Inheritance diagram for operations_research::bop::GuidedSatFirstSolutionGenerator:
operations_research::bop::BopOptimizerBase

Public Types

enum class  Policy { kNotGuided , kLpGuided , kObjectiveGuided , kUserGuided }
 The different guiding heuristics. More...
 
- Public Types inherited from operations_research::bop::BopOptimizerBase
enum  Status {
  OPTIMAL_SOLUTION_FOUND , SOLUTION_FOUND , INFEASIBLE , LIMIT_REACHED ,
  INFORMATION_FOUND , CONTINUE , ABORT
}
 

Public Member Functions

 GuidedSatFirstSolutionGenerator (absl::string_view name, Policy policy)
 
 ~GuidedSatFirstSolutionGenerator () override
 
bool ShouldBeRun (const ProblemState &problem_state) const override
 
Status Optimize (const BopParameters &parameters, const ProblemState &problem_state, LearnedInfo *learned_info, TimeLimit *time_limit) override
 
- Public Member Functions inherited from operations_research::bop::BopOptimizerBase
 BopOptimizerBase (absl::string_view name)
 
virtual ~BopOptimizerBase ()
 
const std::string & name () const
 Returns the name given at construction.
 

Additional Inherited Members

- Static Public Member Functions inherited from operations_research::bop::BopOptimizerBase
static std::string GetStatusString (Status status)
 Returns a string describing the status.
 
- Protected Attributes inherited from operations_research::bop::BopOptimizerBase
const std::string name_
 
StatsGroup stats_
 

Detailed Description

Tries to find a first solution using SAT and a given assignment preference. This optimizer will never run again once it has found a solution except if the policy is kNotGuided in which case it will be ran again.

Definition at line 36 of file bop_fs.h.

Member Enumeration Documentation

◆ Policy

The different guiding heuristics.

Enumerator
kNotGuided 
kLpGuided 
kObjectiveGuided 
kUserGuided 

Definition at line 39 of file bop_fs.h.

Constructor & Destructor Documentation

◆ GuidedSatFirstSolutionGenerator()

operations_research::bop::GuidedSatFirstSolutionGenerator::GuidedSatFirstSolutionGenerator ( absl::string_view name,
Policy policy )

GuidedSatFirstSolutionGenerator

Definition at line 100 of file bop_fs.cc.

◆ ~GuidedSatFirstSolutionGenerator()

operations_research::bop::GuidedSatFirstSolutionGenerator::~GuidedSatFirstSolutionGenerator ( )
overridedefault

Member Function Documentation

◆ Optimize()

BopOptimizerBase::Status operations_research::bop::GuidedSatFirstSolutionGenerator::Optimize ( const BopParameters & parameters,
const ProblemState & problem_state,
LearnedInfo * learned_info,
TimeLimit * time_limit )
overridevirtual
Note
if the last call to Optimize() returned CONTINUE and if the problem didn't change, calling this will resume the solve from its last position.

We use a relatively small conflict limit so that other optimizer get a chance to run if this one is slow. Note that if this limit is reached, we will return BopOptimizerBase::CONTINUE so that Optimize() will be called again later to resume the current work.

As the solution in the state problem is feasible, it is proved optimal.

The problem is proved infeasible

Implements operations_research::bop::BopOptimizerBase.

Definition at line 181 of file bop_fs.cc.

◆ ShouldBeRun()

bool operations_research::bop::GuidedSatFirstSolutionGenerator::ShouldBeRun ( const ProblemState & problem_state) const
overridevirtual

Returns true if this optimizer should be run on the given problem state. Some optimizer requires a feasible solution to run for instance.

Note
a similar effect can be achieved if Optimize() returns ABORT right away. However, doing the later will lower the chance of this optimizer to be called again since it will count as a failure to improve the current state.

Implements operations_research::bop::BopOptimizerBase.

Definition at line 168 of file bop_fs.cc.


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