1. Introduction
The present paper uses the theoretical material developed in a previous study by the authors in order to reconstruct a subclass of 2-convex polyominoes. Indeed, 2-convex polyominoes are the first difficult class of polyominoes in terms of tomographical reconstruction in the hierarchy of k-polyominoes and in this article we design an algorithm of reconstruction for a subclass of L-convex which is the second step in the whole comprehension of the hierarchy of k-polyominoes.
One main problem in discrete tomography consists on the reconstruction of discrete objects according to their horizontal and vertical projection vectors. In order to restrain the number of solutions, we could add convexity constraints to these discrete objects. There are many notions of discrete convexity of polyominoes (namely HV-convex [1] , Q-convex [2] , L-convex polyominoes [3] ) and each one leads to interesting studies. One natural notion of convexity on the discrete plane is the class of HV-convex polyominoes that are polyominoes with consecutive cells in rows and columns. Following the work of Del Lungo, Nivat, Barcucci, and Pinzani [1] we are able using discrete tomography to reconstruct polyominoes that are HV-convex according to their horizontal and vertical projections. In addition to that, for an HV-convex polyomino P every pairs of cells of P can be reached using a path included in P with only two kinds of unit steps (such a path is called monotone). A polyomino is called k-convex if for every two cells we find a monotone path with at most k changes of direction. Obviously a k-convex polyomino is an HV-convex polyomino. Thus, the set of k-convex polyominoes for
forms a hierarchy of HV-convex polyominoes according to the number of changes of direction of monotone paths. This notion of 1-convex polyominoes has been considered by several points of view. In [4] combinatorial aspects of 1-convex polyominoes are analyzed, giving the enumeration according to the semi-perimeter and the area. In [5] it is given an algorithm that reconstructs a 1-convex polyomino from the set of its maximal L-polyominoes. Similarly in [3] it is given another way to reconstruct a L-convex polyomino from the size of some special paths, called bordered L-paths.
In fact 2-convex polymoninoes are more geometrically complex and there was no result for their direct reconstruction. We could notice that Duchi, Rinaldi, and Schaeffer are able to enumerate this class in an interesting and technical article [6] . But the enumeration technique gives no idea for the tomographical reconstruction.
The first subclass that creates the link with 2-convex polyominoes is the class of HV-centered polyominoes. In [7] , it is showed that if P is an HV-centered polyomino then P is 2-convex. Note that the tomographical properties of this subclass have been studied in [8] and its reconstruction algorithm is well known.
The main contribution of this paper is an
-time algorithm for reconstructing a subclass of 2-convex polyominoes using the geometrical properties studied in a previous study, and the algorithm of Chrobak and Dürr [8] . In particular, we add well-chosen clauses to the original construction of Chrobak and Dürr in order to control the 2L-convexity using 2SAT satisfaction problem.
This paper is divided into 5 sections. After basics on polyominoes, Section 3 shows the different geometrical shapes of a subclass of 2-convex polyominoes [9] . In Section 4, the algorithm of Chrobak and Dürr for the reconstruction of the HV-convex polyominoes is given [8] . Section 5 describes the reconstruction of different subclasses of 2-convex polyominoes.
2. Definition and Notation
A planar discrete set is a finite subset of the integer lattice
defined up to translation. A discrete set can be represented either by a set of cells, i.e. unitary squares of the cartesian plane, or by a binary matrix, where the 1’s determine the cells of the set (see Figure 1).
A polyomino P is a finite connected set of adjacent cells, defined up to translations, in the cartesian plane. A row convex polyomino (resp. column-convex) is
Figure 1. A finite set of
, and its representation in terms of a binary matrix and a set of cells.
a self avoiding convex polyomino such that the intersection of any horizontal line (resp. vertical line) with the polyomino has at most two connected components. Finally, a polyomino is said to be convex (or HV-convex) if it is both row and column-convex (see Figure 2).
To each discrete set S, represented as a
binary matrix, two integer vectors
and
are associated such that, for each
,
and
are the number of cells of S (elements 1 of the matrix) which lie on row i and column j, respectively. The vectors H and V are called the horizontal and vertical projections of S, respectively (see Figure 3). Moreover if S has H and V as horizontal and vertival projections, respectively, then we say that S satisfies (H, V). Using the usual matrix notations, the element
denotes the entry in row i and column j.
For any two cells A and B in a polyomino, a path
, from A to B, is a sequence
of adjacent disjoint cells belonging in P, with
, and
. For each
, we say that the two consecutive cells
form:
• an east step if
and
;
• a north step if
and
;
• a west step if
and
;
• a south step if
and
.
Finally, we define a path to be monotone if it is entirely made of only two of the four types of steps defined above (see [7] [10] ).
Proposition 1 (Castiglione, Restivo). A polyomino P is HV-convex if and only if every pair of cells is connected by a monotone path.
Let us consider a polyomino P. A path in P has a change of direction in the cell
, for
, if
Definition 1. We call k-convex an HV-convex polyomino such that every pair of its cells can be connected by a monotone path with at most k changes of direction respectively.
In [5] , it is proposed a hierarchy on convex polyominoes based on the number of changes of direction in the paths connecting any two cells of a polyomino.
For
, we have the first level of hierarchy, i.e. the class of 1-convex polyominoes, also denoted L-convex polyominoes for the typical shape of each
Figure 2. Row convex and convex polyomino.
Figure 3. A polyomino P with
and
.
path having at most one single change of direction. In the present study, we focus our attention on the next level of the hierarchy, i.e. the class of 2-convex polyominoes, whose geometrical properties are more complicated and harder to be investigated than those of 1-convex polyominoes (see Figure 4).
3. 2-Convex Polyominoes
Let
be two projection vectors and let P be an HV-convex polyomino, that satisfies
. By a classical argument P is contained in a rectangle R (called minimal bounding box) where in this box no projection gives a zero. Let
(
,#Math_41#,
) be the intersection of P’s boundary on the lower (right, upper, left) side of R (see [1] ). By abuse of notation, we call
[resp.
,
,
] the cell at the position
[resp.
,
,
] and
[resp.
,
,
] the cell at the position
[resp.
,
,
] (see Figure 5).
Definition 2. The segment
is called the S-foot. Similarly, the segments
,
and
are called E-foot, N-foot and W-foot.
For a bounding rectangle R and for a given polyomino P, let us define the following sets:
•
,
•
,
Figure 4. The convex polyomino on the left is 2-convex, while the one on the right is 1-convex.
•
,
•
.
Let
be the class of HV-convex polyominoes, thus we have the following classes of polyominoes regarding the position of the non-intersecting feet.
•
,
•
,
•
, where P is a 2-convex polyomino.
•
, where P is a 2-convex polyomino.
Now in order to understand the different geometries of the class
, let us define the following subclasses of the class
.
•
(see Figure 6).
•
. (see Figure 6).
•
(see Figure 6).
•
(see Figure 6).
•
, where P is a 2-convex polyomino.
•
, where P is a 2-convex polyomino.
•
, where P is a 2-convex polyomino.
•
, where P is a 2-convex polyomino.
Theorem 1. Let P be a convex polyomino in the class
, P is 2-convex if and only if there exists an L-path from
1)
or
2)
or
3)
Figure 6. An element of the class: (a)
, (b)
, (c)
, (d)
.
or
4)
Corollary 1. If P satisfies the conditions of Theorem 2, then P is in the class
and hence it is in the class
(see Figure 7).
Theorem 2. Let P be a convex polyomino in the class
, P is 2-convex if and only if there exists an L-path from
1)
or
2)
or
3)
or
4)
or
Figure 7. The four geometries in the class
.
5)
or
6)
or
7)
Corollary 2. If P satisfies the conditions of Theorem 3, then P is in the class
and hence it is in the class
(see Figure 8).
Theorem 3. Let P be a convex polyomino in the class
, P is 2-convex if and only if there exists an L-path from
1)
or
Figure 8. The seven geometries in the class
.
2)
or
3)
or
4)
or
5)
or
6)
or
7)
Corollary 3. If P satisfies the conditions of Theorem 4, then P is in the class
and hence it is in the class
(see Figure 9).
Theorem 4. Let P be a convex polyomino in the class
, P is 2-convex if and only if there exists an L-path from
1)
or
2)
or
3)
or
4)
or
5)
or
6)
or
7)
or
Figure 9. The seven geometries in the class
.
8)
or
9)
or
10)
or
11)
or
12)
or
13)
or
14)
Corollary 4. If P satisfies the conditions of Theorem 5, then P is in the class
and hence it is in the class
(see Figure 10 and Figure 11).
4. HV-Convex Polyominoes
Assume that H, V denote strictly positive row and column sum vectors. We also assume that
, since otherwise
do not have a realization.
The idea of Chrobak and Dürr [8] for reconstructing an HV-convex polyomino is to impose convexity on the four corner regions outside of the polyomino.
An object A is called an upper-left corner region if
or
implies
. In an analogous way other corner regions can be defined. Let
be the complement of P. The definition of HV-convex polyominoes directly implies the following lemma.
Lemma 1. P is an HV-convex polyomino if and only if
, where
are disjoint corner regions (upper-left, upper-right, lower-left and lower-right, respectively) such that 1)
implies
not in D, and 2)
implies
.
Figure 10. The first twelve geometries in the class
.
Figure 11. The last two geometries in the class
.
Given an HV-convex polyomino P and two row indices
. P is anchored at
if
. The idea of Chrobak and Dürr is, given
, to reconstruct a 2SAT expression (a boolean expression in conjunctive normal form with at most two literals in each clause)
with the property that
is satisfiable iff there is an HV-convex polyomino realization P of
that is anchored at
.
consists of several sets of clauses, each set expressing a certain property: “Corners” (Cor), “Disjointness” (Dis), “Connectivity” (Con), “Anchors” (Anc), “Lower bound on column sums” (LBC) and “Upper bound on row sums” (UBR).
The set of clauses
means that the corners are convex, that is for the corner A if the cell
belongs to A then cells
and
belong also to A. Similarly for corners B, C, and D.
The set of clauses
means that all four corners are pairwise disjoint, that is
for
.
The set of clauses
means that if the cell
belongs to A then the cell
does not belong to D, and similarly if the cell
belongs to B then the cell
does not belong to C.
The set of clauses
means that we fix two cells on the west and east feet of the polyomino P, for
the first one at the position
and the second one at the position
.
The set of clauses LBC implies that for each column j, we have that
.
The set of clauses UBR implies that for each row i, we have that
.
Define
. All literals with indices outside the set
are assumed to have value 1.
The following theorem allows to link the existence of HV-convex solution and the evaluation of
. The crucial part of this algorithm comes from the constraints on the two sets of clauses LBC and UBR.
Theorem 5 (Chrobak, Durr).
is satisfiable if and only if
have a realization P that is an HV-convex polyomino anchored at
.
Each formula
has size
and can be computed in time
. Since 2SAT can be solved in linear time see [11] [12] , Chrobak and Dürr give the following result.
Theorem 6 (Chrobak, Durr). Algorithm 1 solves the reconstruction problem for HV-convex polyominoes in time
.
5. Reconstruction of 2-Convex Polyominoes in
The present section uses the theoretical material of the previous sections in order to reconstruct 2-convex polyominoes in the class
. Some modifications are made to the reconstruction algorithm of Chrobak and Dürr for HV-convex polyominoes in order to impose our geometries.
Finally, by defining an horizontal symmetry
, we show how to reconstruct P in the class
.
5.1. Clauses for the Class
We code by a 2SAT formula the four geometries that characterize all 2-convex polyominoes in the class
in order to reconstruct them.
In order to reconstruct all 2-convex polyominoes in the class
, we use the set of clauses that impose the 4 geometries.
Proof. The following modifications of the original algorithm of Chrobak and Durr [8] are made in order to add the geometrical constraints of the class
.
• The set
imposes the constraint of the relative positions of feet in
with
and
.
• The set
implies that thes cells at the positions
and
are in the interior of the polyomino.
• The set
implies that the cells at the prositions
,
,
, and
are not in the interior of the polyomino.
• The set
implies that we put a cell in the interior of the polyomino at the position
(resp.
and then by convexity an L-path between
and
(resp.
and
). Thus we have exactly the definition of the first geometry. The set
,
and
give respectively the L-paths of the second geometry, the third geometry and the fourth geometry.
Using the conjunction of the whole set of clauses, if one of the
or
or
or
is satisfiable then we are able to reconstruct an HV-convex with the constraints of the subclass
(see Figure 12).
5.2. Clauses for the Class
We code by a 2SAT formula the seven geometries that characterize all 2-convex polyominoes in the class
in order to reconstruct them.
Figure 12.
and
in the class
In order to reconstruct all 2-convex polyominoes in the class
, we use the set of clauses that impose the 7 geometries.
5.3. Clauses for the Class
We code by a 2SAT formula the seven geometries that characterize all 2-convex polyominoes in the class
in order to reconstruct them.
In order to reconstruct all 2-convex polyominoes in the class
, we use the set of clauses that impose the 7 geometries.
5.4. Clauses for the Class #Math_352#
We code by a 2SAT formula the fourteen geometries that characterize all 2-convex polyominoes in the class
in order to reconstruct them.
In order to reconstruct all 2-convex polyominoes in the class, we use the set of clauses that impose the 14 geometries.
5.5. Reconstruction of the Class Using the Horizontal Reflexion
Given two integer vectors and. To reconstruct a polyomino P in the class, one can see that the horizontal reflexion, sends the projection vectors to, where. Now from the two vectors of projections, one can reconstruct the polyomino P in the class and then by the horizontal reflexion, we reconstruct P in the class.