# Heuristic Functions

A heuristic function is a way to inform the search about the direction to a goal.

In the context of Adversarial Search: An evaluation function estimates the expected utility of the game from a given state. You can also call this Value Function, borrowed from the RL community.

### Grid Search

Suppose you have a goal position $(x_{g},y_{g})$ and your current position is $(x_{n},y_{n})$, then you can use some simple heuristics:

**Manhattan Distance**
$H(x_{n},y_{n})=∣(x_{n}−x_{g})∣+∣(y_{n}−y_{g})∣$
**Euclidean Distance**
$H(x_{n},y_{n})=(x_{n}−x_{g})_{2}+(y_{n}−y_{g})_{2} $