Next Article in Journal
TGSNet: Multi-Field Feature Fusion for Glass Region Segmentation Using Transformers
Previous Article in Journal
A Continuous Process for Validation, Verification, and Accreditation of Simulation Models
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

A Spanning Union of Cycles in Thin Cylinder, Torus and Klein Bottle Grid Graphs †

by
Jelena Đokić
1,
Ksenija Doroslovački
1,* and
Olga Bodroža-Pantić
2
1
Faculty of Technical Sciences, University of Novi Sad, 21000 Novi Sad, Serbia
2
Department of Mathematics and Informatics, Faculty of Science, University of Novi Sad, 21000 Novi Sad, Serbia
*
Author to whom correspondence should be addressed.
Dedicated to the memory of Professor Ratko Tošić (1942–2022).
Mathematics 2023, 11(4), 846; https://doi.org/10.3390/math11040846
Submission received: 7 December 2022 / Revised: 22 January 2023 / Accepted: 26 January 2023 / Published: 7 February 2023

Abstract

:
In this paper, we propose an algorithm for obtaining the common transfer digraph D m * for enumeration of 2-factors in graphs from the title, all of which have m · n vertices ( m , n N , m 2 ). The numerical data gathered for m 18 reveal some matches for the numbers of 2-factors for different types of torus or Klein bottle. In the latter case, we conjecture that these numbers are invariant under twisting.
MSC:
05A15; 05C30; 05C38; 05C85; 05C50

1. Introduction

A spanning subgraph of a graph G in which every vertex has two degrees is called a 2-factor of G. It represents the union of cycles which has the same vertex set as G. Specifically, if the number of these cycles is one, then we call it a Hamiltonian cycle. Enumerating and generating Hamiltonian paths are of interest in chemistry, theoretical physics and biophysics related to polymer melting, protein folding [1] and the study of magnetic systems with O ( n ) symmetry [2]. It might also be useful in the theory of algorithms [3,4]. Additionally, the path planning problem for robots and machine tools [5] as well as security and intellectual property protection using microelectrode dot array (MEDA) biochips [6] make the study of this problem important in engineering and bioinformatics, especially when G is a grid graph. For a brief overview of the chronology of the research on enumeration of Hamiltonian cycles in different graph families, we refer the reader to [7].
The grid graphs with m · n ( m , n N ) vertices on different surfaces can be considered sequences with an index n (or m). The sequences of the numbers of Hamiltonian cycles ( h m ( n ) ) in the rectangular grid graph and the thin and thick cylinders obtained in recent papers revealed some interesting properties. For example, asymptotically equal behavior (when n ) of these sequences in the contractible and non-contractible cases was spotted for the thin cylinder [8]. For the thick grid cylinder, the supremacy of contractible Hamiltonian cycles over non-contractible ones depends on the parity of m [9]. Additionally, the computational data for m 10 indicated that the coefficient for the dominant eigenvalue in the non-contractible case was equal to one and that the positive dominant characteristic root in the contractible case was equal to the same one associated with the rectangular grid graph [10].
With the aim to find some conclusions which can help in proving the above-mentioned properties, we started the investigation of 2-factors in these graphs as a generalization of Hamiltonian cycles. The research in [11,12] was dedicated to the rectangular R G m ( n ) , thick cylinder T k C m ( n ) and Moebius strip M S m ( n ) grid graphs. We proposed an algorithm for obtaining 2-factor transfer digraphs common for all three classes and explored its structure. In this paper, we continue with three new classes of grid graphs: the thin cylinder T n C m ( n ) , torus T G m ( p ) ( n ) and Klein bottle K B m ( p ) ( n ) , all of which have m · n vertices.

2. Definitions, Notations and Tools

