Skip to content

Instantly share code, notes, and snippets.

@pgblu
Last active October 13, 2020 21:15
Show Gist options
  • Save pgblu/b396ae64da1a885631ec313eaaa0cab9 to your computer and use it in GitHub Desktop.
Save pgblu/b396ae64da1a885631ec313eaaa0cab9 to your computer and use it in GitHub Desktop.
All sudoku grids with 7 queens, including rotation & reflection but not transposition
Here are the 24 arrangements of sudoku numbers such that each placed digit behaves like a queen, i.e., no instance of a given digit "sees" a copy of itself along a diagonal. They are in no particular order. In each grid, digits 1-7 are represented, and 8 & 9 would need to be filled in where there are zeros. The 24 grids all 'collapse' to only 4 unique patterns, with 8, 8, 4, and 4 reflection/rotational equivalents each.
Most of these arrangements are broken, however, as you cannot place exactly one 8 and one 9 in each box, column, and row without clashes. The exceptions are grids 3, 7, 19 and 20 (which are rotations of one another). Those four are therefore the only possible solutions to sudokus with 7 queens, disregarding transposition (i.e., substituting a different permutation of digits for 1-9).
The other 20 arrangements are still useful, however, as they can be used as the basis for puzzles with 6, 5 or fewer queens.
Grid 1. (broken)
123|450|670
407|613|052
560|072|134
-----------
072|534|061
304|126|507
615|007|423
-----------
246|705|310
030|261|745
751|340|206
-----------
Grid 2. (broken)
102|034|567
637|512|040
054|607|132
-----------
423|700|651
706|125|304
510|346|270
-----------
345|270|016
260|451|703
071|063|425
-----------
Grid 3. (valid)
102|345|670
034|617|205
765|200|143
-----------
527|034|061
340|176|052
610|520|734
-----------
256|003|417
403|761|520
071|452|306
-----------
Grid 4. (broken)
102|340|567
546|701|302
703|562|014
-----------
421|075|036
630|024|175
075|136|240
-----------
214|650|703
067|203|451
350|417|620
-----------
Grid 5. (broken)
123|045|607
605|701|243
470|623|501
-----------
250|310|764
317|460|052
046|257|310
-----------
501|032|476
734|506|120
062|174|035
-----------
Grid 6. (broken)
120|345|670
065|701|324
743|620|501
-----------
052|416|730
610|073|452
374|052|016
-----------
501|267|043
236|504|107
407|130|265
-----------
Grid 7. (valid)
102|345|670
045|671|302
673|200|541
-----------
456|013|027
710|426|053
320|750|416
-----------
561|002|734
207|534|160
034|167|205
-----------
Grid 8. (broken)
123|450|607
040|673|152
657|102|430
-----------
732|001|564
405|367|201
016|245|073
-----------
270|016|345
501|734|026
364|520|710
-----------
Grid 9. (broken)
123|456|700
706|023|145
450|107|623
-----------
270|645|310
631|070|452
045|312|076
-----------
562|704|031
314|560|207
007|231|564
-----------
Grid 10. (broken)
123|405|607
075|620|143
460|173|025
-----------
230|540|716
501|736|402
746|012|350
-----------
352|064|071
014|357|260
607|201|534
-----------
Grid 11. (broken)
123|405|607
075|632|140
460|170|532
-----------
032|540|716
501|726|403
746|013|025
-----------
350|264|071
214|057|360
607|301|254
-----------
Grid 12. (broken)
123|450|607
075|603|142
460|172|053
-----------
302|045|716
051|726|430
746|310|025
-----------
230|064|571
514|207|360
607|531|204
-----------
Grid 13. (broken)
102|345|607
074|602|135
365|170|042
-----------
520|034|716
041|726|350
736|510|204
-----------
450|263|071
213|407|560
607|051|423
-----------
Grid 14. (broken)
123|450|670
406|273|510
750|016|432
-----------
301|507|264
640|321|057
572|604|301
-----------
215|730|046
034|162|705
067|045|123
-----------
Grid 15. (broken)
102|345|607
357|602|410
640|017|325
-----------
271|450|063
035|261|740
406|073|251
-----------
710|526|034
023|104|576
564|730|102
-----------
Grid 16. (broken)
102|304|567
547|062|310
360|517|024
-----------
271|043|056
604|251|703
035|670|241
-----------
710|420|635
026|135|470
453|706|102
-----------
Grid 17. (broken)
102|304|567
047|652|310
653|017|024
-----------
271|043|650
504|261|703
360|570|241
-----------
710|426|035
025|130|476
436|705|102
-----------
Grid 18. (broken)
102|034|567
647|502|310
530|617|024
-----------
271|340|605
054|261|730
360|075|241
-----------
713|420|056
025|106|473
406|753|102
-----------
Grid 19. (valid)
012|345|607
306|172|450
547|006|321
-----------
720|450|163
630|217|045
451|063|072
-----------
174|500|236
063|721|504
205|634|710
-----------
Grid 20. (valid)
012|345|607
605|712|340
743|006|512
-----------
160|570|234
530|264|071
274|031|065
-----------
451|600|723
027|453|106
306|127|450
-----------
Grid 21. (broken)
012|034|567
073|516|204
654|270|031
-----------
426|103|705
130|765|042
705|402|613
-----------
240|051|376
301|627|450
567|340|120
-----------
Grid 22. (broken)
012|345|067
465|701|320
703|062|541
-----------
051|274|630
634|510|072
270|630|415
-----------
540|126|703
107|403|256
326|057|104
-----------
Grid 23. (broken)
012|034|567
630|572|104
457|610|023
-----------
720|453|610
103|267|405
564|100|372
-----------
075|301|246
341|726|050
206|045|731
-----------
Grid 24. (broken)
001|234|567
347|560|201
562|107|034
-----------
075|342|016
634|010|752
210|675|340
-----------
750|401|623
106|023|475
423|756|100
-----------
compiled by Philipp Blume from a list provided by Ulrich Voigt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment