Class AwAstarSolver<T>

java.lang.Object
org.ddolib.awastar.core.solver.AwAstarSolver<T>
Type Parameters:
T - the type of states in a problem
All Implemented Interfaces:
Solver

public final class AwAstarSolver<T> extends Object implements Solver
Implementation of an Anytime Weighted A* search (AWA*) solver for decision diagram-based optimization problems.

The solver uses a combination of a lower bound, dominance rules to explore the search space efficiently. It adds a weight to the heuristic function of the A* algorithm. This weight speed-up reaching feasible solution.

See Also:
  • Constructor Details

    • AwAstarSolver

      public AwAstarSolver(AwAstarModel<T> model)
      Constructs a solver via a AwAstarModel.
      Parameters:
      model - provides all parameters needed to configure the solver
      Throws:
      IllegalArgumentException - if the weight associated to the heuristic function is < 1
  • Method Details

    • minimize

      public Solution minimize(Predicate<SearchStatistics> limit, BiConsumer<int[],SearchStatistics> onSolution)
      Description copied from interface: Solver
      Minimizes the objective function according to the solver strategy.
      Specified by:
      minimize in interface Solver
      Parameters:
      limit - a Predicate that can limit or stop the search based on current SearchStatistics
      onSolution - a BiConsumer invoked on each new solution found; receives the solution array and current statistics
      Returns:
      the statistics of the search after completion
    • bestValue

      public Optional<Double> bestValue()
      Specified by:
      bestValue in interface Solver
      Returns:
      the value of the best solution in this decision diagram if there is one
    • bestSolution

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