The structure of (square) grid graphs under consideration allows the grouping of vertices in “columns” and consideration of their edges as “vertical” and “horizontal”.
The T n C m ( n ) = def C m × P n , where P n and C n denote the path and cycle with n vertices, respectively, can be obtained from the rectangular grid graph R G m + 1 ( n ) = P m + 1 × P n by identification of the corresponding vertices from the first and last rows (in Figure 1, the vertex A i coincides with C i , both from the ith column, where i = 1 , , n ) without producing (horizontal) multiplying edges. The other two graphs from the title can be obtained from the thin grid cylinder T n C m ( n + 1 ) = C m × P n + 1 by gluing the corresponding vertices from the first and last columns without producing vertical multiplying edges. The identification of corresponding vertices from the first and last columns in T n C m ( n + 1 ) can be achieved in several ways, resulting in the following grid graphs on a torus or Klein bottle surface (see Figure 2).
Definition 1.
Let B i and D i denote the vertices belonging to the ith row ( 1 i m ) from the first and last columns, respectively, in the graph T n C m ( n + 1 ) .
The torus (grid) T G m ( p ) ( n ) ( 0 p m 1 ) is the graph obtained from T n C m ( n + 1 ) with identification vertices B i and D i + p for i = 1 , , m and without duplicating edges.
The Klein bottle K B m ( p ) ( n ) is the graph obtained from T n C m ( n + 1 ) with identification vertices B i and D m i + p + 1 for i = 1 , , m and without duplicating edges. In both cases, the sign + in subscript is the addition modulo m. The value m N is called the width of the grid graph.
Informally, in both cases, we elongated the cylinder and then bent it so that the two ends of the cylinder (i.e., the cycles with vertices B 1 , B 2 , , B m and D 1 , D 2 , , D m ) came close to each other. Prior to identification, one end of the cylinder was twisted until the corresponding vertices matched. Note that T G m ( 0 ) ( n ) = C m × C n is just a special case of the torus grid graph.
For an arbitrary 2-factor of a considered graph of the width m N , we coded its vertices. To each column, we joined a word over some alphabet of a length m (abbreviated as m-word). These words represent the vertices of the so-called transfer digraph D m . The arcs in D m reflect the possibility that two m-words appear as adjacent columns. The process of enumeration of 2-factors was reduced to enumeration of some oriented walks in this digraph. Contrary to the case of rectangular, thick cylinder and Moebious strip grid graphs, where the words assigned to the columns of vertices are linear, for the graphs from the title ( T n C m ( n ) , T G m ( p ) ( n ) and K B m ( p ) ( n ) ( 0 p m 1 ; m , n N )), we treated those words as circular ones.
In Figure 3, the grid graph T n C 3 ( 2 ) = C 3 × P 2 and all its possible 2-factors are shown. With the exception of the last case, all other 2-factors were connected (i.e., Hamiltonian cycles).
To be able to “walk to the left, right, upper or down” trough the cycles in a 2-factor of one of our grid graphs, imagine that we “cut and develop in the plane” the surfaces of the considered graph. At first, in the case of the torus T G m ( p ) ( n ) or Klein bottle K B m ( p ) ( n ) , we “cut” the edges connecting the vertices of the last and first columns. Then, in all three cases, we did the same with the edges connecting the vertices of the last and first rows of the cylinder and developed them in the plane (see Figure 3 below).
Definition 2.
The picture obtained after the described “cutting and developing in the plane", in which the lines corresponding to the edges of the considered 2-factor are bolded, is called the flat representation (FR). In the case of the thin cylinder, by using translation of an infinite number of copies of FR and linking them to each other in a sequence, we obtained the infinite strip grid graph of a width n. In the other two cases, at first we produced the similar infinite strip. Then, we made the copies of it, and using translation (in the case of torus) and glade symmetry (in the case of the Klein bottle), we tiled the whole plane, taking into account that B i D i + p , i = 1 , , m for T G m ( p ) ( n ) , or B i D m + p + 1 i , i = 1 , , m for K B m ( p ) ( n ) . The picture of the infinite grid graph obtained from copies of FR is called the rolling imprints (RI).
Figure 4 illustrates this tiling technique for T n C m ( n ) and Figure 5 for T G m ( 0 ) ( n ) , T G m ( 2 ) ( n ) , K B m ( 0 ) ( n ) and K B m ( 4 ) ( n ) .
Note that one FR can serve different types or classes of grid graphs (see Figure 6). The concept of rolling imprints was introduced in [10]. Observe that the bold lines in RI determined the 2-factor of the infinity grid graph for all three classes.
In this problem, we use matrix labeling. Thus, each vertex of the considered grid graph G with m · n vertices is represented with an ordered pair ( i , j ) { 1 , 2 , , m } × { 1 , 2 , , n } , where i is the ordinal number of the row viewed from top to bottom in FR while j is the ordinal number of the column in FR viewed from left to right:
Definition 3.
We associate each 2-factor of the observed graph G with the so-called code matrix [ α i , j ] m × n , where α i , j is one of six possible labels shown in Figure 7 (called alpha letters) that corresponds to the vertex ( i , j ) ( 1 i m , 1 j n ). By reading the columns of these code matrices from top to bottom, we obtain the so-called alpha words.
For instance, three alpha words— f a c d , c e d b and d f a c (following column order)—determined the 2-factors shown in Figure 6. The digraphs D l r and D u d , shown in Figure 8, describe the possibility that two alpha letters correspond to two adjacent vertices of G in a 2-factor. Contrary to the case when G is a linear grid graph [11,12], now, these words are circular.
The organization of the rest of this paper is as follows. In Section 3, by using code matrices, we give a characterization of the 2-factors for each of the grid graphs from the title. Using this characterization and the transfer matrix method [13], we propose algorithms for obtaining the numbers of 2-factors, labeled by f m T n C ( n ) , f m , p T G ( n ) and f m , p K B ( n ) , where the integer p refers to the type of grid graph. Additionally, we give some properties of the transfer digraph D m , whose adjacency matrix T m is the transfer matrix used in these algorithms. In this way, the problem of enumerating 2-factors in the considered grid graphs reduces to the enumeration of some special oriented walks in the digraph D m .
Under the Cayley–Hamilton theorem [14], for sufficiently large values of n, it follows that the required sequences f m , p T G ( n ) and f m , p K B ( n ) satisfy the same recurrence relation, which is determined by the characteristic polynomial of the transfer matrix T m . In this way, for fixed m and p values, these sequences are completely determined by the recurrence relation and the initial values which can be obtained from T m as well.
For a sequence a j ( j 0 ) which is determined by a homogeneous linear recurrence relation of the order n with constant coefficients a j + B 1 a j 1 + B 2 a j 2 + + B n a j n = 0 ( n N , B n 0 ) for j n and initial values a 0 , a 1 , , a n 1 , it is well known (see Chapter 7 in [15]) that its generating function f ( x ) = j 0 a j x j is the rational function whose denominator is 1 + l = 1 n B l x l and numerator is j = 0 n 1 A j x j , where A 0 = a 0 and A j = a j + k = 1 j a j k B k for 1 j n 1 (this can be checked by simply multiplying the series j 0 a j x j by the denominator and applying the recurrence relation). Similarly, when we have a rational function f ( x ) = A 0 + A 1 x + A 2 x 2 + + A n 1 x n 1 1 + B 1 x + B 2 x 2 + + B n x n = j 0 a j x j , the corresponding sequence a j ( j 0 ) satisfies the recurrence relation that we can “read” from the denominator of f ( x ) . (The verification of this assertion can be derived from Theorem 2.1 in [16].)
The generating functions are more desirable than merely listing a finite number of entries within the sequence because they also allow us to analyze the asymptotic behavior of the sequences. They provide compact formulas to record, in an indirect way, the entire sequences under consideration. The nth member of a sequence a n ( n 0 ) whose generating function is f ( x ) can be obtained using derivatives of the function (i.e., a n = f ( n ) ( 0 ) n ! ) (the Maclaurin series formula). When we can find all the eigenvalues of the recurrence relation, then the explicit formula for the nth member of the sequence is obtained by solving the corresponding system of linear equations. This is a well-known standard procedure (see 7.2 in [15]), and for recurrence relations of a small order, one can use the identity F n ( a , b ) = j = 0 n / 2 n j j ( a + b ) n 2 j ( a b ) j where 1 ( 1 a x ) ( 1 b x ) = n 0 F n ( a , b ) x n (see Lemma 2.1 in [17]).
Our main goal is to find generating functions for f m T n C ( n ) , f m , p T G ( n ) and f m , p K B ( n ) . In the case of the sequence f m T n C ( n ) , we deal with just one component of D m instead of the whole digraph, and hence the corresponding characteristic polynomial is a factor of one for the whole digraph D m . As m grows, the generating functions become lengthy and awkward, even for f m T n C ( n ) . Luckily, the first algorithm which uses digraph D m can be improved. We prove that the number of vertices of D m is 3 m + ( 1 ) m and that D m is a disconnected digraph with strongly connected components.
In Section 4, we reduce D m to the transfer digraph D m * of the order 2 m . Thus, we improve the algorithms for obtaining f m T n C ( n ) , f m , p T G ( n ) and f m , p K B ( n ) . In the case of a thin grid cylinder, we use just one of the components of D m * , labeled as N m * , which can be additionally reduced, resulting in the digraph N m * * . We prove that D m * is also a disconnected digraph with strongly connected components, its adjacency matrix is symmetric, and that the number of its edges is 3 m + ( 1 ) m .
The numerical data about D m * we gathered for m 18 with the implementation of the algorithms described in Section 4 revealed some interesting properties for D m * concerning the order of its components and the generating functions for the considered sequences f m T n C ( n ) , f m , p T G ( n ) and f m , p K B ( n ) . In Section 5, we present some of these results and pose a few assertions. Namely, we prove that f m , p T G ( n ) = f m , m p T G ( n ) for all 1 p m 1 . In the case of the Klein bottle, we conjecture that the number f m , p K B ( n ) is independent of the value of p when m is odd and depends just on the parity of p when m is even.
The explicit formulae and recurrence relations of f m T n C ( n ) , f m , p T G ( n ) and f m , p K B ( n ) for smaller values of m are given in Section 6. The list of the generating functions F m T n C ( x ) = def n 1 f m T n C ( n ) x n for 2 m 18 , F m , p T G ( x ) = def n 1 f m , p T G ( n ) x n and F m , p K B ( x ) = def n 1 f m , p K B ( n ) x n for 2 m 10 is given in the extended version of this paper [18].

3. Enumeration of 2-Factors Using D m

