Exact values for three domination-like problems in circular and infinite grid graphs of small height

In this paper we study three domination-like problems, namely identifying codes, locating-dominating codes, and locating-total-dominating codes. We are interested in ﬁnding the minimum cardinality of such codes in circular and inﬁnite grid graphs of given height. We provide an alternate proof for already known results, as well as new results. These were obtained by a computer search based on a generic framework, that we developed earlier, for the search of a minimum labeling satisfying a pseudo-d -local property in rotagraphs.


Graphs and codes
A graph G is a couple (V, E) in which V is a set of vertices and E is a set of 2-elements subsets of V called edges. Two vertices that are joined by an edge in G are said to be neighbors. For a vertex v ∈ V , the set of neighbors of v in G is denoted by N G (v), and the closed neighborhood N G (v) ∪ {v} of v is denoted by N G [v] (the subscript G may be omitted when there is no ambiguity).
A code of a graph G is simply a subset of vertices of G.
Given a code C of a graph G, we say that a vertex v is dominated by C if N G [v] ∩ C = ∅, and it is totally dominated by C if N G (v) ∩ C = ∅. Two distinct vertices u and v are said separated by C if A code C of a graph G is : dominating, or a D-code, if every vertex of G is dominated by C ; totaldominating, or a T D-code, if every vertex of G is totally dominated by C ; locating-dominating, or an LD-code, if it is a D-code and every two distinct vertices u and v not in C are separated by C ; locatingtotal-dominating, or an LT D-code, if it is a T D-code and an LD-code ; identifying, or an ID-code, if it is a D-code and every two distinct vertices u and v of G are separated by C.
From previous definitions it is immediate to see that given a graph G and a code C of G, the following holds: -C is an ID-code of G ⇒ C is a LD-code of G, -C is an LT D-code of G ⇒ C is an LD-code and a T D-code of G, -C is an LD-code or a T D-code of G ⇒ C is a D-code of G, For the notions of D, T D, LD and LT D-codes, see [15,18]. For the notion of ID-code, see [23]. The following Lemma holds by the definition of domination and separation.
Lemma 1 Let C be a code of a graph G = (V, E) and v ∈ V \ C. In G, every vertex dominated by C is dominated by C ∪ {v} and every two vertices separated by C are separated by C ∪ {v}.
As a corollary of this Lemma we get that G contains a D-code (resp. a T D-, an LD-, an LT D-, an ID-code) only if V itself is a D-code (resp. a T D-, an LD-, an LT D-, an ID-code). Hence, deciding if in a given graph there exists one of these codes is not hard. The problem is to find one of minimum cardinality.

Grids and strips
We define three infinite graphs, that all have Z 2 as vertex set : The square grid, denoted S, is the graph such that (i, j)(k, l) is an edge whenever |i − k| + |j − l| = 1 (see Figure 1). The triangular grid, denoted T , is the graph obtained by adding to S all edges (i, j)(k, l) such that (k − i) = (j − l) = 1 (see Figure 2). The king grid, denoted K, is the graph obtained by adding to T all edges (i, j)(k, l) such that (k − i) = (l − j) = 1 (see Figure 2).
Any of these three graphs will be said to be a grid. Consider a grid G and a positive integer h.
The infinite strip of height h of G, denoted G h , is the subgraph of G induced by the vertices (i, j) with i ∈ {1, . . . , h}. The infinite toroidal strip of height h ≥ 3, denoted S •h , is obtained from the infinite square strip S h by adding all edges (1, j)(h, j) for j ∈ Z.
The finite strip of height h and size s ≥ 1 of G is the subgraph of G, denoted G h,s induced by the vertices (i, j) with i ∈ {1, . . . , h} and j ∈ {1, . . . , s}. The circular strip of G of height h ≥ 1 and size s ≥ 3, denoted G • h,s , is obtained from G h,s by adding all edges (i, s)(i , 1) such that (i, s)(i , s + 1) is an edge of G, for i, i ∈ {1, . . . , h}. The toroidal circular strip of height h ≥ 3 and size s ≥ 3, denoted S • •h,s , is obtained from the circular square strip S • h,s by adding all edges (1, j)(h, j) for j ∈ {1, . . . , s}. Let G be a graph whose set of vertices is included in Z 2 . The k-th column of G denotes the set of vertices (i, j) of G such that j = k. A set E of columns of G is said to be a set of consecutive columns if there exist integers k and l, k ≤ l, such that E is equal to the set of columns numbered from k to l. The columns that are neighbors of the k-th column of G are the (k − 1)-th and the (k + 1)-th columns (if defined), with addition modulo n in the case G is a circular strip on n columns. Notice that if G is a subgraph of a grid then any of its vertices has neighbors only in its column or in a neighbor of it. Given a strip S (of any kind), any non-circular strip induced in S by a set of consecutive columns of S will be a called a substrip of S. In the case S is a circular strip of size s, a substrip of S of size s is obtained from S by deleting the edges between a pair of consecutive columns of S.

