public class

BreadthFirstSearch

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.BreadthFirstSearch<A, S, N extends es.usc.citius.hipster.model.Node<A, S, N>>

Class Overview

Breadth First Search (BFS) implementation. This is an uninformed algorithm that explores first the neighbors at distance 1 (direct neighbors), then the neighbors at distance 2 (neighbors of the neighbors), and so on. The algorithm is complete but not optimal (it is only optimal if the cost of the problem is uniform and each transition has a cost of one).

See this Wikipedia article for more information about BFS.

Summary

Nested Classes
class BreadthFirstSearch.Iterator Implements all the BFS search logic as an iterator  
Fields
protected final NodeExpander<A, S, N extends Node<A, S, N>> expander
protected final N extends Node<A, S, N> initialNode
Public Constructors
BreadthFirstSearch(N initialNode, NodeExpander<A, S, N> expander)
Public Methods
Iterator iterator()
[Expand]
Inherited Methods
From class es.usc.citius.hipster.algorithm.Algorithm
From class java.lang.Object
From interface java.lang.Iterable

Fields

protected final NodeExpander<A, S, N extends Node<A, S, N>> expander

protected final N extends Node<A, S, N> initialNode

Public Constructors

public BreadthFirstSearch (N initialNode, NodeExpander<A, S, N> expander)

Public Methods

public Iterator iterator ()