Class MVCExactCoverSolver
Mork does not bundle any ILP solver, so instead of delegating to CPLEX/Gurobi/OR-Tools, this
implementation performs an exhaustive branch and bound search. This is only tractable because
the restricted sub-instance is expected to stay small: CMSA
only keeps a limited number of candidate vertices active at any given time, aging out and
dropping the ones that are not selected by this solver. In problems where the sub-instance can
grow large, a real MIP/ILP solver would be plugged in instead, implementing the same CMSASolver contract.
When invoked by CMSA, selecting every candidate vertex is a feasible (if not optimal) solution to the restricted problem because candidates come from previously constructed feasible vertex covers. The solver validates this invariant and throws an exception if it is violated.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionsolve(MSTInstance instance, Set<Integer> restrictedComponents, long maxDurationInMillis) Solves the sub-instance induced by restricting the problem to the given set of solution components.Methods inherited from class CMSASolver
toString
-
Constructor Details
-
MVCExactCoverSolver
-
-
Method Details
-
solve
public MSTSolution solve(MSTInstance instance, Set<Integer> restrictedComponents, long maxDurationInMillis) Description copied from class:CMSASolverSolves the sub-instance induced by restricting the problem to the given set of solution components. Implementations are free to return a suboptimal solution if the time limit is reached before the sub-instance is solved to optimality, but the returned solution, if any, must always be feasible.- Specified by:
solvein classCMSASolver<MSTSolution, MSTInstance, Integer>- Parameters:
instance- original problem instancerestrictedComponents- set of solution components the returned solution is restricted to use. Values are the same objects returned byCMSAConstructive.usedComponents(Solution)maxDurationInMillis- maximum time budget, in milliseconds, to spend solving the sub-instance- Returns:
- a feasible solution built only using components in
restrictedComponents, ornullif no feasible solution could be found in the given time budget
-