For each alpha letter α , we denote with α ¯ ( α ) the alpha letter of the situation from Figure 7 obtained by reflecting the situation of α over a horizontal (vertical) line. To be precise, α ¯ and α are images of α under the mapping
a b c d e f c b a f e d and a b c d e f d b f a e c , respectively .
The digraph D u d is responsible for building alpha words, and the other one is responsible for the adjacency of columns in the code matrices in the following sense:
Lemma 1 (Characterization of 2-factors for circular grid graphs).
The code matrix [ α i , j ] m × n for any 2-factor of G { T n C m ( n ) , T G m ( p ) ( n ) , K B m ( p ) ( n ) } satisfies the following properties ( α m + 1 , j = def α 1 , j ):
1.
Column condition: For every fixed j ( 1 j n ),the ordered pairs ( α i , j , α i + 1 , j ) , where 1 i m , must be arcs in the digraph D u d .
2.
Adjacency of column condition: For every fixed j, where 1 j n 1 , the ordered pairs ( α i , j , α i , j + 1 ) , where 1 i m , must be arcs in the digraph D l r .
3.
First and last column conditions:
(a) 
If G = T n C m ( n ) , then the alpha word of the first column consists of the letters from the set { a , b , c } and of the last column of the letters from the set { b , d , f } .
(b) 
If G = T G m ( p ) ( n ) , then the ordered pairs ( α i + p , n , α i , 1 ) , where 1 i m , must be arcs in the digraph D l r .
(c) 
If G = K B m ( p ) ( n ) , then the ordered pairs ( α m + p + 1 i , n , α ¯ i , 1 ) , where 1 i m , must be arcs in the digraph D l r .
The converse is that for every matrix [ α i , j ] m × n with entries from { a , b , c , d , e , f } that satisfies conditions 1–3, there is a unique 2-factor on the grid graph G.
Proof. 
Properties 1–3 can be easily proven by checking the compatibility for all the possible edge arrangements for the adjacent vertices of G in the considered 2-factor and vice versa, where the validity of conditions 1–3 for the matrix [ α i , j ] m × n ensures that the obtained subgraph of G is a unique spanning 2-regular graph (i.e., 2-factor). □
Definition 4.
For any alpha word α α 1 α 2 α m 1 α m , the alpha words α ¯ α ¯ m α ¯ m 1 α ¯ 2 α ¯ 1 and α α 1 α 2 α m 1 α m are called horizontal and vertical conversions of α, respectively. The circular word ρ ( α ) α 2 α 3 α m 1 α m α 1 is called a rotation of α.
Clearly, α ¯ ¯ = α , ( α ) = α , ρ p ( α ) α p + 1 α p + 2 α m α 1 α 2 α p ( 1 p m 1 ) and ρ 0 ( α ) α . Note that ρ p ( α ¯ ) = ρ m p ( α ) ¯ f o r p = 0 , 1 , , m 1 .
Now, we can create for each integer m ( m N ) a digraph D m = def ( V ( D m ) , E ( D m ) ) (common for all three types of grid graphs) in the following way: the set of vertices V ( D m ) consists of all possible circular words α 1 , j α 2 , j α m , j over the alphabet { a , b , c , d , e , f } (alpha words) which fulfill Condition 1 (column condition) from Lemma 1. An arc joins v = α 1 , j α 2 , j α m , j to u = α 1 , j + 1 α 2 , j + 1 α m , j + 1 , i.e., ( v , u ) E ( D m ) or v u if Condition 2 (adjacency of the column condition) from Lemma 1 is satisfied for the vertices v and u.
The subset of V ( D m ) which consists of all the possible first (last) columns in the code matrices [ α i , j ] m × n for T n C m ( n ) (Condition 3a, Lemma 1) is denoted by F m ( L m ). Under Condition 1, the first column of [ α i , j ] m × n is an alpha word from { a , b , c } m . Similarly, the last column of [ α i , j ] m × n is an alpha word from { b , d , f } m . Consequently, we have the following:
Lemma 2.
The cardinalities of F m and L m ( m N ) are equal to the mth member of the Lucas sequence L m ( L 1 = 1 , L 2 = 3 ; L k = L k 1 + L k 2 , where k 3 ).
Proof. 
This can be carried out analogically as was performed in the linear case (see Lemma 3.1 in [11]). In particular, the characteristic polynomial of the adjacency matrix of the subdigraph of D u d induced by the set { a , b , c } or { b , d , f } is λ ( λ 2 λ 1 ) . The polynomial in brackets determines the recurrence relation for the numbers of all oriented closed walks of a length m in the considered subdigraph, starting and ending with the same vertex. Consequently, F m = F m 1 + F m 2 and L m = L m 1 + L m 2 for m 3 .
Since F 1 = { b } = L 1 = 1 = L 1 and F 2 = { b b , a c , c a } = L 2 = { b b , d f , f d } = 3 = L 2 , we conclude that F m = L m = L m , for all m N . □
Definition 5.
A square symmetric binary matrix H m = [ h i j ] of the order V ( D m ) such that h i , j = 1 if and only if the ith and jth vertex of the digraph D m can be obtained from each other by horizontal conversion is called the H-conversion matrix for D m . A permutation binary matrix R m = [ r i j ] of the order V ( D m ) such that r i , j = 1 if and only if v j = ρ ( v i ) where v i and v j are the ith and jth vertex of the digraph D m , respectively, is called the rotation matrix for D m .
Lemma 3.
If f m T n C ( n ) , f m , p T G ( n ) and f m , p K B ( n ) ( m 2 ) denote the number of 2-factors of T n C m ( n ) , T G m ( p ) ( n ) and K B m ( p ) ( n ) , respectively, then
f m T n C ( n ) = v i F m v j L m a i , j ( n 1 ) = v i F m a i , i ( n ) = a 1 , 1 ( n + 1 )
f m , p T G ( n ) = t r ( T m n · R m p ) = t r ( R m p · T m n ) = v i , v j V ( D m ) v i = ρ p ( v j ) a i , j ( n )
f m , p K B ( n ) = t r ( T m n · R m p · H m ) = t r ( R m p · H m · T m n ) = v i , v j V ( D m ) v i ¯ = ρ p ( v j ) a i , j ( n )
where T m = [ a i j ] , H m = [ h i j ] and R m = [ r i j ] are the adjacency (transfer), H-conversion and rotation matrix for the digraph D m , respectively, and v 1 = b m .
Proof. 
The number of all the possible code matrices is equal to the number of all oriented walks of the length n 1 in the digraph D m for which the initial and final vertices satisfy the first and last column conditions from Lemma 1.
In the case of T n C m ( n ) , this number is equal to the sum of ( i , j ) entries of the ( n 1 ) th power of T m , where v i F m and v j L m . Since every vertex from F m is direct successor of any vertex from L m , we have that f m T n C ( n ) = v i F m a i , i ( n ) . As the vertex b m belongs to both F m and L m , we further obtain that the requested number is equal to a 1 , 1 ( n + 1 ) .
In the case of T G m ( p ) ( n ) , the number of all the possible code matrices (i.e., rolling imprints) with the first column is v i , where v i V ( D m ) is equal to the number of all oriented walks of a length n 1 in the digraph D m with an initial vertex v i and one of predecessors of v j = ρ m p ( v i ) (equivalent to v i = ρ p ( v j ) ) as a final vertex (Condition 3(b) from Lemma 1) or all oriented walks of a length n which start with v i and end with v j = ρ m p ( v i ) (the number a i , j ( n ) ). Consequently, the total number of 2-factors of T G m ( p ) ( n ) equals the trace of the matrix T m n · R m p . The trace of a product of the square matrices does not depend on the order of multiplication, so f m , p T G ( n ) = t r ( T m n · R m p ) = t r ( R m p · T m n ) .
The case K B m ( p ) ( n ) is similar to the previous one. Specifically, the enumeration of all oriented walks of a length n 1 in D m starting from v i V ( D m ) and ending at one of the predecessors of v j = ρ m p ( v i ¯ ) = ρ p ( v i ) ¯ (Condition 3(c) from Lemma 1) comes down to finding the trace of the matrix R m p · H m · T m n or T m n · R m p · H m . □
Proposition 1 (Properties of vertical conversion).
For every v , w V ( D m ) , we have
v v ;
I f v w , t h e n w v .
Proof. 
The proof is straightforward. □
Lemma 4.
The number of vertices in D m is V ( D m ) = 3 m + ( 1 ) m .
Proof. 
Let d m ( m N ) be the number of all circular words of a length m over the alphabet { a , b , c , d , e , f } that satisfy the column condition of Lemma 1. It is equal to the number of all closed oriented walks (the first vertex is labeled) of a length m in D u d (i.e., the trace of the mth power of the adjacency matrix of D u d ). Since the characteristic polynomial of this matrix is P ( λ ) = λ 4 ( 1 + λ ) ( λ 3 ) , we have d m = 2 d m 1 + 3 d m 2 , with initial the conditions d 1 = 2 (words from { e , b } ) and d 2 = 10 (words from { a c , a f , b b , c a , c d , d c , d f , e e , f a , f d } ). By solving the above recurrence relation, we obtain d m = ( 1 ) m + 3 m , ( m N ), which implies V ( D m ) ( 1 ) m + 3 m . In order to prove that every circular word w accounted for in d m is a vertex of D m , note that w w and w w = w (see Equation (4)). This means that the word w appears as a column in the code matrix for T G m ( 0 ) ( 2 ) . □
The following definition and lemma are taken from [11], with the only difference being that they now refer to circular words:
Definition 6.
The outlet (inlet) word of the word α α 1 α 2 α m V ( D m ) is the binary word o ( α ) o 1 o 2 o m ( i ( α ) i 1 i 2 i m ), where
o j = def 0 , i f α j { b , d , f } 1 , i f α j { a , c , e } a n d i j = def 0 , i f α j { a , b , c } 1 , i f α j { d , e , f } , 1 j m .
Note that o j = 1 ( i j = 1 ) if and only if the situation α j shown in Figure 7 has an edge “on the right” (“on the left”):
Lemma 5.
The digraph D m for m 2 is disconnected. Each of its components is a strongly connected digraph.
Proof. 
This proof is analogical as in the linear case. Specifically, if two words w and v are adjacent vertices in D m , then the number of ones in their outlet words must have the same parity. Consequently, there exist two vertices of D m (for example, the words a b m 2 f and b m ) belonging to different components.
Note that if there exists a directed walk w 0 w 1 w k 1 w k (of a length k N ), then the existence of the directed walk w k w k w k 1 w 1 w 0 w 0 (see Proposition 1) confirms the second part of this lemma. □
Let D m = A m B m , m 1 , where A m is the component of D m , which contains the vertex e m ( m 1 ). We also introduce N m as the component of D m , which contains the vertex b m ( m 1 ) (this component is sufficient for enumerating 2-factors for the thin grid cylinder T n C m ( n ) ):
Lemma 6.
A m N m if and only if m is even.
Proof. 
If m is even, then e m and b m are connected (belong to the same component) because e m ( d f ) m / 2 b m (i.e., A m N m ). If m is odd, then the number of ones in the outlet words of the vertices in V ( N m ) and V ( A m ) are of different parities, and therefore A m N m . □

4. Enumeration of 2-Factors Using D m * and N m * *

