def manhattan_heuristic(pos, problem):
    """ The Manhattan distance heuristic for a PositionSearchProblem.
      ((int, int), PositionSearchProblem) -> int
    """
    return abs(pos[0] - problem.goal_pos[0]) + abs(pos[1] - problem.goal_pos[1])