News for hackers. Stuff that matters.
Re:Singapore prime minister Lee Hsien Loong’s Sudoku solver ... by gtsop on Wednesday February 02, 2022 @07:05AM (#30176438)
Why is 1ms impressive? How much time does a simple solver take?
Re:Singapore prime minister Lee Hsien Loong’s Sudoku solver ... by 53x15 on Sunday February 13, 2022 @03:25AM (#30320210)
For a casual effort this solver is quite fast. On most datasets it's significantly faster than a C++ port of the Norvig solver and it's often in the same league as well-tuned DLX solvers (though still not in the major league).

Relative to DLX it's faster on the easiest puzzles and slower on hard ones, though its performance degrades significantly in two specific still-easy cases: (1) 17-clue puzzles since these punish solvers that don't propagate hidden singles, (2) 0-solution puzzles since the solver doesn't check for consistency during initialization (something the author acknowledges in a comment).

For context see these benchmarks from a modern laptop (https://github.com/t-dillon/tdoku/blob/master/benchmarks/res...) and compare lhl_sudoku to the other simple solvers tdev_basic_heuristic, zerodoku, fast_solv_9r2, kudoku, and norvig.

For details on the solvers and datasets used in these benchmarks see here (https://github.com/t-dillon/tdoku/tree/master/other) and here (https://github.com/t-dillon/tdoku/tree/master/benchmarks)

Re:Singapore prime minister Lee Hsien Loong’s Sudoku solver ... by pdonis on Wednesday February 02, 2022 @03:30PM (#30183579)
The solution time can vary quite a bit depending on the difficulty of the puzzle. 1 ms for a single puzzle for a program written in C could actually be fairly slow for an easy puzzle, but would be quite fast for a hard puzzle. (It would also depend, of course, on how fast a CPU and how much memory was being used to run the program.)