January 01, 1970
Given a discrete rectangle \(R\) of dimensions \(h \times w\), let \(\mathbf{W}^{\mathrm{snake}}_{h \times w}\) be the set of snake-like polyominoes contained in \(R\) represented as binary matrices, i.e. polyominoes whose underlying simple graph is a chain with respect to the 4-adjacency relation. We present an algorithm that generates \(\mathbf{W}^{\mathrm{snake}}_{h \times w}\) for any \(h\) and \(w\). Also, let \(a_{\mathrm{max}}(h, w)\) the maximal area that can be realized by an element of \(\mathbf{W}^{\mathrm{snake}}_{h \times w}\). We provide exact formulas of \(a_{\mathrm{max}}(h, w)\) for \(h \in \{1,2,3,4,5\}\) and \(w \in \mathbb{N}^*\).
Following a previous result ([@blondin2025maximal]) stating that the number of cells of maximal degree \(2\) in a 2D word with a rectangle \(R\) of dimensions \(h \times w\) is at most \(2/3\) the area of \(R\) plus a small constant that depends on \(h\) and \(w\), we now investigate the maximal area of snake polyominoes contained in a rectangle of dimensions \(h \times w\). We show that this family of polyominoes possess sufficient structure to provide explicit expressions for their maximal area in terms of \(h\) and \(w\), for height \(h \in \{1, 2, 3, 4, 5\}\). Our underlying conjecture is that there exists an explicit expression for the maximal area of snake-like polyominoes in any given rectangle of arbitrary dimensions \(h\times w\) that can be expressed in terms of \(h\) and \(w\). Due to space restriction, many proofs of the stated propositions and lemmas have been ommitted, but will be included in an upcoming extended version.
For \(a,b \in \mathbb{N}\), let \(\llbracket a,b \rrbracket = \{n \in \mathbb{N}\mid a \leq n \leq b\}\). Also, if \(a,b,m \in \mathbb{N}\), with \(m > 0\), we write \(a \equiv_m b\) when \(a\) and \(b\) are congruent modulo \(m\). The definitions and notations that are used here for \(2\)-dimensional words is adapted from [@giammarresi1997two; @morita2004two].
Let \(A\) be a finite alphabet and \(h,w \in \mathbb{N}\). A \(2\)-dimensional word, or \(2D\)-word, \(W\) of dimensions \(h \times w\) on \(A\) is a matrix of \(h\) rows and \(w\) columns with entries in \(A\). The dimensions \(h\) and \(w\) are called respectively the height and width of \(W\). The entry of \(W\) at row \(i \in \llbracket 1,h \rrbracket\) and column \(j \in \llbracket 1,w \rrbracket\) is denoted by \(W[i,j]\). Also, given \(i \in \llbracket 1,h \rrbracket\) (resp. \(j \in \llbracket 1,w \rrbracket\)), the \(1\)-dimensional word, \(1D\)-word, obtained by taking the \(i\)-th row (resp. \(j\)-th column) of \(W\) is denoted by \(W[i,\_]\) (resp. \(W[\_\;,j]\)). The 2D word \(W\) is called empty if \(h = 0\) or \(w = 0\). For each \(h \in \mathbb{N}\) (resp. \(w \in \mathbb{N}\)), there exists a unique empty word of height \(h\) (resp. width \(w\)), denoted by \(\varepsilon_{h \times 0}\) (resp. \(\varepsilon_{0 \times w}\)). The set of all 2D words of dimensions \(h \times w\) (resp. of height \(h\), of width \(w\)) on \(A\) is denoted by \(\mathbf{W}^{A}_{h \times w}\) (resp. \(\mathbf{W}^{A}_{h \times \_}\), \(\mathbf{W}^{A}_{\_ \times w}\)). Given \(h,w_1,w_2 \in \mathbb{N}\), the horizontal concatenation of \(U \in \mathbf{W}^{A}_{h \times w_1}\) and \(V \in \mathbf{W}^{A}_{h \times w_2}\) is the word \(U \overt V \in \mathbf{W}^{A}_{h \times (w_1+w_2)}\) defined by \[(U \overt V)[i,j] = \begin{cases} U[i,j], & if j \leq w_1; \\ V[i,j - w_1], & if j > w_1. \end{cases}\] The vertical concatenation \(U\ominus V\in \mathbf{W}^{A}_{(h_1+h_2) \times w}\) of \(U \in \mathbf{W}^{A}_{h_1 \times w}\) and \(V \in \mathbf{W}^{A}_{h_2 \times w}\) is defined similarly for \(h_1,h_2,w \in \mathbb{N}\). Given \(W \in \mathbf{W}^{A}_{h \times w}\) and \(m,n \in \mathbb{Q}\) such that \(mh, nw \in \mathbb{N}\), the \((m,n)\)-th power of \(W\) is the word \(W^{m \times n} \in \mathbf{W}^{A}_{mh \times nw}\) such that \(W^{m \times n}[i,j] = W[(i - 1\bmod h) + 1, (j - 1\bmod w) + 1]\). One might easily prove that \((\mathbf{W}^{A}_{h \times \_}, \overt, \varepsilon_{h \times 0})\) and \((\mathbf{W}^{A}_{\_ \times w}, \ominus, \varepsilon_{0 \times w})\) are monoids. We denote by \(\tau(W)\) the 2D word obtained from \(W\) by transposing its underlying matrix.
Since 2D words can be seen as discrete rectangles filled with letters, we encode for convenience their north, west, east and south sides, or directions, with the alphabet \(D = \{\texttt{n}, \texttt{w}, \texttt{e}, \texttt{s}\}\). Also, for sake of compactness, we write subsets of \(D\) as words, without, braces and commas, so that the subset \(\{\texttt{n},\texttt{e},\texttt{s}\}\) is denoted by \(\texttt{n}\texttt{e}\texttt{s}\). For convenience, we consider two bijective endofunctions on \(D\). The first one is defined by \(\rho(\texttt{n}) = \texttt{w}\), \(\rho(\texttt{w}) = \texttt{s}\), \(\rho(\texttt{e}) = \texttt{n}\) and \(\rho(\texttt{s}) = \texttt{e}\), corresponding geometrically with a quarter-turn counterclockwise rotation. The second one is defined by \(\tau(\texttt{n}) = \texttt{w}\), \(\tau(\texttt{w}) = \texttt{n}\), \(\tau(\texttt{e}) = \texttt{s}\) and \(\tau(\texttt{s}) = \texttt{e}\), corresponding geometrically with a reflection along a diagonal axis from the north-west corner to the south-east corner. Let \(W, U\) be 2D words. \(U\) is a factor of \(W\) when the rectangle of \(U\) is a subrectangle of the rectangle of \(W\). More formally, we say that \(U\) is a factor of \(W\) if there exist 2D words \(R_1\), \(R_2\), \(R_3\), \(C_1\), \(C_2\), \(C_3\), \(W_{11}\), \(W_{12}\), \(W_{13}\), \(W_{21}\), \(W_{23}\), \(W_{31}\), \(W_{32}\) and \(W_{33}\) such that \[\label{eq:factor} \begin{array}{rcccl} & & R_1 \\ & & \ominus\\ W & = & R_2 & = & C_1 \overt C_2 \overt C_3, \\ & & \ominus\\ & & R_3 \\[3mm] \end{array} \quad \begin{array}{rcl} R_1 & = & W_{11} \overt W_{12} \overt W_{13} \\ R_2 & = & W_{21} \overt U \overt W_{23} \\ R_3 & = & W_{31} \overt W_{32} \overt W_{33} \\[3mm] C_1 & = & W_{11} \ominus W_{21} \ominus W_{31} \\ C_2 & = & W_{12} \ominus U \ominus W_{32} \\ C_3 & = & W_{13} \ominus W_{23} \ominus W_{33} \end{array}\tag{1}\] Given any \(H \subseteq D\) and any \(U, W\) such that \(U\) is a factor of \(W\), we say that \(U\) is an \(H\)-factor of \(W\) if the condition \(\texttt{n}\in H\) implies \(R_1\) is empty, the condition \(\texttt{w}\in H\) implies \(C_1\) is empty, the condition \(\texttt{e}\in H\) implies \(C_3\) is empty and the condition \(\texttt{s}\in H\) implies \(R_3\) is empty. Roughly speaking, \(U\) is an \(H\)-factor of \(W\) if, for each \(d \in H\), \(U\) is on the border of \(W\) in the direction \(d\).
From now on, we fix the alphabet \(A= \{\square, \blacksquare\}\). Given \(W \in \mathbf{W}^{A}_{h \times w}\), the graph of \(W\), denoted by \(G[W]\), is the subgraph of the grid graph \(G_{h \times w}\) induced by \(\{(i,j) \mid W[i,j] = \blacksquare\}\). Any ordered pair \((i,j) \in \llbracket 1,h \rrbracket \times \llbracket 1,w \rrbracket\) is called a cell of \(W\). A cell \((i,j)\) is on the \(\texttt{n}\)-boundary (resp. \(\texttt{w}\)-boundary, \(\texttt{e}\)-boundary, \(\texttt{s}\)-boundary) of \(W\) if \(i = 1\) (resp. \(j = 1\), \(j = w\), \(i = h\)), or simply on the boundary of \(W\) if it is on the \(d\)-boundary of \(W\), for some \(d \in D\). Otherwise \((i,j)\) is called an internal cell. We say that the cell \((i,j)\) of \(W\) is occupied if \(W[i,j] = \blacksquare\) and that it is empty if \(W[i,j] = \square\). The number of occupied cells in \(W\) is denoted \(|W|_{\blacksquare}\) and is also called the area of \(W\). The neighborhood of \((i,j)\) in \(W\) is defined by \[N_W(i,j) = \{(i',j') \in \llbracket 1,h \rrbracket \times \llbracket 1,w \rrbracket \mid (i - i')^2 + (j - j')^2 = 1\},\] while the degree of \((i,j)\) in \(W\) is \(\deg_W(i,j) = \mathrm{Card}\{(i',j') \in N_W(i,j)~:~W[i',j'] = \blacksquare\}\). A connected component \(C \subseteq \llbracket 1,h \rrbracket \times \llbracket 1,w \rrbracket\) of \(G[W]\) is called a component of \(W\). The number of components of \(W\) is denoted by \(c(W)\). We say that \(W\) is \(\texttt{n}\)-inscribed (resp. \(\texttt{w}\)-inscribed, \(\texttt{e}\)-inscribed, \(\texttt{s}\)-inscribed) if \(\blacksquare\) occurs in \(W[1,\_]\) (resp. \(W[\_,1]\), \(W[\_,w]\), \(W[h,\_]\)). Finally, we say that \(W\) is inscribed if it is \(d\)-inscribed for all \(d \in D\).
A snake word is an inscribed binary word \(W\) on \(A\) such that \(G[W]\) is a chain. The set of all snake words of dimensions \(h \times w\) on \(A\) is denoted by \(\mathbf{W}^{\mathrm{snake}}_{h \times w}\). Similarly, a snake forest word is a binary word \(W\) on \(A\) such that \(G[W]\) is a forest of chains. A binary word \(W\) is called a snake factor if there exists a snake word \(W'\) such that \(W\) is a factor of \(W'\). The set of all snake factors of dimensions \(h \times w\) on \(A\) is denoted by \(\mathbf{W}^{\mathrm{s-f}}_{h \times w}\). The following two observations are immediate:
Proposition 1.
A snake factor is a snake forest word.
There exist snake forest words that are not snake factors.
A sided word of dimensions \(h \times w\) is a pair \(S = (W, H)\), where \(W \in \mathbf{W}^{A}_{h \times w}\) and \(H \subseteq D\) is called the hull of \(S\). Without ambiguity, the area and number of components are naturally extended from words to sided words by setting \(|S|_{\blacksquare} = |W|_{\blacksquare}\) and \(c(S) = c(W)\). Similarly, the definitions of height, width, cell, degree of a cell, component, snake word, snake forest and inscription on 2D words are naturally extended to sided words.
The definitions of horizontal concatenation, vertical concatenation, factor and snake factor for sided words, however, need to be adjusted. Let \(S = (W, H)\) and \(S' = (W', H')\) be two sided words. Then the horizontal concatenation of \(S\) and \(S'\) is the partial binary operations \(S \overt S' = (W \overt W', H \cup H')\) defined whenever \(S\) and \(S'\) have the same height, \(\texttt{e}\notin H\), \(\texttt{w}\notin H'\) and \(H - \{\texttt{w}\} = H' - \{\texttt{e}\}\). The vertical concatenation \(S \ominus S'\) of \(S\) and \(S'\) is defined similarly. We say that \(S\) is a factor of \(S'\) if \(H \subseteq H'\) and \(W\) is an \(H\)-factor of \(W'\). Finally, \(S = (W, H)\) is called a snake factor if there exists an inscribed sided word \(S' = (W', D)\) such that \(S\) is a factor of \(S'\) and \(W\) is a snake factor of \(W'\).
Let \(S = (W, H)\) be a sided word and \((i,j)\) a cell of \(S\). The number of outside liberties of \((i,j)\) in \(S\), denoted by \(\ell^{\mathrm{out}}_S(i,j)\), is defined by \[\begin{array}{rcl} \ell^{\mathrm{out}}_S(i,j) & = & \mathbb{I}\left(i = 1\right)\mathbb{I}\left(\texttt{n}\notin H\right) + \mathbb{I}\left(j = 1\right)\mathbb{I}\left(\texttt{w}\notin H\right) \\ & + & \mathbb{I}\left(i = h\right)\mathbb{I}\left(\texttt{s}\notin H\right) + \mathbb{I}\left(j = w\right)\mathbb{I}\left(\texttt{e}\notin H\right), \end{array}\] where \(\mathbb{I}\left(\cdot\right)\) is the usual indicator function, i.e. \(\mathbb{I}\left(p\right) = 1\) if \(p\) is true, \(0\) otherwise. Similarly, the number of liberties of \((i,j)\) in \(S\), denoted by \(\ell_S(i,j)\), is defined by \[\ell_S(i,j) = \max(\min(\ell^{\mathrm{out}}_S(i,j), 2 - \deg_S(i, j)), 0).\] It follows from the definition that \(\ell_S(i,j) \in \{0, 1, 2\}\) if \((i,j)\) is a boundary cell, while \((i,j)\) is an internal cell implies that \(\ell_S(i,j) = 0\). Intuitively, the number of liberties of a cell is the maximum number of its edges that can be connected to other cells without creating cells of degree greater than \(2\). Let \(C\) be a component of \(S\) and define the number of liberties of \(C\) as \(\ell_S(C) = \sum_{(i,j) \in C} \ell_S(i,j)\). Then \(C\) is called unconnectable (resp. terminal, crossing) if \(\ell_S(C) = 0\) (resp. \(\ell_S(C) = 1\), \(\ell_S(C) = 2\)). Moreover, given \(d \in D\), we say that \(C\) is connectable on \(d\) in \(S\) if there exists a \(d\)-boundary cell \((i,j) \in C\) such that \(\ell_S(i,j) > 0\). The number of unconnectable, crossing, terminal components of \(S\) are respectively denoted \(u(S)\). \(x(S)\), \(t(S)\). For each \(d \in D\), the number of terminal components connectable on \(d\) is denoted by \(t_d(S)\). The first main result of this extended abstract is a characterization of sided snake factors:
Theorem 1. Let \(S = (W, H)\) be a sided word. Then \(S\) is a sided snake factor if and only if \(S\) is a sided snake forest word, \(t(S) \leq 2\), and exactly one of the following conditions holds:
\(H = D\), \(S\) is inscribed and \(c(S) = 1\).
\(H = D - \{d\}\) for some \(d\in D\), \(S\) is \(\rho^2(d)\)-inscribed and \(u(S) = 0\).
\(|H| \in \{0, 1\}\) or \(H = \{d, \rho(d)\}\) for some \(d\), and \(u(S) = 0\).
\(H = D - \{d, \rho^2(d)\}\) for some \(d\), \(u(S) = 0\), \(S\) has at least one crossing component connectable on both \(d\) and \(\rho^2(d)\), and the condition \(t(S) = 2\) implies \(t_d(S), t_{\rho^2(d)}(S) \equiv_2 x(S)\).
In order to prove Theorem 1, we need the following lemmas:
Lemma 1. Let \(S = (W,H)\) be a sided snake factor and \(C\) a terminal component of \(S\). Then exactly one of the following two conditions holds:
\(S\) has a unique internal cell \((i,j) \in C\) such that \(\deg_S(i,j) = 1\).
\(S\) has exactly one boundary cell \((i,j) \in C\) such that \(\deg_S(i,j) = 0\) and \(\ell^{\mathrm{out}}_S(i,j) = 1\).
The unique cell satisfying Condition (1) or (2) is called the terminal* cell of \(C\).*
The following observation is well-known in graph theory:
Lemma 2. Let \(S = (W,H)\) be a sided snake word and \(C\) the only component of \(S\). Then for any pair of cells \(c\) and \(c'\) of \(C\), there exists a unique chain between \(c\) and \(c'\).
We are now ready to prove theorem 1.
Proof of Theorem 1. \((\Rightarrow)\) Assume that \(S = (W,H)\) is a sided snake factor. Then there exists an inscribed sided snake word \(S' = (W',D)\) such that \(S\) is a factor of \(S'\). Let \(G = G[W]\) and \(G' = G[W']\). First, since \(G\) is a subgraph of \(G'\), we conclude that \(G\) is a snake forest, so that \(S\) is a sided snake forest word. Next, we cannot have \(t(S) \geq 3\): if it was the case, by Lemma 1, \(G'\) would have at least \(3\) vertices of degree \(\leq 1\), contradicting the fact that \(G'\) is a chain. Hence, \(t(S) \leq 2\). To conclude this part, we consider four cases.
Case \(H = D\). Since \(S\) is a factor of \(S'\), by definition of \(H\)-factor, we conclude that \(W = W'\), which means that \(S = S'\) is a snake word. Hence, \(c(S) = 1\).
Case \(H = D - \{d\}\). Then \(S\) is \(\rho^2(d)\)-inscribed: if it was not the case, then \(S'\) would not be inscribed. Moreover, we cannot have \(u(S) > 0\): if it was the case, then we would have \(c(S') > 1\).
Case \(|H| \in \{0, 1\}\) or \(H = \{d, \rho(d)\}\). As for the preceding case, the assumption \(u(S) > 0\) implies \(c(S') > 1\), a contradiction.
Case \(H = D - \{d, \rho^2(d)\}\). The fact that \(u(S) = 0\) follows from an argument similar to those of the two previous cases. Also, \(S\) must have at least one crossing component connectable on both \(d\) and \(\rho^2(d)\), otherwise, \(S'\) would have at least two components, on each open sides of \(S\). Finally, assume that \(t(S) = 2\) and let \(t = (t_d(S), t_{\rho^2(d)}(S))\), which implies \(t \in \{(0, 2), (1, 1), (2, 0)\}\). If \(t = (1, 1)\), then \(x(S)\) must be odd. Indeed, by Lemma 2, there exists a unique chain between the two terminal cells of the only component of \(S'\). Since the terminal components of \(S\) are connected on opposite sides of \(S\) , they must cross \(S\) an odd number of times. Using a similar argument, if \(t \in \{(0, 2), (2, 0)\}\), then \(x(S)\) must be even. Since all cases have been covered, the result follows.
\((\Leftarrow)\) Due to space restriction, we only provide an idea of the proof. We need to prove that there exists an inscribed sided word \(S' = (W',D)\) such that \(S\) is a factor of \(S'\) and \(W\) is a snake factor of \(W'\). There are four cases to consider, according to which condition between (i) and (iv) holds.
Case (i). If suffices to take \(S' = S\).
Case (ii). If suffices to connect all components of \(S\) by extending it on its only open side, by making sure that the result is \(d\)-inscribed, for all \(d \in D - \{\rho^2(d)\}\).
Case (iii). Similarly to case (ii), il suffices to connect all components of \(S\) and by making sure that the result is \(d\)-inscribed in all directions.
Case (iv). In that case, the inscription is easily obtained in all directions. The connectivity is guaranteed by the conditions on the components: the existence of at least one crossing component allows to connect each side, and if there are two terminal components, then they can be connected consistently with the crossing components, thanks to their equivalence modulo \(2\). ◻
Let \(\mathbf{S}^{\mathrm{s-f}}_{h,w,a,H}\) be the set of all sided snake factors of dimensions \(h \times w\), of area \(a\) and of hull \(H\). We were able to use Algorithm 1 to generate \(\mathbf{S}^{\mathrm{s-f}}_{h,w,a,H}\) for small dimensions \(h \times w\).
We need additional definitions and notation. First, let \(S = (W, H) \in \mathbf{S}^{\mathrm{s-f}}_{h,w,H}\). We denote by \(|S|_{\square}\) the \(4\)-tuple \((n, w, e, s)\) indicating, for each side \(d\), the number of empty cells of \(S\) located on the side \(d\) boundary of \(S\) if \(d \in H\), and we write \(\_\) otherwise. Similarly, we denote by \(|S|_{\deg=2}\) the \(4\)-tuple \((n, w, e, s)\) indicating, for each side \(d\), the number of cells of \(S\), whose degree in \(S\) is \(2\), located on the side \(d\) boundary of \(S\) if \(d \in H\), and we write \(\_\), otherwise. For any \(h, w \in \mathbb{N}^*\) and \(H \subseteq D\), let \(\mathbf{S}^{\mathrm{s-f}}_{h,w,H}\) be the set of all sided snake factors of dimensions \(h \times w\) and of hull \(H\), whatever their area, and let \(a_{\mathrm{max}}(h, w, H)\) be the maximal area that can be realized by a sided snake factor of dimensions \(h \times w\) with hull \(H\), i.e. \(a_{\mathrm{max}}(h,w,H) = \max\{|S|_{\blacksquare} : S \in \mathbf{S}^{\mathrm{s-f}}_{h,w,H}\}\). The following observation is immediate:
Lemma 3. Let \(h,w,w_1,w_2 \in \mathbb{N}^*\), with \(w = w_1 + w_2\), and \(H \subseteq D\). Then \[a_{\mathrm{max}}(h,w,H) \leq a_{\mathrm{max}}(h,w_1,H - \{\texttt{e}\}) + a_{\mathrm{max}}(h,w_2,H - \{\texttt{w}\}).\]
Algorithm 1 can be helpful in establishing exact values or upper bounds of \(a_{\mathrm{max}}(h, w, H)\). More precisely:
Lemma 4. Let \(h,w,a \in \mathbb{N}^*\) and \(H \subseteq D\), where \(h + w - 1 \leq a \leq hw\). If \(\mathbf{S}^{\mathrm{s-f}}_{h,w,a,H} \neq \emptyset\) and \(\mathbf{S}^{\mathrm{s-f}}_{h,w,a + 1,H} = \emptyset\), then \(a_{\mathrm{max}}(h, w, H) = a\).
As a consequence, we obtain the following observations for \(h = 1, 2, 3\).
Lemma 5. Let \(w \in \mathbb{N}^*\) and \(H \subseteq D\). Then the following identities hold:
\(a_{\mathrm{max}}(1, 1, H) = 1\);
\(a_{\mathrm{max}}(2, 1, H) = 2\), \(a_{\mathrm{max}}(2, 2, H) = 3\);
\(a_{\mathrm{max}}(2, w, \texttt{n}\texttt{s}) \leq 3w/2\) if \(w \bmod 2 = 0\);
\(a_{\mathrm{max}}(3, 1, H) = 3\), \(a_{\mathrm{max}}(3, 2, \texttt{n}\texttt{w}\texttt{s}) = a_{\mathrm{max}}(3, 2, \texttt{n}\texttt{e}\texttt{s}) = 5\), \(a_{\mathrm{max}}(3, 2, \texttt{n}\texttt{s}) = 4\);
\(a_{\mathrm{max}}(3, w, \texttt{n}\texttt{s}) \leq 4w/2\) if \(w \bmod 2 = 0\);
Proof. (i), (ii) and (iv) follow from direct observation, Algorithm 1 and Lemma 4.
(iii) follows from (ii), Lemma 3 and from induction on \(w / 2\).
(v) follows from (iv), Lemma 3 and from induction on \(w / 2\). ◻
The cases \(h = 4\) and \(h = 5\) show more complex periodicity patterns:
Lemma 6. For any \(w \in \mathbb{N}^*\), \[a_{\mathrm{max}}(4, w, \texttt{n}\texttt{w}\texttt{s}) \leq \begin{cases} (8w + 4)/3, & if w = 1; \\ (8w + 3)/3, & if w \bmod 3 = 0; \\ (8w + 1)/3, & if w \bmod 3 = 1; \\ (8w + 2)/3, & if w \bmod 3 = 2. \end{cases} \enskip a_{\mathrm{max}}(5, w, \texttt{n}\texttt{w}\texttt{s}) \leq \begin{cases} (22w + 13)/7, & if w \in \{1,8\}; \\ (22w + 15)/7, & if w = 6; \\ (22w + 14)/7, & if w = 7; \\ (22w + 7)/7, & if w \bmod 7 = 0; \\ (22w + 6)/7, & if w \bmod 7 = 1; \\ (22w + 12)/7, & if w \bmod 7 = 2; \\ (22w + 11)/7, & if w \bmod 7 = 3; \\ (22w + 10)/7, & if w \bmod 7 = 4; \\ (22w + 9)/7, & if w \bmod 7 = 5; \\ (22w + 8)/7, & if w \bmod 7 = 6. \end{cases}\]
Let \(a_{\mathrm{max}}(h, w)\) the the maximal area that can be realized by a snake-like polyomino inscribed in a rectangle \(h \times w\). Also, for \(w \in \mathbb{N}^*\), let
2 \[\begin{align} \hat{a}_{\mathrm{max}}(1, w) & = w \\ \hat{a}_{\mathrm{max}}(2, w) & = \begin{cases} 3w / 2, & if w \bmod 2 = 0; \\ (3w + 1) / 2, & if w \bmod 2 = 1; \end{cases} \\ \hat{a}_{\mathrm{max}}(3, w) & = \begin{cases} 2w + 1, & if 1 \leq w \leq 5; \\ 2w + 2, & if w \geq 6. \end{cases} \\ \hat{a}_{\mathrm{max}}(4, w) & = \begin{cases} (8w + 1)/3, & if w = 4; \\ (8w + 3)/3, & if w \bmod 3 = 0; \\ (8w + 4)/3, & if w \bmod 3 = 1; \\ (8w + 2)/3, & if w \bmod 3 = 2. \end{cases} \end{align}\] \[\begin{align} \hat{a}_{\mathrm{max}}(5, w) & = \begin{cases} 3w + 4, & if w \in \{10, 11, 12\}; \\ (22w + 14)/7, & if w \bmod 7 = 0; \\ (22w + 13)/7, & if w \bmod 7 = 1; \\ (22w + 12)/7, & if w \bmod 7 = 2; \\ (22w + 11)/7, & if w \bmod 7 = 3; \\ (22w + 10)/7, & if w \bmod 7 = 4; \\ (22w + 9)/7, & if w \bmod 7 = 5; \\ (22w + 15)/7, & if w \bmod 7 = 6. \end{cases} \end{align}\]
The main result of this extended abstract is the following.
Theorem 2. For \(1 \leq h \leq 5\) and \(w \in \mathbb{N}^*\), \(a_{\mathrm{max}}(h, w) = \hat{a}_{\mathrm{max}}(h, w)\).
The proof of Theorem 2 is divided in two cases, that are addressed in the following two lemmas.
Lemma 7. For \(1 \leq h \leq 5\) and \(w \in \mathbb{N}^*\), \(a_{\mathrm{max}}(h, w) \geq \hat{a}_{\mathrm{max}}(h, w)\).
Proof. It suffices to exhibit families of snakes having area \(\hat{a}_{\mathrm{max}}(h, w)\) for \(1 \leq h \leq 5\) and for any \(w \in \mathbb{N}^*\). Let \[S_{1,w} = \blacksquare^{1 \times w}, \quad S_{2,w} = \left(\begin{array}{@{}c@{}c@{}c@{}c@{}} \blacksquare& \blacksquare& \blacksquare& \square\\[-2mm] \blacksquare& \square& \blacksquare& \blacksquare \end{array}\right)^{1 \times (w / 4)} \quad \text{and} \quad S_{3,w} = \begin{cases} \left(\begin{array}{@{}c@{}c@{}c@{}c@{}c@{}c@{}} \blacksquare& \blacksquare& \blacksquare& \blacksquare& \square& \\[-2.5mm] \blacksquare& \square& \square& \blacksquare& \blacksquare& \\[-2.5mm] \blacksquare& \blacksquare& \blacksquare& \square& \blacksquare& \end{array}\right)^{1 \times (w / 5)}, & if 1 \leq w \leq 5; \\ \begin{array}{@{}c@{}c@{}c@{}c@{}c@{}} \blacksquare& \blacksquare& \blacksquare& \square& \blacksquare\\[-2.5mm] \blacksquare& \square& \blacksquare& \blacksquare& \square\\[-2.5mm] \blacksquare& \blacksquare& \square& \blacksquare& \blacksquare \end{array} \left(\begin{array}{@{}c@{}c@{}} \blacksquare\\[-2.5mm] \square\\[-2.5mm] \blacksquare \end{array}\right)^{1 \times (w - 6)} \begin{array}{@{}c@{}c@{}} \blacksquare\\[-2.5mm] \blacksquare\\[-2.5mm] \blacksquare \end{array}, & if w \geq 6; \end{cases}\] Moreover, let \[\begin{align} S_{4,w} & = \begin{cases} A_4^{1 \times (w/2)}, & if 1 \leq w \leq 2; \\ A_4 (B_4 B_4^h)^{1 \times((w-2)/6)}, & if 3 \leq w \leq 6 or w \bmod 3 \neq 1; \\ A_4 (B_4 B_4^h)^{1 \times ((w-7)/6)} C_4, & if w \geq 7 and w \bmod 6 = 1; \\ A_4 (B_4 B_4^h)^{1 \times ((w-7)/6)} B_4 C_4^h, & if w \geq 7 and w \bmod 6 = 4. \end{cases} \end{align}\] where \[A_4 = \begin{array}{@{}c@{}c@{}} \blacksquare& \blacksquare\\[-2mm] \blacksquare& \square\\[-2mm] \blacksquare& \square\\[-2mm] \blacksquare& \blacksquare \end{array}, \quad B_4 = \begin{array}{@{}c@{}c@{}c@{}} \blacksquare& \blacksquare& \blacksquare\\[-2mm] \square& \square& \square\\[-2mm] \blacksquare& \blacksquare& \blacksquare\\[-2mm] \blacksquare& \square& \blacksquare \end{array}, \quad B_4^h = \begin{array}{@{}c@{}c@{}c@{}} \blacksquare& \square& \blacksquare\\[-2mm] \blacksquare& \blacksquare& \blacksquare\\[-2mm] \square& \square& \square\\[-2mm] \blacksquare& \blacksquare& \blacksquare \end{array}, \quad C_4 = \begin{array}{@{}c@{}c@{}c@{}c@{}c@{}} \blacksquare& \square& \blacksquare& \blacksquare& \blacksquare\\[-2mm] \square& \blacksquare& \blacksquare& \square& \blacksquare\\[-2mm] \blacksquare& \blacksquare& \square& \blacksquare& \blacksquare\\[-2mm] \blacksquare& \square& \blacksquare& \blacksquare& \square \end{array} \quad and \quad C_4^h = \begin{array}{@{}c@{}c@{}c@{}c@{}c@{}} \blacksquare& \square& \blacksquare& \blacksquare& \square\\[-2mm] \blacksquare& \blacksquare& \square& \blacksquare& \blacksquare\\[-2mm] \square& \blacksquare& \blacksquare& \square& \blacksquare\\[-2mm] \blacksquare& \square& \blacksquare& \blacksquare& \blacksquare \end{array}.\] Finally, let \[\begin{align} S_{5,w} & = \begin{cases} A_5, & if w = 1; \\ B_5 C_5^{1 \times (w-2)} B_5^h, & if 2 \leq w \leq 5; \\ B_5 C_5^{1 \times (w-6)} D_5^r, & if 6 \leq w \leq 9; \\ D_5 C_5^{1 \times (w-10)} D_5^r, & if 10 \leq w \leq 19; \\ E_5 C_5^{1 \times m} F_5 (G_5 G_5^h)^{1 \times n} H_5^h, & if w \geq 20 and 0 \leq w \bmod 14 \leq 6; \\ E_5 C_5^{1 \times m} F_5 (G_5 G_5^h)^{1 \times n} H_5, & if w \geq 20 and 7 \leq w \bmod 14 \leq 13. \end{cases} \end{align}\] where \(m = (w+1) \bmod 7 + 1\), \(n = (w-m-12)/14\) and \[A_5 = \begin{array}{@{}c@{}} \blacksquare\\[-2mm] \blacksquare\\[-2mm] \blacksquare\\[-2mm] \blacksquare\\[-2mm] \blacksquare \end{array}, \enskip B_5 = \begin{array}{@{}c@{}} \blacksquare\\[-2mm] \square\\[-2mm] \blacksquare\\[-2mm] \blacksquare\\[-2mm] \blacksquare \end{array}, \enskip B_5^h = \begin{array}{@{}c@{}} \blacksquare\\[-2mm] \blacksquare\\[-2mm] \blacksquare\\[-2mm] \square\\[-2mm] \blacksquare \end{array}, \enskip C_5 = \begin{array}{@{}c@{}} \blacksquare\\[-2mm] \square\\[-2mm] \blacksquare\\[-2mm] \square\\[-2mm] \blacksquare \end{array}, \enskip D_5 = \begin{array}{@{}c@{}c@{}c@{}c@{}c@{}} \blacksquare& \blacksquare& \square& \blacksquare& \blacksquare\\[-2mm] \blacksquare& \square& \blacksquare& \blacksquare& \square\\[-2mm] \blacksquare& \square& \blacksquare& \square& \blacksquare\\[-2mm] \blacksquare& \square& \blacksquare& \square& \blacksquare\\[-2mm] \blacksquare& \blacksquare& \blacksquare& \square& \blacksquare \end{array}, \enskip D_5^r = \begin{array}{@{}c@{}c@{}c@{}c@{}c@{}} \blacksquare& \square& \blacksquare& \blacksquare& \blacksquare\\[-2mm] \blacksquare& \square& \blacksquare& \square& \blacksquare\\[-2mm] \blacksquare& \square& \blacksquare& \square& \blacksquare\\[-2mm] \square& \blacksquare& \blacksquare& \square& \blacksquare\\[-2mm] \blacksquare& \blacksquare& \square& \blacksquare& \blacksquare \end{array}, \enskip E_5 = \begin{array}{@{}c@{}c@{}c@{}c@{}c@{}} \blacksquare& \blacksquare& \blacksquare& \square& \blacksquare\\[-2mm] \blacksquare& \square& \blacksquare& \blacksquare& \blacksquare\\[-2mm] \blacksquare& \square& \square& \square& \square\\[-2mm] \blacksquare& \square& \blacksquare& \blacksquare& \blacksquare\\[-2mm] \blacksquare& \blacksquare& \blacksquare& \square& \blacksquare \end{array},\] \[F_5 = \begin{array}{@{}c@{}c@{}} \square& \blacksquare\\[-2mm] \blacksquare& \blacksquare\\[-2mm] \blacksquare& \square\\[-2mm] \square& \square\\[-2mm] \blacksquare& \blacksquare \end{array}, \enskip G_5 = \begin{array}{@{}c@{}c@{}c@{}c@{}c@{}c@{}c@{}} \blacksquare& \blacksquare& \blacksquare& \blacksquare& \square& \blacksquare& \blacksquare\\[-2mm] \square& \square& \square& \blacksquare& \blacksquare& \blacksquare& \square\\[-2mm] \blacksquare& \blacksquare& \blacksquare& \square& \square& \square& \square\\[-2mm] \blacksquare& \square& \blacksquare& \square& \blacksquare& \blacksquare& \blacksquare\\[-2mm] \blacksquare& \square& \blacksquare& \blacksquare& \blacksquare& \square& \blacksquare \end{array}, \enskip G_5^h = \begin{array}{@{}c@{}c@{}c@{}c@{}c@{}c@{}c@{}} \blacksquare& \square& \blacksquare& \blacksquare& \blacksquare& \square& \blacksquare\\[-2mm] \blacksquare& \square& \blacksquare& \square& \blacksquare& \blacksquare& \blacksquare\\[-2mm] \blacksquare& \blacksquare& \blacksquare& \square& \square& \square& \square\\[-2mm] \square& \square& \square& \blacksquare& \blacksquare& \blacksquare& \square\\[-2mm] \blacksquare& \blacksquare& \blacksquare& \blacksquare& \square& \blacksquare& \blacksquare \end{array}, \enskip H_5 = \begin{array}{@{}c@{}c@{}c@{}c@{}c@{}} \blacksquare& \blacksquare& \blacksquare& \blacksquare& \blacksquare\\[-2mm] \square& \square& \square& \square& \blacksquare\\[-2mm] \blacksquare& \blacksquare& \blacksquare& \square& \blacksquare\\[-2mm] \blacksquare& \square& \blacksquare& \square& \blacksquare\\[-2mm] \blacksquare& \square& \blacksquare& \blacksquare& \blacksquare \end{array}, \enskip H_5^h = \begin{array}{@{}c@{}c@{}c@{}c@{}c@{}} \blacksquare& \square& \blacksquare& \blacksquare& \blacksquare\\[-2mm] \blacksquare& \square& \blacksquare& \square& \blacksquare\\[-2mm] \blacksquare& \blacksquare& \blacksquare& \square& \blacksquare\\[-2mm] \square& \square& \square& \square& \blacksquare\\[-2mm] \blacksquare& \blacksquare& \blacksquare& \blacksquare& \blacksquare \end{array}.\] Then, for any \(h = 1, 2, 3, 4, 5\) and \(w \in \mathbb{N}^*\), the dimensions of \(S_{h,w}\) are \(h \times w\) and \(|S_{h,w}|_{\blacksquare} = \hat{a}_{\mathrm{max}}(h, w)\). Moreover, by using induction on \(w\), we have that \(S_{h,w}\) is a snake, concluding the proof. ◻
There is one last result to prove.
Lemma 8. For \(1 \leq h \leq 5\) and \(w \in \mathbb{N}\), \(a_{\mathrm{max}}(h, w) \leq \hat{a}_{\mathrm{max}}(h, w)\).
Proof. Let \(S \in \mathbf{S}^{\mathrm{s-f}}_{h,w,D}\) with \(|S|_{\blacksquare} = a_{\mathrm{max}}(h,w)\), i.e. \(S\) is a sided snake of maximal area inscribed in a rectangle of dimensions \(h \times w\). We show that \(|S|_{\blacksquare} \leq \hat{a}_{\mathrm{max}}(h, w)\).
Case \(h = 1\). It suffices to notice that \(|S|_{\blacksquare} \leq w = \hat{a}_{\mathrm{max}}(1,w)\).
Case \(h = 2\). The cases \(w = 1\) and \(w = 2\) can be proved by exhaustive verification. Now, assume that \(w \geq 3\). Let \(w_3 = 1 + (w - 1) \bmod 2\) and \(w_2 = w - w_3 - 2\). Notice that \(w_2 \bmod 2 = 0\). Then \(S = S_1S_2S_3\), for some \(S_1 \in \mathbf{S}^{\mathrm{s-f}}_{2,2,\texttt{n}\texttt{w}\texttt{s}}\), \(S_2 \in \mathbf{S}^{\mathrm{s-f}}_{2,w_2,\texttt{n}\texttt{s}}\) and \(S_3 \in \mathbf{S}^{\mathrm{s-f}}_{2,w_3,\texttt{n}\texttt{e}\texttt{s}}\). By Lemma 5(ii)-(iii), \[\begin{align} |S|_{\blacksquare} & = |S_1|_{\blacksquare} + |S_2|_{\blacksquare} + |S_3|_{\blacksquare} \\ & \leq 3 + 3w_2/2 + (w_3 + 1) = (3w + 2 - w_3)/2 = \begin{cases} 3w/2, & if w \bmod 2 = 0; \\ (3w + 1)/2, & if w \bmod 2 = 1. \end{cases} \\ & = a_{\mathrm{max}}(2, w) \end{align}\]
Case \(h = 3\). This case follows from [@blondin2025maximal]. However, for sake of consistency, we provide an alternate proof based on the tools introduced in the previous pages. First, the cases \(1 \leq w \leq 5\) can be proved by exhaustive verification. Now, assume that \(w \geq 6\). Let \(w_3 = 1 + (w - 1) \bmod 2\) and \(w_2 = w - w_3 - 1\). Notice that \(w_2 \bmod 2 = 0\). Then \(S = S_1S_2S_3\), for some \(S_1 \in \mathbf{S}^{\mathrm{s-f}}_{3,1,\texttt{n}\texttt{w}\texttt{s}}\), \(S_2 \in \mathbf{S}^{\mathrm{s-f}}_{3,w_2,\texttt{n}\texttt{s}}\) and \(S_3 \in \mathbf{S}^{\mathrm{s-f}}_{3,w_3,\texttt{n}\texttt{e}\texttt{s}}\). By Lemma 5(ii)-(iii), \[\begin{align} |S|_{\blacksquare} & = |S_1|_{\blacksquare} + |S_2|_{\blacksquare} + |S_3|_{\blacksquare} \leq 3 + 4w_2/2 + (2w_3 + 1) = 2w + 2 = a_{\mathrm{max}}(3, w) \end{align}\]
Case \(h = 4\). The cases \(1 \leq w \leq 5\) can be proved by exhaustive verification. Now, assume that \(w \geq 6\). Then \(S = S_1S_2\), for some \(S_1 \in \mathbf{S}^{\mathrm{s-f}}_{4,w - 4,\texttt{n}\texttt{w}\texttt{s}}\) and \(S_2 \in \mathbf{S}^{\mathrm{s-f}}_{4,4,\texttt{n}\texttt{e}\texttt{s}}\). By Lemma 6(iv), \[\begin{align} |S|_{\blacksquare} = |S_1|_{\blacksquare} + |S_2|_{\blacksquare} & \leq \left(\begin{cases} (8(w - 4) + 3)/3, & if (w - 4) \bmod 3 = 0; \\ (8(w - 4) + 1)/3, & if (w - 4) \bmod 3 = 1; \\ (8(w - 4) + 2)/3, & if (w - 4) \bmod 3 = 2. \end{cases}\right) + 11 \\ & = \begin{cases} (8w + 4)/3, & if w \bmod 3 = 1; \\ (8w + 2)/3, & if w \bmod 3 = 2; \\ (8w + 3)/3, & if w \bmod 3 = 0. \end{cases} \end{align}\]
Case \(h = 5\). The structure of the proof is similar to the case \(h = 4\), but requires to study more cases. In particular, one shows that all concatenations of maximal elements of \(\mathbf{S}^{\mathrm{s-f}}_{5,w,\texttt{n}\texttt{w}\texttt{s}}\) and \(\mathbf{S}^{\mathrm{s-f}}_{5,7,\texttt{n}\texttt{s}}\) yield invalid concatenations for small values of \(w\), and that maximal elements of \(\mathbf{S}^{\mathrm{s-f}}_{5,w,\texttt{n}\texttt{w}\texttt{s}}\) for any \(w\) satisfy some boundary conditions. ◻
Computations not reported here for larger values of \(h\) suggest that similar formulas might exist for any \(h\). Hence, we believe that the results presented in the previous sections introduce arguments that can be extended for the area of snake-like polyominoes in any rectangle.