The Manhattan distance between (1, 2) and (4, 6) is 7.
点 (1, 2) 和 (4, 6) 的曼哈顿距离是 7。
In grid-based pathfinding, Manhattan distance is often used as a heuristic when movement is restricted to up, down, left, and right.
在基于网格的寻路中,当移动只能上下左右时,曼哈顿距离常被用作启发式估计。