Package org.ddolib.nolayer.solver
Interface Solver
- All Known Implementing Classes:
AcsSolver,AStarSolver,AwAstarSolver,DdoSolver
public interface Solver
Interface representing a generic solver for no-layered decision diagram based optimization
problems.
A solver explores the search space defined by a decision diagram, applies bounds and relaxations, and can return the best solution found along with its value.
Implementations of this interface typically provide algorithms such as:
- Dynamic programming on decision diagrams
- A* search
- Branch-and-bound or anytime search strategies
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionReturns the ordered list of labels leading to the best solution from the initial state.Returns the value of the best solution found so far by this solver, if any.initialSolution(Model<?> model) Returns the initial solution of a model, if it provides a non-empty one.minimize(Predicate<SearchStatistics> limit, BiConsumer<List<Integer>, SearchStatistics> onSolution) Minimizes the objective function according to the solver strategy.
-
Method Details
-
minimize
Solution minimize(Predicate<SearchStatistics> limit, BiConsumer<List<Integer>, SearchStatistics> onSolution) Minimizes the objective function according to the solver strategy.- Parameters:
limit- aPredicatethat can limit or stop the search based on currentSearchStatisticsonSolution- aBiConsumerinvoked on each new solution found; receives the solution array and current statistics- Returns:
- the statistics of the search after completion
-
bestValue
Returns the value of the best solution found so far by this solver, if any.- Returns:
- the value of the best solution in this decision diagram if there is one
-
bestSolution
Returns the ordered list of labels leading to the best solution from the initial state.- Returns:
- the ordered list of labels leading to the best solution from the initial state
-
initialSolution
Returns the initial solution of a model, if it provides a non-empty one.Its value is trusted. When the debug mode is enabled, it is checked against
Problem.evaluate(List).- Parameters:
model- the model providing the initial solution- Returns:
- the initial solution, or an empty
Optionalif the model has none - Throws:
IllegalArgumentException- in debug mode, if the initial solution is invalid or if its value does not match its evaluation
-