A heuristic is a technique used in informed search algorithms that provides an estimate of the cost or distance from a given state to the goal.
Think of it as a “rule of thumb” or a “best guess” that helps AI make decisions faster.
| Property | Description |
|---|---|
| Admissibility | A heuristic is admissible if it never overestimates the actual cost to reach the goal. Guarantees optimal solutions with A*. |
| Consistency (Monotonicity) | For every node and successor , the heuristic satisfies: |
| . | |
| Ensures A* doesn't need to revisit nodes. | |
| Efficiency | It should reduce the number of nodes expanded significantly. |
| Accuracy | The closer the heuristic is to the actual cost, the better. |
| Problem | Heuristic | Explanation |
|---|---|---|
| Map routing | Straight-line distance (Euclidean) | Distance from current location to destination |
| 8-puzzle | Number of misplaced tiles | Counts how many tiles are not in correct position |
| 8-puzzle | Manhattan distance | Total distance tiles are away from their goal positions (row + column) |
| Chess | Material advantage | Value of current pieces vs. opponent’s |
| Algorithm | Use of Heuristic |
|---|---|
| Greedy Best-First Search | Uses only h(n) (chooses node that looks closest to goal) |
| A* Search | Uses f(n) = g(n) + h(n) (combines path cost + heuristic estimate) |
A good heuristic should:
| Term | Definition |
|---|---|
| Heuristic (h(n)) | Estimated cost from node n to the goal |
| Admissible | Never overestimates the actual cost |
| Consistent | Satisfies triangle inequality: |
| Role | Guides search, improves efficiency |
Open this section to load past papers