|
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.IterativeDeepeningAStar
public class IterativeDeepeningAStar
Iterative Deepening A* (IDA*). A heuristic search algorithm.
Apart from the evaluation function, IDA* has not much in common with A* but resembles ID, instead. It is not an instance of best-first search, but of bounding search. Which also means that it has less administrative overhead than maintaining priority queues.
IDA* is complete, optimal if the heuristic function h is admissible. It has a time complexity of O(bd) and a space complexity of O(b*d).
The effective time complexity of IDA* depends upon the number of different values the heuristic returns. If |h(S)| is small, IDA* only has to go through very little iterations. Of course, if the heuristic has too few values, then it does not guide search at all.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class orbital.algorithm.template.GeneralSearch |
---|
GeneralSearch.OptionIterator |
Nested classes/interfaces inherited from interface orbital.algorithm.template.HeuristicAlgorithm |
---|
HeuristicAlgorithm.Configuration, HeuristicAlgorithm.PatternDatabaseHeuristic |
Nested classes/interfaces inherited from interface orbital.algorithm.template.EvaluativeAlgorithm |
---|
EvaluativeAlgorithm.EvaluationComparator |
Constructor Summary | |
---|---|
IterativeDeepeningAStar(Function heuristic)
Create a new instance of IDA* search. |
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) + h(n). |
Function |
getHeuristic()
Get the heuristic function used. |
boolean |
isOptimal()
Optimal if heuristic is admissible. |
protected boolean |
isOutOfBounds(java.lang.Object node)
Compare f(n) with bound, normally and in case update cheapest pruned bound. |
void |
setHeuristic(Function heuristic)
Set the heuristic function to use. |
protected java.lang.Object |
solveImpl(GeneralSearchProblem problem)
Solve with bounds f(n0), f(n1), f(n2), ... |
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, spaceComplexity |
Constructor Detail |
---|
public IterativeDeepeningAStar(Function heuristic)
heuristic
- the heuristic cost function h:S→R embedded in the evaluation function f.getEvaluation()
Method Detail |
---|
public Function getHeuristic()
HeuristicAlgorithm
getHeuristic
in interface HeuristicAlgorithm
public void setHeuristic(Function heuristic)
HeuristicAlgorithm
An heuristic cost function h:S→R is estimating the cost to get from a node n to a goal G. For several heuristic algorithms this heuristic function needs to be admissible
A heuristic cost function h is monotonic :⇔ the f-costs (with h) do not decrease in any path from the initial state ⇔ h obeys the triangular inequality
A simple improvement for heuristic functions is using pathmax.
setHeuristic
in interface HeuristicAlgorithm
heuristic
- the heuristic cost function h:S→R estimating h*.
h will be embedded in the evaluation function f
.public Function getEvaluation()
getEvaluation
in interface EvaluativeAlgorithm
getEvaluation
in interface HeuristicAlgorithm
public Function complexity()
complexity
in interface AlgorithmicTemplate
AlgorithmicTemplate.solve(AlgorithmicProblem)
public boolean isOptimal()
isOptimal
in class GeneralSearch
protected boolean isOutOfBounds(java.lang.Object node)
isOutOfBounds
in class GeneralBoundingSearch
node
- the node to check.
nextBound
protected 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 |