Sudoku Solver Application

From UBC Wiki

Authors: Jonathan Adithya, Logan Wu

What is the problem?

The problem centers around the challenge of solving Sudoku puzzles, a popular numerical logic game that has captivated millions worldwide. Despite its seemingly simple rules—filling a 9x9 grid so that each column, row, and 3x3 section contain all digits from 1 to 9—the complexity and variety of Sudoku puzzles can vary greatly, presenting a significant challenge to both humans and algorithms alike. Traditional methods of problem-solving, such as brute force or manual logic, can be time-consuming and inefficient, especially for more difficult puzzles. This project aims to address the need for a more streamlined, accurate, and efficient approach to solving Sudoku puzzles, leveraging the capabilities of Prolog to implement a logic-based solution that can systematically and quickly solve puzzles of any difficulty level.

What is the something extra?

The "something extra" in our Sudoku solver project lies in the simplicity and efficiency of the application. While the core functionality remains the solving of standard Sudoku puzzles, our application differentiates itself by integrating clear and comprehensible visualization techniques and effective logical constraints. The Prolog program utilizes constraint programming principles efficiently, ensuring that each row, column, and box adheres to the standard Sudoku rules of unique numbers. Furthermore, the 'display4.pl' file enhances user experience by clearly displaying the Sudoku board in a readable format, including boundaries for sub-grids, which aids in visual tracking of the puzzle-solving process. This focus on user-friendly output and efficient solving techniques offers an additional layer of engagement and educational value, making it accessible for both beginners and experienced Sudoku players.

What did we learn from doing this?

Through this project, we learned the intricacies of implementing a traditional Sudoku solver using Prolog, a language well-suited for logical problem-solving. Our journey involved understanding and applying constraint programming techniques to enforce the game’s rules effectively. The key challenges we faced included developing a logical solver that efficiently handles the inherent constraints of Sudoku—ensuring uniqueness in rows, columns, and 3x3 grids.

By exploring various approaches in our 'solver3.pl' and 'solver4.pl' files, we experimented with different strategies that initially did not meet our expectations, which provided valuable lessons in troubleshooting and refining our logic. This iterative process of trial and error helped us improve our problem-solving skills and deepen our understanding of Prolog’s capabilities and limitations.

Additionally, the creation of the 'display4.pl' module taught us about enhancing user interaction through clear visualizations, making the solver not just functional but also user-friendly. Integrating visual feedback mechanisms was crucial for making the solver more accessible and understandable to users, highlighting the importance of user interface design even in text-based environments.

Overall, this project not only advanced our technical skills but also enriched our approach to designing and debugging complex logic systems, providing a solid foundation for tackling similar challenges in the future.


Links to code etc.

https://github.com/Logan-WYT/Sudoku-Solver