|
Orbital library | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object orbital.algorithm.template.GeneralSearch orbital.algorithm.template.GeneralBoundingSearch orbital.algorithm.template.IterativeDeepening
public class IterativeDeepening
Iterative Deepening (ID). A blind search algorithm.
ID is complete, optimal, and has a time complexity of O(bd) and a space complexity of O(b*d).
Nested Class Summary |
---|
Nested classes/interfaces inherited from class orbital.algorithm.template.GeneralSearch |
---|
GeneralSearch.OptionIterator |
Nested classes/interfaces inherited from interface orbital.algorithm.template.EvaluativeAlgorithm |
---|
EvaluativeAlgorithm.EvaluationComparator |
Nested classes/interfaces inherited from interface orbital.algorithm.template.AlgorithmicTemplate |
---|
AlgorithmicTemplate.Configuration |
Constructor Summary | |
---|---|
IterativeDeepening()
|
Method Summary | |
---|---|
Function |
complexity()
O(bd) where b is the branching factor and d the solution depth. |
protected java.util.Iterator |
createTraversal(GeneralSearchProblem problem)
Define a traversal order by creating an iterator for the problem's state space. |
Function |
getEvaluation()
f(n) = g(n). |
boolean |
isOptimal()
Whether this search algorithm is optimal. |
protected boolean |
isOutOfBounds(java.lang.Object node)
Whether a node is out of bounds. |
protected java.lang.Object |
solveImpl(GeneralSearchProblem problem)
Solve with bounds 0, 1, 2, ... |
Function |
spaceComplexity()
O(b*d) where b is the branching factor and d the solution depth. |
Methods inherited from class orbital.algorithm.template.GeneralBoundingSearch |
---|
getBound, isContinuedWhenFound, processSolution, search, setBound, setBound, setContinuedWhenFound |
Methods inherited from class orbital.algorithm.template.GeneralSearch |
---|
getProblem, solve |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface orbital.algorithm.template.AlgorithmicTemplate |
---|
solve |
Constructor Detail |
---|
public IterativeDeepening()
Method Detail |
---|
public Function getEvaluation()
public Function complexity()
AlgorithmicTemplate.solve(AlgorithmicProblem)
public boolean isOptimal()
GeneralSearch
If a search algorithm is not optimal, i.e. it might be content with solutions that are sub optimal only, then it can at most reliably find solutions, not best solutions. However, those solutions found still provide an upper bound to the optimal solution.
isOptimal
in class GeneralSearch
protected boolean isOutOfBounds(java.lang.Object node)
GeneralBoundingSearch
Called to check whether to prune a node. This implementation checks whether f(n) > bound. Overwrite to get additional behaviour.
isOutOfBounds
in class GeneralBoundingSearch
node
- the node to check.
GeneralBoundingSearch.getBound()
,
Template Methodprotected java.lang.Object solveImpl(GeneralSearchProblem problem)
solveImpl
in class GeneralSearch
GeneralSearch.search(Iterator)
.GeneralSearch.search(Iterator)
protected java.util.Iterator createTraversal(GeneralSearchProblem problem)
GeneralSearch
Lays a linear order through the state space which the search can simply follow sequentially. Thus a traversal policy effectively reduces a search problem through a graph to a search problem through a linear sequence of states. Of course, the mere notion of a traversal policy does not yet solve the task of finding a good order of states, but only encapsulate it. Complete search algorithms result from traversal policies that have a linear sequence through the whole state space.
problem
- the problem whose state space to create a traversal iterator for.
GeneralSearch.OptionIterator
public Function spaceComplexity()
AlgorithmicTemplate.solve(AlgorithmicProblem)
|
Orbital library 1.3.0: 11 Apr 2009 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |