Meet the Sudoku puzzle Broken puzzle: 6 cannot appear twice in column - - PowerPoint PPT Presentation

meet the sudoku puzzle
SMART_READER_LITE
LIVE PREVIEW

Meet the Sudoku puzzle Broken puzzle: 6 cannot appear twice in column - - PowerPoint PPT Presentation

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


slide-1
SLIDE 1

Meet the Sudoku puzzle

  • Puzzle is NxN grid, with

some cells “given”

  • Permute 1..N in each

“group” (row, col, block)

– Each cell part of three different permutations

  • Place all numbers using

logic (no guessing)

– prove where numbers cannot (or must) go

1 2 3 4 5 6 7 8 9 A 4 3 2 5 1 B 8 1 9 4 5 C 2 1 8 7 3 9 D 5 E 6 1 3 F 2 G 4 7 5 3 6 9 1 2 8 H 9 7 I 3 1 6

NP‐complete => logic to solve a given puzzle can be arbitrarily complex, but verification is O(N)

“Broken” puzzle: 6 cannot appear twice in column 5

slide-2
SLIDE 2

A few notational conventions

1 2 3 4 5 6 7 8 9 A

1 . 3 4 5 . . . 9

B C D 8 E F 1 1 G H * 35 I

Blue text: candidates of interest (involved in a pattern); other candidates may also be present Gray fill: no candidate(s)

  • f interest present here

Red fill: can eliminate candidates

  • f interest from these locations

Black font: given or known (one candidate left) Columns numbered (x) Rows lettered (y) Blocks identified by their center position b (e.g. H5) Candidates: one of these numbers belongs here (not sure which yet) White‐on‐red: only remaining candidate(s) in this space. No other numbers allowed.

slide-3
SLIDE 3

Shadow rule (applies to x/y/b)

1 2 3 4 5 6 7 8 9 A B 3 C D E F G H I 1 2 3 4 5 6 7 8 9 A B C D E 5 F G H I B1 known to be #3 => #3 cannot be elsewhere in row B => #3 cannot be elsewhere in col 1 => #3 cannot be elsewhere in block B2 E5 known to be #5 => #5 cannot be elsewhere in row E => #5 cannot be elsewhere in col 7 => #5 cannot be elsewhere in block E8

slide-4
SLIDE 4

Hidden single rule (applies to self)

1 2 3 4 5 6 7 8 9 A B 3 C D E F G H I 1 2 3 4 5 6 7 8 9 A B C D E 5 F G H I 7 #3 not in gray areas of row B => #3 must be at B1 => no other number can be at B1 (hint: apply y/b shadow rule next) #5 not in gray areas of block E8 => #5 must be at E7 => no other number can be at E7 (hint: apply x/y shadow rule next) Same reasoning for 7@I9

slide-5
SLIDE 5

Pair shadow rule (xb/yb/bx/by)

1 2 3 4 5 6 7 8 9 A B 6 6 C D E 7 7 F G H 1 I 1 1 2 3 4 5 6 7 8 9 A 4 B C 4 7 D 7 E 5 F 5 G H I #7 not in gray areas of block E8 => #7 must be E8 or E9 (row E) => #7 not in red part of row E (this is the b‐y variant of the rule) (y‐b variant applies to 6@{B1,B2}) #4 not in gray areas of column 1 => #4 must be A1 or C1 (in block B2) => #4 not in red part of block B2 (this is the x‐b variant of the rule) (b‐x variant applies to 5@{E7,F7}) Not same row/col, but may be useful later Not same block, but may be useful later

slide-6
SLIDE 6

Locked pair rule (x/y/b)

1 2 3 4 5 6 7 8 9 A B 18 18 C D E F G H I 1 2 3 4 5 6 7 8 9 A B C D 39 26 E F 39 G 26 H I 1‐pair and 6‐pair at B1,B3 => No other numbers at B1,B3 (x variant of rule) Need two pair shadows in same place ‐ 2‐pair and 6‐pair at D7,G7 => No other numbers at D7,G7 (y variant of rule) (b variant of rule applies to 3‐9 pair)

slide-7
SLIDE 7

Hidden pair rule (x/y/b)

1 2 3 4 5 6 7 8 9 A B C D 48 48 E F G H I 1 2 3 4 5 6 7 8 9 A B C D 26 E 26 F G 26 26 H I Two candidates in same row and block, each with same two numbers left => #4, #8 not in red parts of row D => #4, #8 not in red parts of block E2 (matches both x and b variants) Two candidates in same column, each with same two numbers left (y variant) ‐ D7=2 ==> G7=6 ‐ D7=6 ==> G7=2 => #2 and #6 not in red parts of col 7 => Often caused by other locked pairs

slide-8
SLIDE 8

Fishy pair rule (xy/yx/bx/xb/by/yb)

1 2 3 4 5 6 7 8 9 A 8 B 5 C 8 5 D 8 E F 8 G 5 H 5 I 1 2 3 4 5 6 7 8 9 A B 1 1 C D E F 39 G 1 1 H I 8‐pairs in blocks B2 and E2 align with columns 1 and 3 => #8 not in red parts of columns (#8 is b‐y variant, #5 is y‐b variant) Two shadow pairs that involve one number and the same two values for two different groups (easier to see) ‐ For cols 2/4, #1 only in rows B/G => #1 not in red parts of rows B/G (this is the y‐x variant)