Spectrum of free-form Sudoku graphs

A free-form Sudoku puzzle is a square arrangement of m times m cells such that the cells are partitioned into m subsets (called blocks) of equal cardinality. The goal of the puzzle is to place integers 1,...,m in the cells such that the numbers in every row, column and block are distinct. Represent each cell by a vertex and add edges between two vertices exactly when the corresponding cells, according to the rules, must contain different numbers. This yields the associated free-form Sudoku graph. This article studies the eigenvalues of free-form Sudoku graphs, most notably integrality. Further, we analyze the evolution of eigenvalues and eigenspaces of such graphs when the associated puzzle is subjected to a"blow up"operation, scaling the cell grid including its block partition.


Introduction
The recreational game of Sudoku has been popular for several years now. Its classic variant is played on a board with 9 × 9 cells, subdivided into a 3 × 3 grid of square blocks containing 3 × 3 cells each. Each cell may be empty or contain one of the numbers 1, . . . , 9. A number of cells of each puzzle have been pre-filled by the puzzle creator. The goal of the puzzle solver is to fill the remaining cells with the numbers 1, . . . , 9 such that in the completed puzzle the number of each cell occurs only once per row, column and block. An example is shown in Figure 1.
Let us call the classical variant the 3-Sudoku. Its 3 2 × 3 2 board contains 3 4 cells. One can readily generalize the game to n-Sudokus by playing on n 2 × n 2 board with n 4 cells, subdivided into n 2 square blocks with n 2 cells each. The permitted numbers in the cells now range from 1, . . . , n 2 , but the remaining restrictions for a valid solution remain the same. The 2-Sudoku is also known as a Shidoku. Despite the seemingly recreational character of the game, it offers a surprising number of mathematical facets. This makes Sudoku an interesting topic for mathematics lessons [10], [11]. Among the topics touched by Sudoku are problem solving, latin squares, counting, exhausting symmetry and coloring problems on graphs (see, for example, the introductory book [21]). Due to this, more and more interesting results about Sudoku have been published in the recent past. For instance, different approaches for solvers have been presented in [3], [2], [8]. The combinatorial properties of completed Sudoku squares as a family of Latin squares, in particular the search for orthogonal pairs have been considered in [9], [19], [12], [17]. Other researchers focus on algebraic aspects of Sudoku, especially groups and rings associated with Sudoku (cf. [1], [23], [15]).
One of the most intuitive links between Sudoku and mathematics is that the processes of solving a Sudoku can be interpreted as completing a given partial vertex coloring of a certain graph (each preassigned color corresponds to a prefilled number in a cell, a so-called clue). To this end, we represent each cell of the given Sudoku square by a single vertex. Two vertices are adjacent if and only if the associated cells must not contain the same number (according to the rules of the game). Figure 2 (a) depicts the adjacencies in the neighborhood of an exemplary vertex of the Shidoku graph. Using this representation, the valid solutions of a given n-Sudoku can be characterized as proper optimal vertex colorings (using n 2 colors each) of the associated Sudoku graph.
It is possible to investigate many questions about Sudoku with the help of graph theory. For example, there has been some research interest in counting the number of possible completions of a partially colored Sudoku graph. A related question is how to (minimally) partially color the graph such that there is only one way to complete the coloring to a valid Sudoku solution [4]. It has even been shown that 16 precolored vertices do not suffice in order to guarantee a unique completion, however by means of computational brute force [20]. Not only the number of clues is a topic of interest but also where to place them [16]. Other notions of coloring have been applied to Sudoku graphs as well, for example list coloring [14].
Sudoku graphs have also been studied from the perspective of algebraic graph theory. It has been shown that every Sudoku graph is integral, i.e. all eigenvalues of its adjacency matrix are integers. This has been shown algebraically by means of group characters [18]. But it also follows from the fact that Sudoku graphs are actually NEPS of complete graphs, hence they belong to the class of gcd-graphs, a subclass of the integral Cayley graphs over abelian groups [22]. Here, NEPS is the common short form of the non-complete extended p-sum, a generalized graph product that includes many known products [6].
There exist many generalizations and variants of the classic Sudoku, the n-Sudokus being the most common one. Besides changing the size of a Sudoku one can also try to vary every other aspect of a Sudoku, e.g. change the rules, introduce additional rules or change the shape of the blocks. The book [21] presents many such variants. Changing the shape of the blocks leads to the notion of a free-form Sudoku. Given a square arrangement of m × m cells (where m need not be a square number any more), we permit the blocks to be an arbitrary partition T of the cells into m subsets of equal cardinality. Note that the blocks are not required to be contiguous arrangements of cells. The Sudoku rules remain unchanged, in the sense that we need to fill in the numbers 1, . . . , m in such that each row, column and block contains m distinct numbers. We shall denote the associated graph by FSud(m, T ). Figure 2 (b) illustrates the adjacencies in the neighborhood of an exemplary vertex for the graph of a free-form Shidoku. The cells of the (non-contiguous) block containing the considered vertex have been shaded.
It seems that free-form Sudokus have not been studied in the literature so far although they are included in many Sudoku puzzle books that offer challenging variants. Computer experiments readily indicate that integrality of the eigenvalues critically depends on the degree of symmetry exhibited by the chosen cell partition. However, free-form Sudoku graphs are well-structured enough to exactly predict the changes of their spectra and eigenspaces when they are transformed in certain ways.

