Class RelaxationSolver<T>

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

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

    • RelaxationSolver

      public RelaxationSolver(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 relaxed decision diagram.

      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 relaxed 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