![]() |
Google OR-Tools v9.14
a fast and portable software suite for combinatorial optimization
|
Definition at line 33 of file set_cover_mip.h.
#include <set_cover_mip.h>
Public Member Functions | |
SetCoverMip (SetCoverInvariant *inv) | |
Simpler constructors that uses SCIP by default. | |
SetCoverMip (SetCoverInvariant *inv, absl::string_view name) | |
SetCoverMip & | UseMipSolver (SetCoverMipSolver mip_solver) |
SetCoverMip & | UseIntegers (bool use_integers) |
MPSolver::ResultStatus | solve_status () const |
bool | NextSolution (absl::Span< const SubsetIndex > focus) final |
bool | NextSolution () final |
Virtual methods that must be implemented by derived classes. | |
bool | NextSolution (const SubsetBoolVector &in_focus) final |
Same as above, but with a vector of Booleans as focus. | |
Public Member Functions inherited from operations_research::SubsetListBasedSolutionGenerator | |
SubsetListBasedSolutionGenerator (SetCoverInvariant *inv, SetCoverInvariant::ConsistencyLevel consistency_level, absl::string_view class_name, absl::string_view name) | |
bool | NextSolution (absl::Span< const SubsetIndex > _) override |
bool | NextSolution () final |
Virtual methods that must be implemented by derived classes. | |
bool | NextSolution (const SubsetBoolVector &in_focus) final |
Same as above, but with a vector of Booleans as focus. | |
Public Member Functions inherited from operations_research::SetCoverSolutionGenerator | |
SetCoverSolutionGenerator (SetCoverInvariant *inv, SetCoverInvariant::ConsistencyLevel consistency_level, absl::string_view class_name, absl::string_view name) | |
virtual | ~SetCoverSolutionGenerator ()=default |
void | SetName (const absl::string_view name) |
SetCoverInvariant * | inv () const |
virtual SetCoverSolutionGenerator & | ResetLimits () |
Resets the limits to their default values. | |
SetCoverSolutionGenerator & | SetMaxIterations (int64_t max_iterations) |
Sets the maximum number of iterations. | |
int64_t | max_iterations () const |
Returns the maximum number of iterations. | |
SetCoverSolutionGenerator & | SetTimeLimitInSeconds (double seconds) |
Sets the time limit in seconds. | |
absl::Duration | run_time () const |
double | run_time_in_seconds () const |
Returns the total elapsed runtime in seconds. | |
double | run_time_in_microseconds () const |
Returns the total elapsed runtime in microseconds. | |
std::string | name () const |
Returns the name of the heuristic. | |
std::string | class_name () const |
Returns the name of the class. | |
Cost | cost () const |
Returns the current cost of the solution in the invariant. | |
bool | CheckInvariantConsistency () const |
Additional Inherited Members | |
Protected Member Functions inherited from operations_research::SetCoverSolutionGenerator | |
SetCoverModel * | model () const |
Accessors. | |
BaseInt | num_subsets () const |
double | time_limit_in_seconds () const |
The time limit in seconds. | |
Protected Attributes inherited from operations_research::SetCoverSolutionGenerator | |
absl::Duration | run_time_ |
run_time_ is an abstract duration for the time spent in NextSolution(). | |
SetCoverInvariant::ConsistencyLevel | consistency_level_ |
The consistency needed by the solution generator. |
|
inlineexplicit |
Simpler constructors that uses SCIP by default.
Definition at line 36 of file set_cover_mip.h.
|
inline |
Definition at line 39 of file set_cover_mip.h.
|
inlinefinalvirtual |
Virtual methods that must be implemented by derived classes.
Computes the next full solution taking into account all the subsets.
Implements operations_research::SetCoverSolutionGenerator.
Definition at line 181 of file set_cover_heuristics.h.
|
finalvirtual |
Computes the next partial solution considering only the subsets whose indices are in focus.
We are using MPSolver, which is deprecated, because MathOpt does not provide an interface without using protobufs. We construct a restricted MIP, omitting all the parts of the problem that are already fixed in the invariant. The goal is to not spend time sending data, and having the MIP solver re-discover fixed variables.
The model should only contain elements that are not forcibly covered by subsets outside the focus.
set_time_limit takes milliseconds as a unit.
Call the solver.
Report the objective value as a lower bound, and mention that the cost is not consistent with the solution.
Implements operations_research::SetCoverSolutionGenerator.
Definition at line 46 of file set_cover_mip.cc.
|
inlinefinalvirtual |
Same as above, but with a vector of Booleans as focus.
Implements operations_research::SetCoverSolutionGenerator.
Definition at line 183 of file set_cover_heuristics.h.
|
inline |
Definition at line 59 of file set_cover_mip.h.
|
inline |
Definition at line 51 of file set_cover_mip.h.
|
inline |
Definition at line 46 of file set_cover_mip.h.