1 / 27

Product Geometric Crossover for the Sudoku Puzzle

IEEE CEC 2006. Product Geometric Crossover for the Sudoku Puzzle. Alberto Moraglio, Julian Togelius & Simon Lucas. Contents. Geometric Crossover and Product Geometric Crossover Design of Geometric Crossover for the Sudoku Puzzle Experimental Results and Conclusions. I. Geometric Crossover.

Download Presentation

Product Geometric Crossover for the Sudoku Puzzle

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. IEEE CEC 2006 Product Geometric Crossover for the Sudoku Puzzle Alberto Moraglio, Julian Togelius & Simon Lucas

  2. Contents • Geometric Crossover and Product Geometric Crossover • Design of Geometric Crossover for the Sudoku Puzzle • Experimental Results and Conclusions

  3. I. Geometric Crossover

  4. y x Geometric 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

  5. B 1 0 1 1 0 1 X A 2 B 1 1 0 1 1 3 A X 0 1 0 1 1 Geometric Crossover • The traditional n-point crossover is geometric under the Hamming distance. H(A,X) + H(X,B) = H(A,B)

  6. Many 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!

  7. Being 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!

  8. Product Geometric Crossover • GX1:AxAA geometric under d1 • GX2:BxB 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 = d1+d2

  9. Properties 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

  10. II. Geometric Design for Sudoku

  11. The Sudoku Game Fill in the grid so that every row,every column, and every 3x3 boxcontains the digits 1 through 9

  12. Constraints It is a constraint-satisfaction problem with 4 types of constraints: • Fixed Elements • Rows are permutations • Columns are permutations • Boxes are permutations

  13. Computational Complexity • The general Sudoku puzzle is based on a (n^2)x(n^2) grid • The problem is NP-Complete • Relaxation (3 constraints) • Latin square completion: (1+2+3) NP-Hard • Sudoku puzzle generator: (2+3+4) Polynomial? • Initialisation problem: (1+2+4 or 1+3+4) NP-Hard? • Relaxation (2 constraints): Polynomial!

  14. Geometric 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

  15. Soft & 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!

  16. Restricted 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

  17. Row-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

  18. Geometric 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

  19. Fitness 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

  20. Smooth 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 – 27=216 • 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!

  21. Prediction! • 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!

  22. III. Experimental Results

  23. Hamming space crossovers with uniform swap mutation

  24. Row-swap space crossovers with row-swap mutation

  25. Hill Climbers

  26. Results 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

  27. Conclusions • 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

More Related