The

Manhattan distance (also known as the

city block metric) is a metric that is used to define the seperation of two instances of something.

In geometric terms, in a 2D Euclidean space, the distance between points *a* and *b* is defined as

```
d(a,b) = |(x
```_{b} - x_{a})| + |(y_{b} - y_{a})|

In other words, how far across and how far up? It is called the Manhattan distance because the street layout of cities like Manhattan are grids so to travel between any two points, you must walk along the roads.