Functions
A Moore neighborhood includes all points where the Chebyshev distance (also called L∞ distance) from the center is less than or equal to the radius. The Chebyshev distance is the maximum absolute difference across all dimensions. This function uses a direct iteration around a bounding box.
A Moore neighborhood includes all points where the Chebyshev distance (also called L∞ distance) from the center is less than or equal to the radius. The Chebyshev distance is the maximum absolute difference across all dimensions. This function expands from the center outward using a breadth-first search to find the elements.
A von Neumann neighborhood includes all points where the Manhattan distance (sum of absolute differences in all dimensions) from the center is less than or equal to the radius. This function uses a direct iteration around a bounding box.
A von Neumann neighborhood includes all points where the Manhattan distance (sum of absolute differences in all dimensions) from the center is less than or equal to the radius. This function uses an outward expanding approach from the center point using breadth-first search (BFS).
A Moore neighborhood includes all points where the Chebyshev distance (also called L∞ distance) from the center is less than or equal to the radius. The Chebyshev distance is the maximum absolute difference across all dimensions. This function uses a direct iteration around a bounding box. This function returns the Moore neighborhood around an array of zeroes of size dimension
A von Neumann neighborhood includes all points where the Manhattan distance (sum of absolute differences in all dimensions) from the center is less than or equal to the radius. This function uses a direct iteration around a bounding box. This function returns the von Neumann neighborhood around an array of zeroes of size dimension