# Is it possible to have a double miracle Sudoku grid?

I've been attempting to construct a miracle sudoku puzzle for a while now, with a little twist. Instead of one sudoku grid, there are two combined grids, as a new-ish idea. The grid I've been using to construct is shown below:

The green represents that the box is common with both sudoku's.

• Cells which are separated by a Chess King's move (adjacent cells) cannot contain the same digit
• Cells which are separated by a Chess Knight's move (L spaced cells) cannot contain the same digit
• Orthogonally adjacent cells cannot contain consecutive digits.

However, a very common problem I faced in my fruitless attempts of creating a solvable miracle was that I would end up with numbers that I couldn't put into the grid anymore, making me feel that this grid makes the puzzle impossible to create.

Without any means of finding out whether there exists a grid by myself (due to the lack of coding effort or skill), I cannot continue further in my pursuits of an elegant puzzle. As such, I'm asking for a list of possible solutions (where the solution to both sudoku grids are uniquely different from each other) for this grid with the miracle sudoku restraints, so that I know I'm not going down a rabbit hole trying to produce a puzzle. Help would be appreciated.

In other words, I'm asking for help by finding (or showing how I could find) 2 uniquely different solved miracle sudoku grids where Box 3 of one grid is the same as Box 7 of the other.

Yes. For example, one such filled in grid is:

I've thrown the power of a brute-force sudoku solver at this problem. (Solving puzzles with a program feels a bit like cheating, but since this question is about puzzle creation, I have no qualms.)

The first step was to write a solver that creates all miracle sudokus for an initially blank grid. I didn't bother about symmetrical solutions, because the condition that no two directly adjacent cells can have adjacent numbers rules out the possibility that you can create n sudokus with a 1 in the first cell and then generate 9! · n variations by shuffling the numbers around. I think it is unlikely that condition 3 will survive such a shuffling.

Anyway, it turns out that there are only 72 possible miracle sudokus. The next step is now to save these sudokus as they are generated. Then try to find pairs by comparing the southwest and northeast regions. Again, I wasn't very subtle about it: I used a nested loop that tries all 72×72 possibilities.

The conditions that concern directly adjacent cells are already taken care of by the respective sub-sudokus. Care must be taken when a diagonal king's move or a knight's move goes from the non-overlapping parts from one sub-sudoku to a non-overlapping part from the other. (If you imagine a Venn diagram of two sets, that's a move that goes from (A − B) to (B − A) or vice versa.)

It turns out that there are again 72 possible double miracle sudokus. (The extra care described above does not seem to have an effect, probably because equal numbers are already arranged in a spaced out N-queens-pattern with (3, 1) distances between them.)

I hope I haven't made any mistakes. I've replaced single numbers and stretches of adjacent numbers with hash marks to check whether the conditions are all met. Seems to look okay, but I've only spot-checked.

Now there's the problem of which numbers to fill in initially ...

P.S.: My program and its output are here if you want to check my solutions for errors. Note that ...

... according to my program, there are only 72 possible double miracle sudokus. So once such a sudoku is published, it might be easy to find the answer by just checking the known numbers against this short list.

I think that's generally a problem with sudokus, which are easy to solve mechanically. Still, many people enjoy solving them by hand.

I posit that yes, such grids exist. Below is one example.

This was generated with an online sudoku solver which supports anti-knight, anti-king and anti-consecutive rules. I generated the top-right grid first by inserting random givens until the grid was unique, and then generated the second grid by using the green cells as givens. (As it happens, this one seems to also obey anti-knight and anti-king constraints across grid borders, although it wasn't guaranteed to.)

• Fascinating how 147, 369 and 258 need to be in a row/column of a box... Commented Jul 20 at 11:17