Package es.urjc.etsii.grafo.graphs.model
Class MSTSolutionValidator
java.lang.Object
es.urjc.etsii.grafo.solution.SolutionValidator<MSTSolution,MSTInstance>
es.urjc.etsii.grafo.graphs.model.MSTSolutionValidator
Validate that a solution is valid for the MST problem.
Validation is always run after the algorithms executes, and can be run in certain algorithm stages to verify
that the current solution is valid.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidinitGraph(MSTInstance instance, List<Edge> edges) validate(MSTSolution solution) Validate the current solution, check that no constraint is broken and everything is fine
-
Constructor Details
-
MSTSolutionValidator
public MSTSolutionValidator()
-
-
Method Details
-
validate
Validate the current solution, check that no constraint is broken and everything is fine- Specified by:
validatein classSolutionValidator<MSTSolution,MSTInstance> - Parameters:
solution- Solution to validate- Returns:
- ValidationResult.ok() if the solution is valid, ValidationResult.fail("reason why it failed") if a solution is not valid.
-
initGraph
-
bfs
-