Full text
mathematics Article Recognition and Analysis of Image Patterns Based on Latin Squares by Means of Computational Algebraic Geometry Raúl M. Falcón Citation: Falcón, R.M. Recognition and Analysis of Image Patterns Based on Latin Squares by Means of Computational Algebraic Geometry. Mathematics 2021,9, 666. https:// doi.org/10.3390/math9060666 Academic Editor: Eugenio Roanes-Lozano Received: 24 February 2021 Accepted: 18 March 2021 Published: 21 March 2021 Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. Copyright: © 2021 by the author. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https:// creativecommons.org/licenses/by/ 4.0/). Department of Applied Mathematics I, University of Seville, 41012 Sevilla, Spain; [email protected] Abstract: With the particular interest of being implemented in cryptography, the recognition and analysis of image patterns based on Latin squares has recently arisen as an efficient new approach for classifying partial Latin squares into isomorphism classes. This paper shows how the use of a Computer Algebra System (CAS) becomes necessary to delve into this aspect. Thus, the recognition and analysis of image patterns based on these combinatorial structures benefits from the use of computational algebraic geometry to determine whether two given partial Latin squares describe the same affine algebraic set. This paper delves into this topic by focusing on the use of a CAS to characterize when two partial Latin squares are either partial transpose or partial isotopic. Keywords: image pattern recognition; partial Latin square; affine algebraic set; isomorphism; partial transpose; partial isotopic MSC: 05B15; 20N05; 68T10 1. Introduction An n×n array is said to be a partial Latin square of order n if each one of its cells either is empty or contains an element of a finite set of n symbols so that each symbol occurs at most once in each row and at most once in each column. If there are no empty cells, then the array is called a Latin square. Latin squares play a relevant role in cryptography [ 1 – 3 ]. Of particular interest for the aim of this paper, the generation of scramblers in symmetric cryptography by means of encryption–decryption processes having Latin squares as cryptographic keys is remarkable [ 4 – 8 ]. The exponential growth of Latin squares [ 9 – 11 ] ensures the robustness of these symmetric-key algorithms against brute force and statistical attacks. In addition, appropriate choices of Latin squares produce effective symmetric-key algorithms with high period growths [ 12 ]. In this regard, the distribution of Latin squares into isomorphism classes play a fundamental role. It is so that pseudo-random sequences derived from non-isomorphic Latin squares give rise to certain image patterns [ 13 , 14 ], whose algebraic and geometrical properties enable one to distinguish between fractal and non-fractal Latin squares [15,16]. Distributing (partial) Latin squares into isomorphism classes indeed constitutes a main problem in the theory of (partial) Latin squares. Currently, only the number of isomorphism classes of Latin squares of order n≤ 11 is known [ 9 – 11 ], as well as that of partial Latin squares of order n≤ 6 [ 17 , 18 ]. To obtain these last values, the computation of reduced Gröbner bases of ideals associated to partial Latin squares has played a relevant role. Such a computation is, however, extremely sensitive to the number of involved variables and the length and degree of the corresponding generators [ 19 – 22 ]. Thus, although distinct techniques concerning computational algebraic geometry have been implemented since the original work of Bayer [ 23 ] for solving the classical problems of counting, enumerating and classifying partial Latin squares [ 17 , 18 , 24 – 29 ] and solving related problems such as completing sudokus [ 30 – 32 ], their computational cost makes it very difficult to deal with partial Latin squares of high orders. Mathematics 2021,9, 666. https://doi.org/10.3390/math9060666 https://www.mdpi.com/journal/mathematics
Mathematics 2021,9, 666 2 of 26 The study of new invariants concerning partial Latin square isomorphisms has turned out to be an optimal approach to reduce this computational cost [ 33 – 35 ]. This paper delves in particular into those invariants that are related to affine algebraic sets associated to the partial Latin squares under consideration. In this regard, let us recall that the affine algebraic set in a multivariate polynomial ring K[{x1 , . . . , xn}] of a partial Latin square L= (li,j) of order n , with set of symbols [n]:={ 1, . . . , n} , was defined by Falcón, R.M. et al [36] as the set of zeros of the binomial ideal I(L):=Dxixj−xli,j: 1 ≤i,j,li,j≤nE. (1) Isomorphic partial Latin squares give rise to isomorphic affine algebraic sets. Thus, Gröbner bases have played a relevant role for distinguishing, in a computationally fast way, image patterns arisen from non-isomorphic Latin squares. In any case, the study of affine algebraic sets associated to Latin squares is still in the very initial stage. Thus, for instance, their distribution into isomorphism classes is only known for n≤3 [36] . To deal with higher orders, it is necessary to delve into two new ways of classifying partial Latin squares. More specifically, it is necessary to characterize when two partial Latin squares are partial transpose and/or partial isotopic. In both cases, the partial Latin squares under consideration may give rise to the same affine algebraic set. The paper is organized as follows. Section 2deals with some preliminary concepts and results on partial Latin squares and computational algebraic geometry that are used throughout the paper. In Section 3, the notion of standard set of image patterns associated to a Latin square is introduced, which may constitute a fast computational way for distinguishing non-isomorphic Latin squares. To this end, the use of a new affine algebraic set associated to each of these image patterns is proposed. Finally, two new ideals are described in Section 4, whose respective affine algebraic sets are uniquely identified with the set of partial Latin squares that are partial transpose of another given partial Latin square, and the set of partial isotopisms between two given partial Latin squares of the same order and weight. 2. Preliminaries Let us review some basic concepts and results on partial Latin squares and computational algebraic geometry that are used throughout the paper. We refer the reader to the monographs of [37,38] for more details on both topics. 2.1. Partial Latin Squares Let Ln be the set of partial Latin squares of order n having the already mentioned set [n] as set of symbols. Every partial Latin square L= (li,j)∈ Ln is determined by its set of entries Ent(L):={(i,j,li,j):i,j,li,j∈[n]}. Therefore, the cardinality of this set coincides with the number of non-empty cells within the partial Latin square L . It is termed the weight of L . From here on, let Ln;m denote the subset of partial Latin squares in the set Lnof weight m. Let Sn denote the symmetric group on the set [n] . Every triple θ= (f , g , h)∈S3 n preserves the set Ln;m . It constitutes an isotopism of partial Latin squares, where the bijections f , g and h correspond, respectively, to a permutation of rows, a permutation of columns and a permutation of symbols of the partial Latin square under consideration. More specifically, the isotopism θ acts on any given partial Latin square L∈ Ln;m by giving rise to its isotopic partial Latin square Lθ∈ Ln;m, where Ent(Lθ) = {(f(i),g(j),h(k)):(i,j,k)∈Ent(L)}. If f=g=h , then the isotopism θ constitutes an isomorphism. In such a case, the partial Latin squares L and Lθ are said to be isomorphic. Throughout this paper, the computation
Mathematics 2021,9, 666 3 of 26 of isotopisms and isomorphisms among partial Latin squares is done by making respective use of the procedures isot and isom of the library pls.lib, available online at http://personales.us.es/raufalgan/LS/pls.lib (accessed on 28 February 2021), for the open Computer Algebra System (CAS) for polynomial computations SINGULAR [ 39 ]. Isotopic and isomorphic are equivalence relations among partial Latin squares. The distribution into such classes is known for order n≤ 11 in the case of dealing with Latin squares [ 9 – 11 ] and for order n≤ 6 in the case of dealing with partial Latin squares [ 17 , 18 ]. Partial transpose are partial isotopic are two other binary relations among partial Latin squares of the same order and weight, whose study is still in teh very initial stage. Although the original definitions were established by Falcón, R.M. et al [ 36 ] as equivalence relations, it is not so. In what follows, we particularize both definitions in order to obtain two new equivalence relations among partial Latin squares of the same order and weight. To this end, let us consider two partial Latin squares L1and L2in Ln;m. We say that L2 is partial transpose of L1 if and only if the following two conditions hold. 1. For each entry (i,j,k)∈Ent(L2)\Ent(L1), we have that (j,i,k)∈Ent(L1). 2. For each entry (i,j,k)∈Ent(L1)\Ent(L2), we have that (j,i,k)∈Ent(L2). Being partial transpose generalizes, therefore, the classical concept of being transpose. Notice that the second condition that we have just described was not explicitly indicated by Falcón, R.M. et al [ 36 ]. Nevertheless, as is illustrated in the following example, this condition is mandatory in order to obtain a symmetric relation. Example 1. The partial Latin squares L1≡ 1 2 3 4 3 4 1 2 and L2≡ 1 2 4 2 3 4 1 2 , both of them in L4;8 , satisfy the first described condition in order to ensure that L2 is partial transpose of L1 . Nevertheless, such a condition is not satisfied for ensuring that L1 is partial transpose of L2, because the entry (2,4,3)∈Ent(L1)\Ent(L2)and (4, 2,3)6∈ Ent(L2). Now, let P⊆Ent(L1)∩Ent(L2) . We say that L2 is P -partial isotopic to L1 if there exists an isotopism (f,g,h)∈S3 nsuch that Ent(L2)\P={(f(i),g(j),h(k)):(i,j,k)∈Ent(L1)\P}. In such a case, we say that the triple (f , g , h) is a P -partial isotopism (a partial isotopism, when there is no place for confusion) from L1 to L2 . The just described binary relation of being P -partial isotopic constitutes an equivalence relation among partial Latin squares of the same order and weight, as well as containing the subset P in their respective sets of entries. Further, if two partial Latin squares are isotopic, then they are ∅ -partial isotopic. More specifically, every isotopism from L1 to L2 is also a partial isotopism between such partial Latin squares. The subset P⊆Ent(L1)∩Ent(L2) was not established as an essential part of the original definition of being partial isotopic introduced by Falcón, R.M. et al. [ 36 ]. Nevertheless, if it is not considered as such, then the resulting binary relation is intransitive. The following example illustrates this fact. In this example, and from now on, to make much clearer the understanding of the subset P associated to any given partial isotopism in S3 n , we denote L(P)the partial Latin square of order nsatisfying that Ent(L(P)) = P.
Mathematics 2021,9, 666 4 of 26 Example 2. The Latin squares L1≡ 1 2 3 4 2 1 4 3 4 3 2 1 3 4 1 2 and L2≡ 1 2 3 4 2 1 4 3 3 4 1 2 4 3 2 1 are isotopic (and, hence, ∅ -partial isotopic) by means of the isotopism (( 34 ) , Id , Id)∈S3 4 , that is, by switching their third and fourth rows. It is readily verified that the Latin square L2is P-partial isotopic to L3≡ 1 2 3 4 2 4 1 3 3 1 4 2 4 3 2 1 where P =Ent(L2)∩Ent(L3). That is, L(P)≡ 1 2 3 4 2 3 3 2 4 3 2 1 To this end, it is enough to consider, for instance, the partial isotopism (( 23 ) , Id , Id)∈S3 4 . Nevertheless, as shown in Example 8, no partial isotopism exists from L1to L3. The following example illustrates all the previous definitions in case of dealing with partial Latin squares with empty cells. Example 3. The partial Latin squares L1≡ 1 2 3 4 3 4 1 2 and L2≡ 1 2 4 3 4 1 3 2 , both of them in the set L4;8 , are partial transpose of each other. Notice, for instance, that the first condition of the definition holds because Ent(L2)\Ent(L1) = {(1,3,4),(3,1,3),(3,2,4),(4,2,3)} and {(3,1, 4),(1,3, 3),(2,3, 4),(2,4,3)} ⊂ Ent(L1). The second condition holds similarly. In addition, one can find a partial isotopism between both partial Latin squares L1 and L2 . To this end, it is enough to consider the isotopism θ= ((1423),(1324),Id)∈S3and the subset P =Ent(L1)∩Ent(L2). That is, L(P)≡ 1 2 1 2 ∈ L4;4
Mathematics 2021,9, 666 5 of 26 In particular, L(Ent(L1)\P)θ=L(Ent(L2)\P)≡ 4 3 4 3 ∈ L4;4. Notice that both partial Latin squares L1and L2are neither transpose nor isotopic of each other. Let us finish this subsection by focusing on the description of the image patterns based on a given Latin square. To this end, let us recall that every Latin square in the set Ln;n2 constitutes the multiplication table of a quasigroup ([n] , ·) , where the set [n] is endowed with a binary operation · so that the equations a·x=b and y·a=b have unique solutions for x and y in [n] , for all a , b∈[n] . Equivalently, the set [n] is endowed with a left-division \ and a right-division / , so that x=a\b in the first equation, and y=b/a in the second one. Let T=t1t2. . . tm be a plaintext, with ti∈[n] , for all i≤m . For each positive integer s≤n, it is defined [6–8] the encrypted string Es(T):=e1e2. . . em, where ei:=(s·t1, if i=1, ei−1·ti, otherwise. The resulting string can be desencrypted by means of a decryption map Ds based on the already mentioned left-division. More specifically, ti=(s\e1, if i=1, ei−1\ei, otherwise. The sequential implementation of the just described encryption may give rise to image patterns with certain fractal properties [ 13 – 16 ]. More specifically, if S= (s1 , . . . , sr−1) is an (r− 1 ) -tuple of positive integers such that si≤n , for all i<r , then the r×m image pattern PS,T(L) = (pi,j) is defined as the r×m array satisfying that, for each positive integer j≤m , we have that pi,j:= tj, if i=1, si−1·pi−1,1, if i>1 and j=1, pi,j−1·pi−1,j, otherwise. (2) The image patterns arisen from the set of Latin squares of a given order only depend on the distribution of the latter into isomorphism classes. More specifically, the following result is known. Lemma 1 ([ 36 ]) . Let L1 and L2 be two Latin squares in Ln;n2 that are isomorphic by means of an isomorphism (f , f , f)∈S3 n . Let S= (s1 , . . . , sr−1) and f(S) = (f(s1) , . . . , f(sr−1)) be two (r− 1 ) -tuples of positive integers, such that si≤n , for all i<r , and let T=t1. . . tm and f(T) = f(t1). . . f(tm) be two plaintexts, with ti∈[n] , for all i≤m . Then, the r×m image patterns PS,T(L1)=(pi,j) and Pf(S),f(T)(L2)=(p0 i,j) coincide up to permutation of symbols. More specifically, p0 i,j=f(pi,j), for all positive integers i ≤r and j ≤m.
Mathematics 2021,9, 666 6 of 26 2.2. Computational Algebraic Geometry From here on, let K[X] denote the multivariate polynomial ring over a field K that is defined on a finite set X of n variables. A point P∈Kn is a zero of a set S⊆K[X] if f(P) = 0, for all f∈S . The set of all these zeros constitutes an affine algebraic set in Kn . It is irreducible if it cannot be decomposed into two nonempty proper affine algebraic sets. The dimension dim(V) of an affine algebraic set V is the maximal number of its irreducible components minus one. Further, two affine algebraic sets V1 and V2 in Kn are isomorphic if there exists a bijective map φ:V1→V2 such that φ(P) = (f1(P) , . . . , fn(P)) and φ−1(Q)=(g1(Q) , . . . , gn(Q)) , for all (P , Q)∈V1×V2 , where fi , gi∈K[X] , for all i≤n . The map φ constitutes an isomorphism from V1 to V2 . An isomorphism invariant of affine algebraic sets is any property of the latter that is preserved by isomorphisms. An ideal of the multivariate polynomial ring K[X] is a subset I⊆K[X] such that 0 ∈I ; p+q∈I , for all p , q∈I ; and p·q∈I , for all p∈I and q∈K[X] . It is said to be generated by a set of polynomials {p1, . . . , pk} ⊆ K[X]if it is defined as hp1, . . . , pki:=(k ∑ i=1 qi·pi:qi∈K[X]). It is binomial if all its generators are. Further, it is radical if p∈I , for all p∈K[X] such that pm∈I , for some positive integer m . Finally, it is zero-dimensional if dim(VK(I)) = 0, where VK(I) is the affine algebraic set in Kn formed by all the zeros of the polynomials within I . This dimension can be obtained from the reduced Gröbner basis of the ideal I[40–42] . Let us recall in this regard that the leading monomial of a polynomial is its largest monomial with respect to a given multiplicative well-ordering whose smallest element is the constant monomial 1. Then, a Gröbner basis of an ideal I is any subset within I whose leading monomials generate the so-called initial ideal, which is generated in turn by all the leading monomials of the non-zero polynomials of I . If the ideal I is zero-dimensional and radical, then the number of monomials that are not contained in its initial ideal coincides with the cardinality of VK(I) . Further, a Gröbner basis is reduced if all its polynomials are monic and no monomial of its polynomials is generated by the leading monomials of the rest of polynomials. The reduced Gröbner basis of an ideal is unique. It can always be computed from Buchberger’s algorithm [ 43 ]. Arisen from this algorithm, one can find the more efficient direct methods described by the algorithms F4 and F5 [ 44 , 45 ] and the algorithm slimgb [46]. Throughout this paper, all the computations concerning Gröbner bases are carried out on an Intel Core i7-8750H CPU (6 cores), with a 2.2 GHz processor and 8 GB of RAM, with a maximum running time of less than 1 s. All of them are done by making use of the algorithm slimgb that is implemented in the CAS SINGULAR. As multiplicative wellordering, it has been chosen the degree reverse lexicographical ordering. Finally, all the computations are done on either the field Q of rational numbers or the field C of complex numbers. In the first case, the following result holds. Theorem 1 ([ 22 ]) . The arithmetic complexity of computing the reduced Gröbner basis of a zero-dimensional ideal I=hp1 , . . . , pmi ⊂ Q[{x1 , . . . , xn}] is bounded above by the value maxn∑m i=1nhi(n+di n),1 m∑m i=1dino , where hi denotes the maximum size of the coefficients of the generator pi, and didenotes its maximum degree, for all i ≤m. The following example focuses on the computation of the affine algebraic set of a partial Latin square, which is described in the Introduction. Example 4. Let us consider the partial Latin square L1∈ L4;8 described in Example 3. To compute the affine algebraic set in the multivariate polynomial ring Q[{x1 , x2 , x3 , x4}] of L1 , we obtain from Definition 1the binomial ideal I(L1)defined as
Mathematics 2021,9, 666 7 of 26 Dx2 1−x1,x1x2−x2,x1x3−x3,x2x3−x4,x2x4−x3,x1x3−x4,x2 3−x1,x3x4−x2E. A reduced Gröbner basis of this binomial ideal is the subset nx1−x2,x3−x4,x2 2−x2,x2x4−x3,x2 4−x1o⊂I(L1). Hence, the ideal I(L1)is zero-dimensional. Its associated affine algebraic set is VQ(I(L1)) = {(0,0,0, 0),(1,1, 1,1),(1, 1, −1, −1)}. Being partial transpose and being P -partial isotopic, for some P⊂[n]×[n]×[n] , are two equivalence relations in the set Ln;m that give rise to identical affine algebraic sets. Concerning the first of them, the following direct result is known. Lemma 2 ([ 36 ]) . If two partial Latin squares of the same order and weight are partial transpose of each other, then their related affine algebraic sets coincide. Nevertheless, some assumptions are required for the second equivalence relation. In this regard, let us recall that the binomial ideal I(L) associated to a partial Latin square L∈ Lndetermines the following partition of the set [n]. Part(L):={{k∈[n]:xm−xk∈I(L)}:m∈[n]} Then, the following result holds. Proposition 1 ([ 36 ]) . Let L1 , L2∈ Ln;m be P -partial isotopic, for some subset P⊆Ent(L1)∩ Ent(L2). If Part(L1) = Part(L2), then VK(L1) = VK(L2), whatever the field Kis. Example 5. Let us consider again the multivariate polynomial ring Q[{x1 , x2 , x3 , x4}] . Since the partial Latin squares L1 and L2 described in Example 3are partial transpose of each other, Lemma 2 implies that VQ(I(L2)) = VQ(I(L1)) , which is described in Example 4. Now, let us consider the following three partial Latin squares in L4;8. L0 2≡ 2 3 4 3 4 1 1 2 L00 2≡ 341 2 1 2 3 4 L000 2≡ 4 3 4 1 1 2 3 2 Notice that L0 2 is P -partial isotopic to L1 by means of the isotopism (( 14 ) , Id , Id)∈S3 4 and the subset P⊂Ent(L1)∩Ent(L0 2) such that Ent(L1)\P={( 1,1,1 )} . Further, L00 2 and L000 2 are both isotopic (and, hence, ∅ -partial isotopic) to L1 by means, respectively, of the isotopisms (Id, Id, (13)(24)) and ((132),Id,Id)in S3 4. A simple computation enables us to ensure that the reduced Gröbner basis of the binomial ideals I(L1) and I(L0 2) coincide and, hence, VQ(I(L0 2)) = VQ(I(L1)) . This equality also holds from Proposition 1 and the fact that P(L1) = P(L0 2) = {{ 1,2 } , { 3,4 }} , which derives straightforwardly in any case from the mentioned coincidence of reduced Gröbner bases. Proposition 1also enables us to ensure that VQ(I(L00 2)) = VQ(I(L1)) , but, here, the reduced Gröbner basis of the binomial ideal I(L00 2) differs from that one of I(L1) . More specifically, the reduced Gröbner basis of I(L00 2)is the subset nx1−x2,x3−x4,x2x4−x1,x2 2−x3,x2 4−x4o⊂I(L00 2).
Mathematics 2021,9, 666 8 of 26 Finally, the reduced Gröbner basis of the binomial ideal I(L000 2)is the subset nx1−x2,x2−x4,x3−x4,x2 4−x4o⊂I(L00 2). Hence, P(L000 2) = {{1,2, 3,4}} 6=P(L1)and V(L000 2) = {(0,0, 0,0),(1, 1,1,1)}. 3. Standard Image Patterns Associated to Latin Squares Lemma 1establishes the existing relationship among image patterns arisen from Latin squares and the distribution into isomorphism classes of the latter. This section focuses on a particular subset of image patterns, which may enable one to determine, even from a visual way, whether two Latin squares are not isomorphic. In this regard, let m , n , r and s be four positive integers such that s≤n . We define the s -standard r×m image pattern associated to a Latin square L∈ Ln;n2 as Pr,m;s(L):=PS,T(L) , where S is the constant (r− 1 ) -tuple (s , . . . , s) and T is the constant plaintext s. . . s of length m . We call it constant if all its entries coincide. In addition, we term the set {Pr,m;s:s∈[n]} the standard set of r×m image patterns associated to L . From Lemma 1, if the standard sets of r×m image patterns associated to two Latin squares do not coincide up to permutation of symbols, then these Latin squares are not isomorphic. As such, the analysis of standard sets turns out to be of particular interest for distinguishing non-isomorphic Latin squares even from a simple visual way. To illustrate this fact, let us focus on the standard 90 × 90 image patterns associated to each one of the 35 isomorphism classes in which the set of Latin squares of order n= 4 is distributed. (The case n= 3 was already analyzed by Falcón, R.M. et al. [ 36 ].) A representative of each one of these classes is described in Figure 1. Their respective standard image patterns are shown in Figure 2. It is formed by four collages in form of 7 × 5 arrays. They were created by means of the commands Colorize and ImageAssemble in WOLFRAM MATHEMATICA [ 47 ]. Each standard image pattern is represented as a pixel array so that each symbol is uniquely replaced by a color within a given palette of four colors. Each cell within any of these arrays constitutes the corresponding standard image pattern that is associated to the Latin square described at the same position within Figure 1. The union of the four standard images patterns associated to such a Latin square constitutes its standard set of 90 ×90 image patterns. These standard sets can be distributed according to the following classification. 1. Constant standard image patterns. A simple observation of the monochromatic cells in Figure 2enables us to determine this type of standard image patterns. Notice that the s -standard image pattern of a Latin square L= (li,j)is constant if and only if ls,s=s. 2. Fractal standard image patterns. From a simple visual inspection, one can observe that some of the cells in Figure 2 have a fractal character. It is the case, for instance, of the 2-standard image pattern associated to the Latin square L4.1. 3. Non-fractal standard image patterns. The remaining cells do not have a clear fractal character. Their spectrum goes from what one may label as a chaotic behavior (see, for instance, the 2-standard image pattern associated to L4.30 ) to a shadow of fractal behavior (see, for instance, the 2-standard image pattern related to L4.11 ). In any case, we do not distinguish in this paper the fractal gradation of the image patterns under consideration.
Mathematics 2021,9, 666 9 of 26 1 2 3 4 2 1 4 3 4 3 1 2 3 4 2 1 1 2 3 4 2 1 4 3 4 3 2 1 3 4 1 2 1 2 3 4 2 3 4 1 4 1 2 3 3 4 1 2 1 2 3 4 3 1 4 2 4 3 2 1 2 4 1 3 1 2 3 4 3 4 1 2 4 3 2 1 2 1 4 3 L4.1 L4.2 L4.3 L4.4 L4.5 1 2 4 3 2 1 3 4 3 4 1 2 4 3 2 1 1 2 4 3 2 1 3 4 3 4 2 1 4 3 1 2 1 2 4 3 2 1 3 4 4 3 1 2 3 4 2 1 1 2 4 3 2 1 3 4 4 3 2 1 3 4 1 2 1 2 4 3 2 3 1 4 3 4 2 1 4 1 3 2 L4.6 L4.7 L4.8 L4.9 L4.10 1 2 4 3 2 3 1 4 4 1 3 2 3 4 2 1 1 2 4 3 3 1 2 4 2 4 3 1 4 3 1 2 1 2 4 3 3 1 2 4 4 3 1 2 2 4 3 1 1 2 4 3 3 4 1 2 2 1 3 4 4 3 2 1 1 2 4 3 3 4 2 1 2 1 3 4 4 3 1 2 L4.11 L4.12 L4.13 L4.14 L4.15 1 2 4 3 3 4 2 1 2 3 1 4 4 1 3 2 1 2 4 3 3 4 2 1 4 1 3 2 2 3 1 4 1 2 4 3 3 4 2 1 4 3 1 2 2 1 3 4 1 3 4 2 2 1 3 4 3 4 2 1 4 2 1 3 1 3 4 2 2 1 3 4 4 2 1 3 3 4 2 1 L4.16 L4.17 L4.18 L4.19 L4.20 1 3 4 2 2 4 3 1 3 1 2 4 4 2 1 3 1 3 4 2 2 4 3 1 4 2 1 3 3 1 2 4 1 3 4 2 3 1 2 4 4 2 1 3 2 4 3 1 1 3 4 2 4 2 1 3 2 4 3 1 3 1 2 4 2 1 3 4 1 3 4 2 3 4 2 1 4 2 1 3 L4.21 L4.22 L4.23 L4.24 L4.25 2 1 3 4 1 3 4 2 4 2 1 3 3 4 2 1 2 1 3 4 3 4 1 2 1 2 4 3 4 3 2 1 2 1 3 4 3 4 2 1 1 2 4 3 4 3 1 2 2 1 3 4 3 4 2 1 1 3 4 2 4 2 1 3 2 1 3 4 3 4 2 1 4 2 1 3 1 3 4 2 L4.26 L4.27 L4.28 L4.29 L4.30 2 1 3 4 3 4 2 1 4 3 1 2 1 2 4 3 2 3 1 4 1 4 2 3 3 2 4 1 4 1 3 2 2 3 1 4 4 1 3 2 3 2 4 1 1 4 2 3 1 2 3 4 2 1 4 3 3 4 1 2 4 3 2 1 1 2 3 4 2 1 4 3 3 4 2 1 4 3 1 2 L4.31 L4.32 L4.33 L4.34 L4.35 Figure 1. Isomorphism classes of Latin squares of order four.
Mathematics 2021,9, 666 16 of 26 23n3−3n2+9n+|Ent(L)|+α1+2α2+1 3n3−3n2+9n+|Ent(L)|+α1+2α2+1!n3 <2n3, where α1:=|{(i,i,k)6∈ Ent(L): 1 ≤i,k≤n}| and α2:=|{(i,j,k):{(i,j,k),(j,i,k)}∩Ent(L) = ∅, 1 ≤i<j≤n, 1 ≤k≤n}|. Proof. The ideal IPT(L) is zero-dimensional, because VQ(IPT(L)) ⊂ { 0,1 }n3 . Thus, the result holds from Theorem 1and the generators of this ideal, whose coefficients have all of them size one. To see it, Table 3shows the maximum degree of each one of these generators, together with the number of generators of each type. Then, the result follows because, from Theorem 1, the required arithmetic complexity is bounded above by the maximum value between n33n3−3n2+9n+|Ent(L)|n3+2 n3+ (α1+2α2+1)(n3+1) and 23n3−3n2+9n+|Ent(L)|+α1+2α2+1 3n3−3n2+9n+|Ent(L)|+α1+2α2+1!n3 . Table 3. Study of the generators of the ideal IPT(L). Generator Type Maximum Degree Number of Generators x2 ijk −xijk 2 3n xijkxi0jk 2n3−n2+2n xijkxij0k2n3−n2+2n xijkxijk02n3−n2+2n m−∑n i,j,k=1xijk 1 1 (xijk −1)·(xjik −1)2|Ent(L)| xiik 1α1 xijk (with i6=j) 1 2α2 A computational algebraic geometry approach can also be described in the case of dealing with the equivalence relation of being P -partial isotopic, for some subset P⊂ [n]×[n]×[n] . It follows similarly to the approach concerning the equivalence relation of being isotopic, which was described in (Theorem 13, [ 18 ]). To this end, for each positive integer n, let us consider the set of 3n2variables XPI n:=xij,yij,zij : 1 ≤i,j≤n.
Mathematics 2021,9, 666 17 of 26 Then, for each pair of partial Latin squares L1= (li,j) and L2= (l0 i,j) in the set Ln;m , let us define the following ideal in the multivariate polynomial ring Q[XPI n]. IPI(L1,L2):=Dx2 ij −xij,y2 ij −yij,z2 ij −zij : 1 ≤i,j≤nE +*1− n ∑ j=1 xij, 1 − n ∑ j=1 xji : 1 ≤i≤n+ +*1− n ∑ j=1 yij, 1 − n ∑ j=1 yji : 1 ≤i≤n+ +*1− n ∑ j=1 zij, 1 − n ∑ j=1 zji : 1 ≤i≤n+ +xii0yjj0(zli,jl0 i0,j0−1): 1 ≤i,i0,j,j0,li,j,l0 i0,j0≤n, with li,j6=l0 i,j +Dxii0yjj0: 1 ≤i,i0,j,j0≤n,li,j=∅6∈ nl0 i,j,l0 i0,j0oE +Dxii0yjj0: 1 ≤i,i0,j,j0≤n,li,j=l0 i,j=∅6=l0 i0,j0E +Dxii0yjj0: 1 ≤i,i0,j,j0≤n,li,j6=∅=l0 i0,j0and li,j6=l0 i,jE. Lemma 4. Two partial Latin squares L1 and L2 in the set Ln;m are P -partial isotopic, for some subset P⊂[n]×[n]×[n] , if and only if the affine algebraic set of the ideal IPI(L1 , L2) is non-empty. Proof. Let us suppose the existence of a zero (a11 , . . . , ann , b11 , . . . , bnn , c11 , . . . , cnn)∈ { 0,1 }3n2 of the ideal IPI(L1 , L2) . The first three subideals describing this ideal imply that this zero is uniquely related to an isotopism (f , g , h)∈S3 n such that, for each pair of positive integers i,j≤n, the following assertions hold. •f(i) = jif and only if aij =1. •g(i) = jif and only if bij =1. •h(i) = jif and only if cij =1. The fourth subideal implies that this isotopism constitutes a one-to-one map from Ent(L1)\Ent(L2) to Ent(L2) . The fifth one implies that, if the cell (i , j) is empty in L1 but not in L2 , then the former cannot be mapped to a non-empty cell in L2 . Further, the sixth subideal implies that, if the cell (i , j) is empty in both L1 and L2 , then it cannot be mapped to a non-empty cell in L2 . Finally, the last subideal implies that, if the cell (i , j) contains distinct symbols in L1 and L2 , then it cannot be mapped to an empty cell in L2 . Under such assumptions, it is readily verified that the zero under consideration is uniquely identified with a P-partial isotopism from L1to L2, where P⊆Ent(L1)∩Ent(L2). Example 8. Let us consider the Latin squares L1 and L3 in Example 2. The reduced Gröbner basis of the ideal IPI(L1 , L3)⊂Q[XPI 4] is the subset { 1 } ⊂ IPI(L1 , L3) . Thus, the related affine algebraic set is empty and hence, no partial isotopism exists between L1and L3. Example 9. Let us consider the partial Latin square L1 and L2 described in Example 3. The reduced Gröbner basis of the ideal IPI(L1,L2)⊂Q[XPI 4]is the subset {z2 22 −z22,z21 +z22 −1, z12 +z22 −1, z11 −z22,z44 −1, z43,z42,z41,z34,z33 −1} ∪ {z32,z31,z24,z23,z14,z13,y44,y43,y42,y41 −1, y34,y33,y32 −1, y31,y24 −1, y23} ∪ {y22,y21,y14,y13 −1, y12,y11,x44,x43,x42 −1, x41,x34,x33,x32,x31 −1, x24} ∪ {x23 −1, x22,x21,x14 −1, x13,x12,x11} ⊂ IPI(L1,L2).
Mathematics 2021,9, 666 18 of 26 Hence, the affine algebraic set of the ideal IPI(L1 , L2) is formed by two points that are uniquely associated to the isotopisms (( 1423 ) , ( 1324 ) , ( 12 )) and (( 1423 ) , ( 1324 ) , Id) in S3 4 . Both of them constitute P-partial isotopisms from L1to L2, where P =Ent(L1)∩Ent(L2). From Lemma 4, computational algebraic geometry can be used for distributing partial Latin squares according to the equivalence relation of being P -partial isotopic, for some subset P⊂[n]×[n]×[n] . The following result establishes the computational cost that is required to this end in case of being n>2. (The case n=1 is trivial.) Theorem 3. Let L1 and L2 be two partial Latin squares in Ln , with n≥ 2. The arithmetic complexity of computing the reduced Gröbner basis of the ideal IPI(L1 , L2) over the field Q is bounded above by 3β1+2(3n2+β2+β3+β4) + 6n 3n2+6n+β1+β2+β3+β43n2 <33n2, where β1:=n(i,i0,j,j0)∈[n]×[n]×[n]×[n]:li,j,l0 i0,j0∈[n],li,j6=l0 i0,j0o, β2:=n(i,i0,j,j0)∈[n]×[n]×[n]×[n]:li,j=∅6∈ nl0 i,j,l0 i0,j0oo, β3:=n(i,i0,j,j0)∈[n]×[n]×[n]×[n]:li,j=l0 i,j=∅6=l0 i0,j0o and β4:=n(i,i0,j,j0)∈[n]×[n]×[n]×[n]:li,j6=∅=l0 i0,j0and li,j6=l0 i,jo Proof. The ideal IPI(L1 , L2) is zero-dimensional, because VQ(IPI(L)) ⊂ { 0,1 }3n2 . Then, similarly to the proof of Theorem 2, the result holds from Theorem 1and the generators of this ideal, whose coefficients have all of them size one. To see it, Table 4shows the maximum degree of each one of these generators, together with the number of generators of each type. Then, the result holds because, from Theorem 2, the required arithmetic complexity is bounded above by the maximum value between 3n2β13n2+3 3n2+ (3n2+β2+β3+β4)3n2+2 3n2+6n(3n2+1). and 3β1+2(3n2+β2+β3+β4) + 6n 3n2+6n+β1+β2+β3+β43n2 .
Mathematics 2021,9, 666 19 of 26 Table 4. Study of the generators of the ideal IPI(L1,L2). Generator Type Maximum Degree Number of Generators x2 ij −xij 2n2 y2 ij −yij 2n2 z2 ij −zij 2n2 1−∑n j=1xij 1n 1−∑n j=1xji 1n 1−∑n j=1yij 1n 1−∑n j=1yji 1n 1−∑n j=1zij 1n 1−∑n j=1zji 1n xii0yjj0(zli,jl0 i0,j0−1)3β1 xii0yjj02β2+β3+β4 5. Conclusions and Further Work In this paper, we show the relevant role that computational algebraic geometry plays in the recognition and analysis of image patterns associated to Latin squares. To this end, we introduce the concepts of standard image pattern and standard set of a given Latin square. Moreover, a new affine algebraic set associated to any such image pattern is described, whose isomorphism invariants can be used for distinguishing different standard sets and hence, for determining in a computationally fast way (even visually) whether two Latin squares are not isomorphic. The main limitation of the methodology here proposed is the exponential complexity for computing Gröbner bases, which is highly dependent on the number of underlying variables. This number coincides in our case with the order of the Latin square under consideration. Due to it, this limitation is not an inconvenience at all for dealing with the smallest orders for which no results on the distribution of Latin squares into isomorphism classes is known ( n≥ 12). In fact, this computational approach turns out to be an efficient way for dealing with Latin squares of much higher orders. To illustrate this fact, let us consider the Latin square of order 256 that is represented by colors in Figure 5. It was randomly constructed by following Algorithm 1 in [ 48 ], which gives rise to random Latin squares with possible implementation in cryptography. Notice in any case that every Latin square generated in this way is isotopic to a diagonally cyclic Latin square [ 49 ]. Figure 6 shows the running time required by an Intel Core i7-8750H CPU (6 cores), with a 2.2 GHz processor and 8 GB of RAM for computing both the reduced Gröbner basis of the binomial ideal associated to the s -standard 90 × 90 image pattern of this Latin square described in Figure 5, for every positive integer s≤ 256, together with the cardinality of its related affine algebraic set. The maximum running time was 3.45 s, which is reached for s=101.
Mathematics 2021,9, 666 20 of 26 Figure 5. Latin square of order 256 represented by colors. Figure 6. Running time (in seconds) required for computing the cardinality of the set VC(I(P90,90;s(L))), with 1 ≤s≤256, and Lbeing the Latin square described in Figure 5. It is remarkable that the methodology here described may be particularized in order to make more efficient the computation of group isomorphisms. Let us recall in this regard that every associative quasigroup constitutes a group. To illustrate this fact, let us consider both the dihedral and the abelian groups of order six, whose respective multiplication tables are the Latin squares D6≡ 1 2 3 4 5 6 2 3 1 5 6 4 3 1 2 6 4 5 4 6 5 1 3 2 5 4 6 2 1 3 6 5 4 3 2 1 and Z6≡ 1 2 3 4 5 6 2 3 4 5 6 1 3 4 5 6 1 2 4 5 6 1 2 3 5 6 1 2 3 4 6 1 2 3 4 5 . Their respective standard sets of 90 × 90 image patterns are shown in the 2 × 6 collage of Figure 7. Both standard sets are formed by a constant and five fractal standard image
Mathematics 2021,9, 666 21 of 26 patterns. It is readily verified from a visual way that the standard set of the dihedral group (top row of the collage) does not coincide with the standard set of the abelian group (bottom row of the collage), even allowing a possible permutation of symbols. In this simple way, we may ensure that these two groups are not isomorphic. Figure 7. Standard sets of 90 × 90 image patterns associated to the dihedral group ( top ) and the abelian group (bottom) of order six. A similar conclusion arises from the computation of the reduced Gröbner bases concerning both types of affine algebraic sets associated to the dihedral and the abelian group of order six. From this computation, we have that |VC(I(D6))|=3 and |VC(I(Z6))|=7. In addition, we have that |VC(I(P90,90;s(D6)))|=∞ , for every positive integer s≤ 6, but |VC(I(P90,90;2(Z6)))|=|VC(I(P90,90;6(Z6)))|=7. Further, the methodology here described can be generalized for other types of arrays non-subjected to the Latin square condition. In this regard, it would be interesting to delve, for instance, into the study of standard sets of image patterns associated to (partial) semigroups or, more generally, to (partial) magmas. Even if they may not be endowed with a left or right division (as quasigroups are), their multiplication tables enable us to define r×mimage patterns based on these algebraic structures by making use to this end of the corresponding conditions described in (2) (see [ 50 ], for a first approach in this regard in case of dealing with magmas). These conditions may be taken into account to deal also with arrays related to other types of mathematical structures, not only algebraic ones. To illustrate this aspect, let us focus on the classical problem in graph theory of determining whether two given graphs are isomorphic or not. Every adjacency matrix of a given simple graph of order n is a binary symmetric n×n array with main diagonal of zeros. It may be considered the multiplication table of a finite magma of set of symbols { 0,1, . . . , n− 1 } from which one could define r×m image patterns satisfying the corresponding conditions in (2). Then, standard sets of s -standard image patterns, with s∈ { 0,1 . . . , n− 1 } , could be defined similarly to those ones described in Section 3. In this way, the standard set of two isomorphic regular graphs would always coincide, up to permutations of symbols. This fact may therefore be used for distinguishing non-isomorphic regular graphs, even from a visual way. Thus, for instance, the following two arrays constitute respective incidence matrices of the complete graph K4 and the cycle C4. 0 1 1 1 1 0 1 1 1 1 0 1 1 1 1 0 0 1 0 1 1 0 1 0 0 1 0 1 1 0 1 0 The standard sets of the 90 × 90 image patterns associated to both graphs are shown in the 2 × 4 collage of Figure 8. Notice that the standard set of the complete graph K4 (top
Mathematics 2021,9, 666 22 of 26 row of the collage) is formed by one constant and three fractal image patterns, whereas that one of the cycle C4 is formed by one constant, two fractal and one almost constant (except for its first row, the 3-standard image pattern is monochromatic) image patterns. Hence, these two regular graphs are not isomorphic. Figure 8. Standard sets of 90 × 90 image patterns associated to the complete graph K4 ( top ) and the cycle C4(bottom). These examples illustrate the relevance that standard sets of image patterns may have for distributing distinct types of algebraic and combinatorial structures into isomorphism classes. A much more comprehensive study dealing with their recognition and analysis is required in any case. It is established as further work. Similar to the methodology here implemented, computational algebraic geometry may be an interesting approach to this end. Furthermore, notice that this paper has not dealt with the fractal gradation of the image patterns under consideration. A comprehensive analysis of their fractal dimensions is of particular interest in order to improve the efficiency of this computational approach. This paper also focuses on the possible use of computational algebraic geometry for dealing with the distribution of partial Latin squares according to the equivalence relations of being either partial transpose or P -partial isotopic, for some subset P⊂[n]×[n]×[n] . An exhaustive enumeration of these classes is also established as further work. Concerning the distribution into P -partial isotopism classes, it is required to delve into the study of P -partial autotopisms (that is, P -partial isotopisms from a partial Latin square to itself) and make use of the Orbit-Stabilizer Theorem in a similar way to the already studied distribution of partial Latin squares into isotopism classes [18]. Again, the main limitation of the methodology here introduced is the high dependence on the number of variables required by each one of the affine algebraic sets under consideration. To see it, it has been made use of the already mentioned Algorithm 1 described in [ 48 ] in order to obtain random Latin squares on which the computational efficiency of using Gröbner bases has been checked for determining both the set of Latin squares that are partial transpose of another given Latin square, and the set of partial autotopisms of a Latin square. Figure 9shows the running time required by our computer system for computing both the reduced Gröbner basis of the corresponding ideal, together with the cardinality of its related affine algebraic set. Notice that only the relationship of being partial transpose seems to be useful for dealing by itself with the smallest orders for which no results on the distribution of Latin squares into isomorphism classes is known ( n≥ 12). It is not the case of the equivalence relation of being P -partial isotopic, for some subset P⊂[n]×[n]×[n] , whose exponential growth starts visibly much before, even from order n= 5. It agrees with the fact that this equivalence relation comprehends that one of being isotopic, for which previous studies [ 18 ] have already revealed the advantages of using some extra Latin square isomorphism invariant for reducing the computational cost of an analogous algebraic geometry approach. Similar studies concerning this new equivalence relation are, therefore, required and established as further work. In this regard, the joint use of the Latin square isomorphism invariants recently introduced in [ 34 , 35 ] may be of particular interest.
Mathematics 2021,9, 666 23 of 26 Figure 9. Running time (in seconds) required for computing the cardinality of the set VQ(IPT(L)) , for random Latin squares L∈ Ln, with 1 ≤n≤14. It is also interesting to illustrate the computational efficiency of these two approaches in case of dealing with partial Latin squares with empty cells, whose distribution into isomorphism classes is only known [ 17 , 18 ] for order n≤ 6. Firstly, let us focus on the use of Gröbner bases for determining the set of partial Latin squares that are partial transpose of another given partial Latin square. To this end, a partial Latin square in the set L10;m was randomly constructed, for each positive integer m≤ 100, by means of Method (A) described in [ 34 ]. The latter consists of adding sequentially a set of feasible random entries to an empty partial Latin square until the desired weight is reached. Figure 10 shows the running time required by our computer system for determining both the reduced Gröbner basis of the corresponding ideals and the cardinalities of their related affine algebraic sets. The maximum running time was 13.99 s, which is reached for m= 50. It is remarkable the slightly decreasing tendency of this running time with respect to the weight of the partial Latin square under consideration. Figure 10. Running time (in seconds) required for computing the cardinality of the set VQ(IPT(L)) , for random partial Latin squares L∈ L10;m, with 1 ≤m≤100. Now, to illustrate the computational efficiency of using Gröbner bases for determining the set of P -partial isotopisms between two given partial Latin squares, for some subset P⊂[n]×[n]×[n] , the mentioned method of adding random entries has been used to construct a pair of random partial Latin squares in the set L7;m , for each positive integer m≤ 49. (Recall that n= 7 is the first order for which no result on the distribution into isotopism classes is known.) Figure 11 shows the running time required by our computer system for determining both the reduced Gröbner basis of the corresponding ideals and the cardinalities of their related affine algebraic sets. The maximum running time has been 102.43 s, which is reached for m= 49 (the Latin square case). The fast exponential growth
Mathematics 2021,9, 666 24 of 26 of running time is remarkable for dense partial Latin squares. Partial Latin squares with either only one filled cell of with more or less the same number of empty and filled cells seem also to require more running time. All these cases turned out to be related to a high number of partial isotopisms. In any case, a much more comprehensive computational analysis concerning orders, weights and particular isomorphism classes of partial Latin squares is required for distinguishing potential bottlenecks in the computation of related Gröbner bases. Figure 11. Running time (in seconds) required for computing the cardinality of the set VQ(IPI(L , L)) , for random partial Latin squares L∈ L7;m, with 1 ≤m≤49. Let us finish this section by establishing the following open problems to deal also with as further work on this topic. Problem 1. What are the minimum and maximum numbers of partial Latin squares that are partial transpose of a partial Latin square in Ln;m? Problem 2. What are the minimum and the maximum numbers of distinct partial Latin squares for which there is at least one P -partial isotopism to a partial Latin square in Ln;m , for some subset P⊂[n]×[n]×[n]? Problem 3. What is the maximum cardinality of a subset P⊂[n]×[n]×[n] for which a P -partial isotopism exists between two distinct partial Latin squares in Ln;m? Funding: This research received no external funding. Institutional Review Board Statement: Not applicable. Informed Consent Statement: Not applicable. Acknowledgments: This work was partially supported by the Research Project FQM-016 from Junta de Andalucía. In addition, the author wants to express his gratitude to the anonymous referees for the comprehensive reading of the paper and their pertinent comments and suggestions, which helped improve the manuscript. Particularly, the author is very grateful for the interesting suggestions concerning the computational complexity of the proposed approach. Conflicts of Interest: The author declares no conflict of interest. References 1. Moldovyan, N.A.; Shcherbacov, A.V.; Shcherbacov, V.A. On some applications of quasigroups in cryptography. In Workshop on Foundations of Informatics; Acad. Sci. Moldova, Inst. Math. Comput. Sci.: Chi¸sin˘au, Moldova, 2015; pp. 331–340. 2. Moldovyan, N.A.; Shcherbacov, A.V.; Shcherbacov, V.A. Some applications of quasigroups in cryptology. Comput. Sci. J. Mold. 2016,24, 55–67. 3. Shcherbacov, V. Elements of Quasigroup Theory and Applications; Monographs and Research Notes in Mathematics; CRC Press: Boca Raton, FL, USA, 2017. 4. Koscielny, C. A method of constructing quasigroup-based stream-ciphers. Int. J. Appl. Math Comp. Sci. 1996,6, 109–121. 5. Koscielny, C.; Mullen, G.L. A quasigroup-based public-key cryptosystem. Int. J. Appl. Math. Comp. Sci. 1999,9, 955–963.
Mathematics 2021,9, 666 25 of 26 6. Markovski, S.; Gligoroski, D.; Andova, S. Using quasigroups for one-one secure encoding. In Proceedings of the Eight Conference Logic and Computer Science (LIRA), Novi Sad, Serbia, 1–4 September 1997; pp. 157–162. 7. Markovski, S.; Gligoroski, D.; Bakeva, V. Quasigroup string processing: Part 1. Contrib. Sec. Math. Tech. Sci. MANU 1999 ,XX, 13–28. [CrossRef] 8. Markovski, S.; Kusakatov, V. Quasigroup string processing: Part 2. Contrib. Sec. Math. Tech. Sci. MANU 2000 ,XXI, 15–32. [CrossRef] 9. Kolesova, G.; Lam, C.W.H.; Thiel, L. On the number of 8 ×8 Latin squares. J. Comb. Theory Ser. A 1990,54, 143–148. [CrossRef] 10. Hulpke, A.; Kaski, P.; Östergård, P.R.J. The number of Latin squares of order 11. Math. Comp. 2011,80, 1197–1219. [CrossRef] 11. McKay, B.D.; Meynert, A.; Myrvold, W. Small Latin squares, quasigroups, and loops. J. Comb. Des. 2007,15, 98–119. [CrossRef] 12. Dimitrova, V.; Markovski, J. On quasigroup pseudo random sequence generator. In Proceedings of the First Balkan Conference in Informatics, Thessaloniki, Greece, 19–21 November 2003; Manolopoulos, Y., Spirakis, P., Eds.; pp. 393–401. 13. Markovski, S.; Gligoroski, D.; Markovski, J. Classification of quasigroups by random walk on torus. J. Appl. Math. Comput. 2005 , 19, 57–75. [CrossRef] 14. Markovski, S.; Dimitrova, V.; Samardjiska, S. Identity sieves for quasigroups. Quasigroups Relat. Syst. 2010,18, 149–163. 15. Dimitrova, V.; Markovski, S. Classification of quasigroups by image patterns. In Proceedings of the Fifth International Conference for Informatics and Information Technology; Faculty of Computer Science and Engineering, Ss. Cyril and Methodius University in Skopje, N. Macedonia: Bitola, Macedonia, 2007; pp. 152–160. 16. Dimitrova, V.; Markovski, S.; Mileva, A. Periodic quasigroup string transformations. Quasigroups Relat. Syst. 2009,17, 191–204. 17. Falcón, R.M.; Stones, R.J. Classifying partial Latin rectangles. Electron. Notes Discret. Math. 2015,49, 765–771. [CrossRef] 18. Falcón, R.M.; Stones, R.J. Enumerating partial Latin rectangles. Electron. J. Comb. 2020,27, P2.47. 19. Lakshman, Y.N. A single exponential bound on the complexity of computing Gröbner bases of zero-dimensional ideals. In Effective Methods in Algebraic Geometry (Castiglioncello, 1990); Progr. Math. 94; Birkhäuser: Boston, MA, USA, 1991; pp. 227–234. 20. Gao, S. Counting Zeros over Finite Fields Using Gröbner Bases. Master’s Thesis, Carnegie Mellon University, Pittsburgh, PA, USA, 2009. 21. Hashemi, A. Nullstellensätze for zero-dimensional Gröbner bases. Comput. Complex. 2009,18, 155–168. [CrossRef] 22. Hashemi, A.; Lazard, D. Sharper complexity bounds for zero-dimensional Gröbner bases and polynomial system solving. Internat. J. Algebra Comput. 2011,21, 703–713. [CrossRef] 23. Bayer, D. The Division Algorithm and the Hilbert Scheme. PhD. Thesis, Harvard University, Cambridge, MA, USA, 1982. 24. Adams, W.; Loustaunau, P. An introduction to Gröbner bases. In Graduate Studies in Mathematics 3; American Mathematical Society: Providence, RI, USA, 1994. 25. Falcón, R.M.; Martín-Morales, J. Gröbner bases and the number of Latin squares related to autotopisms of order ≤ 7. J. Symb. Comput. 2007,42, 1142–1154. [CrossRef] 26. Falcón, R.M. The set of autotopisms of partial Latin squares. Discret. Math. 2013,313, 1150–1161. [CrossRef] 27. Falcón, R.M. Enumeration and classification of self-orthogonal partial Latin rectangles by using the polynomial method. Eur. J. Comb. 2015,48, 215–223. [CrossRef] 28. Falcón, O.J.; Falcón, R.M.; Nú nez, J.; Pacheco, A.M.; Villar, M.T. Computation of isotopisms of algebras over finite fields by means of graph invariants. J. Comp. Appl. Math. 2017,318, 307–315. [CrossRef] 29. Falcón, R.M.; Falcón, O.J.; Núnez, J. Counting and enumerating partial Latin rectangles by means of computer algebra systems and CSP solvers. Math. Methods Appl. Sci. 2018,41, 7236–7262. [CrossRef] 30. Gago-Vargas, J.; Hartillo-Hermoso, I.; Martín-Morales, J.; Ucha-Enríquez, J.M. Sudokus and Gröbner bases not only a divertimento. In International Workshop on Computer Algebra in Scientific Computing; Springer: Berlin/Heidelberg, Germany, 2006; Volume 4194, pp. 155–165. 31. Arnold, E.; Lucas, S.; Taalman, L. Gröbner basis representations of sudoku. Coll. Math. J. 2010,41, 101–112. [CrossRef] 32. Sato, Y.; Inoue, S.; Suzuki, A.; Nabeshi, K.; Sakai, K. Boolean Gröbner bases. J. Symb. Comp. 2011,46, 622–632. [CrossRef] 33. Falcón, R.M.; Stones, R.J. Partial Latin rectangle graphs and autoparatopism groups of partial Latin rectangles with trivial autotopism groups. Discret. Math. 2017,340, 1242–1260. [CrossRef] 34. Danan, E.; Falcon, R.M.; Kotlar, D.; Marbach, T.G.; Stones, R.J. Refining invariants for computing autotopism groups of partial Latin rectangles. Discret. Math. 2020,343, 111812. [CrossRef] 35. Stones, R.J.; Falcón, R.M.; Kotlar, D.; Marbach, T.G. Computing autotopism groups of partial Latin rectangles. J. Exp. Algorithmics 2020,25, 1–39. [CrossRef] 36. Falcón, R.M.; Álvarez, V.; Gudiel, F. A Computational Algebraic Geometry approach to analyze pseudo-random sequences based on Latin squares. Adv. Comput. Math. 2019,45, 1769–1792. [CrossRef] 37. Dénes, J.; Keedwell, A.D. Latin Squares and Their Applications; Academic Press: New York, NY, USA; London, UK, 1974. 38. Kreuzer, M.; Robbiano, L. Computational Commutative Algebra 1; Springer: Berlin/Heidelberg, Germany, 2000. 39. Decker, W.; Greuel, G.M.; Pfister, G.; Schönemann, H. SINGULAR 4-2-0. A computer Algebra System for Polynomial Computations. Available online: http://www.singular.uni-kl.de (accessed on 28 February 2021). 40. Lazard, D. Solving zero-dimensional algebraic systems. J. Symb. Comput. 1992,13, 117–131. [CrossRef] 41. Möller, H.M. On decomposing systems of polynomial equations with finitely many solutions. Appl. Algebra Eng. Commun. Comput. 1993,4, 217–230. [CrossRef]