Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
|
#include <bop_fs.h>
Public Member Functions | |
LinearRelaxation (const BopParameters ¶meters, absl::string_view name) | |
~LinearRelaxation () override | |
bool | ShouldBeRun (const ProblemState &problem_state) const override |
Status | Optimize (const BopParameters ¶meters, 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 | |
Public Types inherited from operations_research::bop::BopOptimizerBase | |
enum | Status { OPTIMAL_SOLUTION_FOUND , SOLUTION_FOUND , INFEASIBLE , LIMIT_REACHED , INFORMATION_FOUND , CONTINUE , ABORT } |
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_ |
This class computes the linear relaxation of the state problem. Optimize() fills the relaxed values (possibly floating values) that can be used by other optimizers as BopSatLpFirstSolutionGenerator for instance, and the lower bound.
operations_research::bop::LinearRelaxation::LinearRelaxation | ( | const BopParameters & | parameters, |
absl::string_view | name ) |
|
overridedefault |
|
overridevirtual |
Tries to infer more information about the problem state, i.e. reduces the gap by increasing the lower bound or finding a better solution. Returns SOLUTION_FOUND when a new solution with a better objective cost is found before a time limit. The learned information is cleared and the filled with any new information about the problem, e.g. a new lower bound.
Preconditions: ShouldBeRun() must returns true.
The lp returns the objective with the offset and scaled, so we need to unscale it and then remove the offset.
Implements operations_research::bop::BopOptimizerBase.
|
overridevirtual |
Always let the LP solver run if there is an objective. If there isn't, only let the LP solver run if the user asked for it by setting BopParameters.max_lp_solve_for_feasibility_problems
to a non-zero value (a negative value means no limit).
Implements operations_research::bop::BopOptimizerBase.