Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
|
#include <set_cover_mip.h>
Public Member Functions | |
SetCoverMip (SetCoverInvariant *inv) | |
Simpler constructor that uses SCIP by default. | |
SetCoverMip (SetCoverInvariant *inv, SetCoverMipSolver mip_solver) | |
bool | NextSolution (bool use_integers, double time_limit_in_seconds) |
bool | NextSolution (absl::Span< const SubsetIndex > focus, bool use_integers, double time_limit_in_seconds) |
double | lower_bound () const |
Returns the lower bound of the linear relaxation of the problem. | |
Definition at line 30 of file set_cover_mip.h.
|
inlineexplicit |
Simpler constructor that uses SCIP by default.
Definition at line 33 of file set_cover_mip.h.
|
inline |
The constructor takes a SetCoverInvariant that will store the resulting variable choices, and a MIP Solver.
Definition at line 38 of file set_cover_mip.h.
|
inline |
Returns the lower bound of the linear relaxation of the problem.
Definition at line 55 of file set_cover_mip.h.
bool operations_research::SetCoverMip::NextSolution | ( | absl::Span< const SubsetIndex > | focus, |
bool | use_integers, | ||
double | time_limit_in_seconds ) |
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.
Definition at line 51 of file set_cover_mip.cc.
bool operations_research::SetCoverMip::NextSolution | ( | bool | use_integers, |
double | time_limit_in_seconds ) |
Returns true if a solution was found. If use_integers is false, lower_bound_ is populated with a linear lower bound. time_limit_in_seconds is a (rather soft) time limit for the execution time.
Definition at line 45 of file set_cover_mip.cc.