+ 1
How to limit memory use?
I wrote a 4x4 sudocu solver which works just fine. This was meant to be expanded to a 9x9 solver but as i feared, it exceeds the memory limit. I am asking for help to make the code less memory consuming so that maybe, i can make the 9x9 solver run on sololearn. https://code.sololearn.com/cAdeJbf9f3zX/?ref=app https://code.sololearn.com/chX1fbjGYWSy/?ref=app
3 Respostas
+ 2
permutations generates n! possibilities, so you have 9n! rows. this is way too memory consuming so you could try a better approach:
https://en.m.wikipedia.org/wiki/Sudoku_solving_algorithms
+ 2
thanks for the help!
i will give it one more try on my own. regardless of the outcome i will look at the algoritms you posted.
+ 1
i improved the 9x9 code. it still takes more time than the playground gives for minimal input but it works on a sudocu with about 35 numbers.