Abstract
Edge matching puzzles have been amongst us for a long time now and traditionally they have been considered, both, a children’s game and an interesting mathematical divertimento. Their main characteristics have already been studied, and their worst-case complexity has been properly classified as a NP-complete problem. It is in recent times, specially after being used as the problem behind a money-prized contest, with a prize of 2US$ million for the first solver, that edge matching puzzles have attracted mainstream attention from wider audiences, including, of course, computer science people working on solving hard problems. We consider these competitions as an interesting opportunity to showcase SAT/CSP solving techniques when confronted to a real world problem to a broad audience, a part of the intrinsic, i.e. monetary, interest of such a contest. This article studies the NP-complete problem known as edge matching puzzle using SAT and CSP approaches for solving it. We will focus on providing, first and foremost, a theoretical framework, including a generalized definition of the problem. We will design and show algorithms for easy and fast problem instances generation, generators with easily tunable hardness. Afterwards we will provide with SAT and CSP models for the problems and we will study problem complexity, both typical case and worst-case complexity. We will also provide some specially crafted heuristics that result in a boost in solving time and study which is the effect of such heuristics.
Similar content being viewed by others
Explore related subjects
Discover the latest articles, news and stories from top researchers in related subjects.References
Achlioptas, D., Gomes, C., Kautz, H., Selman, B. (2000). Generating satisfiable problem instances. In Proceedings of the AAAI 2000 (pp. 256–261). AAAI Press/The MIT Press.
Achlioptas, D., Jia, H., Moore, C. (2005). Hiding truth assignments: two are better than one. Journal of Artifical Intelligence Research, 24, 623–639.
Achlioptas, D., Naor, A., Peres, Y. (2005). Rigorous location of phase transitions in hard optimization problems. Nature, 435(7043), 759.
Achlioptas, D., & Peres, Y. (2004). The threshold for random k-sat is \(2^k\log{2}-\mathcal{O}(k)\). Journal of the American Mathematical Society, 17(4), 947–973.
Alon, N., & Spencer, J.H. (2000). The probabilistic method (2nd ed.). Discrete Mathematics and Optimization. Wiley Inter-Science.
Ansótegui, C., Béjar, R., Fernández, C., Gomes, C., Mateu, C. (2011). The impact of balance in a highly structured problem domain. In Proceedings of the AAAI 2006 (pp. 438–443). AAAI Press/The MIT Press.
Ansótegui, C., Béjar, R., Fernández, C., Gomes, C., Mateu, C. (2011). Generating highly balanced sudoku problems as hard problems. Journal of Heuristics, 17(5), 589–614. doi:10.1007/s10732-010-9146-y.
Ansótegui, C., Béjar, R., Fernàndez, C., Mateu, C. (2008). Edge matching puzzles as hard SAT/CSP benchmarks. In CP ’08: proceedings of the 14th international conference on principles and practice of constraint programming. Lecture notes in computer science (Vol. 5202, pp. 560–565). Sydney, Australia: Springer.
Ansótegui, C., Béjar, R., Fernández, C., Mateu, C. (2008). How hard is a commercial puzzle: the Eternity II challenge. Frontiers in Artificial Intelligence and Applications - Artificial Intelligence Research and Development, 184, 99–108.
Ansótegui, C., del Val, A., Dotú, I., Fernández, C., Manyà, F. (2004). Modelling choices in quasigroup completion: SAT vs CSP. In Proceedings of the AAAI 2004. AAAI Press/The MIT Press.
Ansótegui, C., & Manyà, F. (2005). Mapping many-valued CNF formulas to Boolean CNF formulas. In Proceedings of the international symposia on multiple-valued logic (pp. 290–295).
Atserias, A., Bulatov, A.A., Dalmau, V. (2007). On the power of k-consistency. In 34th International Colloquium Automata, Languages and Programming, ICALP 2007. of Lecture notes in computer science (Vol. 4596, pp. 279–290). Springer.
Béjar, R., Fernàndez, C., Mateu, C., Pascual, N. (2009). Bounding the phase transition on edge matching puzzles. IEEE International Symposium on Multiple-Valued Logic (pp. 80–85).
Benoist, T., & Bourreau, E. (2008). Fast global filtering for eternity II. Constraint Programming Letters, 3, 36–49.
Bessière, C., & Régin, J.-C. (1996). MAC and combined heuristics: two reasons to forsake FC (and CBJ?) on hard problems. In Principles and practice of constraint programming (pp. 61–75).
Cohen, D.A., Jeavons, P., Jefferson, C., Petrie, K.E., Smith, B.M. (2006). Symmetry definitions for constraint satisfaction problems. Constraints, 11(2–3), 115–137.
Dechter, R. (2003). Constraint processing. Morgan Kaufmann.
Demaine, E.D., & Demaine, M.L. (2007). Jigsaw puzzles, edge matching, and polyomino packing: connections and complexity. Graphs and Combinatorics, 23(s1), 195.
Eén, N., & Biere, A. (2005). Effective preprocessing in SAT through variable and clause elimination. In Proceedings of SAT 2005 (pp. 61–75).
Eén, N., & Sörensson, N. (2003). An extensible SAT-solver. In Proceedings of SAT 2003. Lecture notes in computer science (Vol. 2919, pp. 502–518). Springer.
Eén, N., & Sörensson, N. (2006). Translating pseudo-Boolean constraints into SAT. Journal of Satisfiability, 2, 1–26.
Gent, I.P., Jefferson, C., Miguel, I. (2006). MINION: a fast, scalable, constraint solver. In Proceedings of the 2006 conference on ECAI 2006: 17th European conference on artificial intelligence, 29 Aug–1 Sept 2006, Riva del Garda, Italy (pp. 98–102). Amsterdam, The Netherlands, The Netherlands: IOS Press.
Gent, I.P., Jefferson, C., Miguel, I. (2006). Watched literals for constraint propagation in Minion. In Principles and practice of constraint programming (pp. 182–197).
Haanpää, H., Järvisalo, M., Kaski, P., Niemelä, I. (2006). Hard satisfiable clause sets for benchmarking equivalence reasoning techniques. Journal on Satisfiability, Boolean Modeling and Computation, 2(1–4), 27–46.
Haralick, R.M., & Elliott, G.L. (1980). Increasing tree search efficiency for constraint satisfaction problems. AI Journal, 14, 263–313.
Järvisalo, M. (2006). Further investigations into regular XORSAT. In Proceedings of the AAAI 2006. AAAI Press/The MIT Press.
Li, C.M., & Anbulagan, A. (1997). Heuristics based on unit propagation for satisfiability problems. In Proceedings of the International Joint Conference on Artif icial Intelligence, IJCAI 97 (pp. 366–371). Morgan Kaufmann.
Monasson, R., Zecchinna, R., Kirkpatrick, S., Selman, B., Troyansky, L. (1999). Determining computational complexity from characteristic phase transitions. Nature, 400, 133–137.
Prosser, P. (1996). An empirical study of phase transitions in binary constraint satisfaction problems. AI Journal, 81, 81–109.
Régin, J.-C. (1994). A filtering algorithm for constraints of difference in CSPs. In Proceedings of the AAAI 1994 (pp. 362–367). AAAI Press/The MIT Press.
Régin, J.-C. (1999). The symmetric alldiff constraint. In Proceedings of the sixteenth International Joint Conference on Artificial Intelligence, IJCAI 99 (pp. 420–425). Morgan Kaufmann.
Schaus, P., & Deville, Y. (2008). Hybridization of CP and VLNS for Eternity II. In Quatrime Journes Francophones de Programmation par Contraintes (JFPC’08).
Smith, B., & Dyer, M. (1996). Locating the phase transition in binary constraint satisfaction problems. Artificial Intelligence, 81, 155–181.
Takenaga, Y., & Walsh, T. (2006). Tetravex is NP-complete. Information Processing Letters, 99(5), 171–174.
Williams, R., Gomes, C.P., Selman, B. (2003). Backdoors to typical case complexity. In IJCAI (pp. 1173–1178).
Xu, K., & Li, W. (2000). Exact phase transition in random constraint satisfaction problems. Journal of Artificial Intelligence Research, 12, 93–103.
Author information
Authors and Affiliations
Corresponding author
Rights and permissions
About this article
Cite this article
Ansótegui, C., Béjar, R., Fernández, C. et al. On the hardness of solving edge matching puzzles as SAT or CSP problems. Constraints 18, 7–37 (2013). https://doi.org/10.1007/s10601-012-9128-9
Published:
Issue Date:
DOI: https://doi.org/10.1007/s10601-012-9128-9