Class MVCConstructive
java.lang.Object
es.urjc.etsii.grafo.create.Constructive<MSTSolution, MSTInstance>
es.urjc.etsii.grafo.algorithms.cmsa.CMSAConstructive<MSTSolution, MSTInstance, Integer>
es.urjc.etsii.grafo.graphs.mvc.MVCConstructive
Probabilistic constructive method for the Minimum Vertex Cover (MVC) problem, used as the
"Construct" step of the CMSA demo in this project.
Repeatedly picks a random still-uncovered edge, and adds one of its endpoints to the cover, biased towards the endpoint with the highest degree (as in the classic greedy vertex cover heuristic), but not always: this randomization is what allows CMSA to sample different, varied vertex subsets across iterations to build the sub-instance.
-
Nested Class Summary
Nested classes/interfaces inherited from class Constructive
Constructive.NullConstructive<S,I> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconstruct(MSTSolution solution) Build a solution.toString()usedComponents(MSTSolution solution) Returns the solution components used to build the given solution.Methods inherited from class Constructive
nul
-
Constructor Details
-
MVCConstructive
public MVCConstructive() -
MVCConstructive
-
-
Method Details
-
construct
Description copied from class:ConstructiveBuild a solution. Start with an empty solution, end when the solution is valid.- Specified by:
constructin classConstructive<MSTSolution, MSTInstance>- Parameters:
solution- Empty solution, the result of calling the constructor.- Returns:
- A valid solution that fulfills all the problem constraints.
-
usedComponents
Description copied from class:CMSAConstructiveReturns the solution components used to build the given solution. This method is usually called immediately afterConstructive.construct(Solution), but implementations should not assume this and must be able to work with any feasible solution to the problem, as it is also used to identify which components are part of the solution returned by theCMSASolver.- Specified by:
usedComponentsin classCMSAConstructive<MSTSolution, MSTInstance, Integer>- Parameters:
solution- a feasible solution to the problem- Returns:
- the set of solution components used in the given solution
-
toString
Description copied from class:Constructive- Overrides:
toStringin classConstructive<MSTSolution, MSTInstance>
-