You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a specific problem. With solution 15.10, Implement a Sudoku Solver, it should be noted that the algorithm is not able to solve a sudoku. When I comment the fourth to last line:
# partial_assignment[i][j] = empty_value
I can see how this functions fills a sudoku. I used the example provided by you on page 63, and available on the internet, which is a 2D array:
The function stopped at the sixth row, second column because the values filled in that same column are incorrect (and by incorrect I mean we can't solve the whole sudoku with those values)
As we can see in the solution to the whole sudoku (also on page 63), in the second column we need [3,7,9, 5, 2, 1, 6, 8, 4]. However, instead of that initial 5 after the 9, the algorithm will put in a 1 (because it's a valid entry) but that makes it impossible to solve the whole sudoku.
Note: This algorithm is also unable to complete an empty sudoku grid (9 by 9)
I understand the complexity of the problem and how grueling it would be to account for these changes. I would just like to hear your thoughts on this :)
Thanks, the book is really awesome btw :)
The text was updated successfully, but these errors were encountered:
This is a specific problem. With solution 15.10, Implement a Sudoku Solver, it should be noted that the algorithm is not able to solve a sudoku. When I comment the fourth to last line:
I can see how this functions fills a sudoku. I used the example provided by you on page 63, and available on the internet, which is a 2D array:
This configuration, as well as its solution, can be found in wikipedia
Running your function with the added comment I mentioned, I get this:
The function stopped at the sixth row, second column because the values filled in that same column are incorrect (and by incorrect I mean we can't solve the whole sudoku with those values)
As we can see in the solution to the whole sudoku (also on page 63), in the second column we need [3,7,9, 5, 2, 1, 6, 8, 4]. However, instead of that initial 5 after the 9, the algorithm will put in a 1 (because it's a valid entry) but that makes it impossible to solve the whole sudoku.
Note: This algorithm is also unable to complete an empty sudoku grid (9 by 9)
I understand the complexity of the problem and how grueling it would be to account for these changes. I would just like to hear your thoughts on this :)
Thanks, the book is really awesome btw :)
The text was updated successfully, but these errors were encountered: