TilePacking Tomography is hard
Abstract
Discrete tomography deals with reconstructing finite spatial objects from their projections. The objects we study in this paper are called tilings or tilepackings, and they consist of a number of disjoint copies of a fixed tile, where a tile is defined as a connected set of grid points. A row projection specifies how many grid points are covered by tiles in a given row; column projections are defined analogously. For a fixed tile, is it possible to reconstruct its tilings from their projections in polynomial time? It is known that the answer to this question is affirmative if the tile is a bar (its width or height is ), while for some other types of tiles hardness results have been shown in the literature. In this paper we present a complete solution to this question by showing that the problem remains hard for all tiles other than bars.
1 Introduction
Discrete tomography deals with reconstructing finite spatial objects from their lowdimensional projections. Inverse problems of this nature arise naturally in medical computerized tomography, electron tomography, nondestructive quality control, timetable design and a number of other areas. This wide range of applications inspired significant theoretical interest in this topic and led to studies of computational complexity of various discrete tomography problems. For an extensive and detailed coverage of practical and theoretical aspects of this area, we refer readers to the book by Kuba and Herman, see [8, 7].
In this paper we consider the problem of reconstructing a tile packing from its row and column projections. Formally, consider the integer grid of dimension , consisting of all cells . Every cell is adjacent to its neighbor cells
whichever of those are present in the grid. Alternatively, one can think of each as a cell in an matrix. In the paper, we will often use the matrix notation and terminology, using terms “row” and “column”, with rows numbered topdown and columns numbered from left to right, so that the upperleft cell is .
We define a tile to be any finite connected set of grid cells. By “connected” we mean that for any two cells of there is a path inside between these cells, where any two consecutive cells on this path are adjacent. The width and height of are defined in the obvious manner, as the dimensions of the smallest rectangle containing . If or , then is called a bar. By
we denote the translation of by the vector . is called a (translated) copy of , and is the position of this copy. Later in the paper, we will sometimes refer to as a “tile” – which is somewhat ambiguous but more intuitive than a “copy”
A tile packing of the grid using — or a packing, in short, if and are understood from context — is a disjoint partial covering of the grid with translated copies of . Formally, a packing is defined by a set of translation vectors such that all translated copies , for all , are contained in the grid and are pairwise disjoint. We do not require the tiles to completely cover the grid. We stress here that what we call a packing here has been sometimes called a partial tiling in the literature; see, for example, [5]. An example of a packing is shown in Figure 1. Without loss of generality, throughout the paper, we will be assuming that the tile used in packing is in a canonical position in the upperleft corner of the grid, that is .
To simplify notation, instead of counting how many grid points are covered by tiles in a given row (or column), we count how many tiles start in a given row (column), which is equivalent up to some basechange. So the row and column projections of a packing are defined as a pair and of vectors such that
For example, consider tile . Figure 1 shows an example of a packing. This packing is
We study the problem of reconstructing tile packings from its horizontal and vertical projections. More formally, for any fixed tile , the problem is defined as follows:
 Tile Packing Tomography Problem (TPTP):

The instance of TPTP consists of vectors . The objective is to decide if there is a packing whose projections are and .
This problem has been introduced in [2] and shown to be hard for some particular tiles. In [4], the proof technique has been adapted to show hardness for any rectangular tile, i.e. a tile that consists of all cells for some dimensions .
On the positive side, the classical work of Ryser [11] on projections of 01 matrices provides a characterization of vectors that correspond to projections of packings for the special case when is a single cell, and provides a simple polynomialtime algorithm for that case. The ideas from [11] were extended in [3, 9] to the case when is a bar. In [1], polynomialtime algorithms were given for restricted special cases. The complexity status was unknown for all other tiles, and the current paper completes the picture by proving the following theorem.
Theorem 1
Problem TPTP is complete for any tile that is not a bar.
The general structure of our proof resembles those introduced in [2] and [4], although the reductions we present are substantially more difficult, since the generality of our result means that we cannot take advantage of a specific shape of the tile, and that we need to base the construction on some generic properties shared by infinitely many tiles. Our techniques take advantage of Ryser’s structure results for 01 matrices, in combination with some arguments based on linear algebra.
After reviewing some background information in Section 2, we introduce the main idea of the reduction in Section 3, by formulating the overall framework of the reduction and conditions on required for this reduction to be correct. Then, in Section 4 we show that all nonbar tiles satisfy these conditions.
2 Main Tools
In this section we briefly review two concepts that will play a crucial role in our proofs: affine independence and Ryser’s theorem.
Affine independence.
Vectors are called affinely independent if the unique solution of equations
is . It is easy to show that the following three conditions are equivalent:

