core
Interface HeuristicProblem<T>

Type Parameters:
T - the type of the states used throughout the search
All Superinterfaces:
Problem<T>, TreeProblem<T>

public interface HeuristicProblem<T>
extends TreeProblem<T>

This is the base of all problems which can be solved in an heuristic search.

Additional to the TreeProblem a HeuristicProblem consists of two methods to evaluate the sum of the path costs and the proximity to a goal for a given state. These two methods enables some algorithms to direct their search towards a goal.
If you implement this interface, your problem can additionally be solved by the following search algorithms:

Note: The method which computes the proximity to a goal (called heuristic) is of great importance for the performance of the algorithms above, (but not for the UniformCostSearch). There are some constraints for a good heuristic function which must hold for all states s in the search domain:

Author:
eden06

Method Summary
 double g(T state)
          This method returns the sum of all path costs from the initial to the given state.
 double h(T state)
          This method computes the proximity of the given state to a goal.
 
Methods inherited from interface core.TreeProblem
depth
 
Methods inherited from interface core.Problem
expand, initial, isGoal
 

Method Detail

g

double g(T state)
This method returns the sum of all path costs from the initial to the given state.

Parameters:
state - to be inspected
Returns:
the sum of the path costs from the initial state to the given state

h

double h(T state)
This method computes the proximity of the given state to a goal. The value returned should express how much the path from the given state to a goal state may cost. Note: For optimality and completeness it is important to obeys the following rules for all states s in the search domain.

Parameters:
state - which should be used to reach a goal
Returns:
an approximation of the path costs needed to reach a goal.