Docsity

Achieving Generalized Arc Consistency in Sudoku: An Analysis of Four Constraint Models, Exercises of Computer Numerical Control

Toggle sidebar
bg1
Constraint Programming
Problems on arc consistency
An order nsudoku problem instance is an n2Ɨn2grid with some of the cells preset with
values from 1. . . n2. The cells without a preset are said to be empty.
A sudoku problem instance has 3n2groups of n2cells. There is one group for each of the
n2rows, one for each of the n2columns and one for each of the n2sub-grids.
A solution to a problem instance places a value from 1. . . n2in each empty cell so that
each group of cells contains exactly one occurrence of each value in 1 . . . n2.
This question considers four constraint models of the order nsudoku problem. The models
all use the same variables and domains, but they have different constraints. In all models
there is a distinct variable Xcfor each cell cin the grid. The domain of every variable is
1. . . n2. Each model contains one constraint for each preset. If cell cis preset to value vthen
the model has the constraint Xc=v. In the four models the remainder of the constraints are
as follows.
Alldiff Model: For each group gthere is one constraint: alldifferent(g).
Disequality Model: For each group for any two distinct cells, cand c0, in the group there
is one constraint: Xc6=X0
c.
Member Model: For each group g, for every iin 1 . . . n2there is one constraint: member(i, g).
Subset Model: For each group gthere is one constraint: subset([1,2, . . . , n2], g ). This con-
straint is true of the set {1, ..., n2}is a subset of the values assigned to g.
For each of the four models, show the result of achieving generalised arc consistency on
the model of the following sudoku instance of order two.
4
3
3 4
1

Partial preview of the text

Download Achieving Generalized Arc Consistency in Sudoku: An Analysis of Four Constraint Models and more Exercises Computer Numerical Control in PDF only on Docsity!

Constraint Programming Problems on arc consistency

An order n sudoku problem instance is an n^2 Ɨ n^2 grid with some of the cells preset with values from 1... n^2. The cells without a preset are said to be empty. A sudoku problem instance has 3n^2 groups of n^2 cells. There is one group for each of the n^2 rows, one for each of the n^2 columns and one for each of the n^2 sub-grids. A solution to a problem instance places a value from 1... n^2 in each empty cell so that each group of cells contains exactly one occurrence of each value in 1... n^2. This question considers four constraint models of the order n sudoku problem. The models all use the same variables and domains, but they have different constraints. In all models there is a distinct variable Xc for each cell c in the grid. The domain of every variable is 1... n^2. Each model contains one constraint for each preset. If cell c is preset to value v then the model has the constraint Xc = v. In the four models the remainder of the constraints are as follows.

Alldiff Model: For each group g there is one constraint: alldif f erent(g).

Disequality Model: For each group for any two distinct cells, c and c′, in the group there is one constraint: Xc 6 = X′ c.

Member Model: For each group g, for every i in 1... n^2 there is one constraint: member(i, g).

Subset Model: For each group g there is one constraint: subset([1, 2 ,... , n^2 ], g). This con- straint is true of the set { 1 , ..., n^2 } is a subset of the values assigned to g.

For each of the four models, show the result of achieving generalised arc consistency on the model of the following sudoku instance of order two.

4 3 3 4