Some thoughts on generating Sudokus having a symmetrical pattern.Based on the programming of my generator helper, here is how I probably would go about mass generating Sudokus having a symmetrical pattern.
According to Wikipedia there are 6,670,903,752,021,072,936,960 Sudoku solution grids when all kinds of symmetries such as rotation, reflection, relabelling, etc are counted. On problem I had to figure out for my generator helper was how to stellar fast randomly generate any of the 6,670,903,752,021,072,936,960 possible Sudoku solution grids. For a 9x9 grid with some givens I also need to very fast randomly generate one of the possible solutions for this 9x9 grid. I am now able to do both within microseconds.
Generating vanilla Sudokus having a symmetrical pattern ala http://www.fiendishsudoku.com.I would need two programs. One for generating patterns. Every pattern generated would be converted to a string of its cell numbers separated by dashes. Today’s pattern would be: 1-5-9-12-14-15-21-25-26-29-37-38-41-44-45-53-56-57-61-67-68-70-73-77-81. This would allow easy detection of duplicates and storing in a database. A string of two digit cell numbers could also be used: 01050912141521252629373841444553565761676870737781.
The second program would be the pattern picker, Sudoku solution grid picker and logical solver. First is a set of pattern picked from the database, for instance 10 different ones. The database knows how many times each pattern has been used successfully (all five difficulties Easy, Moderate, Hard, Evil and Fiendish was generated for it), so that preferably never used patterns would be picked.
Then is a Sudoku solution grid generated. For each pattern Sudoku are the solution digits in the cells matching the pattern picked as givens and the Sudoku is solved using the logical solver. For each Sudoku is the result either Easy, Moderate, Hard, Evil, Fiendish or Unsuitable. With a fast and good solver all 10 Sudokus would be rated within one second, especially since techniques harder than X-Wing are not used. This continues in a loop until all five difficulties have been generated for a pattern. For the successful pattern is the result (5 Sudokus with five difficulties) stored and it is replaced with another pattern from the database and the loop continues.
Generating Samurai Sudokus having a symmetrical pattern ala http://www.samurai-sudoku.com.Again I would use two programs. One for generating patterns, and one for picking patterns, picking solution grids and doing logical solving.
For a Samurai the program would only pick one pattern at a time. Then generate a Samurai solution grid, first the centre 9x9 grid and then the four outer ones, since for each of the four outer ones the 9 givens in the overlapping nonet must be included. The solution digits in the cells matching the pattern are picked as givens and the Samurai is solved using the logical solver. The result is either Easy, Moderate, Hard, Evil, Fiendish or Unsuitable. If the result is not Unsuitable a puzzle was successfully generated. In a loop the program could continue with the same pattern for generating various difficulties or a new pattern could be picked every time a suitable solution was found for a pattern.
_________________
Quis custodiet ipsos custodes?
Normal: [D Y-m-d, G:i] PM->email: [D, d M Y H:i:s]