New Constructions for the n-Queens Problem

Let D be a digraph, possibly with loops. A queen labeling of D is a bijective function l:V(G)⟶{1,2,…,|V(G)|}\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$l:V(G)\longrightarrow \{1,2,\ldots ,|V(G)|\}$$\end{document} such that, for every pair of arcs in E(D), namely (u, v) and (u′,v′)\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$(u',v')$$\end{document} we have (i) l(u)+l(v)≠l(u′)+l(v′)\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$l(u)+l(v)\ne l(u')+l(v')$$\end{document} and (ii) l(v)-l(u)≠l(v′)-l(u′)\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$l(v)-l(u)\ne l(v')-l(u')$$\end{document}. Similarly, if the two conditions are satisfied modulo n=|V(G)|\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$n=|V(G)|$$\end{document}, we define a modular queen labeling. There is a bijection between (modular) queen labelings of 1-regular digraphs and the solutions of the (modular) n-queens problem. The ⊗h\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\otimes _h$$\end{document}-product was introduced in 2008 as a generalization of the Kronecker product and since then, many relations among labelings have been established using the ⊗h\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\otimes _h$$\end{document}-product and some particular families of graphs. In this paper, we study some families of 1-regular digraphs that admit (modular) queen labelings and present a new construction concerning to the (modular) n-queens problem in terms of the ⊗h\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\otimes _h$$\end{document}-product, which in some sense complements a previous result due to Pólya.


