Meet the Sudoku puzzle “Broken” puzzle: 6 cannot appear twice in column 5 • Puzzle is NxN grid, with 1 2 3 4 5 6 7 8 9 some cells “given” A 4 3 2 5 1 B 8 1 9 4 5 • Permute 1..N in each C 2 1 8 7 3 9 “group” (row, col, block) D 5 – Each cell part of three E 6 1 3 different permutations F 2 G 4 7 5 3 6 9 1 2 8 • Place all numbers using H 9 7 logic (no guessing) I 3 1 6 – prove where numbers cannot (or must) go NP ‐ complete => logic to solve a given puzzle can be arbitrarily complex, but verification is O(N)
A few notational conventions 1 2 3 4 5 6 7 8 9 Candidates: one of these numbers 1 . 3 A 4 5 . belongs here (not sure which yet) . . 9 B Black font: given or known (one candidate left) Columns numbered (x) C D 8 Rows lettered (y) Red fill: can eliminate candidates of interest from these locations E F 1 1 Gray fill: no candidate(s) Blue text: candidates of interest G of interest present here (involved in a pattern); other H * 35 candidates may also be present I Blocks identified by their White ‐ on ‐ red: only remaining candidate(s) center position b (e.g. H5) in this space. No other numbers allowed.
Shadow rule (applies to x/y/b) 1 2 3 4 5 6 7 8 9 A E5 known to be #5 => #5 cannot be elsewhere in row E B 3 => #5 cannot be elsewhere in col 7 C => #5 cannot be elsewhere in block E8 D 1 2 3 4 5 6 7 8 9 E A F B G C H D I E 5 F B1 known to be #3 G => #3 cannot be elsewhere in row B H => #3 cannot be elsewhere in col 1 => #3 cannot be elsewhere in block B2 I
Hidden single rule (applies to self) 1 2 3 4 5 6 7 8 9 #5 not in gray areas of block E8 A => #5 must be at E7 => no other number can be at E7 B 3 (hint: apply x/y shadow rule next) C Same reasoning for 7@I9 D 1 2 3 4 5 6 7 8 9 E A F B G C H D I E 5 F #3 not in gray areas of row B G => #3 must be at B1 H => no other number can be at B1 (hint: apply y/b shadow rule next) I 7
Pair shadow rule (xb/yb/bx/by) 1 2 3 4 5 6 7 8 9 #4 not in gray areas of column 1 A => #4 must be A1 or C1 (in block B2) => #4 not in red part of block B2 B 6 6 (this is the x ‐ b variant of the rule) C (b ‐ x variant applies to 5@{E7,F7}) D 1 2 3 4 5 6 7 8 9 E 7 7 A 4 F B G Not same row/col, but C 4 7 may be useful later H 1 D 7 I 1 E 5 F 5 #7 not in gray areas of block E8 Not same block, but G => #7 must be E8 or E9 (row E) may be useful later => #7 not in red part of row E H (this is the b ‐ y variant of the rule) I (y ‐ b variant applies to 6@{B1,B2})
Locked pair rule (x/y/b) 1 2 3 4 5 6 7 8 9 Need two pair shadows in same place A ‐ 2 ‐ pair and 6 ‐ pair at D7,G7 => No other numbers at D7,G7 B 18 18 (y variant of rule) C (b variant of rule applies to 3 ‐ 9 pair) D 1 2 3 4 5 6 7 8 9 E A F B G C H D 39 26 I E F 39 1 ‐ pair and 6 ‐ pair at B1,B3 G 26 => No other numbers at B1,B3 H (x variant of rule) I
Hidden pair rule (x/y/b) 1 2 3 4 5 6 7 8 9 Two candidates in same column, each with same two numbers left (y variant) A ‐ D7=2 ==> G7=6 B ‐ D7=6 ==> G7=2 C => #2 and #6 not in red parts of col 7 => Often caused by other locked pairs D 48 48 1 2 3 4 5 6 7 8 9 E A F B G C H D 26 I E 26 Two candidates in same row and block, F each with same two numbers left => #4, #8 not in red parts of row D G 26 26 => #4, #8 not in red parts of block E2 H (matches both x and b variants) I
Fishy pair rule (xy/yx/bx/xb/by/yb) 1 2 3 4 5 6 7 8 9 Two shadow pairs that involve one A 8 number and the same two values for two different groups (easier to see) B 5 ‐ For cols 2/4, #1 only in rows B/G C 8 5 => #1 not in red parts of rows B/G D 8 (this is the y ‐ x variant) 1 2 3 4 5 6 7 8 9 E A F 8 B 1 1 G 5 C H 5 D I E F 39 8 ‐ pairs in blocks B2 and E2 align with G 1 1 columns 1 and 3 H => #8 not in red parts of columns (#8 is b ‐ y variant, #5 is y ‐ b variant) I
Recommend
More recommend