Literature review
There is a broad literature about LDand ID-codes in infinite grids, see for instance [1,7,8,28]. IDand LD-codes in infinite strips were addressed in [2,12,27]. As for LT D-codes in infinite strips, the problem was studied in [17,22].
In the above-mentioned references, bounds or exact values are given for the minimum density of a code in infinite grids or strips. These results are obtained by combinatorial arguments based on the analysis of local configurations.
There are also papers dealing with the algorithmic aspects of finding the minimum cardinality of some codes in grids or in grid-like structures. For instance, in [12,14,24,32,33,34], efficient algorithms are provided to compute the minimum cardinality of a Dor ID-code in broad classes of graphs, containing in particular circular strips. The classes of graphs involved in these papers are called fasciagraphs and rotagraphs ; fasciagraphs generalize strips of grids and rotagraphs generalize circular strips of grids. For short, a fasciagraph is constituted by multiple consecutive copies of a given graph, each copy being linked to the next one by a fixed scheme.
In [6] one can find the definition of a fasciagraph and of a rotagraph, as well as a general framework that unifies the results presented in the above-mentioned papers. It is shown there that, due to the repetitive structure of these graphs, dynamic programming can be applied to address optimization problems that are -in some sense -"local".
In Section 5 we present the results we obtained by implementing the algorithm described in [6], to get new results on the minimum cardinality of ID-, LD-, and LT D-codes in strips of small height.

The algorithm
The present section is dedicated to the description of the adaptation of the theoretical framework of [6] to the case of the search of an ID-code of minimum cardinality in circular strips of given height. The algorithms for LDor LT D-codes being similar, they are not described hereafter. Notice that in [6] the algorithm for finding a minimum D-code is described, and it can easily be adapted for a T D-code.

