I would to find an efficient structure (speed and volume) to store nodes and their neighbourhood.
My input is build out of stings in the following format
where X ∈ [0,359] and Y ∈ [0,169] and each pair of (X,Y) defined the coordinate of a cell on a grid of the size [170x360].
I would like to find which cells are neighboured (above, below, right and left), maximal 4 possibilities and to store this information (coordinate and direction). The structure, where the information will be stored, should not contain duplicate information (e.g. cell (50,50) is neighboured to cell (51,50) from the left side, but cell (51,50) is as well neighboured to cell (50,50) from the right side. Only one of those likes should be stored).
An additional information, the number of input strings (format ./X/Y.log) is not more then 5% of the total amount of possible cells (360*170 = 61200 possible cells).
Which storage structure should I good to my problem? (The code would be written in C++)