use grid map to accelerate searching