• Title/Summary/Keyword: 퍼즐 풀이

Search Result 13, Processing Time 0.021 seconds

Algorithm for Cross-avoidance Bypass Routing in Numberlink Puzzle (숫자 연결 퍼즐에 관한 교차 회피 우회 경로 알고리즘)

  • Sang-Un Lee
    • The Journal of the Institute of Internet, Broadcasting and Communication
    • /
    • v.24 no.3
    • /
    • pp.95-101
    • /
    • 2024
  • The numberlink puzzle(NLP), which non-crossings with other numbers of connection in connecting lines through empty cells between a given pair of numbers, is an NP-complete problem with no known way to solve the puzzle in polynomial time. Until now, arbitrary numbers have been selected and puzzles have been solved using trial-and-error methods. This paper converts empty cells into vertices in lattice graphs connected by edge between adjacent cells for a given problem. Next, a straight line was drawn between the pairs of numbers and divided into groups of numbers where crossing occurred. A bypass route was established to avoid intersection in the cross-number group. Applying the proposed algorithm to 18 benchmarking data showed that the puzzle could be solved with a linear time complexity of O(n) for all data.

Optimized Encoding of Sudoku Puzzle for SAT Solvers (SAT 처리기를 위한 수도쿠 퍼즐의 최적화된 인코딩)

  • Kwon, Gi-Hwon
    • Journal of KIISE:Software and Applications
    • /
    • v.34 no.7
    • /
    • pp.616-624
    • /
    • 2007
  • 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.

Binary Backtracking Algorithm for Sudoku (스도쿠 퍼즐을 위한 이진역추적 알고리즘)

  • Lee, Sang-Un
    • The Journal of the Institute of Internet, Broadcasting and Communication
    • /
    • v.17 no.4
    • /
    • pp.155-161
    • /
    • 2017
  • This paper suggests polynomial time solution algorithm for Sudoku puzzle problem. This problem has been known NP (non-deterministic polynomial time)-complete. The proposed algorithm set the initial value of blank cells to value range of [$1,2,{\cdots},9$]. Then the candidate set values in blank cells deleted by preassigned clue in row, column, and block. We apply the basic rules of Stuart, and proposes two additional rules. Finally we apply binary backtracking(BBT) technique. For the experimental Sudoku puzzle with various categories of solution, the BBT algorithm can be obtain all of given Sudoku puzzle regardless of any types of solution.

Algorithm for Candidate Clue Decision based on Magic Rule in Kakuro Puzzle (가꾸로 퍼즐에 관한 마법 규칙 기반 실마리 후보 결정 알고리즘)

  • Sang-Un Lee
    • The Journal of the Institute of Internet, Broadcasting and Communication
    • /
    • v.24 no.3
    • /
    • pp.103-108
    • /
    • 2024
  • Kakuro puzzles are NP-complete problems where no way to solve puzzles in polynomial time is known. Until now, a brute-force search method or a linear programming method has been applied to substitute all possible cases. This paper finds a magic rule, a rule for box sizes and unfilled numbers according to sum clues. Based on the magic rule, numbers that cannot enter empty cells were deleted from the box for row and column sum clues. Next, numbers that cannot enter the box were deleted based on the sum clue value. Finally, cells with only a single number were confirmed as clues. As a result of applying the proposed algorithm to seven benchmarking experimental data, it was shown that solutions could be obtained for all problems.

A New SAT Encoding for Solving Sudoku (수도쿠 풀이를 위한 새로운 SAT 인코딩)

  • Park, Jun-Kil;Choi, Jin-Young
    • Proceedings of the Korean Information Science Society Conference
    • /
    • 2007.06b
    • /
    • pp.487-492
    • /
    • 2007
  • 수도쿠를 푸는 것은 오락으로서 뿐 아니라 컴퓨터 계산 문제로서도 흥미롭다. 수도쿠는 minimal과 extended 인코딩을 통해 SAT로 변환되고, 탐색이 아닌 추론기술의 반복 적용을 통해 다항시간에 해를 찾을 수 있다. minimal과 extended 인코딩은 직관적이지만 고차 수도쿠($16\times16$ 이상)를 풀기에 충분하지 못하다. 이 논문에서는 extended 인코딩을 개선한 블록 인코딩을 제안한다. 블록 인코딩을 $16\times16$$25\times25$ 퍼즐 집합에 적용 했을 때 extended 인코딩에 비해 추론기술에 따라 1%에서 12% 더 많은 수의 퍼즐을 푸는 것을 실험을 통하여 보인다.

  • PDF