Labelings, codes and pseudo-d-local properties
In the framework of [6], we can address combinatorial problems whose solutions may be described as particular q-labelings of the vertices of an associated graph. Given an integer q ≥ 2, a q-labeling of a graph is simply a function f that maps each vertex v of the graph to an integer f (v) ∈ {0, . . . , q − 1}. There is a one-to-one correspondence between 2-labelings and codes by considering that the vertices of the code are exactly those that are labeled 1. Given a 2-labeling f of the vertices of a graph we will denote by C f the corresponding code. We will see now that, for the kind of 2-labelings of circular strips we are looking for, it is enough to require a property of the labeling limited to "small" subgraphs of the strip. From now on, we will focus on the special case of a minimum ID-code.
Given a labeling f of a strip G h,s and 1 ≤ i ≤ j ≤ s, f i,j denotes the labeling of G h,j−i+1 corresponding to the restriction of f to the columns of G h,s numbered from i to j. Similarly, for a labeling f of a circular strip G • h,s and two integers 1 ≤ i, j ≤ s we will denote by f i,j the labeling by f of the columns i, i + 1 . . . , j − 1, j of G • h,s (addition modulo s). Let us now see more precisely in which sense we consider the property of being an ID-code as "local". We will say that a 2-labeling f of a strip G h,s or a circular strip G • h,s , of size s ≥ 5 (for some grid G) satisfies the property P I if in every (non-circular) substrip F of size 5, the vertices in the three middle columns are dominated and separated from each other by the vertices of C f that are in F . It is easy to see that one can check within a finite number of steps if a labeling of a finite circular strip of size at least 5 satisfies this property. From the following theorem we can then deduce that being an identifying code of a circular string is a pseudo-5-local property (as defined in [6] (i) ).
h,s if and only f satisfies P I .
Proof: We remark that the vertices that are in the three middle columns of a 5-column substrip F of G • h,s have their neighborhoods included in F , so the condition is clearly necessary. Assume now that the condition is fulfilled and let us consider any vertex v of G • h,s . It belongs to the third column of a substrip F of five consecutive columns of G • h,s so, since f satisfies P I , v is dominated already in F . Hence C f is dominating. Let now w be a vertex of G • h,s distinct from v. If v and w are not contained in the set of vertices of three consecutive columns of G • h,s then their closed neighborhoods are disjoint and have a non-empty intersection with C f (since C f is dominating), so v and w are separated by C f . Assume now that v and w are contained in the set of vertices of three consecutive columns of G • h,s . Since s ≥ 5, these columns are the three middle columns of a substrip of G • h,s of size 5. The fact that f satisfies P I entails that v and w are separated by C f . We notice that, if we were interested by a dominating code of a circular strip, it would have been sufficient to verify that in every substrip F of size 3, the vertices in the middle column are dominated by (i) A property P of q-labelings of circular strips is said to be pseudo-d-local if there exists a property P loc such that -one can decide in finite time if a q-labeling of a strip of size d satisfies P loc , and -a q-labeling of a circular strip of size at least d satisfies P if and only if the induced labeling of each substrip of size d satisfies P loc .
Notice that P I is the P loc associated to ID codes. The definition of a pseudo-d-local property of non-circular strips is pretty much the same, but we have to define extra-properties for the first and last columns of the strip. These properties will be stated explicitly for ID codes (see page 9 before Theorem 6).
the vertices of F labeled 1 [6] ; thus this property is pseudo-3-local. For all other kind of codes introduced in the present paper, we can define an associated property P loc of substrips of size d (for some fixed integer d), similar to P I , and a theorem similar to Theorem 1 holds. As it will be seen below, this enables us to find a minimum code of any kind by considering paths of minimum weight in an associated directed graph whose vertices are, basically, substrips of size d − 1 equipped with appropriate vertex labelings, and whose arcs correspond to substrips of size d satisfying P loc , the weight of an arc being equal to the cardinality of the associated code in the last fiber.