(ai1) are affinely independent,

(ai2) are linearly independent,

(ai3) are linearly independent.
We will refer to vectors , , in (ai2), as difference vectors. Condition (ai2) is useful in verifying affine independence. For example, are affinely independent because the difference vectors and are linearly independent.
Condition (ai3) implies that if are affinely independent then for any vector and constant , the equations
have a unique solution .
For any vector and any set of indices , define the restriction of to be the vector that consists only of the coordinates , , of . For example, the restriction of is . For any set of vectors , to show that they are affinely independent it is sufficient to show that their restrictions are affinely independent, for some set of indices .
Ryser’s theorem.
Ryser [10] studied the structure of 01 matrices with given projections. We adapt his characterization of these matrices and express it in terms of tile packings.
Fix a tile and let be a set of rows and a set of columns. We say that a tile copy belongs to if . Note that here we do not require inclusion of in .
Define , where the maximum is taken over all packings of the grid. Thus is the maximum number of copies of that can belong to in a packing without overlapping (and without any restriction on their projections).
For a set of rows, denote . Analogously, let , for a set of columns. By and we denote the complements of of sets and set , respectively.
Consider a packing with projections . Then we have
By definition, . Therefore we obtain the following lemma (inspired by [10]).
Lemma 1
Let be a set of rows and a set of columns. If then every packing with projections satisfies and .
3 General Proof Structure
For each nonbar tile , we show a polynomialtime reduction from the 3Color Tomography Problem introduced in [6] and shown to be hard in [4]. In that problem, an object to be reconstructed is a set of “atoms” (in our terminology, single cells) colored red (R), green (G) or blue (B). The instance contains separate projections for each color. The formal definition is this:
 3Color Tomography Problem (3CTP):

The instance consists of six vectors , . The objective is to decide whether there is an matrix with values from such that, for each color , for each and for each .
From now on, assume that is some nonbar fixed tile of width and height . Let be an instance of 3CTP for some matrix specified by six projections . We will map into an instance of TPTP for an grid with projections , , such that has a matrix with projections if and only if has a packing with projections .
Without loss of generality we assume that for every color we have , for every row we have , and for every column we have . Otherwise, is of course unfeasible, so we could take to be any fixed unfeasible instance of TPTP.
We now describe . We will choose a grid of size for and , where and are positive integer constants to be specified later. We will use the term block for a grid. We can partition our grid into rectangles of dimension , and we can think of each such rectangle as a translated block. The rectangle will be referred to as block .
Next, we need to specify the projections and . We will describe these projections in a somewhat unusual way, by fixing three packings of a block denoted , , and (obviously, corresponding to the three colors), and then expressing and as linear combinations of these packings. More specifically, denoting by and the horizontal and vertical projections of packing , for each , we define
(1) 
for every , , , and . The idea is that replacing each cell in a solution to the 3CTP instance , for , by its colorcorresponding block gives a solution to the TPTP instance .
To complete the description of the reduction, it still remains to define the three packings , , and . This will be done in the next section. In the remainder of this section we establish conditions that will guarantee correctness of our reduction.
Our three packings will be designed to satisfy the following two requirements:

Requirement 1: Vectors are affinely independent and vectors are affinely independent. Note that, by property (ai3), this implies that for any vector there is at most one possible way to represent it in a form , where . Naturally, an analogous statement holds for column projections.

