DOI QR코드

DOI QR Code

Sudoku Algorithm

스도쿠 알고리즘

  • Lee, Sang-Un (Dept. of Multimedia Eng., Gangneung-Wonju National University)
  • 이상운 (강릉원주대학교 과학기술대학 멀티미디어공학과)
  • Received : 2014.10.01
  • Accepted : 2015.02.13
  • Published : 2015.02.28

Abstract

This paper proposes a solution-yielding linear time algorithm to NP-complete Sudoku, to which no polynomial time algorithm has been proposed. The proposed algorithm is performed on blocks in the descending order of the number of clues they contain. It firstly determines all numbers that could possibly occur in the blank rows and columns of each block. By deriving an intersecting value of corresponding rows and columns, it assigns the final number for each blank. When tested on the traditional $9{\times}9$ Sudoku, the proposed algorithm has succeeded in obtaining the solution through performance of 9 times, the exact number of the blocks. Test results on modified Jigsaw Sudoku (9 blocks) and Hypersudoku (13 blocks) also show its success in deriving the solutions by execuring 9 and 13 times respectively. Accordingly, this paper proves that the Sudoku problem is in fact P-problem.

본 논문은 지금까지 NP-완전 문제로 다항시간 알고리즘이 존재하지 않는 스도쿠 문제의 해를 다항시간으로 구하는 알고리즘을 제안하였다. 제안된 알고리즘은 숫자가 많이 들어 있는 블록 내림차순으로 수행한다. 각 블록에서 빈칸들을 대상으로 행에 들어 갈 수 있는 숫자와 열에 들어갈 수 있는 숫자를 결정한다. 행과 열의 교집합을 구하면 해당 빈칸에 들어갈 수 있는 숫자가 결정된다. 이들 숫자를 대상으로 각 빈칸에 들어 갈 수 있는 숫자를 배정하는 방법을 적용하였다. 제안된 알고리즘은 전통적인 $9{\times}9$ 스도쿠에 적용 결과 블록의 개수인 9회만을 수행하여 해를 구하는데 성공하였다. 또한, 변형 스도쿠인 Jigsaw 스도쿠 (9개 블록)와 Hypersudoku (13개 블록)에 적용 결과 Jigsaw 스도쿠는 9회, Hypersudoku는 13회 수행으로 해를 구하는데 성공하였다. 결국, 제안된 알고리즘은 스도쿠 문제가 P-문제임을 증명하였다.

Keywords

References

  1. Wikipedia, "Exact Cover," http://en.wikipedia.org/wiki/Exact_cover, Wikipedia Foundation Inc., 2014.
  2. Wikipedia, "Sudoku," http://en.wikipedia.org/wiki/Sudoku, Wikipedia Foundation Inc., 2014.
  3. Wikipedia, "Mathematics of Sudoku," http://en.wikipedia.org/wiki/Mathematics_of_Sudoku, Wikipedia Foundation Inc., 2014.
  4. Wikipedia, "Algorithmics of Sudoku," http://en.wikipedia.org/wiki/Algorithmics_of_Sudoku, Wikipedia Foundation Inc., 2014.
  5. F. Jarvis and F. Jarvis, "Enumerating Possible Sudoku Grids," http://www.afjarvis.staff.shef.ac.uk/sudoku.pdf, 2005.
  6. C. Lass, "Minimal Number of Clues for Sudokus," Central European Journal of Computer Science, Vol. 2, No. 2, pp. 143-151, Jun. 2012.
  7. G. McGuire, B. Tugemann, and G. Civario, "There is no 16-Clue Sudoku: Solving the Sudoku Minimum Number of Clues Problem," pp. 1-36, Cornell University Library, Aug. 2013.
  8. Wikipedia, "Knuth's Algorithm X," http://en.wikipedia.org/wiki/Knuth's_algorithm, Wikipedia Foundation Inc., 2014.
  9. K. Y. Yun, "ECE 30: Introduction to Computer Engineering," Dept. of Electrical and Computer Eng., University of California, San Diago, http://paradise.ucsd.edu/ project.pdf, 2007.
  10. J. M. Tjensvold, "Genetic Distributed Exact Cover Solver," http://decs.googlecode.com/decs/downloads/list/decs-report.pdf, 2007.