Integrality
In the following, consider a given free-form Sudoku graph FSud(m, T ) and let A be its adjacency matrix (with respect to some arbitrary but fixed vertex order). The structure of the adjacency matrix of a free-form Sudoku graph is governed by the rules of Sudoku: Observation 1 Two vertices of a free-form Sudoku graph are adjacent if and only if one of the following mutually exclusive cases apply: (B) The associated cells belong to the same block of the tiling.
(H) The associated cells belong to the same row of the puzzle, but not to the same block.
(V) The associated cells belong to the same column of the puzzle, but not to the same block.
The chosen partition into mutually exclusive cases immediately gives rise to a decomposition of the adjacency matrix according to these three cases: In this sense, the graph FSud(m, T ) can be interpreted as a composition of three layers of egdes, according to the cases (B), (H), (V). These layers can be viewed and studied as graphs of their own right.
Proposition 1 For i, j ∈ {1, . . . , m} let p ij denote the number of cells in the i-th row (resp. column) of the puzzle that belong to the j-th block of the partition. Then L H (resp. L V ) is an adjacency matrix of the union of m disjoint complete multipartite graphs K p i1 ,...,p im , i = 1, . . . , m.
Proof. Consider a fixed row i of the given Sudoku puzzle. We group the cells of the considered row according to their respective block membership. In view of rule (H) we see that the vertices corresponding to the grouped cells are adjacent if and only if they belong to different blocks. So the groups of cells form m independent sets of the respective sizes p i1 , . . . , p im , further all edges exist between different groups. The reasoning for L V is analogous, just consider a fixed column and rule (V).
Proposition 2 L B is an adjacency matrix of the union of m disjoint complete graphs K m .
Proof. Group the vertices according to block membership of their associated cells. Since each block contains m cells the result follows from rule (B).

