Orbital library

orbital.algorithm.template
Class IterativeDeepening

java.lang.Object
  extended by orbital.algorithm.template.GeneralSearch
      extended by orbital.algorithm.template.GeneralBoundingSearch
          extended by orbital.algorithm.template.IterativeDeepening
All Implemented Interfaces:
java.io.Serializable, AlgorithmicTemplate, EvaluativeAlgorithm

public class IterativeDeepening
extends GeneralBoundingSearch

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).

Author:
André Platzer
See Also:
Serialized Form
Note:
is a basic aspect of exploring the search space in (increasing) iterations.

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

IterativeDeepening

public IterativeDeepening()
Method Detail

getEvaluation

public Function getEvaluation()
f(n) = g(n).

Returns:
the evaluation function f:S→R used to evaluate (either utility or cost) value of states.

complexity

public Function complexity()
O(bd) where b is the branching factor and d the solution depth. On average &asym;(b+1)d+1/(2*(b-1)2).

Returns:
the function f for which the solve() method of this algorithm runs in O(f(n)) assuming the algorithmic problem hook to run in O(1).
See Also:
AlgorithmicTemplate.solve(AlgorithmicProblem)

isOptimal

public boolean isOptimal()
Description copied from class: GeneralSearch
Whether this search algorithm is optimal.

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.

Specified by:
isOptimal in class GeneralSearch
Returns:
whether this search algorithm is optimal, i.e. whether solutions found are guaranteed to be optimal.

isOutOfBounds

protected boolean isOutOfBounds(java.lang.Object node)
Description copied from class: GeneralBoundingSearch
Whether a node is out of bounds.

Called to check whether to prune a node. This implementation checks whether f(n) > bound. Overwrite to get additional behaviour.

Overrides:
isOutOfBounds in class GeneralBoundingSearch
Parameters:
node - the node to check.
Returns:
whether the node is out of current bounds.
See Also:
GeneralBoundingSearch.getBound(), Template Method

solveImpl

protected java.lang.Object solveImpl(GeneralSearchProblem problem)
Solve with bounds 0, 1, 2, ... until a solution is found.

Overrides:
solveImpl in class GeneralSearch
Returns:
the solution found by GeneralSearch.search(Iterator).
See Also:
GeneralSearch.search(Iterator)

createTraversal

protected java.util.Iterator createTraversal(GeneralSearchProblem problem)
Description copied from class: GeneralSearch
Define a traversal order by creating an iterator for the problem's state space.

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.

Parameters:
problem - the problem whose state space to create a traversal iterator for.
Returns:
an iterator over the options of the problem's state space thereby encapsulating and hiding the traversal order.
See Also:
Factory Method, GeneralSearch.OptionIterator

spaceComplexity

public Function spaceComplexity()
O(b*d) where b is the branching factor and d the solution depth.

Returns:
the function f for which the solve() method of this algorithm consumes memory with an amount in O(f(n)) assuming the algorithmic problem hook uses space in O(1).
See Also:
AlgorithmicTemplate.solve(AlgorithmicProblem)

Orbital library
1.3.0: 11 Apr 2009

Copyright © 1996-2009 André Platzer
All Rights Reserved.