1. Introduction
A polyomino is constructed from a finite number of edge-connected cells (or ‘squares’) in the plane. The n-ominoes are polyominoes with area n and we refer to the cases for as monominoes, dominoes, triminoes, tetrominoes, pentominoes and hexominoes, respectively. We focus on free polyominoes, which we can rotate, reflect (‘flip’), or translate. For example, there are exactly 12 free pentominoes. We can rotate or translate, but not reflect, one-sided polyominoes, while the fixed polyominoes can only be translated.
There is a large amount of literature on the mathematics of polyominoes. Golomb wrote a classic work on polyominoes in a 1965 book [
1], which was revised and reissued in 1994 [
2]. Many other mathematicians and computer scientists have since studied tiling with polyominoes. For example, see the comprehensive text by Grünbaum and Shephard [
3] (revised and updated in 2016 [
4]) and the many references there. The recreational mathematics of tiling with polyominoes became popular after a series of articles in
Scientific American by Martin Gardner [
5,
6,
7], which also stimulated serious mathematical research into this area.
In 1954, Golomb [
8] introduced the following famous problem, discussed by others [
9,
10,
11], which motivates the type of colouring arguments used in this article. Remove the two opposite corners of an
chessboard (see
Figure 1). Can the 62 squares be exactly covered by 31 dominoes, with both orientations permitted?
Each domino placed on the chessboard covers exactly one black square and one white square. Thus, if the dominoes exactly tile the board they must cover a total of 31 black squares and 31 white squares. However, the ‘mutilated chessboard’ has 32 white squares and 30 black squares. Thus, the answer is clearly ‘no’.
The focus of this article is the decision problem of whether or not a given set of polyominoes tiles a finite region of the plane called the ‘target region’. The general decision problem is
-complete [
12] and so large problems rapidly become intractable. To help tackle this problem we apply ‘checkerboard’ colouring arguments to the polyominoes and target region, which in certain cases prove the polyominoes do not tile the region. To this end we consider the ‘parity’ of the checkerboard coloured polyominoes or target region, which for a given region is the difference between the number of black squares and the number of white squares. Although checkerboard colouring arguments are common in the literature, a systematic mathematical treatment
without using a more theoretical algebraic approach is lacking. The colouring arguments we use yield sufficient, but not necessary conditions for a tiling problem to have no solution, and are generally weaker than the more theoretical tools of Combinatorial Group theory [
10,
11,
13,
14,
15]. Our main contribution is to tackle this problem algorithmically using colouring arguments, which leads to an efficient numerical method implemented in MATLAB. In addition to developing a systematic method for finding impossible tiling problems we also prove some interesting associated results about polyominoes and their parity values.
Our checkerboard colouring technique identifies impossible tiling problems using polyominoes of arbitrary shape. In graph theory, there is a well-known related approach, which is limited to tiling with dominoes. In that case, black and white squares of the checkerboard coloured region to be tiled are represented by black and white vertices of a graph. A link is made between any two adjacent squares of the region. Then Hall’s marriage theorem gives necessary and sufficient conditions for the existence of a tiling of the region using dominoes, requiring the construction and examination of every possible subset of the white vertices [
16].
A checkerboard colouring is not the only way two colours can help prove a tiling problem has no solution. Other colouring schemes have been successfully used in specific cases (see
Figure 2 for colouring schemes applied to an
square [
2,
8]). However, using two colours, it is only a checkerboard colouring that seems to have wide applicability and hence is amenable to a systematic mathematical description.
The rest of this article has the following structure. In
Section 2, we define the basic terminology and concepts. We also prove a number of theoretical results about polyominoes and their parity values.
Section 3 concerns what we call a ‘parity violation’, which is a sufficient condition involving the concept of parity for a given set of polyominoes to not tile a target region. We also discuss the combinatorial problem of finding parity violations. In
Section 4, we convert the combinatorial problem into the problem of solving a linear Diophantine equation and illustrate our algorithmic approach in
Section 5 with some large examples computed in MATLAB. We make some concluding comments regarding possible future work in
Section 6. The appendices list some polyomino ‘families’ (
Appendix A), and details about our MATLAB solvers for linear Diophantine Equations (
Appendix B).
2. Preliminaries
Consider a finite set of F free polyominoes (‘tiles’) in the lattice , denoted , . We assume the polyominoes are simply-connected, i.e., have no ‘holes’. The area of each polyomino is denoted . Consider another arbitrary union of a finite number of edge-connected cells in the lattice denoted R with area c. We assume R is connected, but not necessarily simply-connected, thus the region R can have ‘holes’. We attempt to tile the target region R with () copies of each free polyomino , , without ‘gaps’ or tiles overlapping, i.e., we have an exact cover problem. Obviously a necessary condition for a solution to a tiling problem is that the sum of the areas of the tiles must equal the area of the target region, i.e., .
Suppose we colour the cells of a polyomino, or the region we wish to tile, either black or white in such a way that each black cell is edge connected only to white cells and each white cell is edge connected only to black cells. We call this a
checkerboard colouring. A checkerboard colouring is rigorously defined using modular arithmetic by identifying each black cell with the number 1 and each white cell with the number 0. If the centre of each cell of a region has coordinates
then a map
given by
defines a checkerboard colouring [
17]. If we have
then we reverse the colouring of cells. See
Figure 3 for an example (we colour the ‘white’ cells of a checkerboard coloured region light grey, to distinguish them from any holes in the region, which we colour white).
We define the parity (pl. parities) of a checkerboard coloured region as the number of black cells minus the number of white cells. We start each tiling problem by assigning the target region R a fixed checkerboard colouring with parity p, . A polyomino placed in a checkerboard coloured region R acquires the colouring of the cells it covers. If the parity of a polyomino is non-zero, then it has two parity values , , depending on its placement in R. Rotating, reflecting or translating the polyomino in the region may reverse its parity. If a polyomino has zero parity then . If a polyomino has parity , then its parity becomes by reversing the colouring of cells (and vice versa).
Consider two distinct polyominoes
and
, with the same area
n and parities
and
, respectively. Then
and
are
parity equivalent n-ominoes if
. Clearly, if
and
are parity equivalent
n-ominoes then
can be transformed into
(and vice versa) by rearranging the black and white cells. Parity equivalence of
n-ominoes is an equivalence relation. An example of parity equivalent 8-ominoes is illustrated in
Figure 4.
Consider a polyomino with black cells and white cells. We state the following simple results without proof, as they are immediate consequences of the equations for area () and parity () of a polyomino (or region) and elementary mathematical induction.
Proposition 1. - (i)
Parity equivalent n-ominoes have the same number of black squares and the same number of white squares.
- (ii)
Consider the set of all free polyominoes. The parities of polyominoes in this set take on all possible values in .
- (iii)
Consider an rectangle in . If is even the parity of the rectangle is 0. If is odd the parity is .
- (iv)
Consider a polyomino with area and parity . Then is odd (resp. even) if and only if is odd (resp. even) (we avoid using the term ‘parity’ here in the usual sense to avoid confusion with its alternate definition in this article).
- (v)
Let the number of black cells and white cells of a checkerboard coloured polyomino with area be and , respectively. If the parity of is , then , and .
As we shall see in later sections, (iii) is useful when we consider the problem of fitting a given set of polyominoes into a rectangle. Additional results for more general polyomino constructions are given in
Appendix A, where we give the explicit relationships between area and parity. The results follow from elementary results for sequences and series and mathematical induction.
Consider the sequence of free polyomino constructions shown in
Figure 5. Starting with a black square, at each stage we add the minimum number of black and white squares to increase the parity by exactly one unit. (If necessary, we allow a re-arrangement of the squares to create all possible parity equivalent
n-ominoes at each level, as is the case with the 2nd construction for
). From the figure we see that we must initially add a straight trimino
, or an L-shaped trimino
, (all orientations permitted) and then in the next step a black square, and repeat, yielding the parity sequence
. At each level in the construction the shapes are parity equivalent
n-ominoes.
The following result clarifies the relationship between the areas and the parities of the polyominoes constructed in
Figure 5.
Theorem 1. Consider the sequence of polyominoes constructed in Figure 5 together with a domino. If the areas of the polyominoes are denoted by with parities , then Furthermore, every polyomino in the sequence has minimal area with respect to its parity, or equivalently, maximal parity with respect to its area.
Proof. We assume throughout the proof that . Similar arguments apply for the case and the result is clearly true for (the case with corresponds to a domino with parity zero). We use induction on p. The result is clearly true for . Assume the result is true for p, then we have two cases to consider. If p is even, then . By construction, we get the next polyomino in the sequence with a parity of by adding a single black square, yielding an area of as is odd. If p is odd, then . By construction we get the next polyomino in the sequence with a parity of by adding two black squares and one white square. So the area becomes as is even.
At each stage of the construction procedure in
Figure 5 we add the least number of black and white squares to increase the parity by one unit. If the parity is odd, no white squares are accessible, so we must add either an L-shaped trimino or a straight trimino. There are various ways to do this and the resulting even parity constructions are parity equivalent
n-ominoes. Although all the odd parity polyominoes have minimal area with respect to their parity, some of them cannot be continued in the sequence (labelled ‘dead-end’). If a white square is not accessible, then the only way the parity can be increased by one unit is by adding one white square and two black squares, resulting in a polyomino that no longer has minimal area (e.g., the third polyomino with
). Even if a white square
is accessible, we cannot always add a single black square to increase the parity by a single unit. For example, in the fifth polyomino construction with
, adding a black square to the single accessible white square is not permitted as this yields a shape that is not simply-connected, contradicting our definition of a polyomino. Thus, in this case, and similar ones, the only way to legitimately increase the parity is by adding three squares (two black and one white), again resulting in a polyomino that no longer has minimal area. As we progress down more levels of the tree the same pattern of polyomino constructions continue, although when the parity is even we get more parity equivalent
n-ominoes.
The sequence of polyominoes also have maximal parity with respect to their area. If this were not true then it would be possible to reduce the area of a polyomino without changing its parity. To do this we would have to remove an equal number of black squares and white squares. However, we cannot remove a single white square from any of the polyominoes as the resulting shape would no longer be simply-connected, contradicting our definition of a polyomino. □
Theorem 1 leads to a simple upper bound for the parity of a polyomino with respect to its area as shown in the following corollary.
Corollary 1. Consider a polyomino with area and parity . Then for all we have Proof. From Theorem 1 the least possible area for a polyomino
with area
and parity
is given by
and if the parity is zero then
. Thus, for all
as required. □
A proof of the less sharp result
is given in ([
18], p. 42) using a different argument.
4. Linear Diophantine Equation Approach
In this section, we convert the combinatorial problem of finding parity violations into the problem of solving linear Diophantine equations. The theoretical results form the basis for a practical algorithm implemented in MATLAB for identifying all possible parity violations of a given tiling problem, presented in
Section 5.
Consider the problem of whether
F free polyominoes
with areas
and
(
) copies of each polyomino
are able to tile a target region
R with area
c. The total number of polyominoes used is
. If the number of copies of each polyomino is not specified then we have the following linear Diophantine equation in
F unknowns
to solve for:
A well-known classical result (e.g., see (([
21], p. 30)) is that a necessary condition for the existence of integer solutions (and hence also positive integer solutions) of (
3) is
where
denotes the greatest common divisor of the numbers
. Now denote the solutions of (
3) by the set of
F-tuples
which may be empty. The subscript
c of
indicates that the solution set depends on
c in (
3).
Assume the target region R has a fixed parity and the polyominoes have parities , and W.L.O.G. the first r polyominoes, have zero parity.
In the arguments below we will need the following simple lemma:
Lemma 1. Let and denote the set of odd and even integers, respectively. Then for all Proof. Recall from the elementary properties of odd and even numbers that the sum of two numbers is odd (resp. even) if and only if the difference is odd (resp. even). After setting and the result follows. □
The following theorem is the theoretical basis of Algorithm 1 presented in
Section 4:
Theorem 2. Let the variable denote how many of the elements drawn from are , , . A solution of the linear Diophantine Equation (3) (if it exists) yields a parity violation if and only if one of the following mutually exclusive conditions holds: - (i)
, where - (ii)
but there is no solution to the following linear Diophantine equation in unknowns : - (iii)
There exists one or more solutions to the linear Diophantine equation in (ii), but none of the solutions satisfy the bounds
Proof. To find possible parity violations we need an equation that matches the sum of the parities of the tiles to the parity of the target region. Our starting point is the parity problem of
Section 3.2. As we have
choices for how many of the
elements drawn from
are
, we must have
choices of
,
,
(recall, the parities of the first
r polyominoes are zero). Then the equation
becomes
or after some simplification
which is a linear Diophantine equation in
unknowns
(if all
F polyominoes have zero parity then we obtain a trivial parity violation if
).
We claim that the right hand side of Equation (
6) is an even number. To show this we prove that
p is even (resp. odd) exactly when
is even (resp. odd), and thus from the elementary property that the sum of two even (resp. odd) numbers is even the result will follow. Recall that we denote the number of black and white squares in a polyomino
by
and
, respectively. Assume
p is even (resp. odd), then from Proposition 1 (iv) we know
c is even (resp. odd) and hence from (
3)
is also even (resp. odd). However, from Lemma 1
is also even (resp. odd), and so the result follows. As a consequence we can safely divide through by 2 in Equation (
6) yielding
The appropriate necessary condition for the existence of integer solutions (and hence also for non-negative integer solutions) of Equation (
7) is
So for each value of
k, depending on a solution from (
5), we have the (possibly empty) solution set given by
So if either the gcd condition (
8) is not satisfied, or, when the gcd condition
is satisfied, but the linear Diophantine Equation (
7) has no solution, then the solution
of the linear Diophantine Equation (
3) yields a parity violation. Furthermore, in the case that the linear Diophantine Equation (
7) has one or more solutions, we also get a parity violation if none of the solutions in the set
satisfy the bounds (
7). □
Algorithm 1 An algorithm for finding all possible parity violations of a tiling problem |
- 1:
Input , , p, and c. Parities are zero (). - 2:
Identify r from the user input of . - 3:
positive integer solutions of ( 3), computed using DIOPHANTINE_ND_POSITIVE- 4:
length of S - 5:
- 6:
- 7:
for to do - 8:
ith solution of S - 9:
entries of corresponding to nonzero parities {solution of form ()} - 10:
maximum possible sum of parities using ( 2) - 11:
if then - 12:
Add to - 13:
Continue {Go to next iteration in For Loop} - 14:
end if - 15:
as in ( 7) - 16:
non-negative integer solutions of ( 7), computed using DIOPHANTINE_ND_NONNEGATIVE - 17:
length of T - 18:
- 19:
for to do - 20:
jth solution of T - 21:
if all then - 22:
- 23:
break {Leave current For Loop} - 24:
end if - 25:
end for - 26:
if then - 27:
Add to - 28:
end if - 29:
end for
|
5. Numerical Results
In this section, we illustrate the theoretical approach for finding large impossible tiling problems with an efficient algorithm implemented in MATLAB.
The open-source MATLAB (R2021b) programs used in this section are freely available in a repository, POLYOMINO_PARITY (v2.0.0) [
22], and run on a Mac Pro (OS X 12.0.1) with 32 GB of memory and a 3.5 GHz 6-core Intel Xeon E5. We describe an algorithm based on Theorem 2 guaranteed to find all possible parity violations of a given tiling problem. To this end we must solve linear Diophantine equations in
n variables
, where the coefficients
and the right hand side value
b are strictly positive integers. We wish to find all solutions
which are either nonnegative or strictly positive integers. Under the assumptions on
a and
b, there are only a finite number of nonnegative or strictly positive integer solutions. We constructed the MATLAB functions
DIOPHANTINE_ND_NONNEGATIVE and
DIOPHANTINE_ND_POSITIVE with the syntax
x = Diophantine_nd_nonnegative(a,b)
x = Diophantine_nd_positive(a,b)
which accept the coefficient
n-vector
a and right hand side
b of a Diophantine equation, and return the set of solutions in an
array
x. Further details are given in
Appendix B.
Our starting point is a given set of
F free polyominoes
with areas
. The numbers of copies of the free polyominoes
is initially left unspecified. Once we have chosen a target region (e.g., from the families of polyominoes in
Appendix A) we use Algorithm 1 implemented in MATLAB using the function
PV_SEARCH with the syntax
[ S1, S2 ] = pv_search ( par, ord, p, c ),
which accepts the positive (or zero) parities of the polyominoes par, the areas of the polyominoes ord, and the parity p and area c of the target region. PV_SEARCH returns S1, the solutions to the area equation yielding trivial parity violations and S2, the solutions to the area equation yielding non-trivial parity violation.
We illustrate this algorithm with several examples. In each problem we use
PV_SEARCH to find all possible parity violations. In the first three examples we also use the open-source MATLAB programs, POLYOMINOES (v2.0.0) [
23] (described in [
24]), to yield successful tiling of the target regions concerned, However, there were many possible solutions and we made no attempt to enumerate them all, even for a particular choice of
.
Example 7. We consider the problem of tiling the checkerboard coloured region shown in Figure 10a with copies of .
The tiles have parities and areas , respectively. The target region (see Appendix A) has an area of and a parity value of zero. Solving the linear Diophantine equation yields solutions.PV_SEARCHfound in s that only of these solutions yielded parity violations (see Table 1): With the particular choice the polyominoes tile the target region (see Figure 10b). Example 8. We consider the problem of tiling the checkerboard coloured region shown in Figure 10c with copies of .
We note that these tiles have parities and areas , respectively. The target region (see Appendix A) has an area of 320
and a parity value of zero. Solving the linear Diophantine equation yields 5158
solutions. PV_SEARCH found in s that only six of these solutions yielded parity violations (see Table 2): With the particular choice of the polyominoes tile the target region (see Figure 10d). Example 9. We consider the problem of tiling the checkerboard coloured region shown in Figure 10e with copies of .
We note that these tiles have parities and areas , respectively. The target region (see Appendix A) has an area of 264
and a parity value of zero. Solving the linear Diophantine equation yields 51,923
solutions. PV_SEARCH found in 12.91
s that 609
of these solutions yielded parity violations (see Table 3 for the ten solutions with ): With the particular choice of the polyominoes tile the target region (see Figure 10f). 6. Conclusions and Future Work
The main contribution of our article is to make some classical colouring techniques in tiling theory algorithmic. Previous work in colouring theory for tiling was typically applied on a case-by-case basis, or used theoretical algebraic techniques. Our article provides a systematic mathematical treatment of checkerboard colouring arguments and leads to a new algorithm, implemented via a suite of MATLAB codes called POLYOMINO_PARITY (v2.0.0) [
22].
For a given choice of target region and a set of polyominoes, with an unspecified number of copies of each polyomino, the algorithm presented in this article finds all associated parity violations. Each parity violation corresponds to an impossible tiling problem.
The ideas presented in this article show promise in opening up new techniques for the analysis of polyomino tiling problems that benefit from the power of modern scientific computing.
There are several possible lines of inquiry we could pursue for future work. For tiling problems where solutions are not excluded by parity arguments, backtrack algorithms are often used to find solutions if they exist [
25,
26,
27,
28]. Such algorithms work by exploring a tree of possible polyomino placements. For each polyomino placement, the remaining untiled region and the remaining polyominoes define a new tiling sub-problem. The same parity arguments can be applied to each sub-problem to decide if that branch of the search tree is necessarily unsolvable. It would be interesting to explore by adding monitoring for parity violations to backtrack algorithms if there is a reduction in solve times for some problems. Matthew Busche [
25] conducted preliminary investigations along these lines using a modern backtrack algorithm called ‘POLYCUBE’, optimized in C++ (personal communication, 8 June 2021).
Another promising line of inquiry that we are currently investigating is to use the colouring techniques presented in this article to formulate an improved tiling procedure for polyominoes. By combining the checkerboard colouring techniques with the linear programming approach presented in [
24] we are able to improve the computational efficiency of tiling in many problems. This technique relies on the fact that checkerboard colouring can split large tiling problems into many smaller tiling subproblems that are embarrassingly parallel, and hence solvable via a ‘divide-and-conquer’ strategy.
A famous open problem in the theory of polyominoes is to enumerate polyominoes as a function of area, and sometimes as a function of perimeter [
29,
30,
31,
32,
33,
34,
35,
36,
37,
38,
39,
40]. In the context of checkerboard colouring we ask how many distinct polyominoes there are with a given (fixed) area
, where
b and
w denote the number of black and white squares, respectively. We introduce a (new) related open problem:
Problem 1. Consider the set of checkerboard coloured polyominoes with b black squares and w white squares. Enumerate the number of distinct (free, one-sided, or fixed) polyominoes as a function of the (fixed) parity .
Even with the simpler situation of a fixed area, i.e., we are enumerating parity equivalent
n-ominoes (see
Section 2), this is a complicated combinatorial problem. Hopefully this question stimulates further research.
While this article focuses on two-dimensional tiling problems on a square lattice, the arguments and techniques presented here are easily extended to tiling problems in higher dimensions, and to other lattice structures (e.g., polyiamonds, polyhexes, etc.).