Abstract
Sudoku problems are some of the most known and enjoyed pastimes, with a never diminishing popularity, but, for the last few years those problems have gone from an entertainment to an interesting research area, a twofold interesting area, in fact. On the one side Sudoku problems, being a variant of Gerechte Designs and Latin Squares, are being actively used for experimental design, as in Bailey et al. (Am. Math. Mon. 115:383–404, 2008; J. Agron. Crop Sci. 165:121–130, 1990), Morgan (Latin squares and related experimental designs. Wiley, New York, 2008) and Vaughan (Electron. J. Comb. 16, 2009). On the other hand, Sudoku problems, as simple as they seem, are really hard structured combinatorial search problems, and thanks to their characteristics and behavior, they can be used as benchmark problems for refining and testing solving algorithms and approaches. Also, thanks to their high inner structure, their study can contribute more than studies of random problems to our goal of solving real-world problems and applications and understanding problem characteristics that make them hard to solve. In this work we use two techniques for solving and modeling Sudoku problems, namely, Constraint Satisfaction Problem (CSP) and Satisfiability Problem (SAT) approaches. To this effect we define the Generalized Sudoku Problem (GSP), where regions can be of rectangular shape, problems can be of any order, and solution existence is not guaranteed. With respect to the worst-case complexity, we prove that GSP with block regions of m rows and n columns with m≠n is NP-complete. For studying the empirical hardness of GSP, we define a series of instance generators, that differ in the balancing level they guarantee between the constraints of the problem, by finely controlling how the holes are distributed in the cells of the GSP. Experimentally, we show that the more balanced are the constraints, the higher the complexity of solving the GSP instances, and that GSP is harder than the Quasigroup Completion Problem (QCP), a problem generalized by GSP. Finally, we provide a study of the correlation between backbone variables—variables with the same value in all the solutions of an instance—and hardness of GSP.
Similar content being viewed by others
References
Achlioptas, D., Gomes, C., Kautz, H., Selman, B.: Generating satisfiable problem instances. In: Proc. of National Conference on Artificial Intelligence (AAAI’00), pp. 193–200 (2000)
Ansótegui, C., del Val, A., Dotú, I., Fernández, C., Manyà, F.: Modelling choices in quasigroup completion: SAT vs. CSP. In: Proc. of National Conference on Artificial Intelligence (AAAI-04) (2004)
Ansótegui, C., Béjar, R., Fernández, C., Gomes, C.P., Mateu, C.: The impact of balancing on problem hardness in a highly structured domain. In: Twenty-First National Conference on Artificial Intelligence (AAAI’06) (2006)
Ansótegui, C., Béjar, R., Fernández, C., Mateu, C.: On balanced CSPs with high treewidth. In: Proceedings of the Twenty-Second AAAI Conference on Artificial Intelligence (AAAI’07), pp. 161–166 (2007a)
Ansótegui, C., Larrubia, J., Li, C.M., Manyà, F.: Exploiting multivalued knowledge in variable selection heuristics for SAT solvers. Ann. Math. Artif. Intell. 49(1–4), 191–205 (2007b)
Ansótegui, C., Béjar, R., Fernández, C., Mateu, C.: From high girth graphs to hard instances. In: Proceedings of the 14th International Conference on Principles and Practice of Constraint Programming (CP’08), pp. 298–312. Springer, Berlin (2008). doi:10.1007/978-3-540-85958-1-20
Argelich, J., Lynce, I.: CNF instances from the software package installation problem. In: Proceedings of 15th RCRA Workshop on Experimental Evaluation of Algorithms for Solving Problems with Combinatorial Explosion (RCRA’08) (2008)
Bailey, R.A., Kunert, J., Martin, R.J.: Some comments on gerechte designs. J. Agron. Crop Sci. 165, 121–130 (1990)
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)
Bessière, C., Régin, J.C.: MAC and combined heuristics: Two reasons to forsake FC (and CBJ?) on hard problems. In: Proceedings of the Second International Conference on Principles and Practice of Constraint Programming (CP’96), pp. 61–75 (1996)
Brockington, M., Culberson, J.: Camouflaging independent sets in quasi-random graphs. In: Cliques, Coloring, and Satisfiability: Second DIMACS Implementation Challenge, pp. 75–88. AMS, New York (1996)
Cerquides, J., Endriss, U., Giovannucci, A., Rodríguez-Aguilar, J.A.: Bidding languages and winner determination for mixed multi-unit combinatorial auctions. In: Proceedings of the 20th International Joint Conference on Artificial Intelligence (IJCAI’07), pp. 1221–1226 (2007)
Chen, H., Gomes, C.P., Selman, B.: Formal models of heavy-tailed behavior in combinatorial search. In: Proceedings of the International Conference on Principles and Practice of Constraint Programming (CP’01), pp. 408–421 (2001)
Cohen, D.A., Jeavons, P., Jefferson, C., Petrie, K.E., Smith, B.M.: Symmetry definitions for constraint satisfaction problems. Constraints 11(2–3), 115–137 (2006)
Culberson, J., Luo, F.: Exploring the k-colorable landscape with iterated greedy. In: Cliques, Coloring, and Satisfiability: Second DIMACS Implementation Challenge, pp. 245–284. AMS, New York (1996)
Delahaye, J.P.: The science behind sudoku. Sci. Am. 80–87, June 2006
Dotú, I., del Val, A., Cebrián, M.: Redundant modeling for the quasigroup completion problem. In: Proceedings of the Ninth International Conference on Principles and Practice of Constraint Programming (CP’03), pp. 288–302 (2003)
Eén, N., Sörensson, N.: An extensible SAT-solver. In: Proceedings of the International Conference on Theory and Applications of Satisfiability Testing (SAT’2003) (2003)
Felgenhauer, B., Jarvis, F.: Mathematics of sudoku I. Math. Spectr. 39, 15–22 (2006)
Gao, Y., Culberson, J.: Consistency and random constraint satisfaction models. J. Artif. Intell. Res. 28, 517–557 (2007)
Gent, I.P., Walsh, T.: The tsp phase transition. Artif. Intell. 88(1–2), 349–358 (1996)
Gent, I.P., Jefferson, C., Miguel, I.: Minion: A fast scalable constraint solver. In: 17th European Conference on Artificial Intelligence (ECAI 2006), pp. 98–102 (2006)
Gomes, C., Selman, B.: Problem structure in the presence of perturbations. In: Proceedings of the Fourteenth National Conference on Artificial Intelligence (AAAI’97), pp. 221–227. AAAI Press, New Providence (1997)
Gomes, C.P., Selman, B., Crato, N.: Heavy-tailed distributions in combinatorial search. In: Proceedings of the Third International Conference of Constraint Programming (CP’97). Springer, Berlin (1997)
Gomes, C.P., Selman, B., Crato, N., Kautz, H.: Heavy-tailed phenomena in satisfiability and constraint satisfaction problems. J. Autom. Reason. 24(1–2), 67–100 (2000)
Hoffmann, J., Gomes, C.P., Selman, B.: Structure and problem hardness: Goal asymmetry and DPLL proofs in SAT-based planning. In: Proceedings of the Sixteenth International Conference on Automated Planning and Scheduling (ICAPS’06), pp. 284–293 (2006)
Hogg, T.: Exploiting the deep structure of constraint satisfaction problems with quantum computers. In: Proceedings of the National Conference on Artificial Intelligence (AAAI’97), pp. 334–339 (1997)
Jacobson, M.T., Matthews, P.: Generating uniformly distributed random Latin squares. J. Comb. Des. 4, 405–437 (1996)
Kannan, R., Tetali, P., Vempala, S.: Simple Markov-chain algorithms for generating bipartite graphs and tournaments. In: Proc. of the Eighth Annual ACM-SIAM Symposium on Discrete Algorithms, pp. 193–200 (1997)
Kautz, H., Ruan, Y., Achlioptas, D., Gomes, C., Selman, B., Stickel, M.: Balance and filtering in structured satisfiable problems. In: Proc. of International Conference on Artificial Intelligence (JCAI’01), pp. 193–200 (2001)
Kilby, P., Slaney, J., Thiebaux, S., Walsh, T.: Backbones and backdoors in satisfiability. In: Proc. of National Conference on Artificial Intelligence (AAAI’05), pp. 193–200 (2005a)
Kilby, P., Slaney, J.K., Walsh, T.: The backbone of the travelling salesperson. In: Proceedings of the International Joint Conference on Artificial Intelligence (IJCAI’05), pp. 175–180 (2005b)
Lewis, R.: Metaheuristics can solve sudoku puzzles. J. Heuristics 13(4), 387–401 (2007)
Li, C.M.: Anbulagan: Look-ahead versus look-back for satisfiability problems. In: Proceedings of the International Conference on Principles and Practice of Constraint Programming (CP’97), pp. 341–355 (1997)
Lynce, I., Marques-Silva, J.: Haplotype inference with boolean satisfiability. Int. J. Artif. Intell. Tools 17(2), 355–387 (2008)
Lynce, I., Ouaknine, J.: Sudoku as a SAT problem. In: Proc. of Ninth International Symposium on Artificial Intelligence and Mathematics (ISAIM-06) (2006)
Mo, H.D., Xu, R.G.: Sudoku square—a new design in field. Acta Agron. Sin. 34(9), 1489–1493 (2008)
Monasson, R., Zecchina, R., Kirkpatrick, S., Selman, B., Troyansky, L.: 2+p-sat: Relation of typical-case complexity to the nature of the phase transition. Random Struct. Algorithms 15(3–4), 414–435 (1999)
Morgan, J.P.: Latin Squares and Related Experimental Designs. Wiley, New York (2008). doi:10.1002/9780470061572.eqr013
Moskewicz, M., Madigan, C., Zhao, Y., Zhang, L., Malik, S.: Chaff: Engineering an efficient sat solver. In: Proceedings of 39th Design Automation Conference (2001)
Sandholm, T., Suri, S.: Improved algorithms for optimal winner determination in combinatorial auctions and generalizations. In: Proc. of Seventeenth National Conference on Artificial Intelligence (AAAI’00), pp. 90–97 (2000)
Simonis, H.: Sudoku as a constraint problem. In: Proc. of Fourth International Workshop on Modelling and Reformulating Constraint Satisfaction Problems (in CP-2005), pp. 13–27 (2005)
Smith, B.M., Grant, S.A.: Sparse constraint graphs and exceptionally hard problems. In: Proc. of the International Joint Conference on Artificial Intelligence (IJCAI’95), pp. 646–654 (1995)
Vaughan, E.R.: The complexity of constructing gerechte designs. Electron. J. Comb. 16 (2009)
Weber, T.: A SAT-based Sudoku solver. In: Sutcliffe, G., Voronkov, A. (eds.) LPAR-12, the 12th International Conference on Logic for Programming, Artificial Intelligence, and Reasoning, Short Paper Proceedings, pp. 11–15 (2005)
Williams, C.P., Hogg, T.: Exploiting the deep structure of constraint problems. Artif. Intell. 70, 73–117 (1994)
Xu, K., Li, W.: Exact phase transitions in random constraint satisfaction problems. J. Artif. Intell. Res. 12, 93–103 (2000)
Xu, K., Boussemart, F., Hemery, F., Lecoutre, C.: Random constraint satisfaction: Easy generation of hard (satisfiable) instances. Artif. Intell. 171(8–9), 514–534 (2007)
Yato, T., Seta, T.: Complexity and completeness of finding another solution and its application to puzzles. In: Proc. of National Meeting of the Information Processing Society of Japan (IPSJ) (2002)
Author information
Authors and Affiliations
Corresponding author
Additional information
Some of the results of this paper were presented in the Twenty-First Conference on Artificial Intelligence (AAAI-06) (Ansótegui et al. 2006).
Rights and permissions
About this article
Cite this article
Ansótegui, C., Béjar, R., Fernández, C. et al. Generating highly balanced sudoku problems as hard problems. J Heuristics 17, 589–614 (2011). https://doi.org/10.1007/s10732-010-9146-y
Received:
Revised:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s10732-010-9146-y