Python Sudoku Solver - Computerphile
Video Statistics and Information
Channel: Computerphile
Views: 1,053,046
Rating: 4.9292884 out of 5
Keywords: computers, computerphile, computer, science, Computer Science, University of Nottingham, Professor Thorsten Altenkirsch, Sudoku, Python, Recursion, 4K, UHD
Id: G_UYXzGuqvM
Channel Id: undefined
Length: 10min 52sec (652 seconds)
Published: Wed Feb 12 2020
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.
I like Peter Norvig's python solution. Does a much better job solving the really difficult puzzles compared to a brute force back tracking algorithm. But by far the most elegant and fastest solver is Donald Knuth's Dancing Links implementation of his Algorithm X solution to the exact cover problem.
A fellow redditor. The secret is hidden in his whiteboard chicken scratch
This isnβt solving the problem in ten lines. He is calling the function named possible in his recursion function. You see this function in the beginning of the video. His recursion function named solve, AkA the ten line of code, is only for moving around the Soduku grid.
Itβs a great video none the less for furthering ones python knowledge
A bit off topic but anyone really get bothered by the extra space before his colons?
Ah crazy code style man is back
Wrote a Sudoku solver in python in HS.
Was proud of figuring it out myself for waaaayy too long.
Checking the validity of a state is most of the programming, just backtracking is fairly simple.
Here's sombody's 8 line abomination:
About 10 lines and didnβt bother to count how many exactly. Well done.