public class

HillClimbing

extends Algorithm<A, S, N extends Node<A, S, N>>
java.lang.Object
   ↳ es.usc.citius.hipster.algorithm.Algorithm<A, S, N extends es.usc.citius.hipster.model.Node<A, S, N>>
     ↳ es.usc.citius.hipster.algorithm.localsearch.HillClimbing<A, S, C extends java.lang.Comparable<C>, N extends es.usc.citius.hipster.model.HeuristicNode<A, S, C, N>>

Class Overview

Implementation of the Hill Climbing algorithm. This is a local search algorithm which starts the exploration of the state space in a random point, and then tries to improve the solution varying a single element of it. This process is repeated iteratively until no further improvements are produced in the solution state. This algorithm performs well finding local optimums, but there is no guarantee to find the best possible solution in the state space. If the state space has a convex cost function then this algoritm is guaranteed to be optimal, but only in that case. Enforced hill climbing uses a BFS search to deal with local optimums, increasing the number of explored states when the neighborhood of a state does not improve the solution. You can find a more detailed description of the algorithm in Wikipedia and the book Artificial Intelligence: A Modern Approach

Summary

Nested Classes
class HillClimbing.EHCIterator  
Public Constructors
HillClimbing(N initialNode, NodeExpander<A, S, N> nodeExpander)
HillClimbing(N initialNode, NodeExpander<A, S, N> nodeExpander, boolean enforcedHillClimbing)
Creates a new hill climbing algorithm with an initial node, a node expander and the boolean flag to use or not enforced hill climbing.
Public Methods
EHCIterator iterator()
[Expand]
Inherited Methods
From class es.usc.citius.hipster.algorithm.Algorithm
From class java.lang.Object
From interface java.lang.Iterable

Public Constructors

public HillClimbing (N initialNode, NodeExpander<A, S, N> nodeExpander)

public HillClimbing (N initialNode, NodeExpander<A, S, N> nodeExpander, boolean enforcedHillClimbing)

Creates a new hill climbing algorithm with an initial node, a node expander and the boolean flag to use or not enforced hill climbing.

Parameters
initialNode initial node of the search
nodeExpander component which creates new nodes from a current one
enforcedHillClimbing flag to use enforced hill climbing

Public Methods

public EHCIterator iterator ()