All Downloads are FREE. Search and download functionalities are using the official Maven repository.

aima.core.search.informed.AStarSearch Maven / Gradle / Ivy

Go to download

AIMA-Java Core Algorithms from the book Artificial Intelligence a Modern Approach 3rd Ed.

The newest version!
package aima.core.search.informed;

import aima.core.search.framework.evalfunc.HeuristicFunction;
import aima.core.search.framework.qsearch.QueueSearch;

/**
 * Artificial Intelligence A Modern Approach (3rd Edition): page 93.
*
* The most widely known form of best-first search is called A* Search * (pronounced "A-star search"). It evaluates nodes by combining g(n), the cost * to reach the node, and h(n), the cost to get from the node to the goal:
* f(n) = g(n) + h(n).
*
* Since g(n) gives the path cost from the start node to node n, and h(n) is the * estimated cost of the cheapest path from n to the goal, we have
* f(n) = estimated cost of the cheapest solution through n. * * @author Ravi Mohan * @author Mike Stampone * @author Ruediger Lunde */ public class AStarSearch extends BestFirstSearch { /** * Constructs an A* search from a specified search space exploration * strategy and a heuristic function. * * @param impl * a search space exploration strategy (e.g. TreeSearch, GraphSearch). * @param hf * a heuristic function h(n), which estimates the cost * of the cheapest path from the state at node n to a * goal state. */ public AStarSearch(QueueSearch impl, HeuristicFunction hf) { super(impl, new AStarEvaluationFunction(hf)); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy