extended
Interface HillClimbingProblem<T>

Type Parameters:
T - the type of the states used throughout the search
All Superinterfaces:
java.util.Comparator<T>, Problem<T>

public interface HillClimbingProblem<T>
extends Problem<T>, java.util.Comparator<T>

This is the base of all problems which can be solved with the hill climbing search.

Additional to the simple Problem a HillClimbingProblem consists of a comparison method which imposes a total ordering over the elements in the search domain. As a conclusion it is now possible to find a smallest or a biggest element in the search domain, and this is exactly what the hill climbing is trying to do.
If you implement this interface, your problem can be solved by the following search algorithms:

In the following there are some important hints how to augment your hill climbing problem:
  1. In order to use HillClimbing with random restart (as explained in the description of the HillClimbing class), you should return a random generated state whenever the core.Problem#initial() method is called.
  2. Make sure the HillClimbingProblem#compare() method is damn fast, otherwise the hill climbing search will get stuck in comparing two states.
  3. Whenever you have to deal with a large number of successor states for a given state, think about using a proxy class which generates the successor state only if necessary. Look at the QueenProxy class in implementation.queenproblem as an example.
  4. For the skilled, it is possible to create your own List implementation, which is created with a given state and creates the successor states only if the are requested. You have to take good care on how to change the semantic of the list interface!
Note: The hill climbing search will not use the core.Problem#isGoal(java.lang.Object) method, to determine if a solution has been found. In fact the hill climbing search assumes that a state is a goal if it has no better successor states.
For compatibility with other search algorithms you should implement the isGoal method in a proper way.

Author:
eden06
See Also:
Comparator, HillClimbing

Method Summary
 
Methods inherited from interface core.Problem
expand, initial, isGoal
 
Methods inherited from interface java.util.Comparator
compare, equals