If two vertices from D m have the same outlet word, then they have the same set of direct successors. We grouped all vertices from V ( D m ) having the same corresponding outlet word and replaced them with just one vertex, labeled by their common outlet words. Next, we substituted all the arcs in D m , starting with vertices with the same outlet word and ending in same vertex with only one arc. In this way, we reduced the transfer digraph D m onto D m * with the adjacency (transfer) matrix T m * :
Example 1.
The vertices a b b c , a b f e , a f d c , c d f a , e d b c , e d f e V ( D 4 ) with the common outlet word 1001 were all replaced with 1001 V ( D 4 * ) . All edges starting from these vertices and ending in d c a f were changed by one arc: 1001 0110 . However, the same was valid for edges starting from these vertices and ending in f a c d . This resulted in the existence of two parallel edges ( 1001 0110 ) in D 4 * .
Note that in the linear case [11], the digraph D m * is simple (i.e., without multiple arcs) because two different vertices from V ( D m ) with the same outlet word cannot have the same direct predecessor. The situation with circular words is different. In particular, for two binary words u and w of a length m, there exist at most two vertices from V ( D m ) whose inlet and outlet words are u and w, respectively. In other words, for the given horizontal edges of a 2-factor corresponding to a column of vertices of the considered grid graph, if such a 2-factor exists at all, then there exist at most two possible choices of vertical edges for that column and that 2-factor. This implies that the entries of T m * are from the set { 0 , 1 , 2 } :
Theorem 1.
The adjacency matrix T m * of the digraph D m * is a symmetric matrix (i.e., T m * = ( T m * ) T ).
Proof. 
Suppose that v w , where v , w V ( D m * ) . Then, there exist vertices x , y V ( D m ) such that x y , where o ( x ) = v and o ( y ) = w . Since v = o ( x ) = i ( y ) = o ( y ) and y y , we have that w v . □
Theorem 2.
The digraph D m * is disconnected. Each of its components is a strongly connected digraph.
Proof. 
Note that all the vertices of D m which are glued in one vertex belong to the same component, so such gluing does not reduce the number of components. Using this, the statement of the theorem follows directly from Lemma 5. □
The component of D m * which contains the circular word 0 m 00 0 is denoted by N m * . The component of D m * containing the circular word 1 m is labeled as A m * , and the union of the remaining components is denoted by B m * :
Example 2.
The adjacency matrices of A m * , N m * and B m * for m = 2 , m = 3 and m = 4 are shown below:
T A 2 * = T N 2 * = 1 2 2 1 v 1 = 00 v 2 = 11 and T B 2 * = 0 2 2 0 v 1 = 10 v 2 = 01 ;
T N 3 * = T B 3 * = 1 1 1 1 1 0 1 1 1 1 0 1 1 1 1 0 v 1 = 000 v 2 = 101 v 3 = 011 v 4 = 110 and T A 3 * = 1 1 1 1 1 0 1 1 1 1 0 1 1 1 1 0 v 1 = 111 v 2 = 001 v 3 = 100 v 4 = 010 ;
T A 4 * = T N 4 * = 1 2 1 1 1 1 2 1 1 1 1 1 1 1 0 1 2 1 1 1 1 0 1 2 1 1 2 1 0 1 1 1 1 2 1 0 v 1 = 0000 v 2 = 1111 v 3 = 0011 v 4 = 0110 v 5 = 1100 v 6 = 1001 and T B 4 * = T B 4 ( 1 ) * 0 0 T B 4 ( 2 ) * , where
T B 4 ( 1 ) * = 0 0 0 0 1 2 1 1 0 0 0 0 1 1 1 2 0 0 0 0 1 1 2 1 0 0 0 0 2 1 1 1 1 1 1 2 0 0 0 0 2 1 1 1 0 0 0 0 1 1 2 1 0 0 0 0 1 2 1 1 0 0 0 0 v 1 = 0001 v 2 = 0111 v 3 = 1101 v 4 = 0100 v 5 = 1011 v 6 = 1110 v 7 = 0010 v 8 = 1000 , and T B 4 ( 2 ) * = 0 2 2 0 v 1 = 0101 v 2 = 1010 .
Theorem 3.
The number of vertices in digraph D m * is V ( D m * ) = 2 m .
Proof. 
We will prove that there exists at least one vertex x V ( D m ) with o ( x ) = v , where v is an arbitrary circular binary word of a length m. In [11], we proved that every binary (linear) m-word except the word 0 ( 10 ) ( m 1 ) / 2 (one of the so-called queens [12]) for odd m values is a vertex of the transfer digraph for the linear case (thick cylinder and Moebius strip grid graphs). Note that this digraph is the subdigraph of D m * . Thus, it remains to find x V ( D m ) with o ( x ) = 010101 . . . 010 (where m is odd). Since x = ( f a ) ( m 1 ) / 2 b ( c d ) ( m 1 ) / 2 b , v = o ( x ) belongs to the same component of D m * as o ( ( c d ) ( m 1 ) / 2 b ) = 1010 . . . 100 , which confirms the statement of this theorem. □
Theorem 4.
The number of edges in D m * is E ( D m * ) = 3 m + ( 1 ) m .
Proof. 
We establish the bijection between the set E ( D m * ) and V ( D m ) in the following way:
  • Each single arc v w ( v w ) from D m * is paired with exactly one vertex x V ( D m ) , whose incoming arcs are all replaced with the arc v w . Clearly, o ( x ) = w , ( z V ( D m ) ) ( z x o ( z ) = v ) , and there is no vertex y V ( D m ) with o ( y ) = w whose incoming arcs have an origin with the outlet word v.
  • A double arc v w (two parallel arcs) in D m * is paired with exactly two vertices x and y from V ( D m ) , where all incoming arcs of x are replaced with one of the two parallel arcs v w and all incoming arcs of y are replaced with the another one. Now, o ( x ) = o ( y ) = w , ( z V ( D m ) ) ( ( z x o ( z ) = v ) ( z y o ( z ) = v ) ) , and x and y are the only two vertices in D m with these properties.