Computation of a minimum ID-code in a circular strip
In the rest of this section we will assume we are given a grid G and a height h. In order to compute the minimum cardinality of an ID-code of a circular strip of G of height h we build an auxiliary directed graph with a length function on the arcs.
We first need some additional definitions and notation.
where V is a set of elements called vertices and A is a subset of couples of elements of V called arcs. An arc (u, u) is called a loop.
Let k be a positive integer and G = (V, A) be a directed graph.
, the circuit is said to be elementary. The cardinality of a path (or a circuit) Q is denoted by |Q|.
A strongly connected component of a directed graph G is a maximal subgraph of G such that there exists a path from any vertex to any other vertex. A strongly connected component of a directed graph G is said to be trivial if it contains only one vertex and no arc.
Let G = (V, A) be a directed graph. If a length function : A → N is given, then we say that G is an -graph, and we define the length of a path P = v 1 , . . . , v k+1 of G (k ≥ 1) as follows: The mean of a k-path or a k-circuit C of an -graph G is mean(C) = (C) k , the mean length of an edge in C. Assume that G has a finite number of vertices. The minimum mean of a circuit in G is denoted by λ( G) ; in case G has no circuit, λ( G) is set to ∞. Notice that, since the mean of a circuit cannot be lower than the minimum mean of its elementary subcircuits, λ( G) is equal to the minimum mean of an elementary circuit of G. As the number of elementary circuits of a finite graph is finite, λ( G) is well-defined for a finite graph. We call min-mean component of G, any non-trivial strongly connected component of the subgraph of G induced by arcs belonging to circuits of mean equal to λ( G). The periodicity of a min-mean component of G is the gcd of the cardinalities of its elementary circuits of mean λ( G).
Given two 2-labelings f and f of the 4-column strip G h,4 , we will say that f is compatible with f if f labels the last three columns of G h,4 exactly as f labels the first three columns of G h,4 . Given two compatible labelings f and f , the concatenation of f and f denoted by f f is the 2-labeling of the 5-column strip G h,5 which is equal to f on the first four columns and to f on the last four columns. If furthermore the concatenation of f and f satisfies P I we will say that f is I-compatible with f .
We denote by G I h the directed -graph defined as follows : -the vertices of G I h are all 2-labelings f of the 4-column strip G h,4 such that the 2-labeling of the 6-column strip G h,6 which is the same as f on the 4 central columns and labels by 1 the vertices in the two peripheral columns satisfies P I .
The graph G I h will be called auxiliary graph for ID-codes in strips of height h. Notice that this auxiliary graph is not the one described in the general method of [6] where the vertices are labelings of fasciagraphs of size d (that is, in this particular case, labelings of strips of d = 5 columns) and not d − 1. It is described in Section 5.2 of [6] and may be used since the "weight" (number of vertices labeled 1) of a 2-labeling of a strip is equal to the sum of the number of vertices labeled 1 in each column of the strip. Remark that we have added a condition on the vertices compare to the definition in Section 5.2 of [6] in order to avoid vertices that cannot belong to a circuit.
It is easy to prove (as for Corollary 2 in [6]) that the following "specific" theorem for ID-codes holds.
Theorem 2 For every integers k ≥ 5 and l ≥ 1, there exists an ID-code of G • h,k of cardinality l if and only if G I h contains a k-circuit of length l. From this theorem we immediately get that we may obtain the minimum cardinality of an ID-code of G • h,k by computing the minimum length of a k-circuit in G I h . There is a well-known way to solve the problem of computing the minimum length of a k-circuit in a directed graph with a length function on the arcs. To describe it we need some additional definitions. Given two n × n matrices A, B with entries in N ∪ {∞}, we define the product of A and B, denoted AB, as the n × n matrix such that: Let G be a directed -graph on n vertices. Given a numbering u 1 , u 2 , . . . , u n of the vertices of G, the length-matrix of G, is the n × n matrix Π defined as follows: The following result is well-known and very useful.
Theorem 3 (Section 4.2 in [13]) Let Π be the length-matrix of an -graph G with vertex set {u 1 , u 2 , . . . , u n }. For any integers k ≥ 1 and i, j ∈ {1, . . . , n}, we have: From all the results above, we can obtain the minimum cardinality of an ID-code of a circular strip G • h,k (k ≥ 5), by generating the directed -graph G I h , computing the k-th power of the length-matrix of G I h and then returning the smallest element in the diagonal of this matrix. For a fixed height h this algorithm has a running-time which is polynomial in k.
In the next section we will see that the length-matrix of G I h has another very interesting property that enables one to compute this minimum cardinality for any size, and even for infinite strips, in constant-time.
3 Constant-time computation of minimum ID-codes in strips of given height In this section we will define a stable matrix and express important results on stable matrices due to Molnárová and Pribiš [26]. These results are essential to show that the minimum cardinality of an ID, LD, or LT D-code in circular and non-circular strips of given height and any size may be computed by a constant-time algorithm. Furthermore, as a corollary of these results we get that the minimum density of a code in an infinite strip of height h is the same as the minimum density of a code in a circular strip of height h.

Stable matrices
Given an n × n matrix A with entries in N ∪ {∞} and an integer c, we define the sum of A and c, denoted Remark 1 If Π is (c, p, u)-stable, then the sequence of the powers of Π is pseudo-periodic, that is to say, it has the following form: where [S 0 ] is the sequence Π u , Π u+1 , . . . , Π u+p−1 , and for j ≥ 1, [S 0 + jc] is the sequence Π u + jc, Π u+1 + jc, . . . , Π u+p−1 + jc. So, once the first u + p powers of Π have been computed, for any integer k > u + p, Π k can be obtained by a constant number of elementary operations.
A matrix is said stable if it is (c, p, u)-stable for some c, p, u (these are not unique). The property of stability of a matrix may be characterized by the circuits of minimum mean in its associated -graph, as shown by the following theorem. This result has been proved by Molnárová and Pribiš [26]. Molnárová [25] showed that the same proof is valid for matrices with entries in a divisible Min-Plus algebra. Furthermore if Π is stable and G contains circuits, then Π is stable with period p equals to the lcm of the periodicities of the min-mean components of G, and transfer factor c equals to pλ( G).
Corollary 1 If the directed -graph G has at most one non-trivial strongly connected component then its length matrix is stable.
Proof: Only non-trivial strongly connected components contain circuits of G and all vertices of a circuit of G belong the same strongly connected component. Hence if G contains at most one non-trivial strongly connected component then the condition of Theorem 4 is fulfilled. 2

