Class DFS<T>
java.lang.Object
org.ddolib.layered.solving.startheuristic.DFS<T>
- Type Parameters:
T- the type of state
Depth-first start heuristic returning the first feasible solution it encounters.
Its purpose is to quickly provide an upper bound to a complete search algorithm. The
children of a node are explored by increasing g + h, where h is given by the
model's FastLowerBound, so that the first dive follows the most promising decisions.
Since the search stops at the first solution, every node whose subtree has been fully
explored is a dead end. States already explored at the same depth, or dominated (according to
the model's DominanceChecker) by an explored state, are therefore skipped.
The returned statistics reuse AstarStats.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSearches the first feasible solution without any stopping criterion.findSolution(Predicate<SearchStatistics> limit) Searches the first feasible solution.
-
Constructor Details
-
DFS
Creates the heuristic from a model. Only its problem, fast lower bound and dominance checker are used.- Parameters:
model- the model of the problem to solve
-
-
Method Details
-
findSolution
Searches the first feasible solution without any stopping criterion.- Returns:
- the first solution found, or an empty solution with status
UNSATif the problem has none
-
findSolution
Searches the first feasible solution.- Parameters:
limit- stopping criterion tested at each iteration- Returns:
- the first solution found (status
SAT), an empty solution with statusUNSATif the problem has none, or an empty solution with statusUNKNOWNif the limit was reached first, or an empty solution with statusMEMOUTif the memory ran out (seeStopCriterion.maxFrontierSize(int))
-