Exploring A Better Way to Constraint Propagation Using Naked Pair

Sudoku is an NP-complete problem therefore developing various efficient algorithms is crucial. This paper presents an enhanced approach to solving sudoku puzzles by improving on recursive backtracking with constraint propagation and bitmask, focusing on the implementation of the naked pair technique...

Full description

Saved in:
Bibliographic Details
Main Author: Chen Kaiqi
Format: Article
Language:English
Published: EDP Sciences 2025-01-01
Series:ITM Web of Conferences
Online Access:https://www.itm-conferences.org/articles/itmconf/pdf/2025/01/itmconf_dai2024_04025.pdf
Tags: Add Tag
No Tags, Be the first to tag this record!
Description
Summary:Sudoku is an NP-complete problem therefore developing various efficient algorithms is crucial. This paper presents an enhanced approach to solving sudoku puzzles by improving on recursive backtracking with constraint propagation and bitmask, focusing on the implementation of the naked pair technique. This research aims to add constraints to reduce the backtracking steps in solving sudoku using naked pairs, which is a technique that eliminates candidates of a cell from other cells in the same row, column or sub-grid when two cells share the same candidate sets. This research uses a dataset of 1 million sudoku puzzlers from Kaggle to evaluate the proposed solver’s performance. The solver first processes the puzzle into bitmask vectors then uses the singles and naked pairs technique to minimize the candidates, and then uses depth-first search to backtrack and solve the puzzle. As a result, the naked pair strategy slightly increases the total steps, and it significantly reduces the computation of depth-first search steps, making the solver potentially more efficient in solving difficult puzzles.
ISSN:2271-2097