Goal-count heuristic
Also known as goal count
heuristic miniplan
The goal-count heuristic estimates the distance to the goal as the number of goal facts that are false in the current state. In miniplan it counts only the positive goal facts. It is very cheap to compute and needs no preprocessing. It is not admissible (it can overestimate the true cost), because one action can make several goal facts true at once. It also ignores preconditions, so it is a weak guide; use it with greedy best-first search for fast, non-optimal plans, or as a baseline for better heuristics.
Pseudocode
algorithm GoalCount(task, s)input: a grounded task with positive goal facts G, a state soutput: the number of goal facts that do not hold in sn ← 0for each f in G doif f ∉ s thenn ← n + 1return nIn the crates
miniplanCounts the unsatisfied goal facts of a state.