Introduction
The n-queens problem consists in placing n nonattacking queens on an n × n chessboard. The modular version of this problem, namely the modular n-queens It is worthwhile mentioning that Acharya and Hegde had already defined in [1] the concept of strongly indexable graph that turns out to be equivalent to the concept of super edge-magic graph. We take this opportunity to mention that although the original definitions of (super) edge-magic graphs and labelings were provided for simple graphs (that is to say, graphs with no loops nor multiple edges), in this paper, we understand these definitions for any graph. Therefore, unless otherwise specified, the graphs considered in this paper are not necessarily simple. Moreover, we say that a digraph is (super) edge-magic if its underlying graph is (super) edge-magic. In [7], Figueroa-Centeno et al. provided the following useful characterization of super edge-magic simple graphs, that works in exactly the same way for graphs in general.
Lemma 1 [7]. Let G be a (p, q)-graph. Then G is super edge-magic if and only if there is a bijective function g : V (G) −→ [1, p] such that the set S = {g(u) + g(v) : uv ∈ E(G)} is a set of q consecutive integers. In this case, g can be extended to a super edge-magic labeling f with valence p + q + min S. [8], the following product: Let D be a digraph and let Γ be a family of digraphs with the same vertex set V . Assume that h : E(D) −→ Γ is any function that assigns elements of Γ to the arcs of D. a, b)). Note that when h is constant, D ⊗ h Γ is the Kronecker product. Many relations among labelings have been established using the ⊗ h -product and some particular families of graphs, namely S p and S k p (see for instance, [11,[13][14][15][16][17][18]). The family S p contains all super edge-magic 1-regular labeled digraphs of order p where each vertex takes the name of the label that has been assigned to it. A super edge-magic digraph F is in S k p if |V (F )| = |E(F )| = p and the minimum sum of the labels of the adjacent vertices (see Lemma 1) is equal to k. Notice that, since each 1-regular digraph has minimum edge induced sum equal to (p + 3)/2, it follows that S p ⊂ S (p+3)/2 p . The following result was introduced in [14], generalizing a previous result found in [8]:

Figueroa-Centeno et al. defined in
Theorem 1 [14]. Let D be a (super) edge-magic digraph and let h : E(D) −→ S k p be any function. Then D ⊗ h S k p is (super) edge-magic. Let Q(n) denote the number of solutions for the n-queens problem and M (n) the number of solutions for the modular n-queens problem.
Theorem 2 [23]. For all m and n for which m ≥ 3 and gcd(n, 6) = 1, it holds that Q(mn) > (Q(m)) n M (n). In particular, if gcd(N, 30) = 5 then Q(N ) > 4 N/5 . The first part of the above theorem is a corollary of a previous result due to Pólya, where a solution of the n-queens problem is described by means of a bijective function f : [0, n − 1] −→ [0, n − 1], so that the k th queen is placed at the (k, f (k)) coordinate of the chessboard. Theorem 3 [22]. For given m, n > 3 such that gcd(n, 6) = 1, f 1 , . . . , f Q(m) are all solutions for the m×m standard board, and g is a solution for the n×n modular board, then for each map π : [0, gives a distinct mn × mn solution for the standard board.
In this paper, we present a new construction concerning to the (modular) n-queens problem in terms of the ⊗ h -product, which in some sense complements a previous result due to Pólya. We also study some families of 1-regular digraphs that admit (modular) queen labelings.

Queen Digraphs and the ⊗ h Product
We start this section by introducing some notation. For the rest of the paper, whenever we work with a (modular) queen digraph, we will assume that the vertices are identified with the labels of a (modular) queen labeling.
Let D be a queen digraph and assume The next two lemmas are trivial.

Lemma 2.
Let F be a queen digraph of order n. Then, Let J be a finite set of integers. We denote by Σ(J) the sum of all integers in J.
Proof. When considering Σ(s(F )), we sum all integers in [1, n] twice, while when we calculate Σ(d(F )) every integer in [1, n] appears also twice but with opposite sign.
Let J be a subset of integers. We denote by J − n = {j − n, j ∈ J}.

Theorem 4. Let D be any queen digraph. Let Γ be a family of queen digraphs of order n and let h : E(D) −→ Γ be any function such that for any pair of arcs
Proof. Recall that we assume that the vertices of D and each element of Γ is renamed after the labels of their corresponding queen labeling. Consider, similarly to what was done in the proof of Theorem 1, the labeling l of the product D ⊗ h Γ that assigns to the vertex (a, i) ∈ V (D ⊗ h Γ ) the label: Vol. 75 (2020) New Constructions for the n-Queens Problem Page 5 of 13 41 and Let us check now that, for any two pairs of different arcs ((a, i), then, by (1) and Lemma 2(i), we obtain Thus, assume that s(a , b )=s(a, b) + 1. Hence, the value for s((a , i ), (2) and Lemma 2(ii), we will obtain The next corollary gives a sufficient condition to simplify the statement of Theorem 4.
Proof. The assumptions s(F ) = I and d(F ) = J imply conditions (i) and (ii) of Theorem 4.
The following result gives an application of the ⊗ h -product to the nqueens problem in terms of queen labelings of 1-regular digraphs. This result can be thought as a complementary result of Theorem 3, since the solutions that are provided, never appear in the construction provided in Theorem 3. ( Proof. This is an immediate consequence of Theorem 4 and the fact that, by definition of the ⊗ h -product, the product of 1-regular digraphs produces 1-regular digraphs.  Fig. 3). Notice that, since gcd(4, 6) = gcd(8, 6) = 1, no one of the queen solutions related to the digraphs that are involved in the ⊗ h -product are modular solutions.

Modular Queen Digraphs
We start this section by applying the ⊗ h -product to modular queen labelings. The idea of this proof is related to the one of Theorem 2.1 in [11].
Then, D ⊗ h Γ is a modular queen digraph.
Proof. As in the previous section, we rename the vertices of D and each element in Γ after the labels of their corresponding modular queen labelings and, we consider the labeling l : [1, mn] that assigns to the vertex (a, i) the label n(a − 1) + i. Let us check that l is a modular queen labeling of D ⊗ h Γ . That is, for any two pairs of different arcs ((a, i), (b, j)), ((a, i), (b, j)) are the induced sum and the induced difference introduced in (1) and (2), respectively. Since each F ∈ Γ is labeled with a modular queen labeling, all the sums i + j (mod n), for (i, j) ∈ F are different. The same happens with all the sums a+b (mod m), for (a, b) ∈ E(D). Thus, (c1) clearly holds whenever (a, b) = (a , b ) or i+j = i +j (mod n). Assume to the contrary that (a, b) = (a , b ), i + j = i + j (mod n) and that s((a, i), (b, j)) = s((a , i ), (b , j )) (mod mn). By Lemma 2, either Similarly to what happens with Corollary 2, we can obtain an application of the above result to the modular n-queens problem. ( Then, D ⊗ h Γ is a modular queen 1-regular digraph. Example 3. It turns out that the labelings of the digraphs that appear in Example 1, namely D, F 1 and F 2 are modular queens, however condition (ii) in Corollary 3 does not hold and the resulting labeled digraph obtained by means of the ⊗ h -product is not a modular queen labeling, for instance, the Vol. 75 (2020) New Constructions for the n-Queens Problem Page 9 of 13 41 arcs (25, 6) and (7,13) induce the same difference modulo 25. Therefore, the solution of Fig. 2, is not a solution for the modular 25-queens problem.
Notice that conditions (i) and (ii) in Corollary 3 trivially hold when h is a constant function, due to the modularity of every element in the family Γ . The next result is a direct consequence of this remark.

Queen Labelings of 1-Regular Digraphs
We know that there is a bijection between solutions of the (modular) n-queens problem and (modular) queen labelings of 1-regular digraph of order n. In this section we will provide some families of 1-regular digraphs that admit (modular) queen labelings.
Let C + n be a strong orientation of the cycle of n vertices. By checking by hand, we obtain the following information: n = 4: C + 4 is a queen digraph, but C + 3 ∪ C + 1 is not a queen digraph. -n = 5: C + 5 is not a queen digraph, but C + 4 ∪ C + 1 is a queen digraph. -n = 6: C + 6 and 2C + 3 are queen digraphs, but C + 5 ∪ C + 1 is not a queen digraph.
n = 7: C + 6 ∪ C + 1 , 2C + 3 ∪ C + 1 and C + 7 are queen digraphs, but C + 4 ∪ C + 3 is not a queen digraph. One of the first families that we provide in this paper is obtained by using the modular solution provided by Pólya [22]. Let Z m be the integers modulo m.

Lemma 4.
Let p be a prime integer, p > 3. If 2 is a primitive root of p, then C + p−1 ∪ C + 1 is a (modular) queen digraph and C + p−1 is a queen digraph.
Proof. Let D be the 1-regular digraph with V (D) = Z p defined by (u, v) ∈ E(D) if and only if v ≡ 2u (mod p). An easy check shows that the adjacency matrix of D is a solution for the modular p-queens problem with a queen in position (0, 0). Since 2 is a primitive root of p, the sequence, 1, 2, 4, 8 (mod p), . . . , 2 p−1 (mod p) defines a labeling of a cycle of length p − 1. Thus, C + p−1 ∪ C + 1 is a (modular) queen digraph and C + p−1 is a queen digraph.
Park et al. characterized in [19] some primes for which 2 is a primitive root.
-Let p = 2q + 1. Then 2 is a primitive root modulo p if and only if q ≡ 1 (mod 4). -Let p = 4q + 1. Then 2 is a primitive root modulo p, for all p. Let p be a Mersenne prime, that is, a prime of the form p = 2 n − 1 for some integer n. It is known that the order of 2 modulo p is n. Thus, using a similar proof that the one of Lemma 4, we obtain the next result.

Lemma 5.
Let p = 2 n − 1 be a prime integer, p > 3. Then (p − 1)/nC + n ∪ C + 1 is a (modular) queen digraph and (p − 1)/nC + n is a queen digraph. The Jacobsthal sequence (or Jacobsthal numbers) is an integer sequence which appears in [24] as 'A001045'. It has connections with multiple applications, some of them can be found in [24]. Let D n be the 1-regular digraph on [1, n] defined by (u, v) ∈ E(D n ) if and only if v ≡ −2u + 2 (mod n). The structure of D n was characterized in [16] using the previous sequence.
Lemma 6 [16]. Let n be an odd integer, (a i ) the Jacobsthal sequence and Θ k ⊂ {1, 2, . . . , n} such that x ∈ Θ k if k is the minimum i with 3a i x ≡ 2a i (mod n). Then, Using the solutions of the n-queens problem provided by Pauls, for n ≡ 1, 5 (mod n), in [20,21], and as a corollary of the above result we obtain the next lemma.

Lemma 7.
Let n be an odd integer such that n ≡ 1, 5 (mod 6), (a i ) the Jacobsthal sequence and Θ k ⊂ {1, 2, . . . , n} such that x ∈ Θ k if k is the minimum i with 3a i x ≡ 2a i (mod n). Then, n k=1 |Θ k | k C + k is a queen digraph.
Proof. The adjacency matrix of D n is a π/2 radiants clockwise rotation of the solution of the (n − 1) × (n − 1)-queens problem provided by Pauls, for n ≡ 1, 5 (mod n), in [20,21], when an extra queen is added in position (0,0). Thus,D n defines a queen labeled digraph. By Lemma 6, the result follows.
Alhough C + 3 is not a queen graph, for every positive integer m ≥ 3, m ≡ 0, 1 (mod 3), the union of m(m − 1)/3 strong oriented cycles of length 3 is a queen digraph. See the next proposition. A known result in the area of graph products (see for instance, [10]) is that the direct product of two strongly oriented cycles produces copies of a strongly oriented cycle, namely,