How do you notate a set of neighbouring locations in an integer lattice?

86 Views Asked by At

So I'm trying to write a paper and in it I'm describing the movement of an agent in a multi-agent simulation. Space is treated as a 2 or 3 dimensional lattice. I need some notation for the set of relative neighbouring locations (in the form of vectors) in a lattice which can then be indexed and summed with the position of an agent in order to update it. For example, suppose an agent's position is $\mathbf{a_\text{pos}}$ and the set of neighbours is $M$. I want to be able to show what $M$ is and how it is used to update $\mathbf{a_\text{pos}}$:

\begin{align} M &= \text{what goes here?} \\ i &\in \mathbb{N}^{[1,|M|]} \\ \mathbf{a_\text{pos}'} &= \mathbf{a_\text{pos}} + \mathbf{m_i} \\ \end{align}

Where $\mathbf{m_i} \in M$. If we are in two dimensions, I would expect $M$ to contain vectors $(1,1),(1,0),(1,-1),(0,1),(0,-1),(-1,1),(-1,0),(-1,-1)$ for example. My initial thought was to try and use some type of set builder notation but I'm not exactly sure how to go about this. It would be great if there is some convenient notation for this sort of thing that is fairly well accepted. Also please let me know if I've made any mistakes in the notation above.

1

There are 1 best solutions below

0
On BEST ANSWER

So after some searching I realized that what I'm looking for is called a Moore neighbourhood. Defining this according to wolfram can be shown using the following notation:

\begin{align}N_{x_0,y_0}^M = \{ (x,y) : |x-x_0| \leq r, |y-y_0| \leq r \}\end{align}

Where r is the range. In order to fit my purposes I want to generalize the expression to accomodate $d$ dimensions, be clear that the set consists of integer tuples and show that I'm omitting the $(0_1,...,0_d)$ value. I have concluded that I will write something like this (was helped in the comments by Robert Israel):

\begin{align} \|(x_1,...,x_d)\|_\infty &= \text{max}(|x_1|,...,|x_d|) \\ \mathbf M_{r} &= \{ \mathbf{m} \in \mathbb{Z}^d : 1 \leq \|\mathbf{m}\|_\infty \leq r \} \\ \end{align} Assuming that \begin{align} \mathbf M_r &=\{\mathbf m_{r,1},...,\mathbf m_{r,|\mathbf M_r|}\} \\ \mathbf m_{r,i} &\in \mathbf M_r \\ \end{align} The agent position can be updated like so: \begin{align} \mathbf{a_\text{pos}'} &= \mathbf{a_\text{pos}} + \mathbf{m_{1,i}} \\ \end{align}