Requirement 2: In any packing of with projections , the restriction of to each block of the grid has projections equal to , for some .
Lemma 2
Assume that the three packings satisfy Requirements 1 and 2. Then has a solution if and only if has a solution.
Proof: Let be a solution to . We transform into the following packing for the grid:
In other words, if then block of the grid contains a copy of . By simple inspection, the projections of are indeed equal to the vectors and in (1).
For the converse, suppose that there is a packing with projections , . By Requirement 2, every block of the grid has projections and , for some . We then associate this block with color . We can thus define a matrix such that if block of is associated with color .
We now need to show that is a solution for . To this end, fix some arbitrary and consider vector
which is the projection of the “row” of all blocks , for all . By the construction (1), can be written as
where , , and . Now, using Requirement 1, we obtain that this representation is unique under the assumption that . We can thus conclude that the projection of row of is correct, that is for all . By the same argument, column projections of are correct as well, completing the proof.
In summary, to complete the proof for the given tile , we need to do this: (i) define a rectangular block with three packings , (ii) show that the row projections of and the corresponding column projections are affinely independent (Requirement 1), and (iii) show that in any solution to , each block has projections equal to those of one of , for some (Requirement 2). We show the construction of such block packings in the next section.
4 Construction of Block Packings
As in the previous section, is a fixed (but arbitrary) nonbar tile. We call a conflicting vector if and overlap, that is . Obviously, the vectors and are either both conflicting or both nonconflicting. Since is not a bar, it has a conflicting vector with . To see this, observe that since is connected and not a bar, it contains two cells and with and , so one of or is a conflicting vector.
For the construction of the proof, fix a conflicting vector of that maximizes the norm under the constraint that none of the coordinates is . We denote this vector by and assume without loss of generality , for otherwise we can flip horizontally or vertically and give the proof for the resulting tile.
So any vector with and is not conflicting. Let be the smallest positive integer such that is not a conflicting vector. Similarly let be the smallest positive integer such that is not a conflicting vector. Without loss of generality we assume that , since otherwise we can exchange the roles of columns and rows in the proof.
We now divide the proof into four cases, and for each of them we show that Requirements 1 and 2 are satisfied.
4.1 Case and
In this case, we use the following three packings:
The values of and are chosen to be the smallest integers for which these three packings are contained in the grid.
The packings are depicted on Figure 2. The squares represent possible positions for tiles. Two positions are connected with a solid line if the difference of the positions is a conflicting vector. That means that no packing can contain simultaneously a tile in both positions. Dotted lines indicate nonconflicting vectors, i.e. they connect pairs of compatible positions. We show lines only between position pairs relevant to the proof. In the figure we mark with letter the tile positions of , for . For illustration, for each case, on the righthand side of the figure we show a tile satisfying the case conditions. Again, solid vectors are conflicting and dotted vectors are nonconflicting.
We first verify Requirement 1. The restrictions of are, respectively, , and , and the restrictions of are, respectively, , and . For both the row and column projections, routine calculations show that their restrictions are affinely independent.
We now focus on Requirement 2. Let be the projections obtained by the reduction, and consider a packing with these projections. We use Lemma 1, with being the set of all row indices that are modulo , and being the set of all column indices that are modulo . By inspecting the definition of the projections we have
so , which is . In consequence Lemma 1 applies. Therefore every block in contains a tile at position and none at position . The remaining possible positions for tiles are , but both cannot be occupied in the same block. This shows that every block of is one of the packings .
4.2 Case and
In this case, we use the following three packings:
The values of and are chosen to be the smallest integers for which these three packings are contained in the grid.
The restrictions of are linearly independent vectors , , ; therefore are affinely independent. By a similar argument, we obtain that the corresponding column projection vectors are affinely independent as well. Thus, Requirement 1 holds.
Now we verify Requirement 2. Row of a block can contain at most 2 tiles. Let be the set of rows with . By inspecting the definition of the projections we have , so every block in a solution must contain exactly 2 tiles in row , and they are at positions .
Now let be the set of all columns with . We only have , so in every block of the positions are empty. The tile at forces position to be empty. By the case assumption that , there is no conflict between and . By maximality of there is no conflict between positions and , or between and , or and .
That leaves only positions where the block packings can differ, namely , and . Let be the number of blocks in with a tile in . Similarly let be the number of blocks in with a tile in . Now we use the fact that in the original instance we had ; let denote this quantity. This time, let be the set of rows with , and the set of columns with . Then, by the definition of and , we have , and by the definition of the chosen three packings, we have . Similarly, we have and , which shows . Therefore every block packing in is one of or .
4.3 Case , and Vector Conflicting
In this case we assume , and that the vector is conflicting. Since is conflicting as well, this makes the construction very symmetric. The three packings used in this case are:
Again, the values of and are chosen to be the smallest integers for which these three packings are contained in the grid. The construction is illustrated in Figure 2. The idea behind this construction is similar to the reduction used in [2] to show hardness of the packing problem for the square tile.
The restrictions of are , , ; therefore are affinely independent. By symmetry, the same holds for .
Now we verify Requirement 2. Let be a packing with projections . Due to conflicts, there can be at most 2 tiles in rows of a block. Let . Since and there are blocks in , every block of must contain exactly 2 tiles in rows . By symmetry, the same holds for columns . There are only 4 packings that satisfy these constraints and avoid conflicts, namely and packing . Let be the respective numbers of these different block packings in . Since has row projection , by expressing the total number of tiles in two different ways, we have
(2) 
From the assumption that , we have also
(3) 
Now let . Then . Similarly, for we obtain . After subtracting these two equations from (2) and (3), we are left with two equations
from which we conclude . This verifies Requirement 2.
4.4 The Remaining Case
Assume now that none of the previous cases holds. Since , this means that either

