I'm trying to code a solver for a 16x16 sudoku with hexadecimal numbers. I originally had a simple brute force backtraking solution, but that took forever to solve a single sudoku. So I implemented naked singles into my code. I did this by making a map of a tuple(the row and col positions of a empty space(0) in the sudoku) and a vector(the list of possible numbers that position could be). Now instead of iterating through all 16 numbers for each 0(empty space) in the puzzle. It iterates through a smaller list. However, now my code is giving me some strange errors whenever I run it. It won't allow me to input the whole board and returns some numbers right after. I presume it's a problem with my map but I don't know what it might be. https://medium.com/@ev.zafeiratos/sudoku-solver-with-python-a-methodical-approach-for-algorithm-optimization-part-2-c48e83b89d20 I implemented the naked singles based on this article written in Python.
#Sudoku Solver for 16x16 using Naked Singles
8 messages · Page 1 of 1 (latest)
When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For more information use !howto ask.
Use dynamic programming
You can only solve threads you own
As I'm new to c++ I'd like to understand why the code is printing before I have finished putting in my input. So as to avoid this problem in the future.
I wonder if this may be the problem. Is this the correct way to access the value of a map of this kind? Cache is the map name. the tuple is the key and a vector, newallowed, is the value.
This question thread is being automatically closed. If your question is not answered feel free to bump the post or re-ask. Take a look at !howto ask for tips on improving your question.