Improved Sudoku Solver using random order


    

Traditional Sudoku is solved by a computer using the backtracking algorithm In this algorithm every digit from 1-9 is tried at the blank spaces until a solution is reached. Since the digits are tried sequentially there is high chance it will be very slow in cases where the blank spaces contain the higher order digits such as 5,6,7,8,9. This is because it will take at least 5 tries to get it correct resulting in higher number of function calls. Rather than trying the digits in sequential order I have tried the digits in a random order. This helps in cases where the actual digit that must occupy its place is tried first and hence the solution is generated faster
Find the comparison here