Applying Genetic Algorithm To Randomly Creating And Solving A Sudoku Puzzle (유전 알고리즘을 이용한 스도쿠 퍼즐 생성 및 풀이 방법)

  • Hwang, Yoon Chan
    • Proceeding of EDISON Challenge
    • /
    • 2015.03a
    • /
    • pp.521-526
    • /
    • 2015
  • A Sudoku puzzle is a kind of magic square puzzle which requires a non-repeated series of numbers from 1 to 9 in each 9 rows and 9 columns. Furthermore it contains total of 9 small three-by-three matrices, which need non-repeated numbers from 1 to 9 as well. Therefore the total number of possible cases of Sudoku puzzle is finite, even though that of creating nine-by-nine square is exponentially great. Accordingly a certain set of way is need not only for solving the puzzle, but also creating a new one. In this study, the method for creating a Sudoku puzzle applying genetic algorithm is suggested and will be demonstrated. Also, it will be shown that a Sudoku puzzle can be solved by genetic algorithm.

  • PDF

유전 알고리즘을 이용한 스도쿠 퍼즐 생성 및 풀이 방법

  • Hwang, Yun-Chan
    • CDE review
    • /
    • v.21 no.2
    • /
    • pp.69-74
    • /
    • 2015
  • A Sudoku puzzle is a kind of magic square puzzle which requires a non-repeated series of numbers from 1 to 9 in each 9 rows and 9 columns. Furthermore it contains total of 9 small three-by-three matrices, which need non-repeated numbers from 1 to 9 as well. Therefore the total number of possible cases of Sudoku puzzle is finite, even though that of creating nine-by-nine square is exponentially great. Accordingly a certain set of way is need not only for solving the puzzle, but also creating a new one. In this study, the method for creating a Sudoku puzzle applying genetic algorithm is suggested and will be demonstrated. Also, it will be shown that a Sudoku puzzle can be solved by genetic algorithm.

  • PDF

Analysis of Model Checking Tools with Maze Puzzles (미로 퍼즐 풀이를 통한 모델 체킹 도구의 특성 분석)

  • Park, Sa-Choun;Lee, Gun-Soo;Kwon, Gi-Hwon
    • Proceedings of the Korea Information Processing Society Conference
    • /
    • 2008.05a
    • /
    • pp.382-385
    • /
    • 2008
  • 본 논문은 게임 풀이를 통해서 모델 체킹 도구의 특징을 분석한다. 도망자-추적자 게임은 격자 모양의 미로에서 도망자가 추적자를 따돌리고 탈출하는 게임이다. 도망자가 격자 상에서 한 칸 움직일 때, 추적자는 일정한 패턴을 가지고 두 칸 움직인다. 이 문제를 SMV와 SPIN 모델 체커로 모델링하고 검증하는 과정을 통해서 SMV와 Spin 모델 체커의 특징을 분석한다. 실험을 통해서 우리는 최단 경로를 찾을 경우는 SMV 모델 체커를 사용해야 하고, 가능한 경로를 빨리 찾는 경우는 Spin 모델 체커가 더 적합함을 확인할 수 있었다.

Extracting Subsequence of Boolean Variables using SAT-solver (만족가능성 처리기를 이용한 이진 변수 서브시퀀스 추출)

  • Park, Sa-Choun;Kwon, Gi-Hwon
    • The KIPS Transactions:PartD
    • /
    • v.15D no.6
    • /
    • pp.777-784
    • /
    • 2008
  • Recently in the field of model checking, to overcome the state explosion problem, the method of using a SAT-solver is mainly researched. To use a SAT-solver, the system to be verified is translated into CNF and the Boolean cardinality constraint is widely used in translating the system into CNF. In BCC it is dealt with set of boolean variables, but there is no translating method of the sequence among Boolean variables. In this paper, we propose methods for translating the problem, which is extracting a subsequence with length k from a sequence of Boolean variables, into CNF formulas. Through experimental results, we show that our method is more efficient than using only BCC.

Performance Analysis on SAT, PB and SMT for Counting Problems (카운팅 문제에 대한 SAT, PB, SMT의 성능 분석)

  • Park, Ho-Jin;Park, Sa-Choun;Kwon, Gi-Hwon
    • Proceedings of the Korea Information Processing Society Conference
    • /
    • 2008.05a
    • /
    • pp.371-374
    • /
    • 2008
  • n개의 이진 변수 집합 중에 k개를 선택하는 카운팅 문제(Counting Problem)들은 여러 방법으로 풀이가 가능하다. 본 논문에서는 카운팅 문제를 풀기 위해 SAT, PB, SMT를 소개하고, 칸 칠하기(Fill-a-Pix) 퍼즐을 예로 들어 카운팅 문제의 인코딩 방법을 제시하고 처리 결과를 비교해 보았다. SAT이 상대적으로 인코딩은 가장 복잡했으나, 처리 시 가장 우수한 성능을 보였다. 따라서 본 논문은 카운팅 문제를 다룰 때에는 SAT이 가장 적합하다는 것을 제안한다.