Class BreadthFirstSearch

java.lang.Object
mazealgo.model.algorithms.search.ASearchingAlgorithm
mazealgo.model.algorithms.search.BreadthFirstSearch
All Implemented Interfaces:
ISearchingAlgorithm
Direct Known Subclasses:
BestFirstSearch

public class BreadthFirstSearch extends ASearchingAlgorithm
Breadth First Search. Uses a FIFO queue as the open list, so the first time a goal cell is reached it has the fewest edges from the start. The same skeleton is reused by BestFirstSearch, which only swaps the queue for a priority queue.
  • Field Details

  • Constructor Details

    • BreadthFirstSearch

      public BreadthFirstSearch()
  • Method Details

    • reset

      protected void reset()
      Description copied from class: ASearchingAlgorithm
      Resets per-solve state. Subclasses with their own mutable state (e.g. an open list) should override this and call super.reset().
      Overrides:
      reset in class ASearchingAlgorithm
    • solve

      public Solution solve(ISearchable domain)
    • getName

      public String getName()