Solving Sudoku Using Artificial Intelligence
|
|
- Shawn Johns
- 6 years ago
- Views:
Transcription
1 Solving Sudoku Using Artificial Intelligence Eric Pass BitBucket: Demo:
2 Background Overview Sudoku problems are some of the most recognizable and popular puzzle games played around the world. A standard Sudoku puzzle is a two dimensional square grid containing 81 cells which are well distributed in 9 rows and 9 columns. The grid is further divided into 9 smaller squares called units which contain 9 cells each. (Zhai and Zhang) For the discussion in this paper, we will denote a puzzle of size or order N to mean a Sudoku puzzle that has N columns, N rows and N units. Figure 1: A 9 by 9 Sudoku Puzzle with a unit highlighted in light blue. The rules of Sudoku are an extension of the rules used in the Latin Square puzzles. (Soedarmadji and Ouaknine) The rules for a general N by N Sudoku puzzle are: 1. All of the N*N squares must be assigned a single value from 1 to N. 2. Each row must contain each number from 1 to N exactly once. 3. Each column must contain each number from 1 to N exactly once. 4. Each unit must contain each number from 1 to N exactly once. Even though the rules of Sudoku are incredibly simple, the task of correctly completing a partially filled Sudoku puzzle is exceedingly difficult. Felgenhauer and Jarvis calculate in their paper Enumerating Possible Sudoku Grids that there are x valid 9 by 9 Sudoku puzzles.
3 (Felgenhauer and Jarvis) Since the state space is so enormous, considerable effort has to go into developing algorithms which will yield a correct solution in a reasonable amount of computing time. Complexity of Sudoku In 2002, Yato and Seta at The University of Tokyo proved, by reducing Sudoku into a Latin square completion problem, that Sudoku is NP-Complete. (Yato T. and Seta) The assertion that Sudoku is NP- Complete indicates that it is possible to reduce Sudoku in polynomial time to another NP-Complete problem. Two common and natural reductions are reducing Sudoku to an exact cover problem and reducing Sudoku to a Boolean satisfiability problem. Sudoku as an Exact Cover Donald Knuth in his Dancing Links paper explains the exact cover problem very intuitively. The problem statement is: Given a matrix of 0s and 1s, does it have a set of rows containing exactly one 1 in each column? For example, the matrix Figure 2: An example exact cover problem matrix from Donald Knuth s paper Dancing Links. has such a set (rows 1, 4, and 5. (Knuth) Sudoku can be reduced to an exact cover problem; for a 9 by 9 puzzle, the matrix has 729 rows and 324 columns. The rows of this matrix encode information about what value is assigned to a given row and column. Since, for a 9 by 9 puzzle, there are 9 possible values which could occupy any of the 9 columns and any of the 9 rows we have a total number of 9*9*9 = 729 rows in this matrix. The columns of this matrix encode the four constraints of the problem that each cell must be assigned a single value between 1 and 9 and every row, column and unit must contain exactly one instance of each number between 1 and 9. This means there is a total of 4*9*9 = 324 columns in this matrix. Once Sudoku has been reduced to an exact cover problem, one can use various algorithms like Donald Knuth s Algorithm X which utilize the Dancing Links technique to solve these problems.
4 Sudoku as a SAT Problem Sudoku can just as easily be encoded as a Boolean Satisfiability Problem (SAT). In order to represent Sudoku as a SAT problem, one will need a considerable number of propositional variables. We will denote S i,j,z to be assigned true if and only if the cell at row i and column j is assigned value z. This means for a 9 by 9 Sudoku puzzle we will need 729 different propositional variables, the same as the number of rows in the Exact Cover reduction. Adding the constraints that each cell must contain a single value from 1 to 9 and that each row, column and unit must contain exactly one instance of each value from 1 to 9, the size of both the minimal and extended encoding can be shown to be O(n 4 ) where n is order of the Sudoku puzzle. (Lynce and Ouaknine) As explained by Lnyce and Ouaknine in their paper Sudoku as a SAT Problem the minimal encoding for a Sudoku puzzle is: By encoding Sudoku as a SAT problem, one can use various SAT solving algorithms such as the famous Davis-Putnam-Logemann-Loveland (DPLL) algorithm to solve a Sudoku puzzle. Objectives The objective of this project was to develop an interactive Sudoku solver generalized to handle N by N Sudoku puzzles in addition to creating a powerful and intuitive graphical user interface (GUI) that can be used to compare the efficiency of different Sudoku solving algorithms against a wide array of Sudoku puzzles differing in size and complexity. Overall, I met these goals by creating five different Sudoku solvers, all of which can handle N by N Sudoku puzzles, although they might not produce a solution in a reasonable amount of time. Each of the solvers can be tested interactively with a GUI I adapted and enhanced from Gilbert Le Blanc. While using the GUI, the user can manually enter in the starting clues,
5 load a puzzle from the database of a given difficulty, or generate a new puzzle specifying how many clues the puzzle should contain. Over the course of this project, I was able to experiment with different design patterns such as the Singleton, Strategy, and MVC design pattern as well as implement features that I did not intend to such as a database to load and save puzzles to. Additionally, my project can be run from the command line without a GUI as a tool to provide data, such as the number of nodes needed to explore and the time it took to find the solution, in order to analyze the performance of an AI against a large sample of Sudoku puzzles. Overall, my project which spanned 27 classes for a total of 2351 lines of code, turned out to be an enjoyable exploration into larger scale software development and an investigation into techniques to solve Sudoku puzzles utilizing artificial intelligence. Software Written Overview I utilized the Model View Controller design pattern to organize this project and create a robust GUI. There are four main packages: model, view, controller, and solvers. The state of the Sudoku puzzle is maintained in the model package comprising of two classes: SudokuPuzzle and SudokuCell. The model package also contains the implementation of the Singleton used to interface with the database in addition to other classes and enumerations such as PuzzleEntity, which is class abstracting a puzzle record in the database, and SudokuPuzzleSize, which is an enumeration of supported sizes for Sudoku puzzles encapsulating drawing logic per puzzle size. Most interestingly, the model package contains the implementation of the the puzzle generator whose implementation and performance will be discussed later in this paper. The controller and view packages contain all the code related to presenting and updating the Sudoku puzzle. These two packages are entirely GUI oriented and was written using Java Swing. If the reader interested in these details, they encouraged to view the actual code via the BitBucket link listed on the cover page of this paper. The last package is solvers, which is the home for my implementation of the five different Sudoku solvers. The solvers I implemented are all general backtracking algorithms and each will be discussed individually in terms of implementation and performance in the Solvers section. In the solvers package, I utilized the strategy design pattern to create an abstract class of a SudokuSolver of which each implementation of solver is forced to extend. The three abstract methods in SudokuSolver are the two methods for solving a Sudoku puzzle with and without a GUI to update, and a function to return the name of the solver.
6 The Sudoku Puzzle Abstraction For my implementation of a Sudoku puzzle, I chose to use a two dimensional array of SudokuCell objects. This was accomplished by having a private field in SudokuPuzzle called cells which was a two dimensional array of SudokuCell objects. The general abstraction function states that given a puzzle P where r denotes the row and c denotes the column the value of the cell P r,c, where r=0 and c=0 is the topmost left column, is represented by SudokuCell at cells[c][r] whose value is equal to P r,c. If the value of P r,c is not known then the value of the SudokuCell at cells[c][r] is set to 0. The SudokuCell object also keeps track of whether this cell was a given value in the puzzle as well as encapsulates all the logic necessary to present the cell in the GUI. Choosing a two dimensional array to represent a Sudoku puzzle was a natural abstraction. This implementation made it very easy and efficient to traverse and interact with the model. However, because I chose to use a two dimensional array, I was unable to utilize Donald Knuth s Dancing Links technique, which requires an exact cover matrix whose cells are all connected in in doubly linked list. If I had implemented the model as a matrix of doubly linked lists, I could have utilized Donald Knuth s Algorithm X which is an efficient recursive, non-deterministic, depth-first, backtracking algorithm for solving the exact cover problem. The Database and Puzzle Generation Generating a Sudoku puzzle solver was a surprisingly difficult task. My initial hope was that there would exist a general Sudoku puzzle generator which could generate puzzles of a given difficulty and size. Unfortunately, such an instrument does not exist. Stephen Ostermiller s qqwing was the closest tool available. Qqwing is a very robust Sudoku generator and solver; however, it is limited in that it can only generate 9 by 9 Sudoku puzzles. One very nice feature of qqwing is that it can generate puzzles of a specified difficulty. This is important because some Sudoku puzzles are inherently harder to solve than others and it is generally difficult to tell if a given puzzle will be trivial or hard solve. Qqwing grades a puzzle on basis of how many different Sudoku solving techniques are needed to solve that given puzzle. These techniques are used by advanced Sudoku players to solve puzzles by hand. Qqwing s grading system is based on the premise that the more techniques needed to solve a puzzle, the harder the puzzle is to solve. An interesting concept discussed in Ansotegui, et al s paper Generating Highly Balanced Sudoku Problems as Hard Problems is that certain properties such as how balanced the holes of a puzzle are distributed contributes to how hard a Sudoku puzzle is to solve. (Ansotegui, et al) Unfortunately, my generator does not utilize counting the number of different techniques to solve the puzzle nor the interesting properties such as singly, doubly and fully balanced Sudoku puzzles opting
7 instead for the naive approach of randomly generating a solved Sudoku puzzle then inserting holes into the puzzle arbitrarily. While this approach does not yield any insight to the difficulty of the puzzle, my generator can generate random puzzles for 16 by 16 Sudoku puzzles and qqwing cannot. Generating Sudoku puzzles takes a non-trivial amount of computational resources because in order to create a new puzzle, you must first solve an empty puzzle. This was the primary motivation for creating a database to store generated puzzles. Also the existence of a database also makes it easy to compare different solvers because you can ensure that they are facing the same puzzles. My database is a MySQL database with two tables PUZZLES and RUNS. I interact with the database through the DatabaseManangerSingleton class which resides in the model package. Solvers Overview For this project, I implemented five different solvers all of which are backtracking algorithms. From least sophisticated to most sophisticated, I implemented a simple backtracking algorithm, a backtracking algorithm with forward checking, an implementations of a backtracking algorithm using the minimum remaining heuristic, an implementation of a backtracking algorithm with a probabilistic heuristic, and finally a backtracking algorithms using constraint propagation. The only algorithm I can performed superbly was the constraint propagation algorithm which was able to solve an empty 25 by 25 Sudoku puzzle, which none of the algorithms other could manage. Presentation of Results Each algorithm was tested on a 2014 MacBook Pro with a 2.8 GHz Intel Core i7 processor and 16 GB of memory. Each algorithm faced the exact same puzzles in the same order. Each algorithm was presented with 200 simple, easy, intermediate and 400 expert Sudoku puzzles generated and graded by qqwing. The maximum amount of nodes for any given puzzle a solver was allowed to evaluate was 10,000,000. If a solution was not found before reach 10,000,000 nodes explored the search was aborted and the solver moved onto the next puzzle.
8 Simple Backtracking This algorithm unsurprisingly faired miserably. Simple backtracking could only solve the most basic of 9 by 9 puzzles and was almost always at magnitude of orders higher in terms of nodes explored than the other algorithms. Figure 3: Graph showing time vs. difficulty for simple backtracking algorithm. Figure 4: Graph showing number of nodes explored vs. difficulty for simple backtracking algorithm. As we can see from the two graphs, it was rare for simple backtracking to return a solution to problem of any difficulty in under 10,000,000 million nodes explored. My implementation of this simple backtracking algorithm, which is consistent with Russle and Norvig s backtracking algorithm presented on page 215 of the third edition of Artificial Intelligence a Modern Approach, enumerates all the possible values for a cell and for each assignment checks to see if this does not violate any of the constraints. If the assignment does violate a constraint, then the enumeration continues until either a valid assignment is found or all possibilities are exhausted. If a valid assignment is not identified, then the algorithm backtracks to the previous assignment and the enumeration process continues from that previous node. The fundamental problem with this algorithm is that it fails to use all of the information available. In visiting the exact same number of nodes, the simple backtracking algorithm can be dramatically improved by finding all the valid assignments of this cell and only trying those instead of checking to see if a given assignment is valid. This is exactly what is done in the forward checking backtracking solver. Overall, simple backtracking was able to solve 69% of simple puzzles, 66% of easy puzzles, 65% of intermediate puzzles, and 68% of expert puzzles exploring in an average of 2,516,820 nodes and 4,807,164 nanoseconds.
9 Forward Checking Solver The first improvement made to the simple backtracking solver was to employ forward checking. This solver is almost the exact same as the simple backtracking solver except that it only assigns values to cells it knows will preserve the consistency of the puzzle instead of checking each possible assignment. Like the simple backtracking algorithm, if a correct assignment does not exist, the algorithm backtracks to the previous cell. Figure 5: Graph showing time vs. difficulty for forward checking solver. Figure 6: Graph showing number of nodes explored vs. difficulty for forward checking solver. As a result of the improvement of forward checking, many more Sudoku puzzles can be solved; however,we are still unable to solve slightly less than 10% of each difficulty. Furthermore, we see a speedup in the time to find a solution when compared to simple backtracking by a little greater than 25%.
10 Minimum Reaming Values Heuristic The first heuristic I investigated was the minimum reaming values heuristic (MVR). This heuristic orders the search to check the puzzle from the most constrained cells, the cells with the fewest possible legal assignments, to the most unconstrained cells. By selecting the most constrained cell, you are effectively picking the variable that is most likely to cause a failure, thereby pruning the search tree. (Russell and Norvig, 216) I implemented MVR using a PriorityQueue where the cells the fewest possible assignments had the highest priority. Figure 7: Graph showing time vs. difficulty for MVR solver. Figure 8: Graph showing number of nodes explored vs. difficulty for MVR solver. The performance of the MVR solver was surprisingly good. It was able to solve all the simple puzzles, 98% of the easy puzzles and 97% of the intermediate and expert puzzles. More impressively, MVR was able to cut down the number of nodes it needed to visit in half and produced a speed up of 25% when compared to forward checking.
11 Probabilistic Heuristic The second heuristic I investigated was using a probabilistic heuristic in which out of the valid assignments for a cell, it would choose the enumerate from the least frequently assigned value to the most frequently assigned value in this puzzle. The logic for this is you know that for a N by N puzzle you need exactly N instances of every number from 1 to N. Therefore, it is more likely that the assignment of this cell falls into a less frequently assigned value than a more frequently assigned value. Figure 9: Graph showing time vs. difficulty for probabilistic solver. Figure 10: Graph showing number of nodes explored vs. difficulty for probabilistic solver. As seen above, this algorithm did not perform any better, and may be a little worst than the forward checking solver. Due to its additional memory needs and complexity, one cannot justify using this over forward checking. Constraint Propagation The last solver I implemented utilized constraint propagation. This was by far the most technically challenging solver with many small details to overlook. My implementation in addition to using constraint propagation used the MVR heuristic. The heart of this algorithm is again a PriorityQueue which contains the current valid assignments for every cell with the priority being those cells which have the fewest possible assignments. If this queue is empty, then we have found a solution to the puzzle. If the queue is not empty, then we poll the first cell off the queue and begin to enumerate through its valid assignments. It is important that before starting to go through the enumerations, that you have captured the old state of the puzzle before the start of the enumeration. After selecting a valid assignment for this
12 cell, you then traverse the puzzle and get the new possible assignments for all the cells that were effected by this assignment. You then iterate through each new assignment making sure that there is no cell that has been left without a valid assignment. If one is identified, you restore the state to before the original assignment and restart the enumeration. If an effected cell after this assignment is left with only one valid assignment, you then assign that value to that cell and collect those updates from that assignment. You continue this way until there are no more assignments or you reach a cell with no valid assignment. Figure 11: Graph showing time vs. difficulty for constraint propagation solver. Figure 12: Graph showing number of nodes explored vs. difficulty for constraint propagation solver. The performance of this algorithm was astounding as it was able to solve every 9 by 9 puzzle effortlessly averaging only 2,433 nodes explored and taking only on average only 1,478,335 nanoseconds to complete. Also, this algorithm was able to solve 16 by 16 puzzles better than all the other algorithms and it was the only algorithm able to solve an empty 25 by 25 grid. Final Thoughts This project was a fun exploration into attempting to solve the very hard and ubiquitous Sudoku puzzle. My entire project is versatile as it can be used to test Sudoku solving algorithms, draw and experiment with large Sudoku puzzles, as well as play and solve Sudoku problems by hand. My five algorithms overall did a good job and the last solver I implemented, the constraint propagation solver, is incredibly exciting. The overall performance of my algorithms are depicted in the three figures below.
13 Figure 13: Graph showing percentage solved for each solver subdivided by difficulty of the puzzle. Figure 14: Graph showing average number of nodes explored while solving a puzzle.
14 Figure 15: Graph showing average number of time for a solver to solve a Sudoku puzzle.
15 References Ansotegui C, Bejar R, Fernandez C, Gomes C, Mateu C. Generating Highly Balanced Sudoku Problems As Hard Problems. J Heuristics 2011;17: Felgenhauer B, Jarvis F. Enumerating Possible Sudoku Grids. Dresden. Sheffield, UK: University of Sheffield June 20, Dresden, Germany: TU Knuth DE. Dancing Links. arxiv:cs.ds 1, Lynce I, Ouaknine J. Sudoku as a SAT Problem. Lisbon, Portugal: Technical University of Lisbon. Oxford, UK: Oxford University Russell, Stuart J, Peter Norvig, and Ernest Davis. Artificial Intelligence: A Modern Approach. Upper Saddle River, NJ: Prentice Hall, Print. Soedarmadji E, McEliece R. Iterative Decoding for Sukoku and Latin Square Codes. Pasadena, CA: California Institute of Technology; Yato T, Seta T. Complexity and Completeness of Finding Another Solution and its Application to Puzzles. Tokyo, Japan: University of Tokyo; Zhai G, Zhang J. Solving Sudoku Puzzles Based on Customized Information Entropy. International Journal of Hybrid Information Technology. Jan 2013;6(1):77-91.
ISudoku. Jonathon Makepeace Matthew Harris Jamie Sparrow Julian Hillebrand
Jonathon Makepeace Matthew Harris Jamie Sparrow Julian Hillebrand ISudoku Abstract In this paper, we will analyze and discuss the Sudoku puzzle and implement different algorithms to solve the puzzle. After
More informationisudoku Computing Solutions to Sudoku Puzzles w/ 3 Algorithms by: Gavin Hillebrand Jamie Sparrow Jonathon Makepeace Matthew Harris
isudoku Computing Solutions to Sudoku Puzzles w/ 3 Algorithms by: Gavin Hillebrand Jamie Sparrow Jonathon Makepeace Matthew Harris What is Sudoku? A logic-based puzzle game Heavily based in combinatorics
More informationPython for education: the exact cover problem
Python for education: the exact cover problem arxiv:1010.5890v1 [cs.ds] 28 Oct 2010 A. Kapanowski Marian Smoluchowski Institute of Physics, Jagellonian University, ulica Reymonta 4, 30-059 Kraków, Poland
More informationAn improved strategy for solving Sudoku by sparse optimization methods
An improved strategy for solving Sudoku by sparse optimization methods Yuchao Tang, Zhenggang Wu 2, Chuanxi Zhu. Department of Mathematics, Nanchang University, Nanchang 33003, P.R. China 2. School of
More informationSudoku Solvers. A Different Approach. DD143X Degree Project in Computer Science, First Level CSC KTH. Supervisor: Michael Minock
Sudoku Solvers A Different Approach DD143X Degree Project in Computer Science, First Level CSC KTH Supervisor: Michael Minock Christoffer Nilsson Professorsslingan 10 114 17 Stockholm Tel: 073-097 87 24
More informationPython for Education: The Exact Cover Problem
Python for Education: The Exact Cover Problem Andrzej Kapanowski Marian Smoluchowski Institute of Physics, Jagiellonian University, Cracow, Poland andrzej.kapanowski@uj.edu.pl Abstract Python implementation
More informationKenken For Teachers. Tom Davis January 8, Abstract
Kenken For Teachers Tom Davis tomrdavis@earthlink.net http://www.geometer.org/mathcircles January 8, 00 Abstract Kenken is a puzzle whose solution requires a combination of logic and simple arithmetic
More information: Principles of Automated Reasoning and Decision Making Midterm
16.410-13: Principles of Automated Reasoning and Decision Making Midterm October 20 th, 2003 Name E-mail Note: Budget your time wisely. Some parts of this quiz could take you much longer than others. Move
More informationSpring 06 Assignment 2: Constraint Satisfaction Problems
15-381 Spring 06 Assignment 2: Constraint Satisfaction Problems Questions to Vaibhav Mehta(vaibhav@cs.cmu.edu) Out: 2/07/06 Due: 2/21/06 Name: Andrew ID: Please turn in your answers on this assignment
More information10/5/2015. Constraint Satisfaction Problems. Example: Cryptarithmetic. Example: Map-coloring. Example: Map-coloring. Constraint Satisfaction Problems
0/5/05 Constraint Satisfaction Problems Constraint Satisfaction Problems AIMA: Chapter 6 A CSP consists of: Finite set of X, X,, X n Nonempty domain of possible values for each variable D, D, D n where
More informationSpring 06 Assignment 2: Constraint Satisfaction Problems
15-381 Spring 06 Assignment 2: Constraint Satisfaction Problems Questions to Vaibhav Mehta(vaibhav@cs.cmu.edu) Out: 2/07/06 Due: 2/21/06 Name: Andrew ID: Please turn in your answers on this assignment
More informationOn the Combination of Constraint Programming and Stochastic Search: The Sudoku Case
On the Combination of Constraint Programming and Stochastic Search: The Sudoku Case Rhydian Lewis Cardiff Business School Pryfysgol Caerdydd/ Cardiff University lewisr@cf.ac.uk Talk Plan Introduction:
More informationA comparison of a genetic algorithm and a depth first search algorithm applied to Japanese nonograms
A comparison of a genetic algorithm and a depth first search algorithm applied to Japanese nonograms Wouter Wiggers Faculty of EECMS, University of Twente w.a.wiggers@student.utwente.nl ABSTRACT In this
More informationCracking the Sudoku: A Deterministic Approach
Cracking the Sudoku: A Deterministic Approach David Martin Erica Cross Matt Alexander Youngstown State University Youngstown, OH Advisor: George T. Yates Summary Cracking the Sodoku 381 We formulate a
More information2048: An Autonomous Solver
2048: An Autonomous Solver Final Project in Introduction to Artificial Intelligence ABSTRACT. Our goal in this project was to create an automatic solver for the wellknown game 2048 and to analyze how different
More informationApplications of Advanced Mathematics (C4) Paper B: Comprehension WEDNESDAY 21 MAY 2008 Time:Upto1hour
ADVANCED GCE 4754/01B MATHEMATICS (MEI) Applications of Advanced Mathematics (C4) Paper B: Comprehension WEDNESDAY 21 MAY 2008 Afternoon Time:Upto1hour Additional materials: Rough paper MEI Examination
More informationCS 188: Artificial Intelligence Spring 2007
CS 188: Artificial Intelligence Spring 2007 Lecture 7: CSP-II and Adversarial Search 2/6/2007 Srini Narayanan ICSI and UC Berkeley Many slides over the course adapted from Dan Klein, Stuart Russell or
More informationAn Empirical Evaluation of Policy Rollout for Clue
An Empirical Evaluation of Policy Rollout for Clue Eric Marshall Oregon State University M.S. Final Project marshaer@oregonstate.edu Adviser: Professor Alan Fern Abstract We model the popular board game
More informationUniversiteit Leiden Opleiding Informatica
Universiteit Leiden Opleiding Informatica Solving and Constructing Kamaji Puzzles Name: Kelvin Kleijn Date: 27/08/2018 1st supervisor: dr. Jeanette de Graaf 2nd supervisor: dr. Walter Kosters BACHELOR
More informationTechniques for Generating Sudoku Instances
Chapter Techniques for Generating Sudoku Instances Overview Sudoku puzzles become worldwide popular among many players in different intellectual levels. In this chapter, we are going to discuss different
More informationCS 229 Final Project: Using Reinforcement Learning to Play Othello
CS 229 Final Project: Using Reinforcement Learning to Play Othello Kevin Fry Frank Zheng Xianming Li ID: kfry ID: fzheng ID: xmli 16 December 2016 Abstract We built an AI that learned to play Othello.
More information5.4 Imperfect, Real-Time Decisions
5.4 Imperfect, Real-Time Decisions Searching through the whole (pruned) game tree is too inefficient for any realistic game Moves must be made in a reasonable amount of time One has to cut off the generation
More informationThe Mathematics Behind Sudoku Laura Olliverrie Based off research by Bertram Felgenhauer, Ed Russel and Frazer Jarvis. Abstract
The Mathematics Behind Sudoku Laura Olliverrie Based off research by Bertram Felgenhauer, Ed Russel and Frazer Jarvis Abstract I will explore the research done by Bertram Felgenhauer, Ed Russel and Frazer
More informationRating and Generating Sudoku Puzzles Based On Constraint Satisfaction Problems
Rating and Generating Sudoku Puzzles Based On Constraint Satisfaction Problems Bahare Fatemi, Seyed Mehran Kazemi, Nazanin Mehrasa International Science Index, Computer and Information Engineering waset.org/publication/9999524
More informationApplications of Advanced Mathematics (C4) Paper B: Comprehension INSERT WEDNESDAY 21 MAY 2008 Time:Upto1hour
ADVANCED GCE 4754/01B MATHEMATICS (MEI) Applications of Advanced Mathematics (C4) Paper B: Comprehension INSERT WEDNESDAY 21 MAY 2008 Afternoon Time:Upto1hour INSTRUCTIONS TO CANDIDATES This insert contains
More informationThe most difficult Sudoku puzzles are quickly solved by a straightforward depth-first search algorithm
The most difficult Sudoku puzzles are quickly solved by a straightforward depth-first search algorithm Armando B. Matos armandobcm@yahoo.com LIACC Artificial Intelligence and Computer Science Laboratory
More informationYet Another Organized Move towards Solving Sudoku Puzzle
!" ##"$%%# &'''( ISSN No. 0976-5697 Yet Another Organized Move towards Solving Sudoku Puzzle Arnab K. Maji* Department Of Information Technology North Eastern Hill University Shillong 793 022, Meghalaya,
More informationTaking Sudoku Seriously
Taking Sudoku Seriously Laura Taalman, James Madison University You ve seen them played in coffee shops, on planes, and maybe even in the back of the room during class. These days it seems that everyone
More informationThe remarkably popular puzzle demonstrates man versus machine, backtraking and recursion, and the mathematics of symmetry.
Chapter Sudoku The remarkably popular puzzle demonstrates man versus machine, backtraking and recursion, and the mathematics of symmetry. Figure.. A Sudoku puzzle with especially pleasing symmetry. The
More information1 This work was partially supported by NSF Grant No. CCR , and by the URI International Engineering Program.
Combined Error Correcting and Compressing Codes Extended Summary Thomas Wenisch Peter F. Swaszek Augustus K. Uht 1 University of Rhode Island, Kingston RI Submitted to International Symposium on Information
More informationAN ABSTRACT OF THE THESIS OF
AN ABSTRACT OF THE THESIS OF Jason Aaron Greco for the degree of Honors Baccalaureate of Science in Computer Science presented on August 19, 2010. Title: Automatically Generating Solutions for Sokoban
More information22c:145 Artificial Intelligence
22c:145 Artificial Intelligence Fall 2005 Informed Search and Exploration II Cesare Tinelli The University of Iowa Copyright 2001-05 Cesare Tinelli and Hantao Zhang. a a These notes are copyrighted material
More informationReal-Time Connect 4 Game Using Artificial Intelligence
Journal of Computer Science 5 (4): 283-289, 2009 ISSN 1549-3636 2009 Science Publications Real-Time Connect 4 Game Using Artificial Intelligence 1 Ahmad M. Sarhan, 2 Adnan Shaout and 2 Michele Shock 1
More informationGame Mechanics Minesweeper is a game in which the player must correctly deduce the positions of
Table of Contents Game Mechanics...2 Game Play...3 Game Strategy...4 Truth...4 Contrapositive... 5 Exhaustion...6 Burnout...8 Game Difficulty... 10 Experiment One... 12 Experiment Two...14 Experiment Three...16
More informationof Nebraska - Lincoln
University of Nebraska - Lincoln DigitalCommons@University of Nebraska - Lincoln MAT Exam Expository Papers Math in the Middle Institute Partnership 7-2009 Sudoku Marlene Grayer University of Nebraska-Lincoln
More informationA new mixed integer linear programming formulation for one problem of exploration of online social networks
manuscript No. (will be inserted by the editor) A new mixed integer linear programming formulation for one problem of exploration of online social networks Aleksandra Petrović Received: date / Accepted:
More information1 Introduction. 2 An Easy Start. KenKen. Charlotte Teachers Institute, 2015
1 Introduction R is a puzzle whose solution requires a combination of logic and simple arithmetic and combinatorial skills 1 The puzzles range in difficulty from very simple to incredibly difficult Students
More informationarxiv: v2 [math.ho] 23 Aug 2018
Mathematics of a Sudo-Kurve arxiv:1808.06713v2 [math.ho] 23 Aug 2018 Tanya Khovanova Abstract Wayne Zhao We investigate a type of a Sudoku variant called Sudo-Kurve, which allows bent rows and columns,
More informationLecture 20 November 13, 2014
6.890: Algorithmic Lower Bounds: Fun With Hardness Proofs Fall 2014 Prof. Erik Demaine Lecture 20 November 13, 2014 Scribes: Chennah Heroor 1 Overview This lecture completes our lectures on game characterization.
More informationINTRODUCTION TO COMPUTER SCIENCE I PROJECT 6 Sudoku! Revision 2 [2010-May-04] 1
INTRODUCTION TO COMPUTER SCIENCE I PROJECT 6 Sudoku! Revision 2 [2010-May-04] 1 1 The game of Sudoku Sudoku is a game that is currently quite popular and giving crossword puzzles a run for their money
More informationGriddler Creator. Supervisor: Linda Brackenbury. Temitope Otudeko 04/05
Griddler Creator Supervisor: Linda Brackenbury Temitope Otudeko 04/05 TABLE OF CONTENTS Introduction... 3 Griddler puzzle Puzzles... 3 Rules and Techniques for solving griddler puzzles... 3 History of
More informationFoundations of Artificial Intelligence
Foundations of Artificial Intelligence 20. Combinatorial Optimization: Introduction and Hill-Climbing Malte Helmert Universität Basel April 8, 2016 Combinatorial Optimization Introduction previous chapters:
More informationGames and Adversarial Search II
Games and Adversarial Search II Alpha-Beta Pruning (AIMA 5.3) Some slides adapted from Richard Lathrop, USC/ISI, CS 271 Review: The Minimax Rule Idea: Make the best move for MAX assuming that MIN always
More informationMidterm Examination. CSCI 561: Artificial Intelligence
Midterm Examination CSCI 561: Artificial Intelligence October 10, 2002 Instructions: 1. Date: 10/10/2002 from 11:00am 12:20 pm 2. Maximum credits/points for this midterm: 100 points (corresponding to 35%
More informationAdverserial Search Chapter 5 minmax algorithm alpha-beta pruning TDDC17. Problems. Why Board Games?
TDDC17 Seminar 4 Adversarial Search Constraint Satisfaction Problems Adverserial Search Chapter 5 minmax algorithm alpha-beta pruning 1 Why Board Games? 2 Problems Board games are one of the oldest branches
More informationWritten examination TIN175/DIT411, Introduction to Artificial Intelligence
Written examination TIN175/DIT411, Introduction to Artificial Intelligence Question 1 had completely wrong alternatives, and cannot be answered! Therefore, the grade limits was lowered by 1 point! Tuesday
More informationConstraint Satisfaction Problems: Formulation
Constraint Satisfaction Problems: Formulation Slides adapted from: 6.0 Tomas Lozano Perez and AIMA Stuart Russell & Peter Norvig Brian C. Williams 6.0- September 9 th, 00 Reading Assignments: Much of the
More informationSUDOKU X. Samples Document. by Andrew Stuart. Moderate
SUDOKU X Moderate Samples Document by Andrew Stuart About Sudoku X This is a variant of the popular Sudoku puzzle which contains two extra constraints on the solution, namely the diagonals, typically indicated
More informationMeasuring Improvements and the Effects of Multiple and Unique Solution Puzzles on Sudoku Solving Algorithms
DEGREE PROJECT, IN COMPUTER SCIENCE, FIRST LEVEL STOCKHOLM, SWEDEN 2015 Measuring Improvements and the Effects of Multiple and Unique Solution Puzzles on Sudoku Solving Algorithms JONATHAN GOLAN JOEL KALLIN
More informationHeuristics & Pattern Databases for Search Dan Weld
10//01 CSE 57: Artificial Intelligence Autumn01 Heuristics & Pattern Databases for Search Dan Weld Recap: Search Problem States configurations of the world Successor function: function from states to lists
More informationInformed search algorithms. Chapter 3 (Based on Slides by Stuart Russell, Richard Korf, Subbarao Kambhampati, and UW-AI faculty)
Informed search algorithms Chapter 3 (Based on Slides by Stuart Russell, Richard Korf, Subbarao Kambhampati, and UW-AI faculty) Intuition, like the rays of the sun, acts only in an inflexibly straight
More informationYou ve seen them played in coffee shops, on planes, and
Every Sudoku variation you can think of comes with its own set of interesting open questions There is math to be had here. So get working! Taking Sudoku Seriously Laura Taalman James Madison University
More information8. You Won t Want To Play Sudoku Again
8. You Won t Want To Play Sudoku Again Thanks to modern computers, brawn beats brain. Programming constructs and algorithmic paradigms covered in this puzzle: Global variables. Sets and set operations.
More informationMAS336 Computational Problem Solving. Problem 3: Eight Queens
MAS336 Computational Problem Solving Problem 3: Eight Queens Introduction Francis J. Wright, 2007 Topics: arrays, recursion, plotting, symmetry The problem is to find all the distinct ways of choosing
More informationComparing Methods for Solving Kuromasu Puzzles
Comparing Methods for Solving Kuromasu Puzzles Leiden Institute of Advanced Computer Science Bachelor Project Report Tim van Meurs Abstract The goal of this bachelor thesis is to examine different methods
More informationProgramming an Othello AI Michael An (man4), Evan Liang (liange)
Programming an Othello AI Michael An (man4), Evan Liang (liange) 1 Introduction Othello is a two player board game played on an 8 8 grid. Players take turns placing stones with their assigned color (black
More informationSelected Game Examples
Games in the Classroom ~Examples~ Genevieve Orr Willamette University Salem, Oregon gorr@willamette.edu Sciences in Colleges Northwestern Region Selected Game Examples Craps - dice War - cards Mancala
More informationENGR170 Assignment Problem Solving with Recursion Dr Michael M. Marefat
ENGR170 Assignment Problem Solving with Recursion Dr Michael M. Marefat Overview The goal of this assignment is to find solutions for the 8-queen puzzle/problem. The goal is to place on a 8x8 chess board
More informationSome results on Su Doku
Some results on Su Doku Sourendu Gupta March 2, 2006 1 Proofs of widely known facts Definition 1. A Su Doku grid contains M M cells laid out in a square with M cells to each side. Definition 2. For every
More informationAnnouncements. CS 188: Artificial Intelligence Fall Today. Tree-Structured CSPs. Nearly Tree-Structured CSPs. Tree Decompositions*
CS 188: Artificial Intelligence Fall 2010 Lecture 6: Adversarial Search 9/1/2010 Announcements Project 1: Due date pushed to 9/15 because of newsgroup / server outages Written 1: up soon, delayed a bit
More informationSection Marks Agents / 8. Search / 10. Games / 13. Logic / 15. Total / 46
Name: CS 331 Midterm Spring 2017 You have 50 minutes to complete this midterm. You are only allowed to use your textbook, your notes, your assignments and solutions to those assignments during this midterm.
More informationA Group-theoretic Approach to Human Solving Strategies in Sudoku
Colonial Academic Alliance Undergraduate Research Journal Volume 3 Article 3 11-5-2012 A Group-theoretic Approach to Human Solving Strategies in Sudoku Harrison Chapman University of Georgia, hchaps@gmail.com
More informationAn Exploration of the Minimum Clue Sudoku Problem
Sacred Heart University DigitalCommons@SHU Academic Festival Apr 21st, 12:30 PM - 1:45 PM An Exploration of the Minimum Clue Sudoku Problem Lauren Puskar Follow this and additional works at: http://digitalcommons.sacredheart.edu/acadfest
More informationCOMP219: COMP219: Artificial Intelligence Artificial Intelligence Dr. Annabel Latham Lecture 12: Game Playing Overview Games and Search
COMP19: Artificial Intelligence COMP19: Artificial Intelligence Dr. Annabel Latham Room.05 Ashton Building Department of Computer Science University of Liverpool Lecture 1: Game Playing 1 Overview Last
More informationA Retrievable Genetic Algorithm for Efficient Solving of Sudoku Puzzles Seyed Mehran Kazemi, Bahare Fatemi
A Retrievable Genetic Algorithm for Efficient Solving of Sudoku Puzzles Seyed Mehran Kazemi, Bahare Fatemi Abstract Sudoku is a logic-based combinatorial puzzle game which is popular among people of different
More informationFive-In-Row with Local Evaluation and Beam Search
Five-In-Row with Local Evaluation and Beam Search Jiun-Hung Chen and Adrienne X. Wang jhchen@cs axwang@cs Abstract This report provides a brief overview of the game of five-in-row, also known as Go-Moku,
More informationAlgorithmique appliquée Projet UNO
Algorithmique appliquée Projet UNO Paul Dorbec, Cyril Gavoille The aim of this project is to encode a program as efficient as possible to find the best sequence of cards that can be played by a single
More informationA GRAPH THEORETICAL APPROACH TO SOLVING SCRAMBLE SQUARES PUZZLES. 1. Introduction
GRPH THEORETICL PPROCH TO SOLVING SCRMLE SQURES PUZZLES SRH MSON ND MLI ZHNG bstract. Scramble Squares puzzle is made up of nine square pieces such that each edge of each piece contains half of an image.
More informationUsing Artificial intelligent to solve the game of 2048
Using Artificial intelligent to solve the game of 2048 Ho Shing Hin (20343288) WONG, Ngo Yin (20355097) Lam Ka Wing (20280151) Abstract The report presents the solver of the game 2048 base on artificial
More informationSlitherlink. Supervisor: David Rydeheard. Date: 06/05/10. The University of Manchester. School of Computer Science. B.Sc.(Hons) Computer Science
Slitherlink Student: James Rank rankj7@cs.man.ac.uk Supervisor: David Rydeheard Date: 06/05/10 The University of Manchester School of Computer Science B.Sc.(Hons) Computer Science Abstract Title: Slitherlink
More informationSudokuSplashZone. Overview 3
Overview 3 Introduction 4 Sudoku Game 4 Game grid 4 Cell 5 Row 5 Column 5 Block 5 Rules of Sudoku 5 Entering Values in Cell 5 Solver mode 6 Drag and Drop values in Solver mode 6 Button Inputs 7 Check the
More informationAI Approaches to Ultimate Tic-Tac-Toe
AI Approaches to Ultimate Tic-Tac-Toe Eytan Lifshitz CS Department Hebrew University of Jerusalem, Israel David Tsurel CS Department Hebrew University of Jerusalem, Israel I. INTRODUCTION This report is
More informationDeep Green. System for real-time tracking and playing the board game Reversi. Final Project Submitted by: Nadav Erell
Deep Green System for real-time tracking and playing the board game Reversi Final Project Submitted by: Nadav Erell Introduction to Computational and Biological Vision Department of Computer Science, Ben-Gurion
More informationLecture 6: Latin Squares and the n-queens Problem
Latin Squares Instructor: Padraic Bartlett Lecture 6: Latin Squares and the n-queens Problem Week 3 Mathcamp 01 In our last lecture, we introduced the idea of a diagonal Latin square to help us study magic
More informationSokoban: Reversed Solving
Sokoban: Reversed Solving Frank Takes (ftakes@liacs.nl) Leiden Institute of Advanced Computer Science (LIACS), Leiden University June 20, 2008 Abstract This article describes a new method for attempting
More informationUNIVERSITY of PENNSYLVANIA CIS 391/521: Fundamentals of AI Midterm 1, Spring 2010
UNIVERSITY of PENNSYLVANIA CIS 391/521: Fundamentals of AI Midterm 1, Spring 2010 Question Points 1 Environments /2 2 Python /18 3 Local and Heuristic Search /35 4 Adversarial Search /20 5 Constraint Satisfaction
More informationCS61B Lecture #33. Today: Backtracking searches, game trees (DSIJ, Section 6.5)
CS61B Lecture #33 Today: Backtracking searches, game trees (DSIJ, Section 6.5) Coming Up: Concurrency and synchronization(data Structures, Chapter 10, and Assorted Materials On Java, Chapter 6; Graph Structures:
More informationEnumerating 3D-Sudoku Solutions over Cubic Prefractal Objects
Regular Paper Enumerating 3D-Sudoku Solutions over Cubic Prefractal Objects Hideki Tsuiki 1,a) Yohei Yokota 1, 1 Received: September 1, 2011, Accepted: December 16, 2011 Abstract: We consider three-dimensional
More informationUMBC 671 Midterm Exam 19 October 2009
Name: 0 1 2 3 4 5 6 total 0 20 25 30 30 25 20 150 UMBC 671 Midterm Exam 19 October 2009 Write all of your answers on this exam, which is closed book and consists of six problems, summing to 160 points.
More informationBeyond Prolog: Constraint Logic Programming
Beyond Prolog: Constraint Logic Programming This lecture will cover: generate and test as a problem solving approach in Prolog introduction to programming with CLP(FD) using constraints to solve a puzzle
More informationBLUFF WITH AI. CS297 Report. Presented to. Dr. Chris Pollett. Department of Computer Science. San Jose State University. In Partial Fulfillment
BLUFF WITH AI CS297 Report Presented to Dr. Chris Pollett Department of Computer Science San Jose State University In Partial Fulfillment Of the Requirements for the Class CS 297 By Tina Philip May 2017
More informationFast Placement Optimization of Power Supply Pads
Fast Placement Optimization of Power Supply Pads Yu Zhong Martin D. F. Wong Dept. of Electrical and Computer Engineering Dept. of Electrical and Computer Engineering Univ. of Illinois at Urbana-Champaign
More informationAlgorithm Performance For Chessboard Separation Problems
Algorithm Performance For Chessboard Separation Problems R. Douglas Chatham Maureen Doyle John J. Miller Amber M. Rogers R. Duane Skaggs Jeffrey A. Ward April 23, 2008 Abstract Chessboard separation problems
More informationHeuristic Search with Pre-Computed Databases
Heuristic Search with Pre-Computed Databases Tsan-sheng Hsu tshsu@iis.sinica.edu.tw http://www.iis.sinica.edu.tw/~tshsu 1 Abstract Use pre-computed partial results to improve the efficiency of heuristic
More informationComp th February Due: 11:59pm, 25th February 2014
HomeWork Assignment 2 Comp 590.133 4th February 2014 Due: 11:59pm, 25th February 2014 Getting Started What to submit: Written parts of assignment and descriptions of the programming part of the assignment
More informationCS61B Lecture #22. Today: Backtracking searches, game trees (DSIJ, Section 6.5) Last modified: Mon Oct 17 20:55: CS61B: Lecture #22 1
CS61B Lecture #22 Today: Backtracking searches, game trees (DSIJ, Section 6.5) Last modified: Mon Oct 17 20:55:07 2016 CS61B: Lecture #22 1 Searching by Generate and Test We vebeenconsideringtheproblemofsearchingasetofdatastored
More informationSolving Problems by Searching
Solving Problems by Searching Berlin Chen 2005 Reference: 1. S. Russell and P. Norvig. Artificial Intelligence: A Modern Approach. Chapter 3 AI - Berlin Chen 1 Introduction Problem-Solving Agents vs. Reflex
More informationInformatica Universiteit van Amsterdam. Performance optimization of Rush Hour board generation. Jelle van Dijk. June 8, Bachelor Informatica
Bachelor Informatica Informatica Universiteit van Amsterdam Performance optimization of Rush Hour board generation. Jelle van Dijk June 8, 2018 Supervisor(s): dr. ir. A.L. (Ana) Varbanescu Signed: Signees
More informationReinforcement Learning in Games Autonomous Learning Systems Seminar
Reinforcement Learning in Games Autonomous Learning Systems Seminar Matthias Zöllner Intelligent Autonomous Systems TU-Darmstadt zoellner@rbg.informatik.tu-darmstadt.de Betreuer: Gerhard Neumann Abstract
More informationAutomatically Generating Puzzle Problems with Varying Complexity
Automatically Generating Puzzle Problems with Varying Complexity Amy Chou and Justin Kaashoek Mentor: Rishabh Singh Fourth Annual PRIMES MIT Conference May 19th, 2014 The Motivation We want to help people
More informationSolving Nonograms by combining relaxations
Solving Nonograms by combining relaxations K.J. Batenburg a W.A. Kosters b a Vision Lab, Department of Physics, University of Antwerp Universiteitsplein, B-0 Wilrijk, Belgium joost.batenburg@ua.ac.be b
More informationCSC 380 Final Presentation. Connect 4 David Alligood, Scott Swiger, Jo Van Voorhis
CSC 380 Final Presentation Connect 4 David Alligood, Scott Swiger, Jo Van Voorhis Intro Connect 4 is a zero-sum game, which means one party wins everything or both parties win nothing; there is no mutual
More information5.4 Imperfect, Real-Time Decisions
116 5.4 Imperfect, Real-Time Decisions Searching through the whole (pruned) game tree is too inefficient for any realistic game Moves must be made in a reasonable amount of time One has to cut off the
More informationCompressing Pattern Databases
Compressing Pattern Databases Ariel Felner and Ram Meshulam Computer Science Department Bar-Ilan University Ramat-Gan, Israel 92500 Email: ffelner,meshulr1g@cs.biu.ac.il Robert C. Holte Computing Science
More informationDeveloping the Model
Team # 9866 Page 1 of 10 Radio Riot Introduction In this paper we present our solution to the 2011 MCM problem B. The problem pertains to finding the minimum number of very high frequency (VHF) radio repeaters
More informationFor slightly more detailed instructions on how to play, visit:
Introduction to Artificial Intelligence CS 151 Programming Assignment 2 Mancala!! The purpose of this assignment is to program some of the search algorithms and game playing strategies that we have learned
More informationSolving the Social Golfer Problem with a GRASP
Solving the Social Golfer Problem with a GRASP Markus Triska Nysret Musliu Received: date / Accepted: date Abstract The Social Golfer Problem (SGP) is a combinatorial optimization problem that exhibits
More informationMore Adversarial Search
More Adversarial Search CS151 David Kauchak Fall 2010 http://xkcd.com/761/ Some material borrowed from : Sara Owsley Sood and others Admin Written 2 posted Machine requirements for mancala Most of the
More informationarxiv: v1 [cs.cc] 21 Jun 2017
Solving the Rubik s Cube Optimally is NP-complete Erik D. Demaine Sarah Eisenstat Mikhail Rudoy arxiv:1706.06708v1 [cs.cc] 21 Jun 2017 Abstract In this paper, we prove that optimally solving an n n n Rubik
More informationCS 188 Fall Introduction to Artificial Intelligence Midterm 1
CS 188 Fall 2018 Introduction to Artificial Intelligence Midterm 1 You have 120 minutes. The time will be projected at the front of the room. You may not leave during the last 10 minutes of the exam. Do
More information