extended
Interface BidirectionalProblem<T>

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

public interface BidirectionalProblem<T>
extends Problem<T>

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

Additional to the simple Problem a BidirectionalProblem consists of a methods to return the goal state and to create predecessor states from a given one.
If you implement this interface, your problem can be solved by the following search algorithms:

Note: The bidirectional search will not use the core.Problem#isGoal(java.lang.Object) method, to determine if a solution has been found. In fact a BidirectionalProblem must know exactly one goal state. For compatibility with other search algorithms you should implement the isGoal method in the following way:

 public boolean isGoal(T state){
        return (goal()==null ? false : goal().equals(state) );
 }
 

Author:
eden06
See Also:
BidirectionalSearch

Method Summary
 T goal()
          Returns the goal state of the search.
 java.util.List<T> implode(T state)
          Generates all predecessor states of the given state.
 
Methods inherited from interface core.Problem
expand, initial, isGoal
 

Method Detail

goal

T goal()
Returns the goal state of the search. Note: This state will be used as the starting state of the backward search in extended.BidirectionalSearch.

Returns:
the goal state of your search domain

implode

java.util.List<T> implode(T state)
Generates all predecessor states of the given state.
This method should never return null. If the state can not be backtracked than you should return an empty List.
Note: Most search algorithms have the ability to check for duplicate states, but if you want to implement your own duplicate handling than this method is the place to put it in.

Parameters:
state - to be backtracked
Returns:
a List of all predecessor states