Solving a Binary Puzzle (original) (raw)
Abstract
A Binary puzzle is a Sudoku-like puzzle with values in each cell taken from the set \(\{ 0, 1\}\). Let \(n \ge 4\) be an even integer, a solved binary puzzle is an \(n \times n\) binary array that satisfies the following conditions: (1) no three consecutive ones and no three consecutive zeros in each row and each column; (2) the number of ones and zeros must be equal in each row and in each column; (3) there can be no repeated row and no repeated column. This paper proposes three approaches to solve the puzzle. The first method is based on a complete backtrack-based search algorithm. The idea is to propagate and fill an unsolved binary puzzle according to the three constraints, followed by a random guess if the puzzle remains unsolved. The second method of solving a binary puzzle is by representing it as an instance of a Boolean satisfiability problem which allows the solution for a binary puzzle to be obtained using SAT solvers. The third approach is based on expressing a binary puzzle as a system of polynomial equations over the binary field \(\mathbb {F}_2\). The set of solutions for the equation system implies the solutions for the binary puzzle and it is obtained by computing a Gröbner basis of the ideal generated by the polynomials. We experimentally compare the three approaches with binary puzzles of various sizes and different numbers of empty cells using a computer algebra system.
Article PDF
Similar content being viewed by others
References
- Arnold, E., Lucas, S., Taalman, L.: Gröbner basis representations of sudoku. Coll. Math. J. 41(2), 101–112 (2010)
Article MATH Google Scholar - Bailey, R.A., Cameron, P.J., Connelly, R.: Sudoku, gerechte designs, resolutions, affine space, spreads, reguli, and hamming codes. Am. Math. Mon. 115, 383–404 (2008)
MathSciNet MATH Google Scholar - Bosma, W., Cannon, J., Playoust, C.: The Magma algebra system. I. The user language. J. Symb. Comput. 24(3–4), 235–265 (1997). Computational algebra and number theory (London, 1993)
Article MathSciNet MATH Google Scholar - Buchberger, B.: Bruno buchbergers phd thesis 1965: an algorithm for finding the basis elements of the residue class ring of a zero dimensional polynomial ideal. J. Symb. Comput. 41(3), 475–511 (2006)
Article MATH Google Scholar - Carlet, C.: Boolean functions for cryptography and error correcting codes. In: Crama, Y., Hammer, P.L. (eds.) Boolean Models and Methods in Mathematics, Computer Science, and Engineering, pp. 257–397. Cambridge University Press, Cambridge (2010)
Chapter Google Scholar - Cox, D., Little, J., O‘Shea, D.: Ideals, Varieties, and Algorithms—An Introduction to Computational Algebraic Geometry and Commutative Algebra. Undergraduate Texts in Mathematics, 4th edn. Springer, Berlin (2015)
MATH Google Scholar - de Biasi, M.: Binary Puzzle is NP-Complete. http://www.nearly42.org/vdisk/cstheory/binaryp.pdf (July 2012)
- Faugère, J.-C.: A new efficient algorithm for computing Gröbner bases (F4). J. Pure Appl. Algebra 139(1–3), 61–88 (1999)
Article MathSciNet MATH Google Scholar - Faugère, J.-C.: A new efficient algorithm for computing Gröbner bases without reduction to zero (F5). In: Proceedings of the 2002 International Symposium on Symbolic and Algebraic Computation. ISSAC ’02, pp. 75–83. NY, USA, ACM, New York (2002)
- Felgenhauer, B., Jarvis, F.: Mathematics of sudoku i, ii. Math. Spectr. 39(15–22), 54–58 (2006)
Google Scholar - Lichtenstein, D.: Planar formulae and their uses. SIAM J. Comput. 11(2), 329–343 (1982)
Article MathSciNet MATH Google Scholar - Lucas, E.: Théorie des fonctions numériques simplement périodiques. Am. J. Math. 1(2), 184–196 (1878)
- Seltner, H.: Extracting hardware circuits from CNF formulas. Master’s Thesis, Institute of Formal Models and Verification, Johannes Kepler Universität Linz (2014). http://fmv.jku.at/master/Seltner-MastherThesis-2014.pdf
- Soedarmadji, E., Mceliece, R. J.: Iterative decoding for sudoku and latin square codes. http://leecenter.caltech.edu/workshop08/papers/mceliece2.pdf
- Soos, M.: The CryptoMiniSat 5 set of solvers at SAT competition 2016. In: Proceedings of SAT Competition 2016: Solver and Benchmark Descriptions—SAT Competition 2016, p. 28 (2016). https://github.com/msoos/cryptominisat
- Tseitin, G.S.: On the complexity of derivation in propositional calculus. In: Automation of Reasoning: 2: Classical Papers on Computational Logic 1967–1970, pp. 466–483. Springer, Berlin (1983)
- SageMath, the Sage Mathematics Software System (Version 7.2), The Sage Developers (2016). http://www.sagemath.org
- Utomo, P., Makarim, R.: The solver of binary puzzle. https://github.com/puth7/binarysolver
- Utomo, P., Pellikaan, R.: Binary puzzles as an erasure decoding problem. In: Jérémie, R., Francois H. (eds.) Proceedings of the 36th WIC Symposium on Information Theory in the Benelux, pp. 129–134 (May 2015). http://www.win.tue.nl/~ruudp/paper/72.pdf
- Utomo, P., Pellikaan, R.: On the rate of constrained arrays. In: Proceedings IndoMS International Conference on Mathematics and its Applications (IICMA) (November 2015). http://www.win.tue.nl/~ruudp/paper/75.pdf
Author information
Authors and Affiliations
- Eindhoven University of Technology, Eindhoven, The Netherlands
Putranto H. Utomo - Mathematical Institute, University Leiden and Centrum Wiskunde en Informatica, Amsterdam, The Netherlands
Rusydi H. Makarim
Authors
- Putranto H. Utomo
You can also search for this author inPubMed Google Scholar - Rusydi H. Makarim
You can also search for this author inPubMed Google Scholar
Corresponding author
Correspondence toPutranto H. Utomo.
Rights and permissions
Open Access This article is distributed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits unrestricted use, distribution, and reproduction in any medium, provided you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made.
About this article
Cite this article
Utomo, P.H., Makarim, R.H. Solving a Binary Puzzle.Math.Comput.Sci. 11, 515–526 (2017). https://doi.org/10.1007/s11786-017-0322-4
- Received: 07 December 2016
- Revised: 13 March 2017
- Accepted: 24 April 2017
- Published: 10 May 2017
- Issue Date: December 2017
- DOI: https://doi.org/10.1007/s11786-017-0322-4