Solving Sudoku with Prolog (2016)
Thank you very much for the publicity, I greatly appreciate your interest!<p>Prolog is extremely well-suited for solving combinatorial tasks like Sudoku puzzles, and also for tough practical challenges such such as timetabling, scheduling and allocation tasks on an industrial scale.<p>The key feature that makes Prolog so efficient and frequently used for such tasks is <i>constraint propagation</i>, provided via libraries or as a built-in feature in many Prolog system. Fast and efficient constraint propagation is often an important reason for buying a commercial Prolog system.<p>In this example, I am using CLP(FD&#x2F;ℤ), constraint logic programming over finite domains&#x2F;integers, the amalgamation of constraint programming (CP) and logic programming (LP), which blend especially seamlessly. I have uploaded a short video that shows how it works for Sudoku puzzles:<p><a href="https:&#x2F;&#x2F;www.metalevel.at&#x2F;prolog&#x2F;videos&#x2F;sudoku" rel="nofollow">https:&#x2F;&#x2F;www.metalevel.at&#x2F;prolog&#x2F;videos&#x2F;sudoku</a><p>If you are interested in constraint solving, a few related videos may also be useful:<p><a href="https:&#x2F;&#x2F;www.metalevel.at&#x2F;prolog&#x2F;videos&#x2F;n_queens" rel="nofollow">https:&#x2F;&#x2F;www.metalevel.at&#x2F;prolog&#x2F;videos&#x2F;n_queens</a><p><a href="https:&#x2F;&#x2F;www.metalevel.at&#x2F;prolog&#x2F;videos&#x2F;knights_and_knaves" rel="nofollow">https:&#x2F;&#x2F;www.metalevel.at&#x2F;prolog&#x2F;videos&#x2F;knights_and_knaves</a><p><a href="https:&#x2F;&#x2F;www.metalevel.at&#x2F;prolog&#x2F;videos&#x2F;map_colouring" rel="nofollow">https:&#x2F;&#x2F;www.metalevel.at&#x2F;prolog&#x2F;videos&#x2F;map_colouring</a><p>These videos are all work in progress, and they may be replaced by better versions at any time. However, the links above will always point to the latest version.<p>Enjoy!