The above-described bijection and Lemma 4 prove the theorem. □
For a binary word v b 1 b 2 b m 1 b m { 0 , 1 } m , we introduce the labels v ¯ = def b m b m 1 b 2 b 1 and ρ ( v ) = def b 2 b m 1 b m b 1 . Note that o ( ρ ( x ) ) = ρ ( o ( x ) ) for any x V ( D m ) :
Proposition 2 (Properties of horizontal conversion).
For an arbitrary x , y V ( D m ) , we have
o ( x ¯ ) = o ( x ) ¯ ;
I f o ( x ) = o ( y ) , t h e n o ( x ¯ ) = o ( y ¯ ) .
Proof. 
The proof is straightforward. □
Definition 7.
The H-conversion matrix H m * = [ h i j ] for D m * is the square binary matrix of the order V ( D m * ) for which h i , j = 1 if and only if v i = v j ¯ ( v i , v j V ( D m * ) ).
The rotation matrix R m * = [ r i j ] for D m * is the permutation matrix of the order V ( D m * ) for which r i , j = 1 if and only if ρ ( v i ) = v j ( v i , v j V ( D m * ) ).
Note that the matrix H m * is a symmetric one (i.e., ( i , j ) ( v i = v j ¯ v j = v i ¯ ) ), and ( R m * ) m is the identity matrix. The process of enumeration of 2-factors can be improved using the new transfer matrix T m * :
Theorem 5.
f m T n C ( n ) = a 1 , 1 ( n )
f m , p T G ( n ) = t r ( ( R m * ) p · ( T m * ) n ) = t r ( ( T m * ) n · ( R m * ) p ) = v i , v j V ( D m * ) v i = ρ p ( v j ) a i , j ( n )
f m , p K B ( n ) = t r ( ( R m * ) p · H m * · ( T m * ) n ) = t r ( ( T m * ) n · ( R m * ) p · H m * ) = v i , v j V ( D m * ) v i ¯ = ρ p ( v j ) a i , j ( n ) ,
where T m * = [ a i j ] is the adjacency matrix of the digraph D m * and v 1 00 0 .
Proof. 
For the observed digraph ( D m or D m * ), the number of oriented walks of a length n which start with vertex x and finish with vertex y is denoted by W x y ( n ) . Recall that the number W v i v j ( n ) , where v i , v j V ( D m * ) , is equal to the ( i , j ) entry a i , j ( n ) of the nth power of the matrix T m * . Note that
W v i v j ( n ) = y V ( D m ) o ( y ) = v j W x y ( n ) , where   x V ( D m ) and   o ( x ) = v i .
Using this and Lemma 3, we have
f m T n C ( n ) = W b m b m ( n + 1 ) = y L m W b m y ( n ) = W 0 m 0 m ( n ) = a 1 , 1 ( n ) ,
which completes the case G = T n C m ( n ) .
In order to obtain the expressions for the other two cases, observe that
W x 1 y ( n ) = W x 2 y ( n ) , for   any   x 1 , x 2 , y V ( D m ) where   o ( x 1 ) = o ( x 2 ) .
By using Equations (11) and (12), for any integer k and v j V ( D m * ) , we obtain
W ρ k ( v j ) v j ( n ) = y V ( D m ) o ( y ) = o ( y 1 ) = v j W ρ k ( y 1 ) y ( n ) = y V ( D m ) o ( y ) = v j W ρ k ( y ) y ( n ) .
By applying Lemma 3 again and Equation (13) to T G m ( p ) ( n ) , we obtain
f m , p T G ( n ) = x , y V ( D m ) x = ρ p ( y ) W x y ( n ) = v j V ( D m * ) y V ( D m ) o ( y ) = v j W ρ p ( y ) y ( n ) =
v j V ( D m * ) W ρ p ( v j ) v j ( n ) = v i , v j V ( D m * ) v i = ρ p ( v j ) a i , j ( n ) = t r ( ( R m * ) p · ( T m * ) n ) = t r ( ( T m * ) n · ( R m * ) p ) .
For K B m ( p ) ( n ) , the procedure is similar. From Equations (11) and (12) and Proposition 2, for any integer k and v j V ( D m * ) , we obtain
W ρ k ¯ ( v j ) v j ( n ) = y V ( D m ) o ( y ) = o ( y 1 ) = v j W ρ k ¯ ( y 1 ) y ( n ) = y V ( D m ) o ( y ) = v j W ρ k ¯ ( y ) y ( n ) .
Now, Lemma 3 and Equation (14) yield that
f m , p K B ( n ) = x , y V ( D m ) x ¯ = ρ p ( y ) W x y ( n ) = y V ( D m ) W ρ p ¯ ( y ) y ( n ) =
v j V ( D m * ) y V ( D m ) o ( y ) = v j W ρ p ¯ ( y ) y ( n ) = v j V ( D m * ) W ρ p ¯ ( v j ) v j ( n ) =
v i , v j V ( D m * ) v j = ρ m p ( v i ¯ ) a i , j ( n ) = t r ( ( R m * ) p · H m * · ( T m * ) n ) = t r ( ( T m * ) n · ( R m * ) p · H m * ) .
Furthermore, reduction of the transfer matrices is possible just in the case where G = T n C m ( n ) using the following:
Lemma 7.
If v V ( N m * ) , then v ¯ V ( N m * ) and ρ k ( v ) V ( N m * ) ( 0 k m 1 ) . Additionally, W v ¯ 0 m ( n ) = W v 0 m ( n ) = W ρ k ( v ) 0 m ( n ) = W ρ k ( v ¯ ) 0 m ( n ) for any vertex v V ( N * ) ( 1 k m 1 ).
Proof. 
If o ( x ) = v , where x V ( N m ) , then there exists an integer n 1 for which W x b m ( n ) 0 . By using the property of reflection symmetry, if x y , then x ¯ y ¯ and b m ¯ = b m , and we obtain that W x ¯ b m ( n ) = W x b m ( n ) 0 , which implies x ¯ V ( N m ) . Since v ¯ = o ( x ¯ ) , we conclude that v ¯ V ( N m * ) and W v ¯ 0 m ( n ) = W v 0 m ( n ) .
Similarly, by using the property of rotational symmetry, if x y , then ρ ( x ) ρ ( y ) and ρ ( b m ) = b m , and we have W ρ ( x ) b m ( n ) = W x b m ( n ) 0 . Hence, W ρ ( v ) 0 m ( n ) = W v 0 m ( n ) 0 and ρ ( v ) V ( N m * ) . Therefore, ρ k ( v ) V ( N m * ) and W ρ k ( v ) 0 m ( n ) = W v 0 m ( n ) 0 for an arbitrary integer k. □
Now, we can glue vertices v, v ¯ , ρ k ( v ) and ρ k ( v ¯ ) ( 1 k m 1 ) into one vertex for v V ( N m * ) , resulting in a new digraph N m * * . During gluing, we retain the arcs starting from just one of these vertices and delete the ones starting from other vertices. Multiple arcs appear when glued vertices have a common direct predecessor:
Example 3.
For example, for m = 4 , in the transition from N 4 * to N 4 * * , the vertices v 3 , v 4 , v 5 and v 6 are glued. The adjacency matrix of N 4 * * is obtained by adding the fourth, fifth and sixth columns to the third one. After that, the added columns and corresponding rows are removed. The resulting matrix is T N 4 * * = 1 2 4 2 1 4 1 1 4 where v 1 = 0000 , v 2 = 1111 , v 3 = 0011 .
Consequently, the number W 0 m 0 m ( n ) remains the same in both digraphs N * and N * * .
Corollary 1.
The number f m T n C ( n ) is equal to entry a 1 , 1 ( n ) of the nth power of the adjacency matrix for N * * , where v 1 0 m .

5. Computational Results and Open Questions

We have written computer programs for the computation of the adjacency matrices of the digraphs D m , D m * , N m , N m * , and N m * * ( m 2 ) and the initial members of the required sequences f m T n C ( n ) , f m , p T G ( n ) and f m , p K B ( n ) , n N . The data pertaining to the size of these digraphs are summarized in Table 1 and Table 2.
By analyzing the computational data for m 10 (in the case of T n C m ( n ) for m 18 ), we spotted some properties of the digraphs D m , D m * and N m * which have been discussed and proven in the previous sections for arbitrary m N . The proofs of the properties concerning the structure of D m * will be explained in another place (see [19]). Now, we express them in the following theorem:
Theorem 6
([19]). For each even m 2 , the digraph D m * has exactly m 2 + 1 components (i.e., D m * = A m * ( s = 1 m 2 B m * ( s ) ) ), where A m * contains both 1 m and 0 m , all the components B m * ( s ) ( 1 s m 2 ) are bipartite digraphs, V ( B m * ( s ) ) = 2 m m / 2 s a n d V ( A m * ) = m m / 2 .
For each odd m 1 , the digraph D m * has exactly two components (i.e., D m * = A m * N m * ) which are mutually isomorphic and with 2 m 1 vertices.
Based on the obtained numerical results, we computed the generating functions F m T n C ( x ) = def n 1 f m T n C ( n ) x n ( 2 m 18 ), F m , p T G ( x ) = def n 1 f m , p T G ( n ) x n ( 2 m 10 ) and F m , p K B ( x ) = def n 1 f m , p K B ( n ) x n ( 2 m 10 ) using standard procedures (for details on such procedures, we recommend [20]).
Recall that they are the rational functions whose denominators provide important information about the required sequences. In particular, the Cayley–Hamilton theorem guarantees a recurrence relation for any such sequence, and we can “read” it from the denominator of corresponding generating function:
Example 4.
The generating function for the Klein bottle K B 4 ( 1 ) ( n ) is F 4 , 1 K B ( x ) = 6 ( 1 + x ) x ( 1 + 2 x ) ( 1 + x ) 1 7 x + 4 x 2 + 52 x 2 100 x 4 ( 1 + x ) ( 1 + x ) ( 1 + 5 x ) ( 1 + 5 x ) + 8 x 2 1 4 x 2 = 6 ( x + 10 x 2 102 x 3 44 x 4 + 789 x 5 302 x 6 1000 x 7 + 600 x 8 ) 1 + 7 x + 26 x 2 210 x 3 9 x 4 + 903 x 5 416 x 6 700 x 7 + 400 x 8 .
The corresponding recurrence relation for the sequence f 4 , 1 K B ( n ) , n N is f 4 , 1 K B ( n ) = 7 f 4 , 1 K B ( n 1 ) + 26 f 4 , 1 K B ( n 2 ) 210 f 4 , 1 K B ( n 3 ) 9 f 4 , 1 K B ( n 4 ) +   903 f 4 , 1 K B ( n 5 ) 416 f 4 , 1 K B ( n 6 ) 700 f 4 , 1 K B ( n 7 ) + 400 f 4 , 1 K B ( n 8 ) .
The sequence f 4 , 1 K B ( n ) , n N is completely determined by it and the initial values f 4 , 1 K B ( 1 ) = 6 (see Figure 9), f 4 , 1 K B ( 2 ) = 102 , f 4 , 1 K B ( 3 ) = 258 , f 4 , 1 K B ( 4 ) = 2934 , f 4 , 1 K B ( 5 ) = 10506 , f 4 , 1 K B ( 6 ) = 98334 , f 4 , 1 K B ( 7 ) = 426642 and f 4 , 1 K B ( 8 ) = 3500454 .
The generating functions F m T n C ( x ) , where 2 m 18 , as well as F m , p T G ( x ) and F m , p K B ( x ) , given as a sum of the generating functions over the components of D m * , where 2 m 10 , are listed in [18]. The orders of the recurrence relations (obtained from the polynomial in the denominator of the joined rational function) for T n C m ( n ) , T G m ( p ) ( n ) and K B m ( p ) ( n ) are displayed in Table 1, Table 3 and Table 4, respectively.
In the case of the torus grid, we noticed that some generative functions coincide:
Theorem 7.
F m , p T G ( x ) = F m , m p T G ( x ) f o r   a l l   1 p m 1 .
Proof. 
Since ( R m * ) m = I , we have ( R m * ) p T = ( R m * ) m p . Additionally, the matrix T m * and all its powers are symmetric ones, and thus
f m , p T G ( n ) = t r ( ( R m * ) p · ( T m * ) n ) = t r ( ( ( R m * ) p · ( T m * ) n ) T ) = t r ( ( T m * ) n T · ( R m * ) p T ) = t r ( ( T m * ) n · ( R m * ) m p ) = t r ( ( R m * ) m p · ( T m * ) n ) = f m , m p T G ( n ) .
In the case of the Klein bottle, the matches of generative functions are less obvious, so we pose the following:
Conjecture 1.
If m is odd, then the generating function F m , p K B ( x ) = def n 1 f m , p K B ( n ) x n is invariant under a change in the value p ( 0 p m 1 ). If m is even, then the values f m , p K B ( n ) depend only on the parity of p.
Similar to the linear case of grid graphs (thick cylinder and Moebius strip), the obtained computational results revealed that the maximum eigenvalues of the adjacency matrices of D m * and its component A m * (the one containing the vertex 1 m ) coincided with each other. Since the digraph N m * is isomorphic to (or the same as) A m * (in accordance with Lemma 6 and Theorem 6), their maximum eigenvalues coincide, too. This eigenvalue is denoted by θ m . Some of the values θ m and corresponding coefficients a m T n C for T n C m ( n ) are given in Table 5.