Circular strips
Now we can prove the following theorem.
Theorem 5 Let G be a grid. For every integer h ≥ 1, the length-matrix of G I h is stable.
Proof: If G I h contains at most one vertex belonging to a non-trivial strongly connected component, then it contains at most one such component and then by Corollary 1 the length-matrix of G I h is stable. Assume now that there exist two distinct vertices x and y of G I h that belong each to a non-trivial strongly connected component. We claim that x and y should then be in the same strongly connected component. , y = f 8,11 , are vertices of G I h and xz 2 , z 2 z 3 , z 3 z 4 , z 4 z 5 , z 5 z 6 , z 6 z 7 and z 7 y are arcs of G I h , so that xz 2 z 3 z 4 z 5 z 6 z 7 y is a path from x to y in G I h . As x and y were any two vertices in a non-trivial strongly connected component this imply that there exists only one such component of G I h . By Corollary 1 the proof is done. 2 As a corollary of Remark 1 and Theorems 2, 3 and 5, for a given h, there is a constant-time algorithm to compute the minimum cardinality of an ID-code in a circular strip of height h and size at least 5 (see the algorithm Stable (P, w, M )−MRP in [6]).

Non-circular strips
We consider here the problem of computing the minimum cardinality of an ID-code in non-circular strips. It can be solved almost as for the case of circular strip but we have to take into account the specificity of the beginning and end of the strip.
Let f be a 2-labeling of a strip G h,4 of a grid G. We will say that f satisfies the property P I b ("b" for beginning) if the vertices in the first three columns of G h,4 are dominated and separated from each other by the vertices of C f . Similarly f satisfies the property P I e ("e" for ending) if the vertices in the last three columns of G h,4 are dominated and separated from each other by the vertices of C f .
It is easy to see that one can check within a finite number of steps if a labeling of a strip of size 4 satisfies P I b or P I e . From the following easy theorem we can then deduce that being an ID-code is a pseudo-5-local property of strips (as defined in [6] for "fasciagraphs").

Theorem 6
The code C f associated to a 2-labeling f of a strip G h,s (s ≥ 4) is an ID-code of G h,s if and only f satisfies P I , f 1,4 satisfies P I b and f s−3,s satisfies P I e . We denote by Γ I h the directed -graph obtained from G I h as follows : -add two specific vertices: a source s and a sink t, -for each vertex u of G I h such that u satisfies P I b , add an arc su of length (s, u) equal to the number of vertices of G h,4 labeled 1 by u, -for each vertex v of G I h such that v satisfies P I e , add an arc ut of length (u, t) equal to 0. It is then easy to prove using the model described in Section 5. Proof: The directed graph Γ I h is obtained from G I h by adding appropriately a source s and a sink t. These two vertices are trivial strongly connected components of Γ I h , so the number of non-trivial strongly connected components is the same in the two directed graphs. By the proof of Theorem 5 we know that this number is equal to 1. Corollary 1 concludes the proof. 2 As a corollary we get again that there is a constant-time algorithm that computes the minimum cardinality of an ID-code in a non-circular strip of height h (for a fixed h).