Proposition 3
The following statements are equivalent: (a) L H (resp. L V ) represents a regular graph.
Proof. Statements (a) and (b) are clearly equivalent. Next we show that This translates to the requirement that the cells associated with vertices i and s are in the same row (but not the same block) and that the cells associated with vertices s and j belong to same block. Therefore, (L H L B ) ij counts the vertices s that meet the mentioned requirement for given i, j. In a similar manner we see that (L B L H ) ij counts the vertices s such that the cells associated with vertices i and s belong to same block and that the cells associated with vertices s and j are in the same row (but do not belong to the same block). If, however, L H has constant row sum, then it follows by rule (H) that each cell has the same common number of cells that are in the same row but not in the same block as the considered cell. Equivalently, since all rows have the same number of cells, each cell has the same common number k of cells that are in the same row and in the same block as the considered cell. Therefore, any block that has cells in a row must have exactly k cells in that row. But then the two counts mentioned before are identical: Conversely, assume that statement (c) is true. Consider two vertices i and j such that their associated cells belong to different rows and different blocks.
implies that these two blocks have the same number of cells in the two rows. Hence there exists a common number k such that any block that has cells in a row must have exactly k cells in that row. Considering a single row of L H , it follows that it has row sum m − k since the puzzle row of the cell associated with that matrix row contains m cells and among them k cells that belong to the same block as the considered cell. Theorem 1 (see [7]) The characteristic polynomial of the complete multipartite graph G = K p 1 ,...,p k is Proof.
Theorem 2 Given a free-form Sudoku puzzle, assume that the following conditions are met: (i) There exists a common number q such that for each cell there exist exactly q cells belonging to the same row and block as the considered cell (including itself ).
(ii) A similar condition holds with 'row' replaced by 'column'.
(iii) For any two cells C 1 , C 2 belonging to different rows and columns, the unique cell lying in the same row as C 1 and the same column as C 2 belongs to the same block as C 1 if and only if exactly the same holds for the unique cell lying in the same column as C 1 and the same row as C 2 .
Then the associated graph FSud(m, T ) is integral.
Proof. Under condition (i) we have p ij ∈ {0, q} for all i, j ∈ {1, . . . , m} in Proposition 1. Therefore, L H represents a union of complete multipartite graphs K q,...,q . Hence L H is integral by Corollary 1. Likewise, condition (ii) ensures that L V is integral. L B is integral by 2 and Corollary 1 (for r = 1).
We can conclude from Proposition 3 and conditions (i) and (ii) that the pairs It is easily checked that the classical n-Sudokus fulfill the conditions of Theorem 2. Hence the theorem provides a new way of proving integrality of classical Sudoku graphs (e.g. different from the proofs in [18], [22]). Further, Theorem 2 helps us identify many more integral free-form Sudoku graphs besides the classical variants.

Transformations
In this section we consider a special kind of transformation of Sudokus puzzles and study its spectral properties. To this end, we define the k-fold blow up of a free-form Sudoku. This is formed by replacing each cell of the original Sudoku by a k × k arrangement of cells. The block partition T ′ of the new graph is derived from the original partition T as follows. For each block B ∈ T we create a block B ′ ∈ T ′ by collecting the replacement cells of all the cells in B. In terms of graphs we see that the k-fold blow up transforms FSud(n, T ) into FSud(kn, T ′ ). Let us denote the latter graph by FSud ↑k (n, T ). In Figure 3 the 3-fold blow up of a free-form Shidoku is illustrated. It also sketches the neighborhood of an exemplary vertex of the blown up graph.
Let us now investigate how the adjacency matrix of a blown up Sudoku graph can be determined from the adjacency matrix of the original graph. To this end, we a assume that a fixed but otherwise arbitrary numbering of the cells of the original free-form Sudoku is given. The vertices of the associated graph shall be numbered accordingly. Further, we number the cells of a k-fold blow up of the given puzzle as follows. Let S i denote the k × k subsquare of the blown up puzzle containing exactly the replacement cells of the original cell number i. We number the k 2 n 2 cells by subsequently numbering all vertices Next, note the following facts about the blow up operation:

Observation 2
• If two cells i and j lie in the same row (resp. column) of the original puzzle, then all cells sharing the same relative row (resp. column) index inside S i and/or S j lie in the same row (resp. column) of the blown up puzzle.
• If two cells i and j lie in the same block of the original puzzle, then all cells from S i and S j lie in the same block of the blown up puzzle.
In view of these facts and due to the chosen cell numbering of the blown up puzzle we can construct the adjacency matrix A ↑ of FSud ↑k (n, T ) from the adjacency matrix A = (a ij ) of FSud(n, T ) by replacing each entry a ij of A by a (k 2 × k 2 )-matrix that solely depends on whether (in the original puzzle) cell number j is in the same block as cell number i, or otherwise in the same row or column as j or lies somewhere else.
For this purpose we define the symbolic template adjacency matrix T(A) = (t ij ) as follows: • t ii = D, • t ij = B if i = j and cells i, j are in the same block of the original puzzle, • t ij = H if cells i, j are not in the same block but in the same row of the original puzzle, • t ij = V if cells i, j are not in the same block but in the same column of the original puzzle, The next step is to define the matrices that will be substituted into the template matrix. But first we need some building blocks. Let I r denote the identity matrix, J r the all ones matrix and N r the zero matrix of size r × r.
Further, we will make use of the Kronecker product ⊗ of real matrices, cf. [13]: Definition 1 Let A ∈ R p×q and B ∈ R r×s . Then the Kronecker product of A and B is defined as the block matrix Fixing the given blow up factor k, we define the following (k 2 × k 2 )-matrices: The following result should now be self-evident: Proposition 4 Given an n × n free-form Sudoku puzzle with block partition T , the adjacency matrix of FSud ↑k (n, T ) (with respect to the vertex numbering mentioned earlier) can be obtained from the symbolic template matrix T(A) = (t ij ) of the adjacency matrix A = (a ij ) of the graph FSud(n, T ) by replacing each entry t ij of T(A) by the contents of the matching matrix from (2) that has the same name as the symbolic value of t ij suggests.
The replacement process can be expressed by means of the Kronecker product. Let us take the template matrix T(A) and use it to partition the non-zero entries a ij of A according to their respective symbols t ij . Setting L D = I n 2 , the blown up adjacency matrix A ↑ can now be expressed as follows: We demonstrate the process of deriving the adjacency matrix of the blown up graph by an illustrative example. Consider the free-form Shidoku depicted in Figure 2 Next construct the 3-fold blowup as indicated in Figure 3. We number its 9 · 16 = 144 cells as described earlier. The adjacency matrix of FSud ↑3 (2, T ) is now readily obtained by replacing each symbol in T(A) by one of the following matrices with the matching name: Our goal is to study the eigenvalues of blown up free-form Sudokus and express them in terms of the eigenvalues of the original puzzle.
For the rest of this section, we consider an arbitrary but fixed free-form n × n Sudoku puzzle with tiling T . Let A be the adjacency matrix of its associated graph FSud(n, T ) and let A ↑ be the adjacency matrix of FSud ↑k (n, T ). We assume that L V , L H , L B etc. denote the matrices appearing in equations (1) and (3). Further, let Eig(M) represent the set of all eigenvectors of a given matrix (or even a graph) M and let ker(M) be the set of all eigenvectors of M associated with eigenvalue 0. Note that neither set contains the null vector.
In the following, we will make use of the following properties of the Kronecker product: Theorem 3 (see [13]) Note that the Kronecker product formally also includes the case where one or both factors are vectors.

Lemma 1
Suppose that x and y are eigenvectors of L V and J k corresponding to the eigenvalues λ and α, respectively. Then, for any z ∈ ker(J k ), x ⊗ y ⊗ z is an eigenvector of A ↑ corresponding to eigenvalue λα − 1.
Lemma 2 Suppose that x and y are eigenvectors of L H and J n corresponding to the eigenvalues λ and α, respectively. Then, for any z ∈ ker(J n ), x ⊗ y ⊗ z is an eigenvector of A ↑ corresponding to eigenvalue λα − 1.
Proof. Similar to the proof of Lemma 1.
The previous two lemmas will play a role in the construction of a basis of eigenvectors of a blown up Sudoku graph. To this end, we need to know the intersection of the spans of the two vector sets mentioned there. But first note the following obvious facts: 3. The set {1 k } ∪ K J is a maximal linearly independent subset of Eig(J k ).
For the next lemma we define the following sets:
Once again employing the fact that ker(J k ) ⊆ Eig(J k ), we arrive at Lemma 4 Let x ∈ R n 2 and y, z ∈ ker(J k ). Then x ⊗ y ⊗ z is an eigenvector of A ↑ corresponding to eigenvalue −1.

Proof.
In the following, let 1 r denote the all ones vector of dimension r.
Lemma 5 For any eigenvector x of the matrix k 2 L B +kL H +kL V , the vector x ⊗ 1 k 2 is an eigenvector of A ↑ corresponding to eigenvalue λ + k 2 − 1.