6. Explicit Formulae and Recurrence Relations for Special Cases

For some small values of m, the obtained explicit formulae or recurrence relations with initial values for the sequences f m T n C ( n ) , f m , p T G ( n ) and f m , p K B ( n ) are listed below.
  • f 2 T n C ( n ) = 1 2 ( 1 ) n + 1 2 3 n
  • f 3 T n C ( n ) = 1 26 13 + 13 3 13 2 n + 1 26 13 13 3 + 13 2 n
  • f 4 T n C ( n ) = 1 2 ( 1 ) n + 2 11 + 33 11 9 + 33 7 33 2 n + 1 132 33 33 7 + 33 2 n
  • f 2 , 0 T G ( n ) = f 2 , 1 K B ( n ) = ( 1 ) n + 3 n + ( 2 ) n + 2 n
  • f 2 , 1 T G ( n ) = f 2 , 0 K B ( n ) = ( 1 ) n + 3 n ( 2 ) n + 2 n
  • f 3 , 0 T G ( n ) = 4 ( 1 ) n + 2 3 13 2 n + 2 3 + 13 2 n
  • f 3 , 1 T G ( n ) = ( 2 ) ( 1 ) n + 2 3 13 2 n + 2 3 + 13 2 n
  • f 3 , 0 K B ( n ) = 2 3 13 2 n + 2 3 + 13 2 n
  • f 4 , 0 T G ( n ) = ( 5 ) n + 3 ( 2 ) n + 4 ( 1 ) n + 3 + 2 n + 5 n + 7 33 2 n + 7 + 33 2 n
  • f 4 , 1 T G ( n ) = f 4 , 3 T G ( n ) = f 4 , 0 K B ( n ) = f 4 , 2 K B ( n )
  • = ( 1 ) ( 5 ) n + ( 1 ) ( 2 ) n + 2 ( 1 ) n 1 + 2 n + 5 n + 7 33 2 n + 7 + 33 2 n
  • f 4 , 2 T G ( n ) = ( 5 ) n + ( 1 ) ( 2 ) n 1 + 2 n + 5 n + 7 33 2 n + 7 + 33 2 n
  • f 4 , 1 K B ( n ) = f 4 , 3 K B ( n ) =
  • ( 5 ) n + ( 2 ) n + 2 ( 1 ) n + 1 + 2 n + 5 n + 7 33 2 n + 7 + 33 2 n
  • f 5 T n C ( n + 4 ) 9 f 5 T n C ( n + 3 ) + 4 f 5 T n C ( n + 2 ) + 22 f 5 T n C ( n + 1 ) 3 f 5 T n C ( n ) = 0 , for n 1 , where f 5 T n C ( 1 ) = 1 , f 5 T n C ( 2 ) = 11 , f 5 T n C ( 3 ) = 81 , f 5 T n C ( 4 ) = 666 .
  • f 6 T n C ( n + 6 ) 16 f 6 T n C ( n + 5 ) + 15 f 6 T n C ( n + 4 ) + 108 f 6 T n C ( n + 3 ) 163 f 6 T n C ( n + 2 ) 14 f 6 T n C ( n + 1 ) + 24 f 6 T n C ( n ) = 0   for   n 1 , where f 6 T n C ( 1 ) = 1 , f 6 T n C ( 2 ) = 20 , f 6 T n C ( 3 ) = 253 , f 6 T n C ( 4 ) = 3725 , f 6 T n C ( 5 ) = 53812 , f 6 T n C ( 6 ) = 781043 .
  • f 7 T n C ( n + 8 ) 27 f 7 T n C ( n + 7 ) + 131 f 7 T n C ( n + 6 ) + 319 f 7 T n C ( n + 5 ) 1511 f 7 T n C ( n + 4 ) + 598 f 7 T n C ( n + 3 ) + 1473 f 7 T n C ( n + 2 ) 740 f 7 T n C ( n + 1 ) 55 f 7 T n C ( n ) = 0 , for n 1 , where f 7 T n C ( 1 ) = 1 , f 7 T n C ( 2 ) = 29 , f 7 T n C ( 3 ) = 477 , f 7 T n C ( 4 ) = 9318 , f 7 T n C ( 5 ) = 181231 , f 7 T n C ( 6 ) = 3562728 , f 7 T n C ( 7 ) = 70182449 , f 7 T n C ( 8 ) = 1384148396 .
  • f 5 , p T G ( n + 10 ) 5 f 5 , p T G ( n + 9 ) 36 f 5 , p T G ( n + 8 ) + 64 f 5 , p T G ( n + 7 ) + 167 f 5 , p T G ( n + 6 ) 211 f 5 , p T G ( n + 5 ) 186 f 5 , p T G ( n + 4 ) + 219 f 5 , p T G ( n + 3 ) 6 f 5 , p T G ( n + 2 ) 25 f 5 , p T G ( n + 1 ) + 3 f 5 , p T G ( n ) = 0 , for n 1 and 0 p 4 ,
  • where f 5 , 0 T G ( 1 ) = 2 , f 5 , 0 T G ( 2 ) = 242 , f 5 , 0 T G ( 3 ) = 782 , f 5 , 0 T G ( 4 ) = 10442 , f 5 , 0 T G ( 5 ) = 67832 , f 5 , 0 T G ( 6 ) = 628382 , f 5 , 0 T G ( 7 ) = 4831612 , f 5 , 0 T G ( 8 ) = 40904442 , f 5 , 0 T G ( 9 ) = 329212322 , f 5 , 0 T G ( 10 ) = 2720543472 .
  • f 5 , 1 T G ( 1 ) = f 5 , 4 T G ( 1 ) = 32 , f 5 , 1 T G ( 2 ) = f 5 , 4 T G ( 2 ) = 92 , f 5 , 1 T G ( 3 ) = f 5 , 4 T G ( 3 ) = 1362 , f 5 , 1 T G ( 4 ) = f 5 , 4 T G ( 4 ) = 7952 , f 5 , 1 T G ( 5 ) = f 5 , 4 T G ( 5 ) = 78402 , f 5 , 1 T G ( 6 ) = f 5 , 4 T G ( 6 ) = 583082 , f 5 , 1 T G ( 7 ) = f 5 , 4 T G ( 7 ) = 5025732 , f 5 , 1 T G ( 8 ) = f 5 , 4 T G ( 8 ) = 40071652 , f 5 , 1 T G ( 9 ) = f 5 , 4 T G ( 9 ) = 332785472 , f 5 , 1 T G ( 10 ) = f 5 , 4 T G ( 10 ) = 2705210252 .
  • f 5 , 2 T G ( 1 ) = f 5 , 3 T G ( 1 ) = 12 , f 5 , 2 T G ( 2 ) = f 5 , 3 T G ( 2 ) = 152 , f 5 , 2 T G ( 3 ) = f 5 , 3 T G ( 3 ) = 1022 , f 5 , 2 T G ( 4 ) = f 5 , 3 T G ( 4 ) = 9412 , f 5 , 2 T G ( 5 ) = f 5 , 3 T G ( 5 ) = 71952 , f 5 , 2 T G ( 6 ) = f 5 , 3 T G ( 6 ) = 610862 , f 5 , 2 T G ( 7 ) = f 5 , 3 T G ( 7 ) = 4906052 , f 5 , 2 T G ( 8 ) = f 5 , 3 T G ( 8 ) = 40585712 , f 5 , 2 T G ( 9 ) = f 5 , 3 T G ( 9 ) = 330578112 , f 5 , 2 T G ( 10 ) = f 5 , 3 T G ( 10 ) = 2714684802 .
  • f 5 , p K B ( n + 4 ) 9 f 5 , p K B ( n + 3 ) + 4 f 5 , p K B ( n + 2 ) + 22 f 5 , p K B ( n + 1 ) 3 f 5 , p K B ( n ) = 0 , for n 1 ,
  • where f 5 , p K B ( 1 ) = 18 , f 5 , p K B ( 2 ) = 146 , f 5 , p K B ( 3 ) = 1110 , f 5 , p K B ( 4 ) = 9034 and 0 p 4 .
  • f 7 , p K B ( n + 8 ) 27 f 7 , p K B ( n + 7 ) + 131 f 7 , p K B ( n + 6 ) + 319 f 7 , p K B ( n + 5 ) 1511 f 7 , p K B ( n + 4 ) + 598 f 7 , p K B ( n + 3 ) + 1473 f 7 , p K B ( n + 2 ) 740 f 7 , p K B ( n + 1 ) 55 f 7 , p K B ( n ) = 0 , for n 1 ,
  • where f 7 , p K B ( 1 ) = 54 , f 7 , p K B ( 2 ) = 934 , f 7 , p K B ( 3 ) = 16230 , f 7 , p K B ( 4 ) = 310718 , f 7 , p K B ( 5 ) = 6040924 , f 7 , p K B ( 6 ) = 118584826 , f 7 , p K B ( 7 ) = 2335206032 , f 7 , p K B ( 8 ) = 46047350318 and 0 p 6 .

