Search arXivSearch

arXiv · 2509.10472

Linear Equations for Solving Partial Latin Squares and Sudokus

Abstract

For Latin squares the units (rows and columns) have fixed sum. The same holds for rows, columns, and blocks in Sudokus. Summing the elements of a unit yields a linear equation, and the set of all such equations forms a system of linear equations that models the relations of the variables in Latin squares and Sudoku puzzles. Every completed Latin square or Sudoku satisfies this system, enabling analysis and completion of partially filled puzzles. The linear system provides necessary but not sufficient conditions for a solution. We analyze the structure and rank of these systems and establish limits on their ability to uniquely determine solutions. For Latin squares of size $n \times n$ with $k$ unknowns and Sudokus with block size $n = m \cdot l$, the system has full rank only if \[ k \leq 2n - 1 \quad \text{(Latin squares)}, \qquad k \leq 2n - 1 + (l - 1)(m - 1) \quad \text{(Sudokus)}. \] These conditions are necessary for uniqueness under the linear model, though counterexamples exist. We also highlight that this system captures only one of the three relations known to puzzle solvers, requiring extensions with additional (nonlinear) constraints for complete solutions. Our analysis shows that certain partial Latin squares and Sudokus can be solved in polynomial time using Gaussian elimination, placing them in complexity class P, while the general completion problem remains NP-complete.

Explore related subjects

Keep this discovery

Explore connections, maps & timelines

BibTeXRIS

Ralf Pöppel. 2025-08-26. Linear Equations for Solving Partial Latin Squares and Sudokus. https://arxiv.org/abs/2509.10472

Cite the original work for its findings. Save a collection to share your selection of sources.

KEEP EXPLORING

Related papers

The new Fermat-type factorization algorithm

Let n be any odd natural number other than a perfect square. We show that the new factorization algorithm, presented in this paper and which we call DFM-1 (where DFM stands for Detto's Factorization Method), is much more efficient than the implementation technique of Fermat's Factorization Algorithm (FFA) called FFA-1, which, among the implementation techniques of Fermat's Factorization Algorithm (FFA), is the one that requires the fewest iterations to identify the non-trivial and trivial factors of n (excluding the cases in which the two factors of the pair of non-trivial or trivial factors of n are so close to each other that they can be identified at the 1st iteration with each of such implementation techniques). Indeed, by the way in which Euler's totient function of any n that is a semiprime is applied to FFA-1, we arrive at the new factorization algorithm (DFM-1), which halves (possibly rounding up to the next integer) the number of iterations required by FFA-1. Furthermore, in this paper, we present the hypothetical scenario according to which the number of iterations could possibly be further reduced. Finally, and still in relation to this new factorization algorithm, in this paper we present the limit number of iterations, which is less than the number of iterations required by DFM-1 to reach the condition x - y = 1 which characterizes the pair of trivial factors of n, beyond which it is no longer possible for pairs of non-trivial factors of n to occur.

math.GM

A Note on the Measure of Vector and Pythagorean Theorem

Why the square? We present a geometry-axiom-free derivation of the Pythagorean theorem and the square at its core, establishing their algebraic origin from within the bare vector-space framework. Such concepts as the (right) angle, rotation, inner product, orthogonality etc also emerge as a logical construct rather than taken as given. They are necessitated by the square, and the ensuing theory, in turn, $\textit{canonically}$ stems from a $\textit{single}$ definitional primitive $-$ the ($\mathbb R^{\vcenter{\hbox{$\scriptscriptstyle+$}}}\!$-quantitative) invariant $\mathcal Q$-measure of a vector. This provides the core of an algebraic justification for Euclidean geometry. Equally important, these findings account (also canonically) for the complex modulus-squared $p = |\mathfrak a|^2$ $-$ the quantum Born rule $-$ and point out what is even admissible for being quantitatively interpreted. The linear structure and its endomorphisms are rigid in the sense that the $\textit{well-defined}$ interpretable turns out to be, up to gauge $\mathcal Q {\,\to\,} \mathrm{const} {\,\vcenter{\hbox{$\scriptstyle\times$}}\,} \mathcal Q$, the unique gauge-invariant measure $\mathcal Q=|\hspace{-0.18em}| {\cdot}{\cdot}{\cdot} |\hspace{-0.18em}|^2$; independently of the field $\mathbb R$ or $\mathbb C$.

math.GM

A Proof of Liu's Conjecture on the Fundamental Triangle Inequality

Let $a,b,c$ be the side lengths of a triangle, and let $R$ and $r$ denote its circumradius and inradius, respectively. Liu proposed the conjecture \[ \sum_{\text{cyc}} \left(\frac{a(b+c-a)}{bc}\right)^k \ge 2+\left(\frac{2r}{R}\right)^k,\qquad k>1, \] with the reverse inequality for $k<1$. We prove this conjecture by reducing it to an algebraic inequality for three positive variables with prescribed sum and product. We also determine the equality cases.

math.GM