Using solving techniques for generating puzzles

Post the puzzle or solving technique that's causing you trouble and someone will help

Using solving techniques for generating puzzles

Postby AJG » Mon Aug 20, 2012 4:31 pm

Recently I've been coding a sudoku game that teaches people different solving techniques. I've been concentrating on that aspect of my game, and unfortunately my puzzle generator isn't very good. I was wondering if anyone could suggest solving techniques I could program into my game so that it creates much better puzzles. If anyone was interested, here is my process for creating sudokus:

1. Generates a completed sudoku grid.

2. Does the following 50 times:
Removes the cell with the most candidates and which belongs to the most populated groups if and only if
-The puzzle has one unique solution after the cell is removed

The puzzle checks the following solving techniques to test for a solution and uniqueness
-Hidden and Naked Singles
-Segment Ones and Twos
-Naked pairs, triples, and quads

Difficulty is based on a score, which is determined by which method are used to solve each cell

Sorry if this was not posted in the correct forum. :oops:
AJG
 
Posts: 7
Joined: 09 August 2012

Re: Using solving techniques for generating puzzles

Postby civiliza » Mon Aug 27, 2012 5:16 pm

If you are comfortable with programming them in, I would suggest trying the Pointing and Claiming techniques.

Pointing - All the candidates for a specific value in a box (I call it a block) are in the same row/column, so you can eliminate the possibility of that value from other locations in said row/column.

Claiming - All the candidates for a specific value in a row/column are in the same box, so you can eliminate the possibility of that value from other locations in said box.
civiliza
 
Posts: 64
Joined: 25 October 2010

Re: Using solving techniques for generating puzzles

Postby AJG » Tue Aug 28, 2012 3:15 pm

Thanks for responding! Unfortunately the methods you named have different names as I know them (Segment One and Segment Two), and I've already programmed them into my sudoku generator. Currently I'm in the process of programming single coloring, with limited results (I expected better). I'm thinking the process I'm using for removing numbers isn't very good, so I'm redoing it and I hope my program will generate harder sudokus.
AJG
 
Posts: 7
Joined: 09 August 2012

Re: Using solving techniques for generating puzzles

Postby civiliza » Tue Aug 28, 2012 4:01 pm

Ah, I see, I was wondering what your "Segment" methods were.

As a relative newcomer to this site, the impression I get is that terminology tends to standardise towards the definitions given at Sudopedia.com (http://www.sudopedia.org/wiki/Main_Page). The sudopedia site lists and explains a variety of solving techniques that you might want to investigate.

Try looking up XY Wings, paraphrasing massively, these are a trio of cells each containing precisely two values. The root has candidate values X and Y and can "see" (ie is in the same box, column or row as) the first pincer and can see (via a different box, column or row) the other pincer. One pincer has candidate values X and Z, the other has candidate values Y and Z.

The logic is that if the root has value X then the XZ pincer must have value Z, while if the root has value Y then the YZ pincer must have value Z. Either way any other cell that both pincers can "see" must have some value other than Z.

(I am sure that Sudopedia describes it better).

There are also X-Wings (base member of the "fish" family of techniques), and XYZ Wings that you might want to look into.
civiliza
 
Posts: 64
Joined: 25 October 2010

Re: Using solving techniques for generating puzzles

Postby daj95376 » Wed Aug 29, 2012 1:57 am

_
The techniques used by the program Simple Sudoku are recognized by all of the experienced players in numerous forums.

The first two groups are Basics. It's seldom that experienced players will specifically lists them in a puzzle's solution. When discussing a puzzle, a pencilmark grid is usually posted that starts with a first line of "after basics". The next two groups are additional techniques that may or may not be listed. If they're not listed, then their presence is indicated by "after SSTS"and "SSTE" for Simple Sudoku to end. The last two techniques are often considered honorary members of SSTS even though they're not actually present in Simple Sudoku.

Code: Select all
===== ===== ===== ===== Simple Sudoku Technique Set   (SSTS)

- Naked  Single        (single-digit technique)
- Hidden Single        (single-digit technique)
- Locked Candidate 1   (single-digit technique)
- Locked Candidate 2   (single-digit technique)

- Naked  Pair
- Naked  Triple
- Naked  Quad
- Hidden Pair
- Hidden Triple
- Hidden Quad

- X-Wing               (single-digit technique)
- Swordfish            (single-digit technique)
- Colors               (single-digit technique)
- Multi-Colors         (single-digit technique)

- XY-Wing

* XYZ-Wing             (honorary but not actual in Simple Sudoku)
* Jellyfish            (honorary but not actual in Simple Sudoku)

I suggest that your puzzle generator starts by identifying these techniques.
daj95376
2014 Supporter
 
Posts: 2624
Joined: 15 May 2006

Re: Using solving techniques for generating puzzles

Postby AJG » Wed Aug 29, 2012 2:32 am

For some reason I found hidden pairs, triples, and quads to be incredibly rare, and time consuming to find. I left them out of my generator, but maybe I'll revisit them. I've programmed single coloring, and I've generalized the fish methods, so when I program them into my sudoku it should cover all of those.... I just feel like decent puzzles take way too long to generate (up to 10 seconds) and even the decent ones rarely require anything worse than naked quads to complete. I'm sure there are holes in my logic, but so far I'm a little flustered by the results I've gotten.
AJG
 
Posts: 7
Joined: 09 August 2012


Return to Help with puzzles and solving techniques