7. Conclusions

In this paper, we presented two algorithms for determination of the number of all spanning unions of cycles (abbreviated as 2-factors) in three classes of grid graphs: the thin cylinder T n C m ( n ) , torus T G m ( p ) ( n ) and Klein bottle K B m ( p ) ( n ) , all of which had a width of m. For this purpose, we introduced and discussed two digraphs, D m and D m * , the latter of which was obtained by reduction from the former of the order 2 m . The whole process for these so-called circular grid graphs is quite similar to the one for linear grid graphs (rectangular, thick cylinder and Moebius strip grid graphs) [11], although the number of observed grid graphs for a fixed m value in the circular case was larger than the one in the linear case due to the different twisting degrees ( 0 p m 1 ) for T G m ( p ) ( n ) and K B m ( p ) ( n ) . We proved that the number of edges in D m * for the circular case was twice the number of edges in the linear case, although they had almost the same number of vertices (for odd m values, the number of vertices in the linear case was 2 m 1 ). The numerical data obtained by implementation of the algorithms described in this paper show that this increased number of edges contributed to the reduction in the number of components in D m * only when m was odd. (We spotted exactly two components which appeared to be mutually isomorphic [19].) We calculated the generating functions for the number of 2-factors f m T n C ( n ) for 2 m 18 as well as f m , p T G ( n ) and f m , p K B ( n ) for 2 m 10 , which can be found in the extended version of this paper [18]. We noticed that some of them matched. Specifically, all generating functions for f m , p K B ( n ) , 0 p m 1 were mutually equal when m was odd, while when m was even, they depended only on the parity of p. We proved the matches of the generating functions F m , p T G ( x ) and F m , m p T G ( x ) for any 1 p m 1 .
Every component of D m * was strongly connected, and hence its adjacency matrix was irreducible. Since the component A m * had the loop 1 m 1 m , its matrix T A m * was primitive (a square nonnegative matrix, some power of which is positive). From the Perron–Frobenius theory [21], we can conclude that T A m * has a simple, positive eigenvalue θ m such that θ m > μ for any other eigenvalue μ for A m * . This implies that for odd m values, T m * has the dominant eigenvalue θ m with an algebraic multiplicity of two (Theorem 6), which by using the well-known property for the trace of a matrix implies that f 2 k 1 , 0 T G 2 θ 2 k 1 n when n , k N . However, the computational results show that the coefficients a m , p T G and a m , p K B for θ m for the grid graphs T G m p ( n ) and K B m p ( n ) when m is odd are equal to two as well. In other words, they do not depend on the type of grid graph (i.e., on the value p).
The reason why the dominant (positive) eigenvalue for any component B m * ( s ) ( 1 s m 2 ) is less than θ m when m is even seems to still be unknown. If we adopt this as the truth, then we have f 2 k , 0 T G θ 2 k n when n , k N . The question about coefficients a m , p T G and a m , p K B when m is even remains open, since we obtained that they were equal to one for m 10 .

Author Contributions

Conceptualization, J.Đ., K.D. and O.B.-P.; investigation, J.Đ., K.D. and O.B.-P.; supervision, K.D. and O.B.-P.; validation, J.Đ., K.D. and O.B.-P.; writing—original draft preparation, J.Đ. and K.D.; writing—review and editing, J.Đ. and K.D. All authors have read and agreed to the published version of the manuscript.

Funding

This work was supported by the Ministry of Science, Technological Development and Innovation of the Republic of Serbia (Grants 451-03-9/2022-14/200125 and 451-03-68/2022-14/200156) and the project of the Department for Fundamental Disciplines in Technology of the Faculty of Technical Sciences at the University of Novi Sad “Application of general disciplines in technical and IT sciences”.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

Not applicable.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Kloczkowski, A.; Jernigan, R.L. Transfer matrix method for enumeration and generation of compact self-avoiding walks. I. Square lattices. J. Chem. Phys. 1998, 109, 5134–5146. [Google Scholar] [CrossRef]
  2. Jacobsen, J.L. Exact enumeration of Hamiltonian circuits, walks and chains in two and three dimensions. J. Phys. A Math. Theor. 2007, 40, 14667–14678. [Google Scholar] [CrossRef]
  3. Krasko, E.S.; Labutin, I.N.; Omelchenko, A.V. Enumeration of Labelled and Unlabelled Hamiltonian Cycles in Complete k-partite Graphs. J. Math. Sci. 2021, 255, 71–87. [Google Scholar] [CrossRef]
  4. Montoya, J.A. On the Counting Complexity of Mathematical Nanosciences. MATCH Commun. Math. Comput. Chem. 2021, 86, 453–488. [Google Scholar]
  5. Nishat, R.I.; Whitesides, S. Reconfiguring Hamiltonian Cycles in L-Shaped Grid Graphs. Graph-Theor. Concepts Comput. Sci. 2019, 21, 325–337. [Google Scholar]
  6. Liang, T.C.; Chakrabarty, K.; Karri, R. Programmable daisychaining of microelectrodes to secure bioassay IP in MEDA biochips. IEEE Trans. Very Large Scale Integr. (VLSI) Syst. 2020, 25, 1269–1282. [Google Scholar] [CrossRef]
  7. Vegi Kalamar, A.; Žerak, T.; Bokal, D. Counting Hamiltonian Cycles in 2-Tiled Graphs. Mathematics 2021, 9, 693. [Google Scholar] [CrossRef]
  8. Bodroža-Pantić, O.; Kwong, H.; Pantić, M. A conjecture on the number of Hamiltonian cycles on thin grid cylinder graphs. Discret. Math. Theor. Comput. Sci. 2015, 17, 219–240. [Google Scholar] [CrossRef]
  9. Bodroža-Pantić, O.; Kwong, H.; Đokić, J.; Doroslovački, R.; Pantić, M. Enumeration of Hamiltonian Cycles on a Thick Grid Cylinder—Part II: Contractible Hamiltonian Cycles. Appl. Anal. Discret. Math. 2022, 16, 246–287. [Google Scholar] [CrossRef]
  10. Bodroža-Pantić, O.; Kwong, H.; Doroslovački, R.; Pantić, M. Enumeration of Hamiltonian Cycles on a Thick Grid Cylinder—Part I: Non-contractible Hamiltonian Cycles. Appl. Anal. Discret. Math. 2019, 13, 28–60. [Google Scholar] [CrossRef]
  11. Đokić, J.; Bodroža-Pantić, O.; Doroslovački, K. A spanning union of cycles in rectangular grid graphs, thick grid cylinders and Moebius strips. Trans. Comb. 2022, in press. [CrossRef]
  12. Đokić, J.; Doroslovački, K.; Bodroža-Pantić, O. The structure of the 2-factor transfer digraph common for rectangular, thick cylinder and Moebius strip grid graphs. Appl. Anal. Discret. Math. 2022; accepted. [Google Scholar] [CrossRef]
  13. Stanley, R.P. Enumerative Combinatorics, Vol. I, 1st ed.; Wadsworth & Brooks/Cole: Monterey, CA, USA, 1986. [Google Scholar]
  14. Brualdi, R.A.; Cvetković, D. A Combinatorial Approach to Matrix Theory and Its Application, 1st ed.; CRC Press: Boca Raton, FL, USA, 2008. [Google Scholar]
  15. Charalambides, C.A. Enumerative Combinatorics, 1st ed.; Chapman & Hall/CRC: Boca Raton, FL, USA, 2002. [Google Scholar]
  16. Goubi, M. On the Recursion Formula of Polynomials Generated by Rational Functions. Int. J. Math. Anal. 2019, 13, 29–38. [Google Scholar] [CrossRef]
  17. Goubi, M. On combinatorial formulation of Fermat quotients and generalization. Montes Taurus J. Pure Appl. Math. 2022, 4, 59–76. [Google Scholar]
  18. Đokić, J.; Doroslovački, K.; Bodroža-Pantić, O. A Spanning Union of Cycles in Thin Cylinder, Torus and Klein Bottle Grid Graphs. arXiv 2022, arXiv:2210.11527. [Google Scholar]
  19. Đokić, J.; Doroslovački, K.; Bodroža-Pantić, O. The Structure of the 2-factor Transfer Digraph common for Thin Cylinder, Torus and Klein Bottle Grid Graphs. arXiv 2022, arXiv:2212.13779. [Google Scholar]
  20. Bodroža-Pantić, O.; Kwong, H.; Pantić, M. Some new characterizations of Hamiltonian cycles in triangular grid graphs. Discret. Appl. Math. 2016, 201, 1–13. [Google Scholar] [CrossRef]
  21. Meyer, C.D. Matrix Analysis and Applied Linear Algebra, 2nd ed.; Siam: Philadelphia, PA, USA, 2000. [Google Scholar]
