Orbital library

orbital.algorithm.template
Class IterativeExpansion

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

public class IterativeExpansion
extends GeneralSearch
implements HeuristicAlgorithm

Iterative Expansion (IE).

Iterative Expansion is a memory-bounded search algorithm that combines the space complexity advantages of IDA* with A*'s ability of remembering more than just a bound from the rest of the search tree. IE is inferior to SMA* which has a more flexible tradeoff between reducing memory consumption and remembering parts of the search tree in order to avoid re-expansion. However, IE has much less memory management overhead and thus has a comparable performance to that of SMA*. Nevertheless, all current memory-bounded algorithms have difficulties with problems having too many distinct f-costs (i.e. |f(S)| is large).

Author:
André Platzer
See Also:
"Russel, S. (1992?) Efficient memory-bounded search methods.", "Korf, R.E. (1991) Best-first search with limited memory. UCLA Comp. Sci.Ann.", Serialized Form
Note:
memory-bounded algorithms suffer from transpositions in the search graph.

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
IterativeExpansion(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, and initial bound sufficiently large (usually ∞).
 void setHeuristic(Function heuristic)
          Set the heuristic function to use.
protected  java.lang.Object solveImpl(GeneralSearchProblem problem)
          Implements the solution policy.
 Function spaceComplexity()
          O(b*d) where b is the branching factor and d the solution depth.
 
Methods inherited from class orbital.algorithm.template.GeneralSearch
getProblem, search, 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

IterativeExpansion

public IterativeExpansion(Function heuristic)
Create a new instance of IDA* search. Which is a bounding search using the evaluation function f(n) = g(n) + h(n).

Parameters:
heuristic - the heuristic cost function h:S→R embedded in the evaluation function f.
See Also:
getEvaluation()
Method Detail

getHeuristic

public Function getHeuristic()
Description copied from interface: HeuristicAlgorithm
Get the heuristic function used.

Specified by:
getHeuristic in interface HeuristicAlgorithm
Returns:
the heuristic cost function h:S→R estimating h*.

setHeuristic

public void setHeuristic(Function heuristic)
Description copied from interface: HeuristicAlgorithm
Set the heuristic function to use.

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

h ≤ h*
i.e. h is a lower bound for the effective cost function h*. Then the pathmax heuristic f(s') := max {f(s), g(s') + h(s')} (for transitions s→s'=t(s,a) with a∈A(s)) is monotonic.

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

∀s∈S,a∈A(s) h(s) ≤ h(s') + c(s,a) with s' = t(s,a)
i.e. the sum of the costs from A to C and from C to B must not be less than the cost from A to B.

A simple improvement for heuristic functions is using pathmax.

Specified by:
setHeuristic in interface HeuristicAlgorithm
Parameters:
heuristic - the heuristic cost function h:S→R estimating h*. h will be embedded in the evaluation function f.
See Also:
"Pearl, J. Heuristics: Intelligent Search Strategies for Computer Problem Solving. Addison-Wesley, Reading, Massachusetts. 1984."

getEvaluation

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

Specified by:
getEvaluation in interface EvaluativeAlgorithm
Specified by:
getEvaluation in interface HeuristicAlgorithm
Returns:
the evaluation function f:S→R used to evaluate (either utility or cost) value of states.

spaceComplexity

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

Specified by:
spaceComplexity in interface AlgorithmicTemplate
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)

complexity

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

Specified by:
complexity in interface AlgorithmicTemplate
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()
Optimal if heuristic is admissible, and initial bound sufficiently large (usually ∞).

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

solveImpl

protected java.lang.Object solveImpl(GeneralSearchProblem problem)
Description copied from class: GeneralSearch
Implements the solution policy.

Like the default solution policies, this implementation will

  1. Fetch a traversal order policy by calling GeneralSearch.createTraversal(GeneralSearchProblem).
  2. Then call GeneralSearch.search(Iterator) to search through the state space in the traversal order.
However, sophisticated search algorithms may want to change that policy and iterate the above process, resulting in a sequence of calls to those methods. They may do so by by overwriting this method.

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.

Specified by:
createTraversal in class GeneralSearch
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

Orbital library
1.3.0: 11 Apr 2009

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