This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: CSE 630: Homework 2 Solutions Key 1. Sudoku problem (a) (State representation) There are multiple, valid representations. The simplest is to have an array of 16 variables, one for each cell in the 4x4 grid. Each of the variables takes one value from { 1, 2, 3, 4, BLANK } , with BLANK indicating that the cell corresponding to the variable has not yet been filled. (b) (Goal test) For each of the 4 rows, 4 columns and 4 inner grids: verify if all the numbers 1 through 4 are present exactly once. (c) (Successor function) Again, there are multiple ways of defining the successor function. Here is successor function 1: Define a simple order among all the cells, say from left to right, and within each column, from top to bottom. Now, for any given state, we can generate four possible successor states with this first blank cell being filled with one of { 1, 2, 3, 4 } . Successor function 2 is a minor tweak on successor function 1: identify the first blank cell and fill it with only those numbers that have not already been used in the row, column and inner grid that the cell is a part of. Both functions have 4 successor states at maximum (while successor function 2 often has many fewer). There are other possible successor functions which have more successor states. Both successor functions 1 and 2 allow only one path between any pair of states. There are other valid ways of defining the successor function which will allow multiple paths between some pairs of states. Why did I ask this question of multiple/single paths? If we know that a state space does not have multiple paths between any pair of states, then we don’t need to remember which states were already visited, since each state gets visited no more than once (since there is only one way to get to each state starting from a given start state)....
View
Full
Document
This note was uploaded on 03/16/2011 for the course CSE 630 taught by Professor Naeemshareef during the Spring '10 term at Ohio State.
 Spring '10
 NaeemShareef

Click to edit the document details