Optimized Encoding of Sudoku Puzzle for SAT Solvers

SAT 처리기를 위한 수도쿠 퍼즐의 최적화된 인코딩

  • 권기현 (경기대학교 전자계산학과)
  • Published : 2007.07.15

Abstract

Sudoku can be regarded as a SAT problem. Various encodings are known for encoding Sudoku as a Conjunctive Normal Form (CNF) formula, which is the standard input for most SAT solvers. Using these encodings for large Sudoku, however, generates too many clauses, which impede the performance of state-of-the-art SAT solvers. This paper presents an optimized CNF encodings of Sudoku to deal with large instances of the puzzle. We use fixed cells in Sudoku to remove redundant clauses during the encoding phase. This results in reducing the number of clauses and a significant speedup in the SAT solving time.

SAT을 이용해서 수도쿠 퍼즐을 풀기 위해서는 수도쿠를 SAT 처리기의 표준 입력 언어인 CNF 논리식으로 인코딩 해야 한다. 기존에 제시된 인코딩 알고리즘으로 크기가 큰 수도쿠를 인코딩하면 현재 SAT 처리기의 처리 수준을 넘을 정도로 많은 논리식이 생성된다. 본 논문에서는 크기가 큰 수도쿠를 다루기 위해서 수도쿠의 고정 셀을 이용하여 최적화된 CNF 논리식을 생성하는 방법을 제시한다. 고정 셀에 배정된 숫자는 불변이기 때문에 이를 이용해서 일부 변수의 값을 인코딩 단계에서 미리 결정할 수 있고, 이들 변수의 값을 이용해서 SAT 처리에 영향을 주지 않는 절과 리터럴을 인코딩 단계에서 제거할 수 있다. 다양한 크기의 수도쿠 퍼즐에 적용한 결과 기존 인코딩 알고리즘에 비해서 우수한 성능을 보였다.

Keywords

References

  1. M.W. Moskewicz, et.al., 'Chaff: Engineering an Efficient SAT Solver,' in The Proceedings of DAC'01. 2001
  2. N. Een and N. Sorensson, 'An Extensible SAT Solver,' in The Proceedings of SAT'03, 2003
  3. I. Lynce and J. Ouaknine, 'Sudoku as a SAT problem,' in The Proceedings of AIMATH, 2006
  4. T. Weber, 'A SAT-based Sudoku Solver,' in The Proceedings of LPAR, pp.11-15, 2005
  5. N. Een and A. Biere, 'Effective Preprocessing in SAT through Variable and Clause Elimination,' in the Proceedings of SAT'05, 2005
  6. M. Davis, G. Logemann and D. Loveland, 'A Machine Program for Theorem Proving,' Communications of the ACM 5 (7): 394-397, 1962 https://doi.org/10.1145/368273.368557
  7. S. Subbarayan and D. Pradhan, 'NiVER: Non increasing Variable Elimination Resolution for Preprocessing SAT Instances,' in The Proceedings of SAT'04, 2004
  8. H. A. Kautz, D. McAllester and B. Selman, 'Encoding Plans in Propositional Logic,' in the Proceedings of Principle of Knowledge Representation and Reasoning, pp.374-384, 1996
  9. A. Biere, A. Cimatti, E. M. Clarke, O. Strichman and Y. Zhu, 'Bounded Model Checking,' Advances in Computers, Vol.58, 2003
  10. From http://www.satlib.org/Benchmarks/SAT/satformat.ps
  11. L. Aaronson, 'Sudoku Science: A popular puzzle helps researchers dig into deep math,' IEEE Spectrum, 2006.02. (from http://www.spectrum.ieee.org/feb06/2809)
  12. From http://www.menneske.no/sudoku