[Community Puzzle] 16x16 Sudoku

Coding Games and Programming Challenges to Code Better

Send your feedback or ask for help here!

Created by @yoch, validated by @darkhorse64, @Rob-G and @Timinator.
If you have any issues, feel free to ping them.

(CommunityBot did not create this post; maybe the forum was down when the puzzle was approved.)

So far I tried this:

  1. First go through the grid to find trivial cell values (cells with only one possible candidate) until there are none left.
  2. Then do brute-force backtracking on the remaining grid.

I’ve managed to speed up the brute-force backtracking considerably, but it is still way to slow to solve test grids 3-6. Grid 3 requires 3,907,366,771 iterations to complete (after filling 5 trivial cell values), taking 82 seconds on my machine.

How can this be improved? What is the required “smart” backtracking part here? How can I prioritize exploring the candidates during backtracking? Any hints?


For Test3 I’m only making 3 guesses in total so you are missing quite a few in your first step.
Before I have to make any guess my grid looks like that:


You say you are taking care of cells with only one possible candidate, you also need to use the fact that you know that in each row, col & block every letter appears only once, ie: if you can only place the letter in one cell of the row, col or block, it has to go there.

1 Like

I must be doing something fundamentally wrong then. For grid 3, I am only able to find 10 trivial cell values now (after fixing a silly mistake), after which my grid looks like this:


When testing the trivial cell values, I of course combine what is already in the row plus in the column plus in the block, and if only one letter is missing across all 3, that is the only solution. I go through the whole grid and repeat until I find no more trivial cell values.

How many trivial cell values do you find?

The grid I posted above is after I’m done with adding all the “trivial”.

Let’s take the third line after you added the 10 values:


You can deduce that E has to go in the first position because:

  • It can’t go in position 2 because there’s already an E in position 2 on line 13
  • It can’t go in position 4 because there’s already an E in position 4 on line 10
  • It can’t go in position 6 because there’s already an E in position 6 on line 9
  • It can’t go in position 7 because there’s already an E in position 7 on line 7
  • It can’t go in position 9 or 10 because there’s already an E the second block (line 4, position 12)
  • It can’t go in position 13 or 15 because there’s already an E the third block (line 2, position 14)