Class RestrictionSolver<T>

java.lang.Object
org.ddolib.layered.solving.ddo.core.solver.RestrictionSolver<T>
Type Parameters:
T - the type representing a problem state

public final class RestrictionSolver<T> extends Object
A solver that compile one relaxed MDD from the root node.
See Also:
  • Constructor Details

    • RestrictionSolver

      public RestrictionSolver(DdoModel<T> model)
      Creates a fully qualified instance. The parameters of this solver are given via a DdoModel
      Parameters:
      model - all the parameters needed to configure the solver
  • Method Details

    • minimize

      public Solution minimize(Predicate<SearchStatistics> limit, BiConsumer<int[],SearchStatistics> onSolution)
      Solves the model by compiling a single restricted decision diagram.

      The status is SearchStatus.SAT when the restricted DD contains a solution. Otherwise, the solution is empty and the status is SearchStatus.UNSAT if the DD is exact (no node was dropped), or SearchStatus.UNKNOWN if it is not.

      When the JVM throws an OutOfMemoryError during the compilation, the search stops and returns the best solution found so far, if any, with the status SearchStatus.MEMOUT.

      Parameters:
      limit - a predicate that can limit or stop the search based on current statistics
      onSolution - a callback invoked once with the best solution found, if any
      Returns:
      the statistics of the search after completion
    • bestValue

      public Optional<Double> bestValue()
      Returns the value of the best solution found so far by this solver, if any.
      Returns:
      the value of the best solution in the restricted decision diagram if there is one
    • bestSolution

      public Optional<Set<Decision>> bestSolution()
      Returns the set of decisions that lead to the best solution found by this solver, if any.
      Returns:
      an Optional containing the set of Decision objects representing the best solution, or empty if no solution exists