Welcome to the new platform of Programmers Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use it's exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
Sudoku Resolution Algorithm???
I'm trying to figure out how to solve a sudoku puzzle using a backtracking algorithm (any other way would be ok as well).
Any hints? Any code you could share??
So far i've managed to develop a function able to detect when only one number can fit into one slot, applying this function a few times, and filling the square with the only right number i get to a point where i have no more slots available where only just 1 number would fit.
So now, i need to apply a backtracking algorithm, trying to fill out with one of the 2 or more numbers that would fit the gap, if the number is OK, i can go on filling the following ones, if i get to a point where no more "moves" can be done, i must go back and change the previously wrongly guessed number and try with the next available one.
Well, basically thats the backtracking technic.
How can i translate that easy-to-say-code into java (c++ ok too) code ??
I would appreciate if someone could help out.
I can share my code with others, could be helpful, just ask.