Suppose the 2d array we are working on
abcd efgh ijkl mnop
The closest neighbor is 'f' [abceg i jk]. I am trying to create a cache friendly data structure to store a node neighbor. Right now i have something like this
struct Neighbor{ size_t neighborPosition[8][2]; size_t size; }; typedef size_t Position[2]; typedef Neighbor** NeighborTable;
Note that the maximum neighbor of a node can have a value of 8. Does anyone have any tips? I need a structure to be a constant search for neighbors in the neighborhood, so I will pre-compute the neighbor of each node.
source share