Infinite strips
In the case on an infinite strip there exists clearly no finite ID-code and we need another way to define the size of a "minimum code", using the concept of density. In a finite graph G = (V, E) the density d G (C) of a code C of G is equal to |C| |V | . We define the density D(C) of a code in the infinite strip G h (h ≥ 1) as where V n is the set of vertices (x, y) of G h such that |y| ≤ n (in other words, V n is the set of vertices of G h that belong to the columns numbered from −n to n). From Lemma 1 and the fact that in a strip of height 2 of the king grid, two vertices that are in the same column have exactly the same closed neighborhood, it is easy to deduce the following fact.
Proposition 1 There exists no ID-code of a king strip of height 2. All other strips (circular or not) of size at least 4 have an ID-code.
We have the following corollary of Theorem 4 (see Corollary 1 in [6]).
Corollary 2 Let G h be an infinite strip such that G = K or h = 2 and let λ = λ( G I h ) be the minimum mean of an elementary circuit of G I h . The minimum density on an Proof: Let C be an identifying code of the infinite strip G h and f the associated labeling of the vertices . From Proposition 1, there exists such a code and the circular strip G • h,5 also has one. Then by Theorem 2 the directed graph G I h contains at least one circuit and λ = ∞. By Theorem 5, the length matrix Π of G I h is (c, p, u)-stable for some integers c, p, u and by Theorem 4 the transfer factor c is equal to pλ.
We get that the density of C, D(C) = lim sup n→+∞ |C∩Vn| |Vn| h . Consider now an elementary circuit C of G I h of mean λ (by assumption there exists at least one such circuit) and let k be the cardinality of C. This circuit corresponds to a labeling f * of the strip G h,k+4 that satisfy P I and such that f * 1,4 = f * k+1,k+4 . The density of C f * 5,k on the last k columns of G h,k+4 is equal to kλ kh = λ h . The code of the infinite strip corresponding to an infinite repetition of f * 5,k is an ID-code of G h of density equal to λ h . Thus we have proved that Remark that, by Corollary 2, the problem of computing the minimum density of an ID-code of an infinite strip S of height h is the same as the problem of computing the minimum cardinality of an IDcode of a circular strip of height h on the same grid than S.
In the next section, we explain how we implemented the algorithm we have described above to get ID-codes of minimum density for circular and infinite strips of grids of height at most 4.

General scheme
The algorithms were implemented using the C++ language. They were designed to be executed in multithread, that is to say on several processors in parallel. These algorithms were run on the computational server of the G-SCOP lab having 10 processors.
The first task consisted in generating all possible 2-labelings of strips of a given height and size 4 (vertices of the graph) and the entries of the length-matrix (lengths of the arcs of the auxiliary graph). Coefficients of powers of the length-matrix matrix Π of the auxiliary graph G were stored as 16-bits shorts.
At any step k of the algorithm, in order to compute Π k , three matrices need to be stored in the RAM: The initial length matrix Π, its power Π k−1 , as well as its power Π k that we compute as the product of Π with Π k−1 .
In order to detect a period in the sequence of matrices, we need to store on the hard disk drive the matrix obtained at each step k.
When a period is detected, we get the values c, p, u such that Π is (c, p, u)-stable. This enables one to find the minimum cardinality of a code in a strip of size n using only a constant number of elementary operations.
If one wishes to obtain also the configuration of an optimal code, then one can perform a backtrack analysis of the algorithm, in order to get an optimal circuit of the auxiliary graph with the desired number of arcs.

Technical tricks to speed up the process
Size of the matrices The number of vertices, hence the size of the length-matrix Π, increases rapidly as the height of the strip increases. For instance, in the case of ID-codes, for the strip of the square grid of height 3, the auxiliary graph has 16 824 vertices. Using the approach described in Section 4.1, the size of a power of Π is approximately 540 Mo. Hence, in this algorithm, the size of the matrices is a critical parameter, since we have to be able to store three such matrices in the RAM.
Detecting the period In order to detect a period in the sequence of matrices, we stored on the hard disk drive the matrix Π k = Π k − min i,j (Π k i,j ) for each k, instead of Π k . Hence there is a period when we find k > k such that Π k = Π k . In oder to speed up the process, hashcodes of each matrix were computed.
Since different values of the hashcode ensure that the matrices are different, this enables one to avoid a large number of tests of the form "do we have Π k = Π k ?".
Speeding up the backtrack Due to the prohibitive size of the matrices, we did not perform any backtrack to get optimal codes. Indeed, a backtrack would have required to load into the RAM each of the matrices computed before the detection of the pseudo-period. Instead, we used constraint programming, using the java language and the CHOCO library. On a personal computer, the program finds an optimal code in less than 1 second for strips of height 1 and 2. For height 3, the computation time is about 1 hour. For height 4, the computation time is about 1 day.

Running times
We provide here the running times and the size of the length-matrixmatrix for the case of ID-codes in the strip of the square grid. Running times in strips of other types of grids are of the same order.