Figure 1. Construction of the thin grid cylinder T n C m ( n ) = C m × P n .
Figure 1. Construction of the thin grid cylinder T n C m ( n ) = C m × P n .
Mathematics 11 00846 g001
Figure 2. Construction of the torus grid T G m ( p ) ( n ) = C m × C n and Klein bottle K B m ( p ) ( n ) .
Figure 2. Construction of the torus grid T G m ( p ) ( n ) = C m × C n and Klein bottle K B m ( p ) ( n ) .
Mathematics 11 00846 g002
Figure 3. The graph T n C 3 ( 2 ) = C 3 × P 2 with all the possible 2-factors (bold edges) and their flat representations (below).
Figure 3. The graph T n C 3 ( 2 ) = C 3 × P 2 with all the possible 2-factors (bold edges) and their flat representations (below).
Mathematics 11 00846 g003
Figure 4. The technique for obtaining rolling imprints using flat representation for T n C m ( n ) .
Figure 4. The technique for obtaining rolling imprints using flat representation for T n C m ( n ) .
Mathematics 11 00846 g004
Figure 5. The technique for obtaining rolling imprints using flat representation for T G m ( p ) ( n ) and K B m ( p ) ( n ) .
Figure 5. The technique for obtaining rolling imprints using flat representation for T G m ( p ) ( n ) and K B m ( p ) ( n ) .
Mathematics 11 00846 g005
Figure 6. RI of a 2-factor for T G 4 ( 3 ) ( 3 ) (left) and RI of a 2-factor for K B 4 ( 3 ) ( 3 ) (right) with their common flat representation (in the middle).
Figure 6. RI of a 2-factor for T G 4 ( 3 ) ( 3 ) (left) and RI of a 2-factor for K B 4 ( 3 ) ( 3 ) (right) with their common flat representation (in the middle).
Mathematics 11 00846 g006
Figure 7. Six possible situations in any vertex for a given 2-factor.
Figure 7. Six possible situations in any vertex for a given 2-factor.
Mathematics 11 00846 g007
Figure 8. Digraphs D u d and D l r .
Figure 8. Digraphs D u d and D l r .
Mathematics 11 00846 g008
Figure 9. The graph K B 4 ( 1 ) ( 1 ) has six 2-factors.
Figure 9. The graph K B 4 ( 1 ) ( 1 ) has six 2-factors.
Mathematics 11 00846 g009
Table 1. The number of vertices for N m , N m * and N m * * and the order of recurrence relations for the thin cylinder graph C m × P n . ( L m is the mth member of the Lucas sequence L 0 = 2 , L 1 = 1 and L m = L m 1 + L m 2 for m 2 .)
Table 1. The number of vertices for N m , N m * and N m * * and the order of recurrence relations for the thin cylinder graph C m × P n . ( L m is the mth member of the Lucas sequence L 0 = 2 , L 1 = 1 and L m = L m 1 + L m 2 for m 2 .)
m2345678910
F m = L m = L m 3471118294776123
V ( N m ) 6133812128210932214984117,906
V ( N m * ) 24616206470256252
V ( N m * * ) 223469112326
order223468101621
m1112131415161718
F m = L m = L m 1993225218431364220735715778
V ( N m * ) 10249244096
V ( N m * * ) 636219017061248720561530
order32396473
Table 2. The number of vertices of D m , D m * and components of D m * .
Table 2. The number of vertices of D m , D m * and components of D m * .
m2345678910
V ( D m ) 1026822427302186656219,68259,050
V ( D m * ) 481632641282565121024
V ( A m * ) 24616206470256252
V ( B m * ( 1 ) ) 248163064112256420
V ( B m * ( 2 ) ) --2-12-56-240
V ( B m * ( 3 ) ) ----2-16-90
V ( B m * ( 4 ) ) ------2-20
V ( B m * ( 5 ) ) --------2
Table 3. The order of the recurrence relation for the torus graphs T G m ( p ) ( n ) .
Table 3. The order of the recurrence relation for the torus graphs T G m ( p ) ( n ) .
m2345678910
p = 0 438102635105132370
p = 1 43810253580132369
p = 2 -3710243561132370
p = 3 --810263580132369
p = 4 ---102435105132370
p = 5 ----253580132369
Table 4. The order of the recurrence relation for the Klein bottle K B m ( p ) ( n ) .
Table 4. The order of the recurrence relation for the Klein bottle K B m ( p ) ( n ) .
m2345678910
0 p m 1 4284178341666
Table 5. The approximate values of θ m , a m T n C for 1 m 18 and a m , p T G and a m , p K B for 1 m 10 , where ( n ) indicates the estimate based on the first n entries of the sequence.
Table 5. The approximate values of θ m , a m T n C for 1 m 18 and a m , p T G and a m , p K B for 1 m 10 , where ( n ) indicates the estimate based on the first n entries of the sequence.
m θ m a m TnC a m , p TG a m , p KB
230.511
33.302775637731994646559610.3613249509436927194954122
46.372281323269014329925310.2064805860110755404556811
58.188926995568964448551020.1474246508394862854120422
614.506431494048075192146750.08380360755743503326832211
719.735246391978464696819420.06012457786263438970198522
833.676786957722045951059590.03399331146717892545042611
947.191981081164343561776810.02449432493067348769354122
1078.818864591827703095106140.01379580862621271290932711
11112.475967649756843596538830.0099731885141630148539155
12185.239857806635111790299550.0056015242668523217503199
13267.610486301985955508701310.0040594014830894625219171
14436.399571184707954138014280.0022751952682333538270877
15 ( 400 ) 636.07041461464648869768059 ( 400 ) 0.0016519675074264452373550
16 ( 300 ) 1029.6591497906007164409665 ( 300 ) 0.00092436404208619807770845
17 ( 300 ) 1510.8614061966116128903621 ( 300 ) 0.00067217371233189645627886
18 ( 300 ) 2431.89478407418442105820 ( 300 ) 0.00037562107425215551890931
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Đokić, J.; Doroslovački, K.; Bodroža-Pantić, O. A Spanning Union of Cycles in Thin Cylinder, Torus and Klein Bottle Grid Graphs. Mathematics 2023, 11, 846. https://doi.org/10.3390/math11040846

AMA Style

Đokić J, Doroslovački K, Bodroža-Pantić O. A Spanning Union of Cycles in Thin Cylinder, Torus and Klein Bottle Grid Graphs. Mathematics. 2023; 11(4):846. https://doi.org/10.3390/math11040846

Chicago/Turabian Style

Đokić, Jelena, Ksenija Doroslovački, and Olga Bodroža-Pantić. 2023. "A Spanning Union of Cycles in Thin Cylinder, Torus and Klein Bottle Grid Graphs" Mathematics 11, no. 4: 846. https://doi.org/10.3390/math11040846

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop