![]() |
Google OR-Tools v9.14
a fast and portable software suite for combinatorial optimization
|
The consistency level is maintained up to kFreeAndUncovered. More...
The consistency level is maintained up to kFreeAndUncovered.
An obvious idea is to take all the S_j's (or equivalently to set all the x_j's to 1). It's very silly but fast, and we can improve on it later using local search.
Definition at line 245 of file set_cover_heuristics.h.
#include <set_cover_heuristics.h>
Public Member Functions | |
TrivialSolutionGenerator (SetCoverInvariant *inv) | |
TrivialSolutionGenerator (SetCoverInvariant *inv, absl::string_view name) | |
bool | NextSolution (absl::Span< const SubsetIndex > focus) final |
TrivialSolutionGenerator. | |
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) | |
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 |
Definition at line 247 of file set_cover_heuristics.h.
|
inline |
Definition at line 250 of file set_cover_heuristics.h.
|
inlinefinalvirtual |
Virtual methods that must be implemented by derived classes.
Computes the next full solution taking into account all the subsets.
Reimplemented from operations_research::SubsetListBasedSolutionGenerator.
Definition at line 181 of file set_cover_heuristics.h.
|
finalvirtual |
Reimplemented from operations_research::SubsetListBasedSolutionGenerator.
Definition at line 51 of file set_cover_heuristics.cc.
|
inlinefinalvirtual |
Same as above, but with a vector of Booleans as focus.
Reimplemented from operations_research::SubsetListBasedSolutionGenerator.
Definition at line 183 of file set_cover_heuristics.h.