Volume 15, Number 2, Pages 95-131 ISSN 1715-0868
Volume 15, Number 2, Pages 95-131 ISSN 1715-0868
ISSN 1715-0868
Received by the editors February 6, 2019, and in revised form July 9, 2020.
2010 Mathematics Subject Classification. 05B50, 52C20, 90C05, 90C10.
Key words and phrases. polyominoes, tiling, integer linear programming, optimization,
MATLAB.
Corresponding author: Marcus Garvie.
95
96 MARCUS R. GARVIE AND JOHN BURKARDT
Reid introduced a variable xi ∈ {0, 1} for how many times each placement
of a domino is used to tile the region, illustrated in Figure 3: In any tiling
of Figure 2 each of the 8 cells must be covered exactly once, yielding the
following system of 8 linear equations in 10 unknowns :
x1 + x6 =1
x3 + x6 =1
x1 + x2 + x7 =1
x3 + x4 + x7 + x8 =1
(1.1)
x5 + x8 =1
x2 + x9 =1
x4 + x9 + x10 =1
x5 + x10 =1
Observe that the total number of dominoes used to tile the region is given
by
10
X
xi = (number of cells in region)/2 = 4.
i=1
A NEW MODEL FOR TILING WITH POLYOMINOES 99
This
P is incorporated in the above system as adding the equations yields
2 10i=1 xi = 8, which gives the same result. We have converted a tiling
problem into an algebraic problem. A tiling of the region corresponds to
a solution of the algebraic system, however the converse is not necessarily
true. Nonbinary ‘solutions’ do not correspond to a tiling of the region.
We generalize the approach used in this example for tiling arbitrary finite
subsets of Z2 using a given number of free polyominoes, with a known num-
ber of copies of each polyomino. The model formulation is easily converted
into an algorithm that can be coded on a computer. The resulting linear
system of equations can be solved via a direct approach, or as a binary
linear programming problem using well-known optimization routines. The
binary linear programming problem is another N P-complete problem [25],
but hopefully more efficient than a pure trial-and-error approach.
The remaining parts of this paper are organized as follows. In Section 2
the mathematical model for tiling with polyominoes is derived and stated
and methods for solving the model are discussed in Section 3. In Section 4 we
present numerical results for small problems solved in MATLAB using a di-
rect solution method, and for larger problems solved using high-performance
optimization software packages. Conclusions are made in Section 5. Finally,
in Appendix A the main notation of this paper is summarized, and in Ap-
pendix B some implementation details are given for using the optimization
software to find multiple feasible solutions.
We then define a binary matrix B ∈ {0, 1}r×c such that the (ĩ, j̃) entry of
B is equal to 1 if the unit square [j̃ − 1, j̃] × [ĩ − 1, ĩ] of B is a cell of R,
otherwise 0. If R is simply-connected and a rectangle, then all the entries
in B will be equal to 1. An example is illustrated in Figure 4:
Assume we have a collection of ns free polyominoes S := {Pi }ni=1 s
, where
the order of each Pi is denoted ci . Allowing for a combination of rotations,
reflections and translations, assume each polyomino Pi fits si ways into R.
We tile R with di , 1 ≤ di ≤ si , copies of each free polyomino Pi ∈ S,
100 MARCUS R. GARVIE AND JOHN BURKARDT
0 0 1 1 1
1 1 1 1 1
1 1 0 1 0
0 1 1 1 0
(a) R, (b) R and B. (c) B.
i = 1, . . . , ns , thus
ns
X
(2.1) ci di = cR ,
i=1
in the region R is in general greater then the number of ways the associated
fixed polyominoes for Pi fits into R1.
The set of binary matrices Ai,j associated with fitting the polyominoes Pi
into R is called Series i, given by
Series i := {Ai,j ∈ {0, 1}r×c | j = 1, . . . , si }, i = 1, . . . , ns .
The total number of binary matrices Ai,j is given by
ns
X
(2.3) n := si .
i=1
Before the model can be formulated and solved for a particular case, there
is the practical task of finding all binary matrices Ai,j in each series. Initially
for each free polyomino Pi we find all the associated fixed polyominoes ob-
tained by appropriate combinations of rotations and reflections. Depending
on the symmetry of the polyomino this will be either 1, 2, 4, or 8. For each
fixed polyomino we exhaustively find all possible ways in which the fixed
polyomino fits into R, and for each configuration we calculate the associ-
ated binary matrix. The number of choices a particular fixed polyomino fits
into R will depend on divisibility conditions concerning the dimensions of
the rectangular hulls of Pi and R. As this is elementary (but tedious) we
omit further details.
We introduce a variable αi,j ∈ {0, 1} for how many times the jth place-
ment of Pi is used to tile R. The mathematical description of tiling the
region R with polyominoes in S is given by the following problem:
Problem I.
The constraints (2.4b) enforce the conditions that we must use exactly di
polyominoes from each Series i to tile R.
Remark 2.1. In general, the solutions of equation (2.4a) subject to the
constraints (2.4b) (if they exist) are rational (see Theorem 2.18). If the
solutions of this relaxed problem are not binary then we can no longer in-
terpret each di as the number of copies of a polyomino Pi used to tile a region
R. For
P 1example, consider d1 = 1, s1 = 3, with α1,1 = α1,2 = α1,3 = 1/3,
and sj=1 α1,j = 1, so the number of polyominoes used from Series 1 is 3.
1This is because free polyominoes can be rotated, reflected, and translated in R, while
fixed polyominoes can only be translated.
102 MARCUS R. GARVIE AND JOHN BURKARDT
Problem II.
Remark 2.3. In general, the solutions of equation (2.5) (if they exist) are
rational (see Theorem 2.18). If the solutions of this relaxed problem are not
binary then d1 may not be a positive integer (see Example 4.4).
Remark 2.4. If one sums over all rows and columns of the matrices in
equation (2.5), the right hand side evaluates to cR , and each A1,j evaluates
to c1 , yielding
Xs1 s1
X
c1 α1,j = cR = c1 d1 =⇒ α1,j = d1 , 1 ≤ d1 ≤ s1 .
j=1 j=1
Thus the constraint on the variables of the problem when we tile with copies
of a single polyomino is automatically incorporated into the problem (cf.
Remark 2.2).
For a given set of free polyominoes
Pns S, there may be many possible ways
of satisfying the area equation i=1 ci di = cR , depending on how many
copies of each polyomino Pi are used. If a single polyomino P1 is used to
tile R then it must be used d1 = cR /c1 times. On the other hand, if all
theP free polyominoes are used exactly once, then di = 1 for i = 1, . . . , ns
so ni=1 s
ci = cR . If the number of copies di of each polyomino Pi are not
specified then we have a linear Diophantine equation in ns unknowns to
solve for:
(2.6) c1 d1 + c2 d2 + · · · + cns dns = cR .
A NEW MODEL FOR TILING WITH POLYOMINOES 103
Linear System I.
(2.7) M α = b,
b M ∈ {0, 1}m×n , α ∈ {0, 1}n ,
where m = cR + ns , n = ni=1
P s
si and
(
b i = 1 for i = 1, . . . , cR
{b} ,
di for i = cR + 1, . . . , m
T
α = α1,1 . . . α1,s1 | α2,1 . . . α2,s2 | . . . | αns ,1 . . . αns ,sns .
The vertical lines in the solution vector indicate the partition of unknowns
according to the series they are associated with. As a consequence of the
constraints (2.4b) exactly di coefficients associated with each Series i are
equal to 1, with the remaining coefficients equal to zero.
Remark 2.11. Let M c be the matrix composed of the first cR rows of M , i.e.
the coefficient matrix of Linear System I without the constraint equations.
Each row in M c corresponds to a nonzero entry in B, while each column
corresponds to an unknown in α. The columns of M c are equal to the entries
i,j
in the binary matrices A written row-wise. (We only take the entries in
2Zero entries of B correspond to cells not in R.
A NEW MODEL FOR TILING WITH POLYOMINOES 105
Ai,j that correspond to nonzero entries in B.) Thus if we sum the first cR
equations in Linear System I we obtain
s1 s2 s ns
X X X
c1 α1,j + c2 α2,j + · · · + cns αns ,j ,
j=1 j=1 j=1
not exist then certainly there are no binary solutions. To this end we state
one of the many (equivalent) results concerning the existence of solutions
to linear inequalities, which is a classic result in linear programming and
optimization:
Theorem 2.14 (Farkas’ Lemma, see [20],[24, Lemma 1, p. 318]). Let A ∈
Rm×n and b ∈ Rm , then exactly one of the following alternatives hold:
(i) There exists x ∈ Rn satisfying Ax = b and x ≥ 0.
(ii) There exists y ∈ Rm satisfying yT A ≥ 0T and yT b < 0.
Remark 2.15. Inequalities involving vectors are understood component-
wise, i.e. x ≥ 0 means each component of x is greater than or equal to
0. A similar interpretation is given to the statement yT A ≥ 0T .
Remark 2.16. The statement yT A ≥ 0T is equivalent to the statement
AT y ≥ 0. (Here, 0T is the 1 × n zero vector.)
Remark 2.17. In Linear System I when we use only a single polyomino
from each series then the vector b in Theorem 2.14 is a vector of all ‘1’s
and so the statement yT b < 0 becomes m
P
y
i=1 i < 0, where yi := {y}i .
If A is a binary matrix and the components of b are positive integers,
then the above result can be strengthened to the rational solution case:
Theorem 2.18. If A ∈ {0, 1}m×n and b ∈ Nm then Theorem 2.14 holds
with x ∈ Qn .
Proof. Suppose the system of equations Ax = b is consistent. If we have a
unique solution then the Gaussian elimination algorithm with exact arith-
metic and partial pivoting applies a finite number of operations (+, −, ×,
÷) to the entries of N ∪ {0} in the augmented matrix [A|b]. Thus the solu-
tion must be rational. If we have an infinite number of solutions then the
solutions are guaranteed to be rational if we choose the free variables to be
rational.
Algorithm 1
1: N ← 0
2: Read M and b b from file
3: Compute [A|b] (the RREF of [M |b]) b
4: Compute r := rank(M )
5: if r < rank([M |b]) b then
6: print "System is inconsistent"
7: else if r = n then
8: if b is binary then
9: α←b
10: Save binary solution α to file
11: print "There is a unique binary solution"
12: else
13: print "No binary solution exists"
14: end if
15: else {system has an infinite number of rational solutions}
16: f ←n−r
17: Identify the fk free variables in each Series Sk and compute bfk , for
k = 1, . . . , ns , using
Qns equation (3.1)
18: Compute bf := k=1 bfk
19: for i = 1 to bf do
20: Assign binary values to free variables {fk }nk=1
s
4For GUROBI to solve these problems we found it necessary to make the objective
function in the LP file blank, instead of the default: ‘Obj: 0’.
112 MARCUS R. GARVIE AND JOHN BURKARDT
4. Numerical experiments
4.1. Small problems solved in MATLAB. We demonstrate the direct
solution method with some examples that illustrate the types of solutions
that are possible. Although these examples are very simple, they encapsulate
all the features of larger problems.
Series 1 =
1 1 1 0 0 1 1 1 0 0 0 0 0 0 0 0
, , , ,
0 0 0 0 0 0 0 0 1 1 1 0 0 1 1 1
| {z } | {z } | {z } | {z }
A1,1 A1,2 A1,3 A1,4
Series 2 =
0 0 1 0 0 0 0 1 1 0 0 0 0 1 0 0
, , , ,
1 1 1 0 0 1 1 1 1 1 1 0 0 1 1 1
| {z } | {z } | {z } | {z }
A2,1 A2,2 A2,3 A2,4
1 1 1 0 0 1 1 1 1 1 1 0 0 1 1 1
, , , ,
1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1
| {z } | {z } | {z } | {z }
A2,5 A2,6 A2,7 A2,8
Series 3 =
1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1
, , , ,
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
| {z } | {z } | {z } | {z }
A3,1 A3,2 A3,3 A3,4
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
, , , .
1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1
| {z } | {z } | {z } | {z }
A3,5 A3,6 A3,7 A3,8
A NEW MODEL FOR TILING WITH POLYOMINOES 113
[A|b] =
α1,1 α1,2 α1,3 α1,4 α2,1 α2,2 α2,3 α2,4 α2,5 α2,6 α2,7 α2,8 α3,1 α3,2 α3,3 α3,4 α3,5 α3,6 α3,7 α3,8
0 2 −1 0 −1 −1 −1 −2 −1 0 −2 −1
1 0 0 0 0 0 1 0 0
0 1 0 0 0 0 −1 0 0 0 0 1 0 1 1 1 1 0 1 1 1
0 0 1 0 0 0 1 0 0 0 0 −1 0 0 −1 0 0 0 0 −1 0
0 0 0 1 0 0 −1 0 0 0 −2 1 0 0 1 0 1 1 −1 2 1
0 0 0 0 1 0 0 0 0 0 1 0 0 0 1 0 0 0 1 0 0
0 0 0 0 0 1 1 0 0 0 1 0 0 −1 −1 0 −1 −1 0 −1 0
0 0 0 0 0 0 0 1 0 0 1 0 0 1 0 0 0 0 1 0 0
0 0 0 0 0 0 0 0 1 0 −1 1 0 0 0 0 1 0 −1 1 1
0 0 0 0 0 0 0 0 0 1 −1 0 0 0 0 0 0 1 −1 0 0
0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
The variables corresponding to each column are indicated with vertical lines
separating the series they are associated with and pivots are circled. The
system is clearly consistent with 10 = r < n = 20, so there are f = n−r = 10
free variables:
Series 1: −
Series 2: α2,3 , α2,7 , α2,8
Series 3: α3,2 , α3,3 , α3,4 , α3,5 , α3,6 , α3,7 , α3,8
In each series only a single free variable can be equal to 1 at a time, or
all members of that series can be zero, yielding (see Corollary 3.2, part (i))
bf = (1 + 0)(1 + 3)(1 + 7) = 32 possible binary choices of free variables to
check. Solving the linear systems via back-substitution for all possible choices
of free variables as described in Section 3.1 yields the following four binary
solutions:
114 MARCUS R. GARVIE AND JOHN BURKARDT
α1,1 α1,2 α1,3 α1,4 α2,1 α2,2 α2,3 α2,4 α2,5 α2,6 α2,7 α2,8 α3,1 α3,2 α3,3 α3,4 α3,5 α3,6 α3,7 α3,8
0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0
0 0 1 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0
1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0
0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1
α1,1 α1,2 α1,3 α1,4 α1,5 α1,6 α1,7 α1,8 α1,9 α1,10
1 0 0 0 0 0 1 0 −1 0 0
0 1 0 0 0 0 0 0 1 0 1
0 0 1 0 0 0 1 0 −1 0 0
0 0 0 1 0 0 0 0 1 1 1
[A|b] =
0 0 0 0 1 0 0 0 0 1
1
0 0 0 0 0 1 −1 0 1 0 1
0 0 0 0 0 0 0 1 0 −1 0
0 0 0 0 0 0 0 0 0 0 0
A NEW MODEL FOR TILING WITH POLYOMINOES 115
The variables associated with each column are indicated and the pivots have
been circled. The system is clearly consistent with 7 = r < n = 10, so there
are f = n − r = 3 free variables: α1,7 , α1,9 , and α1,10 . As d1 = cR /c1 = 4
we have bf = 23 binary choices for the free variables to check for (see Corol-
lary 3.2, part (ii)). Solving the linear systems via back-substitution for all
possible choices of free variables as described in Section 3.1 yields the fol-
lowing four binary solutions:
α1,1 α1,2 α1,3 α1,4 α1,5 α1,6 α1,7 α1,8 α1,9 α1,10
0 1 0 1 1 1 0 0 0 0
0 1 0 0 0 1 0 1 0 1
1 0 1 0 1 0 0 0 1 0
0 0 0 0 1 1 1 0 1 0
Ignoring trivial differences due to rotating and reflecting, the whole tiled
region yields just two different tilings.
Example 4.6. For our first example we investigated the problem of enu-
merating all possible solutions to tiling the 5 × 18 rectangle with 30 copies
of a single L-triomino:
( )
S= .
All rotations and reflections are permitted. The binary linear programming
problem has 272 variables with 91 constraints. A particular solution com-
puted using CPLEX is shown in Figure 9a. CPLEX, GUROBI and SCIP
successfully found 1, 168, 512 solutions in 3.8 minutes, 2.8 hours, and 8.6
minutes, respectively, which is in agreement with results reported at [36]. If
we neglect trivial variations due to rotating and reflecting the whole board
this yields a total of 1, 168, 512/4 = 292, 128 solutions.
Example 4.7. For our second example we enumerated the total number of
solutions to tiling the 10 × 6 rectangle with each of the 12 free pentominoes
(often labelled with the letters - F, I, L, N, P, T, U, V, W, X, Y, and Z.
118 MARCUS R. GARVIE AND JOHN BURKARDT
(
S= , , , ,
, , , ,
)
, , ,
All rotations and reflections are permitted. The binary linear programming
problem has 2, 056 variables with 73 constraints. This example is a classic
problem of tiling with polyominoes. A particular solution computed using
CPLEX is shown in Figure 9b. CPLEX, GUROBI and SCIP successfully
found 9, 356 solutions in 7.3 minutes, 77.4 minutes, and 89.9 minutes, re-
spectively, which is in agreement with the first reporting of this result in
1960 [40], and at numerous websites (e.g. [36]). If we neglect trivial vari-
ations due to rotating and reflecting the whole board this yields a total of
9, 356/4 = 2, 339 solutions.
The next two examples demonstrate the capability of our method to tile
nonrectangular regions, or regions containing ‘holes’.
Example 4.8. We tile an L-shaped region with 4 copies of each of the fol-
lowing 8 octominoes5:
(
S= , , , ,
)
, , ,
All rotations and reflections are permitted. The binary linear programming
problem has 9, 878 variables with 265 constraints. CPLEX and SCIP suc-
cessfully found a single (optimal) solution in 12.8 minutes and 13.1 hours,
respectively, however GUROBI failed to find a solution in over 14 hours of
computation. The solution shown in Figure 10a was computed in CPLEX.
Example 4.9. We tiled an 11 × 11 square with four 2 × 2 holes using
the 12 free pentominoes (see Example 4.7) with copies6. All rotations and
reflections are permitted. The binary linear programming problem has 2, 619
variables with 118 constraints. CPLEX, GUROBI, and SCIP successfully
found a single (optimal) solution in 0.4, 1.5, and 15.9 seconds, respectively.
The solution shown in Figure 10b was computed in CPLEX.
The last two examples illustrate the capability of our method to tile large
problems, either with copies of a single polyomino, or with copies of a set of
pieces.
Example 4.10. We tile a 60 × 60 square with 600 copies of a single hex-
omino: ( )
S= .
All rotations and reflections are permitted. The binary linear programming
problem has 26, 912 variables with 3, 601 constraints. CPLEX found a single
(optimal) solution (see Figure 11) in 1.9 hours, however SCIP and GUROBI
failed to find a solution in over 14 hours of computation.
Example 4.11. For our final example we tile the 40 × 30 rectangle using 20
copies each of the 12 free pentominoes (see Example 4.7). All rotations and
reflections permitted. The binary linear programming problem has 67, 396
variables with 1, 213 constraints. CPLEX found a single (optimal) solution
(see Figure 12) in 9.5 minutes, however SCIP and GUROBI failed to find a
solution in over 14 hours of computation.
6With the naming convention of Example 4.7 we used the following numbers of copies
of the free pentominoes: V, W, and Z - a single copy each; all other pieces utilized two
copies each.
120 MARCUS R. GARVIE AND JOHN BURKARDT
Figure. 10. Two medium-sized tiling problems. (a) See Example 4.8.
We tile with 4 copies of 8 octominoes. (b) See Example 4.9. We tile
with copies of the 12 free pentominoes. See the text for further details
concerning the tiles used.
A NEW MODEL FOR TILING WITH POLYOMINOES 121
Figure. 11. See Example 4.10. 600 copies of a single hexomino tile a
60 × 60 square.
122 MARCUS R. GARVIE AND JOHN BURKARDT
2,500
Runtimes vs Area
Exponential regression curve
2,000
Runtime (sec)
1,500
1,000
500
0
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8
Area of square regions (# cells) ·104
Figure. 13. CPLEX runtimes versus area of square regions tiled with
L-triominoes.
The ‘saw-tooth’ shape of the data merits some discussion. The lower data
points in the ‘saw-tooth’ pattern correspond to areas divisible by 6 while the
upper data points correspond to areas divisible by 3, but not 6. As the L-
triomino tiles a 6 × 6 square it is plausible that optimal solutions are found
124 MARCUS R. GARVIE AND JOHN BURKARDT
more readily when the area is divisible by 6. If this were the case we might
expect the optimal tiling of areas divisible by 6 to be predominantly filled with
6 × 6 blocks, where each block is tiled by 12 L-triominoes. We checked if this
was the case for the 66 × 66 square and it was not (details omitted). Further
investigations are needed to explain this behaviour.
5. Conclusions
The main contribution of this paper is to present the first general system-
atic algebraic approach for tiling finite subsets of Z2 with polyominoes. The
resulting mathematical model can be solved via direct solution techniques
(see Algorithm 1), or expressed as a binary linear programming problem in
MATLAB and solved using high-performance optimization packages, for ex-
ample, CPLEX, SCIP, or GUROBI. To the best of our knowledge, all current
general purpose algorithms for tiling regions of the plane with polyominoes
employ backtracking techniques for exhaustively finding solutions with a
computer. We illustrated our methodology for small problems (n < 30) in
MATLAB, and for medium to large problems (200 < n < 70, 000) we used a
combination of MATLAB and high-performance optimization packages. We
found the CPLEX optimizer to be much faster than either SCIP or GUROBI
for solving the problems in this paper.
We make no claims regarding the efficiency of our methodology. Indeed,
preliminary investigations using the optimized C++ backtracking software
(POLYCUBE), freely available at [11], indicate this package to be consid-
erably faster than our approach (details omitted). There are a couple of
reasons that may explain this. Firstly, the backtracking algorithms for
tiling remain entirely in the discrete realm, however, with our optimiza-
tion approach we must sift through the rational solutions to find the binary
solutions. Another reason that can make backtracking fast is that the code
can be tailored to the specific problem being solved. For example, one can
choose to place pieces in the target region first that are most constrained.
Regardless of the method employed, as the problem of tiling finite regions of
the plane with polyominoes is in general N P-complete (see the discussion in
Section 1), there will always be an upper bound on the size of the problems
that can be solved. This was illustrated by the results of Experiment 4.12
in Section 4.2, which confirmed numerically that tiling finite regions of the
plane with the L-triomino is N P-complete [57]. With our approach that
upper bound is determined in large part by the efficiency of the particu-
lar optimization package employed. There have been huge advances made
in recent decades for solving mixed-integer and integer linear programming
problems [48, 54]. As advances are made (in software and hardware) for solv-
ing integer linear programming problems, the efficiency of our methodology
for tiling with polyominoes will also improve.
There are several advantages of the methodology employed in this paper
for tiling with polyominoes compared to the backtracking methods. Firstly,
A NEW MODEL FOR TILING WITH POLYOMINOES 125
as the tiling problem has been converted into an algebraic model, the struc-
ture, combinatorial nature, and solvability of the model can be analyzed
(see for example Theorem 2.14, Theorem 2.18, and Theorem 3.1). For ex-
ample, the standard condition involving rank can be efficiently applied to
determine if the associated linear system of equations is consistent. In prin-
ciple, it should also be possible to construct a solver that is tailored to
the properties of the linear systems. It is the subject of a follow-up paper
to investigate the efficiency of an optimized C++ version of Algorithm 1.
A second advantage of our mathematical model is its flexibility. Ignoring
memory and efficiency considerations, there are no limitations on: the ge-
ometry of the region to be tiled; the number of different pieces used; or
the total number of pieces (including copies) that are used to tile a spe-
cific region. If the constraints in Problem I are neglected, then we do not
have to specify beforehand how many copies of each polyomino are to be
used7. A third advantage of our methodology is that the underlying code
for constructing the mathematical model is freely available as a suite of
MATLAB programs (see http://people.sc.fsu.edu/~jburkardt/m_src/
polyominoes/polyominoes.html). Thus other researchers can reproduce
our numerical results, or use it as a starting point for their own investiga-
tions.
The techniques developed in this paper may have more general applica-
bility. As the problem of tiling regions of the plane with polyominoes is an
example of an exact cover problem [45], it would be interesting to investigate
if our methodology can be adapted to tackle other exact cover problems. For
example, the n-queens problem [7], Sudoku [74], and edge-matching puzzles
[50] are examples of mathematical puzzles and games that can be repre-
sented as exact cover problems. Applications that can be modelled as exact
cover problems include Integrated Circuit Design [41], 3D Printing [79], and
Cloud Computing [14].
There are some additional lines of enquiry we can pursue with our math-
ematical model. For example, it would be interesting to investigate least
squares approximations of Linear System I and II. When the linear system
is inconsistent, and cells in a tiling are allowed to overlap, the least squares
solution corresponds to a weighted sum of pieces that minimizes the sum
of the squared deviations. In this context, a deviation corresponds to the
mismatch between the ‘height’ of a cell in the target region and unity. Thus
even when a given set of polyominoes does not tile the target region, we can
seek an approximate solution in the least squares sense. This is an approach
that is not possible with backtracking methods as backtracking methods
remain entirely in the discrete realm.
In addition to investigating the efficiency of an optimized C++ implemen-
tation of Algorithm 1 (see the comments above), it might be advantageous
Appendix A. Notation
For the convenience of the reader we summarize the main notation used
in Table 1.
Table 1
Main notation used.
Symbol Definition
R The polyomino to be tiled
cR The order of R
B Lattice for the rectangular r × c hull of R
B ∈ {0, 1}r×c Binary matrix associated with B
ns Number of series (= number of free polyominoes)
S Set of free polyominoes Pi
Pi ith free polyomino
ci Order of Pi
si Number of ways each Pi fits in R (= number of binary
matrices Ai,j in Series i)
di Number of copies of Pi used to tile R
Ai,j ∈ {0, 1}r×c Binary matrix associated with j ways of fitting Pi in R
n Total number of binary matrices Ai,j (= number of un-
knowns in linear systems)
αi,j ∈ {0, 1} Number of times the jth placement of Pi is used to tile R
np Number of polyominoes used to tile R
m Number of equations in Linear System I, or II
M ∈ {0, 1}m×n Coefficient matrix of Linear System I or II
α ∈ {0, 1}n Solution vector for Linear System I or II
b
b Right-hand-side vector for Linear System I or II
N Number of binary solutions of Linear System I or II
[A|b] Reduced row echelon form of [M |b] b
r Rank of M
f n − r (= number of free variables in [A|b])
fi Number of free variables in Series i
bfi Number of binary choices for the free variables in Series i
bf Number of binary choices for all free variables
A NEW MODEL FOR TILING WITH POLYOMINOES 127
B.3. Shell commands for GUROBI. The following line of code: reads
the LP file, sets the upper bound on the number of solutions sought to N ,
calculates all feasible solutions, and saves the solutions to file:
> gurobi_cl PoolSearchMode=2 PoolSolutions=N PoolGap=0
ResultFile=test.sol test.lp
Acknowledgments
We gratefully acknowledge the helpful comments of: Matthew Busche,
Laurence Garvie, Steven Gismondi, Herb Kunze, Rajesh Pereira, and Allan
Willms. We are also very grateful to an anonymous referee for their careful
corrections and valuable suggestions that improved this paper.
128 MARCUS R. GARVIE AND JOHN BURKARDT
References
1. G. Aleksandrowicz and G. Barequet, Counting polycubes without the dimensionality
curse, Discrete Math. 309 (2009), 4576–4583.
2. F. Ardila and R. Stanley, Tilings, Math. Intelligencer 32 (2010), no. 4, 32–43.
3. J. M. Ash and S. W. Golomb, Tiling deficient rectangles with trominoes, Math. Mag.
77 (2003), no. 1, 46–55.
4. D. Ashlock and L. Taylor, Evolving polyomino puzzles, Proceedings of the IEEE 2016
Congress on Evolutionary Computation, IEEE Congress on Evolutionary Computa-
tion, IEEE, Vancouver, 2016, pp. 327–334.
5. B. Banerjee, L. Kraemer, and J. Lyle, Multi-agent plan recognition: Formalization and
algorithms, Proceedings of the twenty-fourth AAAI conference on artificial intelligence
(AAAI-10), Book Series: Lecture Notes in Artificial Intelligence, Conference: 24th
AAAI Conference on Artificial Intelligence (AAAI), Atlanta, GA, 2010, pp. 1059–
1064.
6. D. Battalion, M. Bouvel, A. Frosini, and S. Rinaldi, Permutation classes and poly-
omino classes with excluded submatrices, Math. Struct. in Comp. Science 27 (2017),
157–183.
7. J. Bell and B. Stevens, A survey of known results and research areas for n-queens,
Discrete Math. 309 (2009), no. 1, 1–31.
8. R. Berger, The undecidability of the domino problem, Mem. Amer. Math. Soc. 66
(1966), 1–72.
9. O. Bodini, Tiling a rectangle with polyominoes, Discrete Math. Theor. Comput. Sci.
AB(DMCS) (2003), 81–88.
10. M. Braun, T. Etzion, P. R. J. Östergård, A. Vardy, and A. Wassermann, Existence of
q-analogs of steiner systems, Forum Math. Pi e7, 14 pp. (2016).
11. M. Busche, Solving polyomino and polycube puzzles. algorithms, software, and solu-
tions, http://www.mattbusche.org/blog/article/polycube/ (2 July 2020).
12. G. Castiglione, A. Frosini, A. Restivo, and S. Rinaldi, Enumeration of L-convex poly-
ominoes by rows and columns, Theoret. Comput. Sci. 347 (2005), 336–352.
13. R. D. Chatham, M. Doyle, J. J. Miller, A. M. Rogers, R. D. Skaggs, and J. A. Ward,
Algorithm performance for chessboard separation problems, J. Combin. Math. Combin.
Comput. 70 (2009), 127–142.
14. B. A. Cheikh, An exact cover-based approach for service composition, 2016 IEEE
International Conference on Web Services (ICWS), IEEE Computer Society, 2006,
pp. 631–636.
15. J. L. Conway and J. C. Lagarias, Tiling with polyominoes and combinatorial group
theory, J. Combin. Theory Ser. A 53 (1990), no. 2, 183–208.
16. M. Cwiek and J. Nalepa, Spatial planning as a hexomino puzzle, Intelligent Infor-
mation and Database Systems, ACIIDS 2017, Pt 1, Book Series: Lecture Notes in
Artificial Intelligence, vol. 10191, Conference: 9th Asian Conference on Intelligent In-
formation and Database Systems (ACIIDS), Kanazawa, JAPAN, 2017, pp. 410–420.
17. N. G. de Bruijn, Programmeren van de pentomino puzzle, Euclides 47 (1971/72),
90–104.
18. A. Del Lungo, E. Duchi, A. Frosini, and S. Rinaldi, On the generation and enumeration
of some classes of convex polyominoes, Electron. J. Combin. 11 (2004), no. 1, 1–46.
19. M.-P. Delest and G. Viennot, Algebraic languages and polyominoes enumeration, The-
oret. Comput. Sci. 34 (1984), no. 1-2, 169–206.
20. J. Farkas, Über die Theorie der einfachen Ungleichungen, Journal für riene und ange-
wandte Mathematik 121 (1902), 1–27.
21. S. Feretić, A perimeter enumeration of column-convex polyominoes, Discrete Math.
Theor. Comput. Sci. 9 (2007), no. 1, 57–83.
A NEW MODEL FOR TILING WITH POLYOMINOES 129
22. J. G. Fletcher, A program to solve the pentomino problem by the recursive use of
macros, Communications of the ACM 8 (1965), no. 10, 621–623.
23. A. Fontaine and G. E. Martin, Polymorphic polyominoes, Math. Mag. 57 (1984), no. 5,
275–283.
24. D. Gale, H. W. Kuhn, and A. W. Tucker, Linear programming and the theory of
games, Activity Analysis of Production and Allocation (T.C. Koopmans, ed.), John
Wiley & Sons, New York, 1951, pp. 317–329.
25. M. R. Garey and D. S. Johnson, Computers and intractability: A guide to the theory
of NP-Completeness, W. H. Freeman and Company, San Francisco, 1979.
26. S. W. Golomb, Checker boards and polyominoes, Amer. Math. Monthly 61 (1954),
no. 10, 675–682.
27. , Tiling with polyominoes, J. Combinatorial Theory 1 (1966), 280–296.
28. , Polyominoes which tile rectangles, J. Combin. Theory Ser. A 51 (1987), 117–
124.
29. , Tiling rectangles with polyominoes, Math. Intelligencer 18 (1996), no. 2, 38–
47.
30. S. W. Golomb and L. D. Baumert, Backtrack programming, J. Ass. Comp. Machinery
12 (1965), no. 4, 516–524.
31. S. W. Golomb and D. A. Klarner, Polyominoes, Handbook of discrete and compu-
tational geometry (J.E. Goodman and J. O’Rourke, eds.), Chapman & Hall / CRC,
Atlanta, GA, 2nd ed., 2004, pp. 331–352.
32. S.W. Golomb, Polyominoes, Scribner, New York, 1965.
33. , Tiling with sets of polyominoes, J. Combinatorial Theory 9 (1970), 60–71.
34. , Polyominoes, second ed., Princeton University Press, Princeton, NJ, 1994.
35. A. Goupil, H. Cloutier, and F. Nouboud, Enumeration of polyominoes inscribed in a
rectangle, Discrete Appl. Math. 158 (2010), no. 18, 2014–2023.
36. D. O. Grekov, Polyomino tilings, http://polyominoes.org/data/ (3 August 2018).
37. B. Grünbaum and G.C. Shephard, Tilings and patterns, W. H. Freeman and Company,
New York, 1987.
38. V. Gruslys, I. Leader, and T. S. Tan, Tiling with arbitrary tiles, Proc. London Math.
Soc. 3 (2016), no. 112, 1019–1039.
39. A. J. Guttman, History and introduction to polygon models and polyominoes, Polygons,
Polyominoes and Polycubes (A.J. Guttman, ed.), Lecture Notes in Physics, vol. 775,
Springer, Dordrecht, 2009.
40. C. B. Haselgrove and J. Haselgrove, A computer program for pentominoes, Eureka 23
(1960), no. 2, 16–18.
41. I. Hui-Ru and H.-Y. Chang, Multiple patterning layout decomposition considering com-
plex coloring rules and density balancing, IEEE transactions on computer-aided design
of integrated circuits and systems 36 (2017), no. 12, 2080–2092.
42. D. A. Klarner, Packing a rectangle with congruent n-ominoes, J. Combinatorial Theory
7 (1969), 107–115.
43. D. A. Klarner and R. L. Rivest, A procedure for improving the upper bound for the
number of n-ominoes, Can. J. Math. 25 (1973), no. 3, 585–602.
44. , Asymptotic bounds for the number of convex n-ominoes, Can. J. Math. 25
(1974), no. 8, 31–40.
45. D. Knuth, Dancing links, Millennial Perspectives in Computer Science, proceedings
of the 1999 Oxford-Microsoft Symposium in honour of Professor Sir Antony Hoare
(J. Davies, B. Roscoe, and J. Woodcock, eds.), Cornerstones of Computing, Palgrave
Macmillan, 2000, p. 432.
46. , Selected papers on fun & games, CSLI Lecture Notes; no. 192, CSLI Publica-
tions, Stanford, CA, 2011.
130 MARCUS R. GARVIE AND JOHN BURKARDT