First, the algorithm thought
In the state space search, if each step using the evaluation function f (n) = g (n ) + h (n) to the Open table nodes are sorted, then A algorithm. It is a heuristic search algorithm.
Algorithm type:
- Global preferred: selecting a cost function value of all the nodes from the smallest table Open extended.
- Partial merit: only newly generated child node selects a minimum cost function value to be extended.
Second, the global A merit-based search algorithm process
- Into the initial node S0 Open table, f (S0) = g (S0) + h (S0);
- If Open table is empty, the problem has no solution, failed to exit;
- The first node into Closed Open table fetch table, and referred to as the n-node;
- Examine whether the node is the destination node n. If so, then find a solution to the problem, successful exit;
- If node n can not be extended, go to (2) step;
- Extension node n, generating its child nodes ni (i = 1, 2, ...), each sub-node is calculated estimated value f (ni) (i = 1, 2, ...), and for each sub-node point setting a pointer to the parent node, then the child node into the Open list;
- The cost function value of each node, all nodes on the Open table in ascending order reordering;
- Rotation (2) step.
Third, the global A merit-based search algorithm searches