Package org.ddolib.common.solver
Interface Solver
- All Known Implementing Classes:
ACSSolver,AStarSolver,AwAstarSolver,ExactSolver,LNSSolver,SequentialSolver
public interface Solver
Interface representing a generic solver for 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 set of decisions that lead to the best solution found by this solver, if any.default int[]constructSolution(Set<Decision> decisions) Constructs an array representing the values assigned to each variable from a set of decisions.minimize(Predicate<SearchStatistics> limit, BiConsumer<int[], SearchStatistics> onSolution) Minimizes the objective function according to the solver strategy.
-
Method Details
-
minimize
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 in this decision diagram if there is one
-
bestSolution
Returns the set of decisions that lead to the best solution found by this solver, if any. -
constructSolution
Constructs an array representing the values assigned to each variable from a set of decisions.- Parameters:
decisions- a set ofDecisionobjects representing variable assignments- Returns:
- an array
tsuch thatt[i]is the assigned value of variablei, or an empty array if the solution does not exist
-