Filtering edge cells in neighbor analysis