Proof.
Before we present the main result of this section we need one more technical lemma.
for suitable numbers c i ∈ R. Let X φ(i) = (x 1,φ(i) , . . . , x r,φ(i) ) T . By the definition of the Kronecker product we have Thus, for each j we have But due to the linear independence of the vectors Y i we see that c i x j,φ(i) = 0 for every j = 1, . . . , r and i = 1, . . . , n. Now assume that c i * = 0 for some index i * . Then x j,φ(i * ) = 0 for all j, therefore X φ(i * ) = 0. But this is For what follows, let B V , B H and B M denote arbitrary maximal linearly independent subsets of Eig(L V ), Eig(L H ) and Eig(k 2 L B + kL V + kL H ), respectively. Further, let E = {e 1 , . . . , e n 2 } be the standard basis of R n 2 , where e i denotes the i-th unit vector.
Theorem 4 Given a graph FSud(n, T ), define the sets Then, their union X V ∪ X H ∪ X E ∪ X M forms a maximal linearly independent subset of Eig(FSud ↑k (n, T )).
Proof. By construction and Lemma 6, each of the sets X V , X H , X E , X M in itself is linearly independent. Further, by construction and Proposition 6, the spans of these four sets are mutually disjoint (neglecting the null vector). Moreover, Lemmas 1, 2, 4 and 6 guarantee that the union contains only eigenvectors of FSud ↑k (n, T ). Finally, note that and thus Looking closer at Theorem 4, we see that if L V , L H , k 2 L B + kL H + kL V were all integral, then FSud ↑k (n, T ) would be integral as well.
Corollary 2 Under the conditions stated in Theorem 2 it follows that the blown up graph FSud ↑k (n, T ) is integral for every k.
Proof. From the proof of Theorem 2 it follows that L V , L H and L B are all integral and commute with each other, hence they are simultaneously diagonizable. Consequently, k 2 L B + kL H + kL V is integral and therefore FSud ↑k (n, T ).
Owing to Theorem 4, we can use Lemmas 1, 2, 4 and 6 to establish the spectrum of a k-fold blow up from its original. Interestingly, we can explicitly predict that the largest eigenvalue stems from the set X M : Theorem 5 Given a graph FSud(n, T ), let λ be the largest eigenvalue of the associated matrix k 2 L B +kL V +kL H . Then λ+k 2 −1 is the largest eigenvalue of FSud ↑k (n, T ).
Proof. For the purposes of this proof we renumber the vertices of FSud(n, T ) such that we sequentially number the vertices with one block, then continue with the next block and so on. The order in which the vertices are numbered with a single block is arbitrary. With respect to this vertex order the matrix L B assumes the form I n ⊗ J n − I n 2 . Clearly, this matrix contains J n − I n as a principal submatrix. Consequently, the matrix M := k 2 L B + kL V + kL H contains the matrix k 2 J n − k 2 I n as a principal submatrix, the latter having maximum eigenvalue k 2 (n − 1). By virtue of eigenvalue interlacing (see e.g. [5]) we conclude that λ > (n − 1)k 2 . So, according to Lemma 5, the largest eigenvalue of FSud ↑k (n, T ) originating from the set X M is at least (n − 1)k 2 + k 2 − 1 = nk 2 − 1. We will now show that the largest eigenvalues originating from X V , X H and X B are smaller than this bound.
Since the largest eigenvalue of a matrix is bounded from above by the maximum row sum of the matrix it is clear that the maximum eigenvalue both of L H and L V can be at most n − 1. Now recall from Proposition 6 that k is the maximum eigenvalue of J k . Combining these findings, it now follows from Lemmas 1 and 2 that none of the eigenvalues associated with the vectors of the sets X V and X H exceeds (n − 1)k − 1, which is less than the lower bound given for X M . Finally, Lemma 4 tells us that no positive eigenvalue of FSud ↑k (n, T ) originates from X B .

Conclusion
Up to now, it seems that free-form Sudokus have not been researched at all. Providing a starting point, we have studied integrality of these graphs. Moreover, we have presented the blow up operation and shown how to obtain the eigenvalues of blown up free-form Sudokus from their originals. We would like to inspire more research on this topic, in particular regarding further spectral properties of free-form Sudoku graphs. Let us therefore close with the following open questions: 1. Can we find a precise condition on the tiling that allows us to predict when exactly a free-form Sudoku graph is integral or not?
2. If a given Sudoku is integral, is its blown up version always integral as well?
3. Can a blown up free-form Sudoku be integral although its original Sudoku is not?