Title: Product Geometric Crossover for the Sudoku Puzzle
1IEEE CEC 2006
Product Geometric Crossover for the Sudoku Puzzle
Alberto Moraglio, Julian Togelius Simon
Lucas
2Contents
- Geometric Crossover and Product Geometric
Crossover - Design of Geometric Crossover for the Sudoku
Puzzle - Experimental Results and Conclusions
3I. Geometric Crossover
4Geometric Crossover
- Line segment
- A binary operator GX is a geometric crossover if
all offspring are in a segment between its
parents. - Geometric crossover is dependent on the metric
5Geometric Crossover
- The traditional n-point crossover is geometric
under the Hamming distance.
H(A,X) H(X,B) H(A,B)
6Many Recombinations are Geometric
- Traditional Crossover extended to multary strings
- Recombinations for real vectors
- PMX, Cycle Crossovers for permutations
- Homologous Crossover for GP trees
- Ask me for more examples over a coffee!
7Being geometric crossover is important because.
- We know how the search space is searched by
geometric crossover for any representation
convex search - We know a rule-of-thumb on what type of
landscapes geometric crossover will perform well
smooth landscape - This is just a beginning of general theory, in
the future we will know more!
8Product Geometric Crossover
- GX1AxA?A geometric under d1
- GX2BxB? B geometric under d2
- A product crossover of GX1 and GX2 is an operator
defined on the cartesian product of their domains
PGX(A,B)x(A,B)?(A,B) that applies GX1on the
first projection and GX2 on the second
projection. GX1 and GX2 do not need to be
independent. - Theorem PGX is a geometric crossover under the
distance d d1d2
9Properties of Product Geometric Crossover
- It is a simple and general method to build more
complex geometric crossovers from simple
geometric crossovers - Multi-crossover same representation, same
crossover n times - Hybrid crossover same representation, different
crossover for each projection - Hybrid representation different representation
(and crossover) for each projection - No independence required base crossovers do not
need to be independent
10II. Geometric Design for Sudoku
11The Sudoku Game
Fill in the grid so that every row,every column,
and every 3x3 boxcontains the digits 1 through 9
12Constraints
- It is a constraint-satisfaction problem with 4
types of constraints - Fixed Elements
- Rows are permutations
- Columns are permutations
- Boxes are permutations
13Computational Complexity
- The general Sudoku puzzle is based on a
(n2)x(n2) grid - The problem is NP-Complete
- Relaxation (3 constraints)
- Latin square completion (123) NP-Hard
- Sudoku puzzle generator (234) Polynomial?
- Initialisation problem (124 or 134) NP-Hard?
- Relaxation (2 constraints) Polynomial!
14Geometric Design
- Look at the problem and build a nice fitness
landscape ( fitness function distance) - the smaller search space the better
- the smoother landscape the better
- Pick genetic operators that match the landscape
mutation and crossover should be geometric under
the distance chosen
15Soft Hard Constraints
- Hard constraints all feasible solutions must
respect them. Search operators take feasible
solutions and produce feasible solutions - Soft constraints level of fulfillment is the
fitness of a solution - More than one combination of soft and hard
constraints available!
16Restricted Hamming space
- Hard constraint fixed positions
- Soft constraints permutations on rows, columns
and boxes - Distance Hamming distance between grids
- Feasible Mutation change any non-fixed element
- Feasible Crossover traditional crossover over
the vector obtained by joining the rows of the
grid
17Row-swap space
- Hard constraints fixed positions and
permutations on rows - Soft constraints permutations on columns and
boxes - Distance sum of swap distances between paired
rows (row-swap distance) - Feasible mutation swap two non-fixed elements in
a row
18Geometric crossovers for row-swap space
- Row-wise PMX and row-wise cycle crossover
- Feasibility
- Row permutation simple PMX and cycle crossovers
recombine permutations and produce permutations - Fixed elements they both preserve fixed
positions in the parents - Geometricity
- Known simple PMX and cycle crossovers are
geometric under swap distance - For the product geometric theorem row-wise PMX
and row-wise cycle crossovers are geometric under
row-swap distance
19Fitness Function
- Fitness level of fulfilment of soft constraints
- Fitness to maximize
- Sum of unique elements in each row, plus,
- Sum of unique elements in each column, plus,
- Sum of unique elements in each box
- For a 9x9 grid the fitness corresponding to a
fully correct grid is 243
20Smooth Fitness Landscapes
- Restricted Hamming Space
- a single element change affects the current
fitness of -1, 0 or 1 for its row, for its
column and for its box. Absolute maximum total
change in fitness for a single change is 3 - Row-swap space
- A single swap in a row affects the current
fitness of 0 for its row, between -2 and 2 for
the columns touched, and the same for the boxes
touched. The absolute maximum total change in
fitness for a single swap in a row is 4 - Maximum delta fitness
- Max fitness for 9x9 grid 243
- Min fitness for 9x9 grid 27
- Max delta fitness in the landscape 243 27216
- Index of smoothness
- Change in fitness at distance one divided maximum
change in fitness - 0 perfectly smooth landscape, 1 max and min
fitness are neighbours - Index for Restricted Hamming Space 3/216
- Index for Row-swap Space 4/216
- Both Fitness Landscapes are very smooth!
21Prediction!
- Both fitness landscapes are very smooth so
geometric crossovers and mutations associated
with both spaces should work well - Advantages of the row-swap search space
- it is much smaller because it restricts the
search to feasible rows - The restriction includes the optimum grid and
prunes only grids with lower fitness - Bet Row-swap operators will win!
22III. Experimental Results
23Hamming space crossovers with uniform swap
mutation
24Row-swap space crossovers with row-swap mutation
25Hill Climbers
26Results summary
- Crossovers based on row-swap space better than
those based on hamming space - Crossover (with mutation) better than hill
climbers - Many more experiments in the paper!
- Future work smartsquare crossover
27Conclusions
- Extended the geometric crossover with the notion
of Product Geometric Crossover - Product geometric crossover for Sudoku
- Designed geometric crossovers to deal naturally
with constraints - New geometric crossovers for the entire grid by
using simple geometric crossover for each rows - The associated distance has allowed us to analyse
the crossover fitness landscape and predict that
the crossovers will perform well - Extensive experimental results confirm that the
crossovers designed perform well