If you consider a grid based game map using squares and we assume three sort of layers of map info, units, terrain, movement, then we could represent each as follows,

Unit info:

[{0,0,0},{0,1,0},{0,0,0}] ---> a single unit standing in the middle of the map.

Terrain info:

[{1,1,1}, {1,0,1},{1,1,1}] --> all the terrain is of type one except the middle which is type 0

Movement info:

[{1,1,1},{1,0,5,1},{1,1,1}] --> The movement is 1 mp for all squares but the middle which is 0.5

In general, you would probably handle all these matrices as one matrix with each square holding the information for each of these layers.

Now, since each square can be assumed to have an inherent label of (i,j) denoting its place in the matrix, it is easy enough to denote adjacency by simply using the axiom that two squares are adjacent if they are 1 off from i or j ( we could make this 1 difference exclusive to i or j, to denote only 4 directions of moment).