I have a grid of cells, X cells wide by Y cells high. Each cell has four corners, NW, NE, SW and SE. Each corner is shared with adjacent neighbors; i.e., a cell's SW corner is the NW corner of the cell just below it.
In any grid of (X,Y) cells, there are (X+1,Y+1) corners.
In this grid, each corner can be assigned an arbitrary identifier, giving the cell an 'address' of the format NW-NE-SW-SE
In this image below, for cell 'h' the four corners are named @, #, $ and %
. The NE corner of cell 'g' would also share the corner name '@'. Cell 'h' would have the address @#$%
What is the minimum number of unique identifiers needed to allow all cells to have a unique 'address'?
Is there a generalized algorithm or pattern one might use to calculate such a list of identifiers and to assign them to all the corners in a grid of size (XY)?
Thanks in advance!
Edited to add: My purpose in asking this question is to solve a real-world problem, which I did not originally state in my question, and further, that I don't necessarily need the theoretical or provable 'minimum set of unique symbols' but rather an algorithm that combines the properties of a) being easy to understand and implement and, b) provides fairly good answers (i.e., small, perhaps not smallest). Very subjective, I know.