Tiling the plane with von Neumann neighborhoods of range r
In 2d cellular automata, the von Neumann neighborhood of range r at point \( ( x_0, y_0 ) \) is the set of cell centers defined by
$$\begin{aligned} {\mathcal {N}}^{\, r }_{ ( x_0,\, y_0 ) } = \{ ( x, y ) : \ | x - x_0 \ | + \ | y - y_0 \ | \le r \} \qquad ( r \in {\mathbb {N}} ) \end{aligned}$$
at a Manhattan distance \( d ( ( x, y ) , ( x_0 , y_0 ) ) \le r . \) The cardinality of this neighborhood, hereafter referred as r–neighborhood, is the centered square number
$$\begin{aligned} {\mathbf {n}}_r = 2 \, r^2 \, + 2 r + 1 \end{aligned}$$
(1)
illustrated in the inset of Fig. 5 for the first usual values of \( r > 0 \) (the 0–neighborhood is the trivial point \( \{( x_0, y_0 ) \}). \) Von Neumann’s 2d neighborhoods define a family of polyominoes, that are “prototiles” which perfectly tessellateFootnote 1 the plane.
The labeling scheme is defined from a generating set \( ( s_{ 1 }, s_{ 2 } ) ( r ) \) and must satisfy that \( s_{ 1 }, s_{ 2 } \) and \( {\mathbf {n}}_r \) be pairwise coprime (Yebra et al. 1985). A usual choice is to set \( ( s_{ 1 }, s_{ 2 } ( r ) ) = ( 1, 2 \, r + 1 ): \) the first direction (horizontal) is generated by the infinite sequence \( ( 0, 1, 2,... , {\mathbf {n}}_r - 1 ) \) of elements of \( {\mathbb {Z}} / {\mathbf {n}}_r {\mathbb {Z}} \) with 0 at the center of the prototile, whence the generation of the second sequence (vertical) is deduced. Thus, a cell c is adjacent to cells \( c \pm 1 \pmod {{\mathbf {n}}_r} \) according to the first direction of generators and is adjacent to cells \( c \pm (2\,r + 1) \pmod {{\mathbf {n}}_r} \) according to the second direction. This adjacency relation is formally depicted by the circulant graphs \( {\mathcal {C}}^{ s_{ 1 } s_{ 2 } ( r ) }_{ {\mathbf {n}}_r } \) – namely \( {\mathcal {C}}^{ 1, 3 }_{ 5 } \hbox { and } {\mathcal {C}}^{ 1, 5 }_{ 13 } \) – of Fig. 6. They are Cayley graphs and therefore have the property of being vertex–transitive (Boesch and Tindell 1984; Monakhova et al. 2020).
The adjacency matrices \( M_{ {\mathbf {n}}_r } \) associated with the (von Neumann) r–circulant \( {\mathcal {C}}^{ s_{ 1 } s_{ 2 } ( r ) }_{ {\mathbf {n}}_r } \) have handsome spectral properties (Davis 1970). They are bisymmetric and the simple knowledge of coefficients \( c_{ 1 } , c_{ 2\,r + 1 } \) in the first row \( c_{ 0 } , c_{ 1 } , c_{ 2 } , \ldots , c_{ {\mathbf {n}}_r - 1 } \) suffices to determine the set of eigenvalues. Thereby \( c_{ 1 } = c_{ 2\,r + 1 } = 1 \) and
$$\begin{aligned} \uplambda _{ {\mathbf {n}}_r, \,k }= & {} 2 \cos \left( \frac{ 2 \, k \pi }{ {\mathbf {n}}_r } \right) + 2 \cos \left( \frac{ ( 2\,r + 1 )\, 2 \, k \pi }{ {\mathbf {n}}_r } \right) \nonumber \\&\qquad ( 0 \le k \le {\mathbf {n}}_r - 1 ) \end{aligned}$$
(2)
where \( \uplambda _{ {\mathbf {n}}_r , \,k } \) denotes the k–th eigenvalue of matrix \( M_{ {\mathbf {n}}_r } . \) For a given \( r > 0 \) there exists a unique maximal eigenvalue \( \uplambda _{ {\mathbf {n}}_r , \,0 } = 4 \) that denotes a 4–regular graph and there exist \( ( {\mathbf {n}}_r - 1 ) / 4 \) equivalence classes with 4 equal eigenvalues and such that
$$\begin{aligned} \hbox { tr }( M_{ {\mathbf {n}}_r } ) = \uplambda _{ {\mathbf {n}}_r, \,0 } + \sum _ {k = 1 }^{ {\mathbf {n}}_r - 1 } \uplambda _{ {\mathbf {n}}_r, \,k } = 0 \end{aligned}$$
where \( \hbox { tr}( M_{ {\mathbf {n}}_r } ) \) denotes the trace of \( M_{ {\mathbf {n}}_r } . \) Thereby from (2) and after simple trigonometric transformations we get \( \, \uplambda _{ 5, 4 } = \uplambda _{ 5, 3 } = \uplambda _{ 5, 2 } = \uplambda _{ 5, 1 } \) for \( M_5 \) and
$$\begin{aligned} \uplambda _{ 13, 12 }= & {} \uplambda _{ 13, 8 } = \uplambda _{ 13, 5 } = \uplambda _{ 13, 1 } \ ; \uplambda _{ 13,11 } = \uplambda _{ 13,10 } = \uplambda _{ 13, 3 } = \uplambda _{ 13, 2 } \ ;\\ \uplambda _{ 13, 9 }= & {} \uplambda _{ 13, 7 } = \uplambda _{ 13, 6 } = \uplambda _{ 13, 4 } \end{aligned}$$
for \( M_{ 13 } \). In particular, the spectrum highlights the rotational symmetry of the prototiles in Fig. 5 and by comparing with (Yebra et al. 1985), one could verify that the set of eigenvalues does not depend on the chosen labeling scheme.
The vertex–transitivity implies that any window of size \( {\mathbf {n}}_r \times {\mathbf {n}}_r \) and embedded into this cellular space will contain exactly \( {\mathbf {n}}_r \) distinct cells \( c \in {\mathbb {Z}} / {\mathbf {n}}_r {\mathbb {Z}} \) whatever the position of the window. Moving the window by a vector \( (\alpha ,\beta ) \) turns into the automorphism \( \tau _{ \alpha \beta } \) mapping \( {\mathbb {Z}} / {\mathbf {n}}_r {\mathbb {Z}} \) into itself as
$$\begin{aligned} c \mapsto \tau _{ \alpha \beta } ( c ) = c + ( \alpha s_1 + \beta s_2 ( r ) ) = c + \alpha + ( 2\, r + 1 ) \beta \pmod {{\mathbf {n}}_r} \end{aligned}$$
for any \( c \in {\mathbb {Z}} / {\mathbf {n}}_r {\mathbb {Z}}. \) This therefore defines a \( {\mathbf {n}}_r \times {\mathbf {n}}_r \) wrap–around toroidal topology that provides the exact number \( {\mathbf {n}}_r \) of required sensor points. For any multiple \( n = p \cdot {\mathbf {n}}_r \) this property remains true, that is, with \( p^{\,2\, } {\mathbf {n}}_r \) sensor points.
Min–coverage problem
For other sizes \( n \times n \) further analysis should be carried out. The perfect tiling will then give way to patterns with overlapped prototiles. Let \( V_n = ( v_{ i j })_{ \, 1 \le \, i, j \, \le n } \) therefore be the coverage matrix where element \( v_{ i j } = v \, ( x, y ) \) denotes the cover level at site (x, y) . Let \( \sigma _{ n } \) be the number of “\( {\mathbf {0}} \)” in the \( n \times n \) field –the number of “sensor points”– for a given configuration. Then \( \sigma _{ n } \) also denotes the number of prototiles and we consider the rational \( n^2 / {\mathbf {n}}_2 \) surrounded by the two consecutive integers \( \sigma _{ n } - 1 \) and \( \sigma _{ n } \) such that
$$\begin{aligned} \sigma _{ n } - 1 < \frac{ n^2 }{ {\mathbf {n}}_2 } \le \sigma _{ n } \hbox { with } \quad \quad {\mathbf {n}}_2 \, \sigma _{ n } = \sum _{ i, j } v_{ i j } \end{aligned}$$
(3)
and where the sum in matrix \( V_n \) denotes the global cover index with \( \sigma _{ n } \) points. It follows that \( \sigma _{ n } \) defines a lower bound for the required number of points in the \( n \times n \) field. However, in most cases this rough lower bound is not a tight bound and the values of \( \sigma _{ n } \) displayed in Table 2 are often lower than those provided by the simulation. This theoretical inadequacy results from the fact that the toroidal constraint is not taking into account. A heuristic framework is presented, applied for any n \( ( 3 \le n < 13 ) \) and illustrated in Appendix \( A_1 \). The four following primitives are stated thereafter. The result is the formation of valid min patterns for almost all values of n.
The heuristic evolves more or less easily depending on whether or not there exists some “affinity” between n and \( {\mathbf {n}}_2 \). The 4–fold rotational symmetry initiated at the beginning is conserved throughout evolution for \( n = 3, 7, 10 \) and is eventually achieved for \( n = 6 \). It can be checked that the relation \( {\mathbf {n}}_2 \cdot \sigma ^{ *}_{ n } \equiv _4 n^2 \) holds for those cases.
For \( n = 4 \) the case is somewhat trivial: at least 2 points are expected from (3), now a \( n \times n \) torus has diameter n for n even and there exist \( \sigma ^{ *}_{ 4 } = 2 \) antipodals at distance 4.
The symmetry is broken for \( n = 5, 8, 9 \) but an optimal pattern is easy to achieve.
For \( n = 12 \) the symmetry holds until the penultimate step, that is, until a single point is added. Indeed, we can observe that \( {\mathbf {n}}_2 \cdot ( \sigma ^{ *}_{ n } - 1 ) \equiv _4 n^2 \) holds for this case.
————————————–
Initialize (n, \( \sigma _{ n }( 0 ) \))
————————————–
// Define a \( n \times n \) window with 4–fold rotational symmetry :
// For n odd the center is the \( {\mathbf {0}} \)–kernel of a centered prototile, surrounded by a maximum of prototiles whose kernels are strictly inner to the \( n \times n \) window
// For n even (\( n > 4\)) the center is the \(\left[ \mathbf {2,3,10,11}\right] \) \( 2 \times 2 \) square, surrounded by a maximum of prototiles whose kernels are strictly inner to the \( n \times n \) window; for \( n = 4 \) the pattern is empty
\( \sigma ^{ *}_{ n } = \sigma _{ n }( 0 ) \) // initial number of points
————————————–
Set_PBC (\( n, \{( i, j )\} [, \texttt {pbcl} ] \))
————————————–
// From the inner (i, j) kernel, fix the periodic boundary conditions (PBC) generating the four N–S and E–W outer images \(( i, j \pm n)\) and \(( i \pm n, j )\) as well as the four NW–SE–NE–SW \(( i \pm n,j \pm n)\) outer images
// {( i, j )} : List of kernels
// pbcl: Number of points lost by PBC sequence ;
the empty parameter is the default ( pbcl = 0 )
\( \sigma ^{ *}_{ n } \leftarrow \sigma ^{ *}_{ n } - \texttt {pbcl} \)
————————————–
Add_P (n, (i, j) )
————————————–
// Add a new prototile centered at (i, j) and propagate PBC
\( \sigma ^{ *}_{ n } \leftarrow \sigma ^{ *}_{ n } + 1 \)
————————————–
Move_P (\( n, \{ ( i, j ) \), dir })
————————————–
// Move the (i, j) –prototile to one of the N–S–E–W direction dir and propagate PBC
// {(i, j), dir } : List of movings
————————————–
Surprisingly, this heuristic evolves badly for \( n = 11 \). Although it could lead to a pattern with \( \sigma '^{ *}_{ 11 } = 13 \) points without too much difficulty (it can be checked that relation \( {\mathbf {n}}_2 \cdot \sigma '^{ *}_{ n } \equiv _4 n^2 \) holds), this pattern is far from optimal. The question arises whether this complexity could explain the excessive time required by the simulations for this particular value, as highlighted in the sequel, in Table 5.
Observing for \( n = 11 \) that \( n^2 = n\, ( {\mathbf {n}}_2 - 2 ) \) could suggest a possible tessellation of the \( n \times n \) field by some n–prototile. Again, the adjacency matrices \( M_{ 11 } \) are bisymmetric and the simple knowledge of the two first coefficients is needed. An exhaustive examination shows that there exist exactly \( \sum _{ k = 1 }^{ 4} k = 10 \) circulants
$$\begin{aligned} {\mathcal {C}}^{ \, s_\mu \, s_\nu }_{ n } \ : \ \ 1 \le \mu< \frac{ n - 1 }{ 2 } \ ; \ \ \mu < \nu \le \frac{ n - 1 }{ 2 } \ \ \ ( n = 11 ) \end{aligned}$$
that split into two isospectral classes
$$\begin{aligned} \overline{ {\mathcal {C}}}_{ 1 }= & {} \{ \, {\mathcal {C}}^{ 1,2 }_{ 11 } , \ {\mathcal {C}}^{ 1,5 }_{ 11 } , \ {\mathcal {C}}^{ 2,4 }_{ 11 } , \ {\mathcal {C}}^{ 3,4 }_{ 11 } , \ {\mathcal {C}}^{ 3,5 }_{ 11 } \, \} \ ; \\ \overline{ {\mathcal {C}}}_{ 2 }= & {} \{ \, {\mathcal {C}}^{ 1,3 }_{ 11 } , \ {\mathcal {C}}^{ 1,4 }_{ 11 } , \ {\mathcal {C}}^{ 2,3 }_{ 11 } , \ {\mathcal {C}}^{ 2,5 }_{ 11 } , \ {\mathcal {C}}^{ 4,5 }_{ 11 } \, \} \end{aligned}$$
and their circulant matrices are such that
$$\begin{aligned} \uplambda _{ n, \,k }= & {} 2 \cos \left( \frac{ 2 \, \mu \, k \, \pi }{ n } \right) + 2 \cos \left( \frac{ \, 2 \, \nu \, k \, \pi }{ n } \right) \\&\quad ( 0 \le k \le n - 1 ) \ \ \ ( n = 11 ) \end{aligned}$$
where \( \uplambda _{ n, \,k } \) denotes the k–th eigenvalue of matrix \( M_{ n }^{ \, \mu , \, \nu } . \) Dividing the circulants into the two classes \( \overline{ {\mathcal {C}}}_{ 1 }, \overline{ {\mathcal {C}}}_{ 2 } \) results from simple trigonometric transformations. Each class \( \overline{ {\mathcal {C}}}_{ 1 } ( \hbox {resp. } \overline{ {\mathcal {C}}}_{ 2 } ) \) has its own minimum (negative) eigenvalue \( {\overline{\uplambda }}_{ 1 } ( \hbox {resp. } {\overline{\uplambda }}_{ 2 } ) \) and the criterion \( {\overline{\uplambda }}_{ 2 } < {\overline{\uplambda }}_{ 1 } \) yields the min valid patterns in \( \overline{ {\mathcal {C}}}_{ 2 } . \) The whole set of circulant \( {\mathcal {C}}_{ 11 } \) with their respective pattern is displayed in Appendix \( A_2 \) (Figs 24, 25).
Table 2 Exact minimal number \( \sigma _n^{*} \) of “points” expected from the simulation model. A first estimation of the lower bound \( \sigma _{ n } \) is derived from (3). The quantity \( \sigma _{ n }( 0 ) \) denotes the initial value in the heuristic. The sum of cover levels in the penultimate row equals the global cover index \( {\mathbf {n}}_r \cdot \sigma _n^{*} \). All \( \sigma _n^{*} \) result from heuristic except \( \sigma _{ 11 }^{*} \) Resulting either from heuristic or from spectral theory, a set of min valid patterns \( ( 3 \le n < 13 ) \) is displayed in Fig. 7. Each cell is “decorated” from its von Neumann label of Fig. 5. The number of labels at site (x, y) is the cover level \( v_{ i j } = v \, ( x, y ) \) with one color per eigenvalue in \( M_{ {\mathbf {n}}_2 }. \) The patterns are consistent with the results of the simulations in Figs. 3–4. They perfectly match for \( n = 3 \), \( n = 6 \), \( n = 10 \) and now \( n = 11 \). The number \( \sigma _n^{*} \) of points appears in the last row of Table 2.
Equivalence between Min and Max coverage problems
We close this theoretical framework by pointing out a relation between our problems of minimization and maximization. Basically, our min problem could be associated with a physical distancing configuration while our max problem could be associated with a tightly–coupled configuration and the objective function thus becomes the search for the optimal number \( \sigma _{ n } \) of points in both cases. For simplicity we consider the infinite plane and assert thereby that the pattern must be biperiodic. Obviously for the max problem, trying a 4–fold coverage of the whole hull will prove to be impossible due to the repulsive action of the kernel. Therefore the maximal suitable solution is a 3–fold coverage of the whole hull as suggested in Fig. 3 and illustrated on the decorated pattern of Fig. 8. It follows that solving the min–problem in the 1–neighborhood amounts to solve the max–problem in the 2–neighborhood. By extension, we conjecture that there would exist a close relationship between solving the min–problem in a r–neighborhood and solving the max–problem in the \( ( r + 1 ) \)–neighborhood, shortly: \( min_{ r } \cong max_{ r + 1 } \) with of course an additional condition for a finite field.
We refer back to inequalities in (3) and assume that equality holds for \( {\mathbf {n}}_r = {\mathbf {n}}_1. \) On the other hand, let
$$\begin{aligned} \sigma _{ n } = \frac{ n^2 }{ {\mathbf {n}}_1 } = \frac{ \sigma _{ n } + 3 \, ( n^2 - \sigma _{ n } ) }{ {\mathbf {n}}_2 }\,\,\,( {\mathbf {n}}_1 = 5 , {\mathbf {n}}_2 = 13 ) \end{aligned}$$
(4)
that means (i) for the min–problem, all \( n \times n \) sites take on value “1” regardless of their state either of kernel or of hull (ii) for the max–problem, all \( \sigma _{ n } \) kernel points take on value “1” while the remaining \( ( n^2 - \sigma _{ n } ) \) hull sites take on value “3”. It follows that
$$\begin{aligned} {\mathbf {n}}_2 \cdot n^2\,\,=\,\, & {} {\mathbf {n}}_1 \, ( 3\, n^2 - 2 \, \sigma _{ n } ) \quad \Rightarrow \quad n^2 \, ( 3\,{\mathbf {n}}_1 - {\mathbf {n}}_2 ) = 2 \, \sigma _{ n }\\&\cdot {\mathbf {n}}_1 \quad \Rightarrow \quad \sigma _{ n } \cdot {\mathbf {n}}_1 = n^2 \end{aligned}$$
whence the equivalence \( min_{ 1 } \cong max_{2 }. \)