New results on ID-, LD-, and LT D-codes in finite circular strips and infinite strips
In this section, we report the results we obtained thanks to our implementation of the algorithm described above (and in [6]) for computing the minimum cardinality of an ID-, LD-, or LT D-code in finite circular strips and the minimum density of such codes in infinite strips. We remark that the number of vertices in a strip of size n and height h is equal to nh (it is the same for all kind of strips).
For each case we will underline the period p, the transfer factor c, the minimum mean λ = c p of a circuit in the auxiliary graph and specify the smaller size of a circular strip for which the corresponding minimum density λ h is attained as well as one corresponding pattern. By Corollary 2 a code of minimum density of the infinite strip is obtained by an infinite repetition of such a pattern.
The strips of height 1 of the king grid, and of the triangular grid are the same as the one of the square grid, so this case is studied only in the square grid section. Toroidal grid or strips are defined only for an height at least 3.

Square grid
Some of the results stated here for strips of height 1 or 2 were already in [2] and in [12].
Proposition 2 Let ID S (n, h) denote the minimum cardinality of an ID-code in a circular strip of the square grid of size n and height h: 3, for n = 5 n 2 , for n ≥ 6 and n ≡ 0[2] n 2 + 1, for n ≥ 7 and n ≡ 1 [2]. So that, p = 2, c = 1, and λ = 1 2 is the minimum density (see Figure 1 for a pattern of minimum density that applies for any circular strip of even size greater than or equal to 6) • h = 2: ID S (n, 2) =    6n 7 + 1, for n ≥ 8 and n ≡ 1 or 2 [7] 6n 7 , for n ≥ 5, and n ≡ 0, 3, 4, 5 or 6 [7]. So that, p = 7, c = 6, λ = 6 7 corresponds to the minimum density 6 7 /2 = 3 7 (see Figure 1 for a pattern of minimum density that applies for any circular strip whose size is a multiple of 7).

Toroidal circular strip
Proposition 4 Let ID S T (n, h) denote the minimum cardinality of an ID-code in a toroidal circular strip of size n ≥ 5 and height h.
So that, p = 4, c = 5, λ = 5 4 corresponds to the minimum density 5 4 /3 = 5 12 (see Figure 2 for a pattern of minimum density that applies for any circular strip whose size is a multiple of 4). So that, p = 7, c = 10, λ = 10 7 corresponds to the minimum density 10 7 /4 = 5 14 (see Figure 3 for a pattern of minimum density that applies for any circular strip whose size is a multiple of 28).

Triangular grid
Proposition 5 Let ID T (n, h) denote the minimum cardinality of an IDcode in a circular strip of the triangular grid of size n ≥ 5 and height h.
So that, p = c = 1 and λ = 1 corresponds to the minimum density 1 2 (see Figure 2 for a pattern of minimum density that applies for any circular strip of size at least 4). So that, p = c = 1 and λ = 1 corresponds to the minimum density 1 3 (see Figure 2 for a pattern of minimum density that applies for any circular strip of even size at least 6).  • h = 1: LD S (n, 1) = 2n 5 . So that, p = 5, c = 2, λ = 2 5 is the minimum density (see Figure 4 for a pattern of minimum density that applies for any circular strip whose size is a multiple of 5). This result was already stated in [30].
So that, p = 6, c = 6, λ = 1 corresponds to the minimum density 1 3 (see Figure 4 for a pattern of minimum density that applies for any circular strip of even size at least 6).

King grid
Proposition 7 Let LD K (n, h) denote the minimum cardinality of an LD-code in a circular strip of the king grid of size n ≥ 5 and height h: • h = 2: LD K (n, 2) = n.
So that, p = c = 1, λ = 1 corresponds to the minimum density 1 2 (see Figure 5 for a pattern of minimum density that applies for any circular strip of size at least 4).

Toroidal grid
Proposition 8 Let LD S T (n, 3) denote the minimum cardinality of an LD-code in a toroidal circular strip of of size n ≥ 5 and height 3: LD S T (n, 3) = n. So that, p = c = 1, λ = 1 corresponds to the minimum density 1 3 (see Figure 5 for a pattern of minimum density that applies for any circular strip of even size at least 4).

