Class BestFirstSearch

All Implemented Interfaces:
ISearchingAlgorithm

public class BestFirstSearch extends BreadthFirstSearch
Best First Search algorithm. It works just like Breadth First Search (BFS), but instead of exploring equally in all directions, it uses a "smart" queue (a priority queue) to decide where to go next. It prioritizes states based on their actual cost so far PLUS an estimated cost to the goal, obtained from the domain's own heuristic. This makes it act like A*, finding the cheapest path while exploring far fewer nodes than BFS - assuming the domain provides an admissible heuristic.