(a) and or

(b) , and vector is not conflicting.
We claim that the vector is not conflicting. Indeed, in case (b) above, it follows by case assumption and in case (a), it follows from the maximality of . Therefore, in any block of a packing both positions and could contain a tile.
We use the following three packings (see Figure 2):
Again, the values of and are chosen to be the smallest integers for which these three packings are contained in the grid.
The restrictions of are , , , and their difference vectors , are linearly independent. Therefore are affinely independent. The restrictions of are linearly independent vectors , , ; therefore are affinely independent. Thus, Requirement 1 holds.
Now we verify Requirement 2. The proof is similar to those of previous cases, except that now we have more candidate packings to consider. Fix some packing with projections . First, using the same arguments as in the previous case, we observe that every block of must contain exactly one tile in column , that is either in location or . Taking conflicts into accounts, straightforward case analysis produces nine possible packings, including two pairs of “equivalent” packings with identical projections. We now introduce notation for the numbers of these packings:

the number of packings ,

the number of packings or ,

the number of packings ,

the number of packings or ,

the number of packings ,

the number of packings ,

the number of packings .
Let be the set of all rows with and be the set of all columns with . Then, by inspecting the projection definitions, we have . Since and are the projections of , we also have and . This shows , completing the analysis of this case and the proof of hardness.
5 Acknowledgements
This research was partially supported by the USA National Science Foundation, grant CCF0729071, and by the Spanish CICYT (Comisión interministerial de ciencia y tecnología) projects TIN200768005C0403 and TIN200806582C0301.
We would like to thank the anonymous reviewers for pointing out a number of typographical mistakes in the submitted manuscript.
References
 S. Brunetti, M.C. Costa, A. Frosini, F. Jarray, and C. Picouleau. Reconstruction of binary matrices under adjacency constraints. In G. Herman and A. Kuba, editors, Advances in Discrete Tomography and Its Applications, pages 125–150. Birkhauser Boston, 2007.
 M. Chrobak, P. Couperus, C. Dürr, and G. Woeginger. On tiling under tomographic constraints. Theoretical Computer Science, 290(3):2125–2136, 2003.
 C. Dürr, E. Goles, I. Rapaport, and E. Rémila. Tiling with bars under tomographic constraints. Theoretical Computer Science, 290(3):1317–1329, 2003.
 C. Dürr, F. Guíñez, and M. Matamala. Reconstructing 3colored grids from horizontal and vertical projections is NPhard. In Proc. 17th Annual European Symposium on Algorithms, pages 776–787, 2009.
 A. Frosini and G. Simi. The reconstruction of a subclass of domino tilings from two projections. Discrete Applied Mathematics, 151(13):154 – 168, 2005.
 R. Gardner, P. Gritzmann, and D. Prangenberg. On the computational complexity of determining polyatomic structures by Xrays. Theoretical Computer Science, 233:91–106, 2000.
 G. Herman and A. Kuba. Advances in Discrete Tomography and Its Applications. Birkhäuser, Boston, 2007.
 A. Kuba and G. T. Herman. Discrete Tomography: Foundations, Algorithms and Applications. Birkhäuser, 1999.
 C. Picouleau. Reconstruction of domino tiling from its two orthogonal projections. Theoretical Computer Science, 255:437–447, 2001.
 H.J. Ryser. Matrices of zeros and ones. Bulletin of the American Mathematical Society, 66:442–464, 1960.
 H.J. Ryser. Combinatorial Mathematics. Mathematical Association of America and Quinn & Boden, Rahway, New Jersey, 1963.