# Cellular Automata/Neighborhood

## 1D neighborhood

Since in 1D there are no shapes, the definition of the neighborhood is usually very simple.

Usually the neighborhood in 1D is described by its radius ${\displaystyle r}$, meaning the number of cell left and right from the central cell that are used for the neighborhood. The output cell is positioned at the center.

Formal definition

Formally the radial neighborhood is the set of neighbors

${\displaystyle N=\{-r,-(r-1),\dots ,-1,0,1,\dots ,r-1,r\}}$

or simply the neighborhood size ${\displaystyle k=2r+1}$ with the output cell at the center ${\displaystyle k_{0}=r}$.

Symmetries
• reflection symmetry

### Stephen Wolfram's notation

In Wolframs's texts and many others the number of available cell states ${\displaystyle |S|}$ and the radius ${\displaystyle r}$ are combined into a pair

${\displaystyle (|S|,r)\,}$

### Brickwall neighborhood

Brickwall neighborhood

An unaligned neighborhood, usually the smallest possible ${\displaystyle k=2}$. The output cell is positioned at ${\displaystyle k_{0}=0.5}$ between the two cells of the neighborhood. It is usually processed by alternatively shifting the output cell between ${\displaystyle k_{0}=0}$ and ${\displaystyle k_{0}=1}$.

## 2D neighborhood

### von Neumann neighborhood

von Neumann neighborhood

It is the smallest symmetric 2D aligned neighborhood usually described by directions on the compass ${\displaystyle N=\{N,W,C,E,S\}}$ sometimes the central cell is omitted.

Formal definition

Formally the von Neumann neighborhood is the set of neighbors

${\displaystyle N=\lbrace \{0,-1\},\{-1,0\},\{0,0\},\{+1,0\},\{0,+1\}\rbrace }$

or a subset of the rectangular neighborhood size ${\displaystyle k_{x}=k_{y}=3}$ with the output cell at the center ${\displaystyle k_{0}x=k_{0}y=1}$.

Symmetries
• reflection symmetry
• rotation symmetry 4-fold

### Moore neighborhood

Moore neighborhood

Is a simple square (usually 3×3 cells) with the output cell in the center. Usually cells in the neighborhood are described by directions on the compass ${\displaystyle N=\{NW,N,NE,W,C,E,SW,S,SE\}}$ sometimes the central cell is omitted.

Formal definition

Formally the Moore neighborhood is the set of neighbors

${\displaystyle N=\lbrace \{-1,-1\},\{0,-1\},\{1,-1\},\{-1,0\},\{0,0\},\{+1,0\},\{-1,+1\},\{0,+1\},\{1,+1\}\rbrace }$

or simply a square size ${\displaystyle k_{x}=k_{y}=3}$ with the output cell at the center ${\displaystyle k_{0}x=k_{0}y=1}$.

Symmetries
• reflection symmetry
• rotation symmetry 4-fold

reversible

### Unaligned rectangular neighborhood

Unaligned rectangular neighborhood

An unaligned (brickwall) rectangular neighborhood, usually the smallest possible ${\displaystyle k_{x}=k_{y}=2}$. The output cell is positioned at ${\displaystyle k_{0x}=k_{0y}=0.5}$ between the four cells of the neighborhood. It is usually processed by alternatively shifting the output cell to ${\displaystyle k_{0x}=k_{0y}=0}$ and ${\displaystyle k_{0x}=k_{0y}=1}$.

## Hexagonal neighborhood

### Hexagonal neighborhood

Hexagonal neighborhood
Symmetries
• reflection symmetry
• rotation symmetry 6-fold

### Small unaligned hexagonal neighborhood

Unaligned hexagonal neighborhood
Formal definition

Formally the small (3-cell) unaligned hexagonal neighborhood represented on a rectangular lattice is the set of neighbors

${\displaystyle N=\lbrace \{0,0\},\{1,0\},\{0,1\}\rbrace }$
Symmetries
• reflection symmetry
• rotation symmetry 3-fold