Tile-Packing Tomography is \mathbb{NP}-hard

# Tile-Packing Tomography is NP-hard

## Abstract

Discrete tomography deals with reconstructing finite spatial objects from their projections. The objects we study in this paper are called tilings or tile-packings, 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 low-dimensional projections. Inverse problems of this nature arise naturally in medical computerized tomography, electron tomography, non-destructive 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

 (i−1,j),(i,j−1),(i,j+1),(i+1,j),

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 top-down and columns numbered from left to right, so that the upper-left 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

 T+(i,j)={(x+i,y+j):(x,y)∈T}

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 upper-left 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 base-change. So the row and column projections of a packing are defined as a pair and of vectors such that

 ri=|{j:(i,j)∈D}|andsj=|{i:(i,j)∈D}|.

For example, consider tile . Figure 1 shows an example of a -packing. This packing is

 D={(0,3),(2,0),(2,7),(3,5),(4,3),(6,0),(6,7)}.

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 0-1 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 polynomial-time algorithm for that case. The ideas from [11] were extended in [3, 9] to the case when is a bar. In [1], polynomial-time 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 0-1 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 non-bar 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

 k∑i=1αi=0 and k∑i=1αivi=0

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

 k∑i=1αivi=v and k∑i=1αi=β

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 0-1 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

 r(I)−s(¯J) = |D∩(I×J)|−|D∩(¯I×¯J)|.

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 non-bar tile , we show a polynomial-time reduction from the 3-Color 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:

3-Color 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 non-bar 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

 rxk+i=∑crcx⋅¯rci%andsyℓ+j =∑cscy⋅¯scj (1)

for every , , , and . The idea is that replacing each cell in a solution to the 3CTP instance , for , by its color-corresponding 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:

 D=⋃x∈[0,m)⋃y∈[0,n)(DMxy+(xk,yℓ)).

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

 v=(rxk,rxk+1,...,r(x+1)k−1),

which is the projection of the “row” of all blocks , for all . By the construction (1), can be written as

 v=nR¯rR+nG¯rG+nB¯rB,

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) non-bar tile. We call a conflicting vector if and overlap, that is . Obviously, the vectors and are either both conflicting or both non-conflicting. 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 a=1 and b=1

In this case, we use the following three packings:

 DR ={(p,0),(p,q)}, DG ={(0,q),(p,q)}, DB ={(p,q)}.

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 non-conflicting 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 right-hand side of the figure we show a tile satisfying the case conditions. Again, solid vectors are conflicting and dotted vectors are non-conflicting.

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

 r(I)=∑x∈[0,m)rRx+mn=∑y∈[0,n)sRy+mn=s(¯J)+mn,

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 a=1 and b≥2

In this case, we use the following three packings:

 DR ={(2p,0),(2p,bq),(p,0)} DG ={(2p,0),(2p,bq),(0,q)} DB ={(2p,0),(2p,bq)}

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 a=2, b=2 and Vector (p,q) 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:

 DR ={(0,2q),(p,0),(2p,2q)}, DG ={(0,q),(2p,0),(2p,2q)}, DB ={(0,0),(0,2q),(2p,0),(2p,2q)}.

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

 3∑rRx+3∑rGx+4∑rBx=3λR+3λG+4λB+3λA. (2)

From the assumption that , we have also

 ∑rRx+∑rGx+∑rBx=mn=λR+λG+λB+λA. (3)

Now let . Then . Similarly, for we obtain . After subtracting these two equations from (2) and (3), we are left with two equations

 ∑rBx =λB+λA, 4∑rBx =4λB+3λA,

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):

 DR ={(p,0),(p,bq)}, DG ={(0,q),(p,bq)}, DB ={(p,bq)}.

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 CCF-0729071, and by the Spanish CICYT (Comisión interministerial de ciencia y tecnología) projects TIN2007-68005-C04-03 and TIN2008-06582-C03-01.

We would like to thank the anonymous reviewers for pointing out a number of typographical mistakes in the submitted manuscript.

### References

1. 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.
2. M. Chrobak, P. Couperus, C. Dürr, and G. Woeginger. On tiling under tomographic constraints. Theoretical Computer Science, 290(3):2125–2136, 2003.
3. 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.
4. C. Dürr, F. Guíñez, and M. Matamala. Reconstructing 3-colored grids from horizontal and vertical projections is NP-hard. In Proc. 17th Annual European Symposium on Algorithms, pages 776–787, 2009.
5. A. Frosini and G. Simi. The reconstruction of a subclass of domino tilings from two projections. Discrete Applied Mathematics, 151(1-3):154 – 168, 2005.
6. R. Gardner, P. Gritzmann, and D. Prangenberg. On the computational complexity of determining polyatomic structures by X-rays. Theoretical Computer Science, 233:91–106, 2000.
7. G. Herman and A. Kuba. Advances in Discrete Tomography and Its Applications. Birkhäuser, Boston, 2007.
8. A. Kuba and G. T. Herman. Discrete Tomography: Foundations, Algorithms and Applications. Birkhäuser, 1999.
9. C. Picouleau. Reconstruction of domino tiling from its two orthogonal projections. Theoretical Computer Science, 255:437–447, 2001.
10. H.J. Ryser. Matrices of zeros and ones. Bulletin of the American Mathematical Society, 66:442–464, 1960.
11. H.J. Ryser. Combinatorial Mathematics. Mathematical Association of America and Quinn & Boden, Rahway, New Jersey, 1963.
You are adding the first comment!
How to quickly get a good reply:
• Give credit where it’s due by listing out the positive aspects of a paper before getting into which changes should be made.
• Be specific in your critique, and provide supporting evidence with appropriate references to substantiate general statements.
• Your comment should inspire ideas to flow and help the author improves the paper.

The better we are at sharing our knowledge with each other, the faster we move forward.
The feedback must be of minimum 40 characters and the title a minimum of 5 characters