

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


Due Date: Thursday, October 17, 5PM
For this programming assignment, you will be modifying a backtracking imple- mentation of Sudoku to solve the Sudoku puzzle more efficiently.
In this game, your goal is to fill a 4x4, 6x6 or 9x9 grid such that each value in a column, row and block has a different value from other entries in the same row, column and block. Each cell in the grid can be filled with a digit from 1 to n (where n is the size of an nxn board).
You can gain some intuition on how to solve this problem by checking: http://www.websudoku.com
You will solve the Sudoku puzzle as a constraint satisfaction problem (CSP). You will need to implement Minimum Remaining Values (MRV) heuristic, Least Constraining Value (LCV) heuristic and Forward Checking. Backtracking has been already implemented. Your goal is to modify this code to find the solution as efficiently as possible.
Copy the code from http://www.cs.umd.edu/class/fall2006/cmsc421/projects/pa2.tar to your directory. Read the documentation in the file thoroughly. A couple of notes on the code:
(a) sudoku - a list representation of a sudoku board (Test cases are in- cluded). (b) mcv - if mcv = t, do Minimum Remaining Values (MRV) (c) lcv - if lcv = t, do Least Constraining Value (LCV) (d) fc - if fc = t, do Forward Checking (e) ac - if ac = t, do Arc Consistency
Programming Assignment 2: CMSC 421, Introduction to Artificial Intelligence: Fall 2006 2
(a) [10 points] Modify the current implementation to support Forward Checking. (b) [10 points] Implement the Minimum Remaining Values (MRV) heuris- tic. (See Russell and Norvig p. 143) (c) [10 points] Implement the Least Constraining Value (LCV) heuris- tic. (See Russell and Norvig p. 144)
Make sure that your code is well commented and readable. Also, make sure to remove all the debugging statements before submitting.
(a) Only Backtracking (b) Backtracking with MRV (c) Backtracking with LCV (d) Backtracking with forward checking (e) Backtracking with MRV and LCV (f) Backtracking with MRV, LCV and forward checking
(Note: The write up will be graded for presentation, as well as correctness. Presentation of your results in tables is highly encouraged. You may also sum- marize your results by providing statistics, such as calculating the average, in addition to presenting full results.)
The deliverables of this project is a single tar file, your-glue-id.tar, containing the following files.