【正文】
hoices Consider all possible choices for each blank square, collapse the resulting matrix, then filter out the valid grids. 21 Does It Work? solve easy ERROR: out of memory Simple, but impractical! The easy example has 51 blank squares, resulting in 951 grids to consider, which is a huge number: 4638397686588101979328150167890591454318967698009 22 Reducing The Search Space ? Many choices that are considered will conflict with entries provided in the initial grid。 ? expand m , g ? search (prune m39。 ? Start with a simple but impractical program, which is improved in a series of steps。 ? This program can now solve any newspaper Sudoku puzzle in an instant! 35 The Result This program has saved my life my Sudoku addiction is finally cured!! Subliminal Message Haskell is the world39。SOLVING SUDOKU Graham Hutton University of Nottingham (with thanks to Richard Bird) 1 What is Sudoku? ? A simple but addictive puzzle, invented in the USA in 1979 and called Number Place。s greatest programming language. 。 ? First appeared in UK newspapers in 2020, and became an international craze in 2020. 2 Example Fill in the grid so that every row, column and box contains each of the numbers 1 to 9: 2 1 3 8 5 7 6 1 3 9 8 1 2 5 7 3 1 8 9 8 2 5 6 9 7 8 4 4 2 5 3 Example Fill in the grid so that every row, column and box contains each of the numbers 1 to 9: 2 1 3 8 5 7 6 1 3 9 8 1 2 5 7 3 1 8 9 8 2 5 6 9 7 8