Extracting 'pearl' states from puzzles?

Programs which generate, solve, and analyze Sudoku puzzles

Extracting 'pearl' states from puzzles?

Postby Clouded » Thu Mar 24, 2022 8:00 am

Is there any software that would take a puzzle, solve it step by step and extract the 'hardest' grid from the solution? More precisely, I want the SE pearl rating of the original puzzle = the SE diamond rating of the grid that is output.

Context: I've been training a neural net to solve Sudoku step-by-step. Surprisingly, the bottleneck is not training but periodically evaluating progress. If you solve 1000 puzzles to evaluate progress, that's actually around 60,000 board states that need to be processed by the net; most of those states are so easy that they don't tell you anything. I want to take my 1000 puzzles, solve them step by step and extract 1000 intermediate grids that need 'hard' steps to progress; then I only need to test whether the net can make the first move correctly on each grid, which will make evaluation 60x faster.
Clouded
 
Posts: 18
Joined: 10 December 2020

Re: Extracting 'pearl' states from puzzles?

Postby m_b_metcalf » Thu Mar 24, 2022 9:07 pm

Have you thought of selecting your 1000 puzzles from among the thousands of pearls and diamonds listed in the Patterns Game results in the interactive games forum?

Mike
User avatar
m_b_metcalf
2017 Supporter
 
Posts: 13631
Joined: 15 May 2006
Location: Berlin

Re: Extracting 'pearl' states from puzzles?

Postby dobrichev » Fri Mar 25, 2022 7:41 am

Hi Clouded,

If SE means Sudoku Explainer, then formally you are anchored to it due to its specific rating rules.

You can intercept pearl rating update in SE and take the needed pencilmark state. AFAIK mith does the same in hard puzzles hunting.

One puzzle can have several steps with equal rating (both horizontally - choose one of them and continue solving, and vertically - at different stages steps with same rating are used) and you have to choose which of them is in your interest.

Actually, for the horizontal branching you must follow SE's choice. SE doesn't examine all horizontal branches and chooses one in an undocumented way. Some beleive that this is a bug that can be fixed w/o all branch examination. I personally don't think so.
dobrichev
2016 Supporter
 
Posts: 1863
Joined: 24 May 2010

Re: Extracting 'pearl' states from puzzles?

Postby Clouded » Sun Apr 17, 2022 8:52 am

Sorry for the slow reply -- for some reason the notification email didn't reach me. In the end I ran

java -cp SukakuExplainer.jar diuf.sudoku.test.serate --format="FOR_PUZZLE%t%r%t%g" --after="%r%t%i" --input=patterns-game.txt > patterns-game.steps.txt

which listed all the 'steps' of the solutions to each patterns-game puzzle. Then I used a simple Python script to extract the state with the hardest rating, and checked that it corresponded to the overall SE rating for the puzzle. It took days to run SE on all the problems, but it worked fine.
Clouded
 
Posts: 18
Joined: 10 December 2020


Return to Software