Triangular grid
Proposition 9 Let LD T (n, h) denote the minimum cardinality of an LD-code in a circular strip of the triangular grid of size n ≥ 5 and height h.
• h = 3: LD T (n, 3) = 9n 10 . So that, p = 10, c = 9, λ = 9 10 corresponds to the minimum density 9 10 /3 = 3 10 (see Figure 5 for a pattern of minimum density that applies for any circular strip whose size is a multiple of 10). n 2 + 1, for n ≥ 6 and n ≡ 2 [4]. So that, p = 4, c = 2, λ = 1 2 corresponds to the minimum density (see Figure 6 for a pattern of minimum density that applies for any circular strip whose size is a multiple of 4). So that, p = 5, c = 4, λ = 4 5 corresponds to the minimum density 4 5 /2 = 2 5 (see Figure 6 for a pattern of minimum density that applies for any circular strip whose size is a multiple of 5).

King grid
Proposition 11 Let LT D K (n, h) denote the minimum cardinality of an LT D-code in a circular strip of the king grid of size n ≥ 5 and height h: So that, p = c = 1, λ = 1 corresponds to the minimum density 1 2 (see Figure 7 for a pattern of minimum density that applies for any circular strip of size at least 4).
• h = 3: LT D K (n, 3) = 8n 9 . So that, p = 9, c = 8, λ = 8 9 corresponds to the minimum density 8 9 /3 = 8 27 (see Figure 7 for a pattern of minimum density that applies for any circular strip whose size is a multiple of 9). n + 1, for n ≡ 0 [6]. So that, p = c = 1, λ = 1 corresponds to the minimum density 1 3 (see Figure 7 for a pattern of minimum density that applies for any circular strip whose size is a multiple of 6).

Triangular grid
Proposition 13 The minimum cardinality of an LT D-code in a circular strip of the triangular grid of size n ≥ 5 and height h is: • for h = 2: LT D T (n, 2) = 2n 3 . So that, p = 3, c = 2, λ = 2 3 corresponds to the minimum density 2 3 /2 = 1 3 (achieved for any circular strip whose size is a multiple of 3 greater than or equal to 6, see Figure 7).
So that, p = c = 1, λ = 1 corresponds to the minimum density 1 3 achieved for any circular strip of size at least 5, (see Figure 7 for a pattern valid for any circular strip whose size is a multiple of 3 greater than or equal to 6, see Figure 7).

Infinite strips
By Corollary 2, the optimal results on circular strips provide those for the infinite strips. The results we obtained for infinite strips of height at most 4 are summarized in Table 2 and corresponding patterns are in Figures 1-7. All were already stated in [4]. Notice that the already known values were only for strips of height at most 2. Until now the best known density for an ID-code of a infinite square strip of height 3 was 2 5 [12] and we have shown that the optimal density for such a strip is 7 18 . The same result is proved by a Discharging Method in [5]. Similarly the best density of an LT D-code in an infinite square strip has also been proved by Junnila [22] by using a "Share Method" as defined by Slater [31]. By a computer search similar to ours, Jiang [21] recently and independently found the optimal density of an indentifying code in infinite square strips of heights 4 and 5. In Table 2 we give also all known results on the minimum density in infinite grids (there, when there are two references, the first is for the lower bound, and the second contains the optimal corresponding pattern(s)). Not surprisingly, these minima are lower than those in infinite strips. For identifying codes, the minimum density in an infinite square grid is 7 20 [1] [10], and in [5] the following bounds on the minimum density of an identifying code of an infinite square strip are proved: .
Note that, however, the smallest density of an identifying code in an infinite square strip is lower in the case of height 3 ( 7 18 ) than in the case of height 4 ( 11 28 ). Tab. 2: Minimum densities of codes in infinite strips of height at most 4 (computed by our algorithm), and minimum densities of codes in infinite grids. A cross "X" indicates that the corresponding graph is not relevant. For instance, the graph K ∞ 1 is identical to S ∞ 1 . The symbol ∅ means that the code does not exist for the corresponding graph (the graph K ∞ 2 has no ID code, since, for instance, vertices (1, 1) and (2, 1) have the same closed neighborhood). Empty cells in the row of the height 4 correspond to cases for which we did not run the computer search.